Debugging Tools for Windows

WriteMemory

The WriteMemory function works like the Win32 WriteProcessMemory routine. It writes memory to the process being debugged. The entire area to be written must be accessible, or the operation fails.

ULONG 
  WriteMemory (
    ULONG offset,
    LPCVOID lpbuffer,
    ULONG cb, 
    PULONG lpcbBytesWritten
    );

Parameters

offset
Specifies the base address of the memory to be written in the process that is being debugged.
lpbuffer
Points to the buffer that contains the data to be written.
cb
Specifies the number of bytes that WriteMemory should write.
lpcbBytesWritten
Receives the actual number of bytes that WriteMemory transferred from the buffer. This parameter is optional; if it is NULL, it is ignored.

Return Value

If the routine succeeds, the return value is TRUE; otherwise, it is FALSE.

Requirements

Headers: Defined in wdbgexts.h. If you are writing a WdbgExts extension, include wdbgexts.h. If you are writing a DbgEng extension that calls this function, include wdbgexts.h before dbgeng.h (see Writing DbgEng Extension Code for details).

Build machine: CAPEBUILD