| 82 | } |
| 83 | |
| 84 | std::optional<PVOID> QueryNativePebAddress(HANDLE process) { |
| 85 | const auto ntQueryInformationProcess = NtQueryInformationProcessProc(); |
| 86 | if (!ntQueryInformationProcess) return std::nullopt; |
| 87 | |
| 88 | NtAbi::ProcessBasicInformation info{}; |
| 89 | const NTSTATUS status = ntQueryInformationProcess( |
| 90 | process, |
| 91 | NtAbi::ProcessInfoClass::BasicInformation, |
| 92 | &info, |
| 93 | sizeof(info), |
| 94 | nullptr); |
| 95 | if (!NtAbi::NtSuccess(status) || !info.pebBaseAddress) return std::nullopt; |
| 96 | |
| 97 | return info.pebBaseAddress; |
| 98 | } |
| 99 | |
| 100 | std::optional<ULONG_PTR> QueryWow64PebAddress(HANDLE process) { |
| 101 | const auto ntQueryInformationProcess = NtQueryInformationProcessProc(); |
no test coverage detected