MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / SecureProcessMemory

Function SecureProcessMemory

Kernel-Bridge/API/MemoryUtils.cpp:133–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132 _IRQL_requires_max_(APC_LEVEL)
133 BOOLEAN SecureProcessMemory(
134 PEPROCESS Process,
135 __in_data_source(USER_MODE) PVOID UserAddress,
136 SIZE_T Size,
137 ULONG ProtectRights,
138 OUT PHANDLE SecureHandle
139 ) {
140 if (!Process || !SecureHandle) return FALSE;
141 if (Process == PsGetCurrentProcess())
142 return SecureMemory(UserAddress, Size, ProtectRights, SecureHandle);
143
144 HANDLE hSecure = NULL;
145 KAPC_STATE ApcState;
146 KeStackAttachProcess(Process, &ApcState);
147 BOOLEAN Result = SecureMemory(UserAddress, Size, ProtectRights, &hSecure);
148 KeUnstackDetachProcess(&ApcState);
149
150 *SecureHandle = hSecure;
151 return Result;
152 }
153
154 _IRQL_requires_max_(APC_LEVEL)
155 VOID UnsecureMemory(HANDLE SecureHandle) {

Callers 3

OperateProcessMemoryFunction · 0.85
KbSecureVirtualMemoryFunction · 0.85
KbFindSignatureFunction · 0.85

Calls 1

SecureMemoryFunction · 0.85

Tested by

no test coverage detected