MCPcopy Create free account
hub / github.com/Astronaut00/DoubleDataPointer / GetProcessCr3

Function GetProcessCr3

Driver/core.cpp:57–68  ·  view source on GitHub ↗

check normal dirbase if 0 then get from UserDirectoryTableBas

Source from the content-addressed store, hash-verified

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();

Callers 2

ReadProcessMemoryFunction · 0.85
WriteProcessMemoryFunction · 0.85

Calls 1

Tested by

no test coverage detected