diff --git a/Windows API/GetLinkedDllCount.cpp b/Windows API/GetLinkedDllCount.cpp new file mode 100644 index 0000000..a5e8ba5 --- /dev/null +++ b/Windows API/GetLinkedDllCount.cpp @@ -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; +}