WriteProcessMemory function kernel32

int WriteProcessMemory(
  1. int hProcess,
  2. Pointer<NativeType> lpBaseAddress,
  3. Pointer<NativeType> lpBuffer,
  4. int nSize,
  5. Pointer<IntPtr> lpNumberOfBytesWritten,
)

Writes data to an area of memory in a specified process. The entire area to be written to must be accessible or the operation fails.

BOOL WriteProcessMemory(
  HANDLE  hProcess,
  LPVOID  lpBaseAddress,
  LPCVOID lpBuffer,
  SIZE_T  nSize,
  SIZE_T  *lpNumberOfBytesWritten
);

Implementation

int WriteProcessMemory(
  int hProcess,
  Pointer lpBaseAddress,
  Pointer lpBuffer,
  int nSize,
  Pointer<IntPtr> lpNumberOfBytesWritten,
) => _WriteProcessMemory(
  hProcess,
  lpBaseAddress,
  lpBuffer,
  nSize,
  lpNumberOfBytesWritten,
);