| 255 | return nullptr; |
| 256 | } |
| 257 | LPVOID CDynamicWinapi::FindModuleFromAddress(DWORD_PTR dwAddress) |
| 258 | { |
| 259 | auto pPEB = GetCurrentPEB(); |
| 260 | auto CurrentEntry = pPEB->LoaderData->InLoadOrderModuleList.Flink; |
| 261 | while (CurrentEntry != &pPEB->LoaderData->InLoadOrderModuleList && CurrentEntry != NULL) |
| 262 | { |
| 263 | auto Current = CONTAINING_RECORD(CurrentEntry, _LDR_MODULE, InLoadOrderModuleList); |
| 264 | if (dwAddress >= reinterpret_cast<DWORD_PTR>(Current->BaseAddress) && dwAddress <= (reinterpret_cast<DWORD_PTR>(Current->BaseAddress) + Current->SizeOfImage)) |
| 265 | { |
| 266 | return Current; |
| 267 | } |
| 268 | |
| 269 | CurrentEntry = CurrentEntry->Flink; |
| 270 | } |
| 271 | return nullptr; |
| 272 | } |
| 273 | |
| 274 | static HMODULE WINAPI MyGetModuleHandleA(_In_ LPCSTR lpModuleName) |
| 275 | { |
no test coverage detected