Create GetLinkedDllCount.cpp

This commit is contained in:
vxunderground
2022-07-14 23:12:56 -05:00
committed by GitHub
parent 939f506a25
commit 85c856b940
+18
View File
@@ -0,0 +1,18 @@
DWORD GetLinkedDllCount(VOID)
{
PPEB Peb = GetPeb();
PLDR_MODULE Module = NULL;
DWORD dwIndexHash = 0;
DWORD dwCount = 0;
Module = (PLDR_MODULE)((PBYTE)Peb->LoaderData->InMemoryOrderModuleList.Flink - 16);
for (; TRUE; dwCount++)
{
Module = (PLDR_MODULE)((PBYTE)Module->InMemoryOrderModuleList.Flink - 16);
if (Module->BaseDllName.Buffer == NULL)
break;
}
return dwCount;
}