MCPcopy Create free account
hub / github.com/NullTerminatorr/NullHook / read_kernel_memory

Function read_kernel_memory

KernelCheatYT/memory.cpp:147–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147bool read_kernel_memory(HANDLE pid, uintptr_t address, void* buffer, SIZE_T size)
148{
149 if (!address || !buffer || !size)
150 return false;
151
152 SIZE_T bytes = 0;
153 NTSTATUS status = STATUS_SUCCESS;
154 PEPROCESS process;
155 PsLookupProcessByProcessId((HANDLE)pid, &process);
156
157 status = MmCopyVirtualMemory(process, (void*)address, (PEPROCESS)PsGetCurrentProcess(), (void*)buffer, size, KernelMode, &bytes);
158
159 if (!NT_SUCCESS(status))
160 {
161 return false;
162 }
163 else
164 {
165 return true;
166 }
167}
168
169bool write_kernel_memory(HANDLE pid, uintptr_t address, void* buffer, SIZE_T size)
170{

Callers 1

hook_handlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected