MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / SecureProcessMemory

Function SecureProcessMemory

Source/Client/NM_Sys/API/MemoryUtils.cpp:94–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93 _IRQL_requires_max_(APC_LEVEL)
94 BOOLEAN SecureProcessMemory(PEPROCESS Process,__in_data_source(USER_MODE) PVOID UserAddress, SIZE_T Size, ULONG ProtectRights, OUT PHANDLE SecureHandle)
95 {
96 if (!Process || !SecureHandle)
97 return FALSE;
98
99 if (Process == PsGetCurrentProcess())
100 return SecureMemory(UserAddress, Size, ProtectRights, SecureHandle);
101
102 KAPC_STATE ApcState;
103 KeStackAttachProcess(Process, &ApcState);
104
105 HANDLE hSecure = NULL;
106 BOOLEAN Result = SecureMemory(UserAddress, Size, ProtectRights, &hSecure);
107
108 KeUnstackDetachProcess(&ApcState);
109
110 *SecureHandle = hSecure;
111 return Result;
112 }
113
114 _IRQL_requires_max_(APC_LEVEL)
115 VOID UnsecureMemory(HANDLE SecureHandle)

Callers 2

OperateProcessMemoryFunction · 0.85
KbSecureVirtualMemoryFunction · 0.85

Calls 1

SecureMemoryFunction · 0.85

Tested by

no test coverage detected