check normal dirbase if 0 then get from UserDirectoryTableBas
| 55 | |
| 56 | //check normal dirbase if 0 then get from UserDirectoryTableBas |
| 57 | ULONG_PTR GetProcessCr3(PEPROCESS pProcess) |
| 58 | { |
| 59 | PUCHAR process = (PUCHAR)pProcess; |
| 60 | ULONG_PTR process_dirbase = *(PULONG_PTR)(process + 0x28); //dirbase x64, 32bit is 0x18 |
| 61 | if (process_dirbase == 0) |
| 62 | { |
| 63 | DWORD UserDirOffset = GetUserDirectoryTableBaseOffset(); |
| 64 | ULONG_PTR process_userdirbase = *(PULONG_PTR)(process + UserDirOffset); |
| 65 | return process_userdirbase; |
| 66 | } |
| 67 | return process_dirbase; |
| 68 | } |
| 69 | ULONG_PTR GetKernelDirBase() |
| 70 | { |
| 71 | PUCHAR process = (PUCHAR)PsGetCurrentProcess(); |
no test coverage detected