Refactored FindLdrpHashTable function, fixed crash when calling LdrUnloadDllMemory on Windows11

This commit is contained in:
Boring
2022-12-02 11:36:34 +08:00
parent 06bb567c09
commit 3468890776
4 changed files with 64 additions and 15 deletions
+17
View File
@@ -18,6 +18,21 @@ static PVOID ReadDllFile(LPCSTR FileName) {
return buffer;
}
static void DisplayStatus() {
printf(
"MemoryModulePP [Version %d.%d]\n\n\tMmpFeatures = %08X\n\n\tLdrpModuleBaseAddressIndex = %p\n\tNtdllLdrEntry = %p\n\tRtlRbInsertNodeEx = %p\n\tRtlRbRemoveNode = %p\n\n\tLdrpInvertedFunctionTable = %p\n\n\tLdrpHashTable = %p\n\n",
MmpGlobalDataPtr->MajorVersion,
MmpGlobalDataPtr->MinorVersion,
MmpGlobalDataPtr->MmpFeatures,
MmpGlobalDataPtr->MmpBaseAddressIndex->LdrpModuleBaseAddressIndex,
MmpGlobalDataPtr->MmpBaseAddressIndex->NtdllLdrEntry,
MmpGlobalDataPtr->MmpBaseAddressIndex->_RtlRbInsertNodeEx,
MmpGlobalDataPtr->MmpBaseAddressIndex->_RtlRbRemoveNode,
MmpGlobalDataPtr->MmpInvertedFunctionTable->LdrpInvertedFunctionTable,
MmpGlobalDataPtr->MmpLdrEntry->LdrpHashTable
);
}
int test() {
LPVOID buffer = ReadDllFile("a.dll");
@@ -101,6 +116,8 @@ end:
}
int main() {
DisplayStatus();
test();
return 0;