MCPcopy Create free account
hub / github.com/AlSch092/UltimateAntiCheat / GetRemoteModuleBaseAddress

Method GetRemoteModuleBaseAddress

Process/Process.cpp:904–926  ·  view source on GitHub ↗

GetRemoteModuleBaseAddress - fetch module base address of `moduleName` in `processId` */

Source from the content-addressed store, hash-verified

902 GetRemoteModuleBaseAddress - fetch module base address of `moduleName` in `processId`
903*/
904HMODULE Process::GetRemoteModuleBaseAddress(__in const DWORD processId, __in const wchar_t* moduleName)
905{
906 HMODULE hModule = NULL;
907 HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, processId);
908 if (hSnapshot != INVALID_HANDLE_VALUE)
909 {
910 MODULEENTRY32 moduleEntry = { 0 };
911 moduleEntry.dwSize = sizeof(MODULEENTRY32);
912 if (Module32First(hSnapshot, &moduleEntry))
913 {
914 do
915 {
916 if (_wcsicmp(moduleEntry.szModule, moduleName) == 0)
917 {
918 hModule = moduleEntry.hModule;
919 break;
920 }
921 } while (Module32Next(hSnapshot, &moduleEntry));
922 }
923 CloseHandle(hSnapshot);
924 }
925 return hModule;
926}
927
928bool Process::GetRemoteTextSection(__in const HANDLE hProcess, __out uintptr_t& baseAddress, __out SIZE_T& sectionSize)
929{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected