This commit is contained in:
vxunderground
2022-09-10 13:20:38 -05:00
parent 8f5eca39d2
commit 86ca3658a5
143 changed files with 2396 additions and 1398 deletions
@@ -0,0 +1,28 @@
#include "Win32Helper.h"
DWORD GetProcessPathFromLoaderLoadModuleA(DWORD nBufferLength, PCHAR lpBuffer)
{
PPEB Peb = GetPeb();
PLDR_MODULE Module = NULL;
Module = (PLDR_MODULE)((PBYTE)Peb->LoaderData->InMemoryOrderModuleList.Flink - 16);
if (nBufferLength < Module->FullDllName.Length)
return 0;
return (DWORD)WCharStringToCharString(lpBuffer, Module->FullDllName.Buffer, Module->FullDllName.MaximumLength);
}
DWORD GetProcessPathFromLoaderLoadModuleW(DWORD nBufferLength, PWCHAR lpBuffer)
{
PPEB Peb = GetPeb();
PLDR_MODULE Module = NULL;
Module = (PLDR_MODULE)((PBYTE)Peb->LoaderData->InMemoryOrderModuleList.Flink - 16);
if (nBufferLength < Module->FullDllName.Length)
return 0;
if (StringCopyW(lpBuffer, Module->FullDllName.Buffer) == NULL)
return 0;
return Module->FullDllName.Length;
}