| 122 | |
| 123 | |
| 124 | NTSTATUS DriverEntry(EntryParams* params) //damn this needs serious fixing... it's clunky |
| 125 | { |
| 126 | if (!params) |
| 127 | return STATUS_FAILED_DRIVER_ENTRY; |
| 128 | |
| 129 | printf("[mapper] Driver Entry: %xll Image Base: %xll Size: %xll\n", params->entryPoint, params->poolBase, params->size); |
| 130 | |
| 131 | #pragma region win32base.sys |
| 132 | auto win32kbase = Core::GetSystemModuleBase("\\SystemRoot\\System32\\win32kbase.sys"); |
| 133 | { |
| 134 | |
| 135 | if (!win32kbase) |
| 136 | { |
| 137 | printf("[mapper] Failed to get Base Address!\n"); |
| 138 | return STATUS_FAILED_DRIVER_ENTRY; |
| 139 | } |
| 140 | |
| 141 | printf("[mapper] win32kbase.sys -> 0x%p\n", win32kbase); |
| 142 | } |
| 143 | #pragma endregion |
| 144 | #pragma region ApiSetEditionSetProcessWindowStationEntryPoint |
| 145 | |
| 146 | auto ApiSetEditionSetProcessWindowStationEntryPointAddress = Util::FindPattern( |
| 147 | win32kbase, |
| 148 | "\xE8\x00\x00\x00\x00\x48\x98\x48\x83\xC4\x28\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x70\x10", |
| 149 | "x????xxxxxxxxxxxxxxxxxxxxxxxxxx"); |
| 150 | { |
| 151 | if (!ApiSetEditionSetProcessWindowStationEntryPointAddress) |
| 152 | { |
| 153 | printf("[mapper] Unable to find ApiSetEditionSetProcessWindowStationEntryPoint signature!\n"); |
| 154 | return STATUS_FAILED_DRIVER_ENTRY; |
| 155 | } |
| 156 | ApiSetEditionSetProcessWindowStationEntryPointAddress = RVA(ApiSetEditionSetProcessWindowStationEntryPointAddress, 5); |
| 157 | printf("[mapper] ApiSetEditionSetProcessWindowStationEntryPoint -> 0x%p\n", ApiSetEditionSetProcessWindowStationEntryPointAddress); |
| 158 | } |
| 159 | |
| 160 | auto ApiSetEditionSetProcessWindowStationEntryPointDataPointer = RVA(ApiSetEditionSetProcessWindowStationEntryPointAddress + 0x5E, 7); |
| 161 | { |
| 162 | if (!ApiSetEditionSetProcessWindowStationEntryPointDataPointer) |
| 163 | { |
| 164 | printf("[mapper] Invalid ApiSetEditionSetProcessWindowStationEntryPoint Data Pointer!\n"); |
| 165 | return STATUS_FAILED_DRIVER_ENTRY; |
| 166 | } |
| 167 | printf("[mapper] ApiSetEditionSetProcessWindowStationEntryPoint Data Pointer -> 0x%p\n", |
| 168 | ApiSetEditionSetProcessWindowStationEntryPointAddress); |
| 169 | } |
| 170 | #pragma endregion |
| 171 | #pragma region ApiSetEnsurePointerDeviceHasMonitor |
| 172 | auto ApiSetEnsurePointerDeviceHasMonitorAddress = Util::FindPattern(win32kbase, "\xE8\x00\x00\x00\x00\x85\xC0\x75\x43", "x????xxxx"); |
| 173 | { |
| 174 | if (!ApiSetEnsurePointerDeviceHasMonitorAddress) |
| 175 | { |
| 176 | printf("[mapper] Unable to find ApiSetEnsurePointerDeviceHasMonitor signature!\n"); |
| 177 | return STATUS_FAILED_DRIVER_ENTRY; |
| 178 | } |
| 179 | ApiSetEnsurePointerDeviceHasMonitorAddress = RVA(ApiSetEnsurePointerDeviceHasMonitorAddress, 5); |
| 180 | printf("[mapper] ApiSetEnsurePointerDeviceHasMonitor -> 0x%p\n", ApiSetEnsurePointerDeviceHasMonitorAddress); |
| 181 | } |
nothing calls this directly
no test coverage detected