| 639 | } |
| 640 | |
| 641 | bool IScanner::ScanProcessModules(HANDLE hProcess) |
| 642 | { |
| 643 | SCANNER_LOG(LL_SYS, "Module scanner has been started! Target process: %u(%p)", g_winapiApiTable->GetProcessId(hProcess), hProcess); |
| 644 | |
| 645 | if (!IS_VALID_HANDLE(hProcess)) |
| 646 | { |
| 647 | SCANNER_LOG(LL_ERR, "Target handle is NOT valid!"); |
| 648 | return true; |
| 649 | } |
| 650 | |
| 651 | if (!g_nmApp->DynamicWinapiInstance()->IsValidHandle(hProcess)) |
| 652 | { |
| 653 | SCANNER_LOG(LL_ERR, "Target process is NOT active!"); |
| 654 | return true; |
| 655 | } |
| 656 | |
| 657 | auto szProcessName = CProcessFunctions::GetProcessName(hProcess); |
| 658 | if (szProcessName.empty()) |
| 659 | { |
| 660 | SCANNER_LOG(LL_ERR, "Process name read fail! Target process: %p Error: %u", hProcess, g_winapiApiTable->GetLastError()); |
| 661 | return false; |
| 662 | } |
| 663 | SCANNER_LOG(LL_SYS, "Process image name: %s", szProcessName.c_str()); |
| 664 | |
| 665 | return EnumerateModules(hProcess); |
| 666 | } |
| 667 |
nothing calls this directly
no test coverage detected