GetRemoteModuleBaseAddress - fetch module base address of `moduleName` in `processId` */
| 902 | GetRemoteModuleBaseAddress - fetch module base address of `moduleName` in `processId` |
| 903 | */ |
| 904 | HMODULE 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 | |
| 928 | bool Process::GetRemoteTextSection(__in const HANDLE hProcess, __out uintptr_t& baseAddress, __out SIZE_T& sectionSize) |
| 929 | { |
nothing calls this directly
no outgoing calls
no test coverage detected