MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / ScanProcessModules

Method ScanProcessModules

Source/Client/NM_Engine/IModuleScanner.cpp:641–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641bool 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

Callers

nothing calls this directly

Calls 3

GetProcessIdMethod · 0.80
IsValidHandleMethod · 0.80
DynamicWinapiInstanceMethod · 0.80

Tested by

no test coverage detected