| 408 | } |
| 409 | |
| 410 | bool 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 |
nothing calls this directly
no test coverage detected