MCPcopy Create free account
hub / github.com/NtQuery/Scylla / parseModuleWithOwnProcess

Method parseModuleWithOwnProcess

Scylla/ApiReader.cpp:526–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526void ApiReader::parseModuleWithOwnProcess( ModuleInfo * module )
527{
528 PIMAGE_NT_HEADERS pNtHeader = 0;
529 PIMAGE_DOS_HEADER pDosHeader = 0;
530 HMODULE hModule = GetModuleHandle(module->getFilename());
531
532 if (hModule)
533 {
534 pDosHeader = (PIMAGE_DOS_HEADER)hModule;
535 pNtHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)hModule + (DWORD_PTR)(pDosHeader->e_lfanew));
536
537 if (isPeAndExportTableValid(pNtHeader))
538 {
539 parseExportTable(module, pNtHeader, (PIMAGE_EXPORT_DIRECTORY)((DWORD_PTR)hModule + pNtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress), (DWORD_PTR)hModule);
540 }
541 }
542 else
543 {
544#ifdef DEBUG_COMMENTS
545 Scylla::debugLog.log(L"parseModuleWithOwnProcess :: hModule is NULL");
546#endif
547 }
548}
549
550bool ApiReader::isPeAndExportTableValid(PIMAGE_NT_HEADERS pNtHeader)
551{

Callers

nothing calls this directly

Calls 2

getFilenameMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected