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

Method IsInModuleRange

Source/Client/NM_Engine/Functions.cpp:397–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397bool CFunctions::IsInModuleRange(HMODULE hModule, DWORD_PTR dwAddress)
398{
399 bool bRet = false;
400
401 MODULEINFO mi = { 0 };
402 if (g_winapiApiTable->GetModuleInformation(NtCurrentProcess, hModule, &mi, sizeof(mi)))
403 {
404 auto dwBase = reinterpret_cast<DWORD_PTR>(mi.lpBaseOfDll);
405 auto dwHi = reinterpret_cast<DWORD_PTR>(mi.lpBaseOfDll) + mi.SizeOfImage;
406
407 bRet = (dwAddress >= dwBase && dwAddress <= dwHi);
408 }
409 return bRet;
410}
411
412bool CFunctions::IsInModuleRange(const char* c_szModuleName, DWORD_PTR dwAddress)
413{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected