| 98 | } |
| 99 | |
| 100 | std::optional<ULONG_PTR> QueryWow64PebAddress(HANDLE process) { |
| 101 | const auto ntQueryInformationProcess = NtQueryInformationProcessProc(); |
| 102 | if (!ntQueryInformationProcess) return std::nullopt; |
| 103 | |
| 104 | ULONG_PTR peb32 = 0; |
| 105 | const NTSTATUS status = ntQueryInformationProcess( |
| 106 | process, |
| 107 | NtAbi::ProcessInfoClass::Wow64Information, |
| 108 | &peb32, |
| 109 | sizeof(peb32), |
| 110 | nullptr); |
| 111 | if (!NtAbi::NtSuccess(status) || peb32 == 0) return std::nullopt; |
| 112 | return peb32; |
| 113 | } |
| 114 | |
| 115 | std::optional<PVOID> QueryNativeEnvironmentAddress(HANDLE process) { |
| 116 | const auto pebAddress = QueryNativePebAddress(process); |
no test coverage detected