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

Method ScanModuleLinks

Source/Client/NM_Engine/IModuleScanner.cpp:410–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410bool IScanner::ScanModuleLinks(HANDLE hProcess, DWORD64 dwModuleBase)
411{
412 auto bFound = false;
413
414 if (!IS_VALID_HANDLE(hProcess))
415 {
416 SCANNER_LOG(LL_ERR, "Target handle is NOT valid!");
417 return true;
418 }
419
420 if (!g_nmApp->DynamicWinapiInstance()->IsValidHandle(hProcess))
421 {
422 SCANNER_LOG(LL_ERR, "Target process is NOT active!");
423 return true;
424 }
425
426 static auto vModuleList = GetModuleList(hProcess);
427 if (vModuleList.empty())
428 {
429 SCANNER_LOG(LL_ERR, "Module list is NULL!");
430 return false;
431 }
432
433 for (const auto & pCurrModule : vModuleList)
434 {
435 if (IS_VALID_SMART_PTR(pCurrModule))
436 {
437 if (pCurrModule->ullBaseAddress == dwModuleBase)
438 {
439 bFound = true;
440 }
441 }
442 }
443
444 if (bFound == false) // check alloc base and base is it equal
445 {
446 // manually mapped or unlinked module found
447// g_nmApp->ScannerInstance()->SendViolationMessageToMasterServer
448 }
449
450 return true;
451}
452
453
454

Callers

nothing calls this directly

Calls 2

IsValidHandleMethod · 0.80
DynamicWinapiInstanceMethod · 0.80

Tested by

no test coverage detected