MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / InModuleRange

Function InModuleRange

Source/Client/NM_Engine/DynamicWinapi.cpp:367–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367inline bool InModuleRange(HMODULE hModule, DWORD_PTR dwAddress)
368{
369 bool bRet = false;
370
371 MODULEINFO mi = { 0 };
372 if (LI_FIND(GetModuleInformation)(NtCurrentProcess, hModule, &mi, sizeof(mi)))
373 {
374 auto dwBase = reinterpret_cast<DWORD_PTR>(mi.lpBaseOfDll);
375 auto dwHi = reinterpret_cast<DWORD_PTR>(mi.lpBaseOfDll) + mi.SizeOfImage;
376
377 bRet = (dwAddress >= dwBase && dwAddress <= dwHi);
378 }
379 return bRet;
380}
381
382static FARPROC WINAPI MyGetProcAddress(_In_ HMODULE hModule, _In_ LPCSTR lpProcName)
383{

Callers 1

MyGetProcAddressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected