Welcome to ReadWriteMemory’s documentation!

class ReadWriteMemory.Process(name: str = '', pid: int = - 1, handle: int = - 1, error_code: str = None)

The Process class holds the information about the requested process.

close() → int

Closes the handle of the process.

Returns

The last error code from the result after an attempt to close the handle.

static get_last_error() → int

Get the last error code.

Returns

The last error code.

get_pointer(lp_base_address: hex, offsets: List[hex] = ) → int

Get the pointer of a given address.

Parameters
  • lp_base_address – The address from where you want to get the pointer.

  • offsets – a list of offets.

Returns

The pointer of a give address.

open()

Open the process with the Query, Operation, Read and Write permissions and return the process handle.

Returns

True if the handle exists if not return False

read(lp_base_address: int) → Any

Read data from the process’s memory.

Parameters

lp_base_address – The process’s pointer

Returns

The data from the process’s memory if succeed if not raises an exception.

write(lp_base_address: int, value: int) → bool

Write data to the process’s memory.

Parameters
  • lp_base_address – The process’ pointer.

  • value – The data to be written to the process’s memory

Returns

It returns True if succeed if not it raises an exception.

class ReadWriteMemory.ReadWriteMemory

The ReadWriteMemory Class is used to read and write to the memory of a running process.

static enumerate_processes() → list

Get the list of running processes ID’s from the current system.

Returns

A list of processes ID’s

get_process_by_id(process_id: int)ReadWriteMemory.Process
Description

Get the process by the process ID and return a Process object.

Parameters

process_id – The process ID.

Returns

A Process object containing the information from the requested Process.

get_process_by_name(process_name: str)ReadWriteMemory.Process
Description

Get the process by the process executabe’s name and return a Process object.

Parameters

process_name – The name of the executable file for the specified process for example, my_program.exe.

Returns

A Process object containing the information from the requested Process.

exception ReadWriteMemory.ReadWriteMemoryError

Indices and tables