uniref.util.injector

class uniref.util.injector.windows.WinInjector(exe_filename: str = '', process_id: int = 0)

Bases: Injector

Process injector for Windows.

property bit_long: int

Application bit long

get_module_base(module_name: str) int

Get module base by name in the injected process.

get_proc_address(module_base: int, proc_name: str) int

Get module exported function address in the injected process.

mem_alloc(alloc_address: int = 0, alloc_size: int = 4096, alloc_type: int = 12288, protection: str = 'rwx') int

Allocate memory.

mem_free(address: int, free_size: int = 0, free_type: int = 32768) None

Free allocated memory.

mem_read_bool(address: int) bool

Read a bool value from the specified address.

mem_read_c_string(address: int) str

Read a C-style string from the specified address.

mem_read_char(address: int) int

Read a char value from the specified address.

mem_read_double(address: int) float

Read a double value from the specified address.

mem_read_float(address: int) float

Read a float value from the specified address.

mem_read_int16(address: int) int

Read a short value from the specified address.

mem_read_int32(address: int) int

Read an int value from the specified address.

mem_read_int64(address: int) int

Read a long long value from the specified address.

mem_read_pointer(address: int) int

Read a void* value from the specified address.

mem_read_uchar(address: int) int

Read an unsigned char value from the specified address.

mem_read_uint16(address: int) int

Read an unsigned short value from the specified address.

mem_read_uint32(address: int) int

Read an unsigned int value from the specified address.

mem_read_uint64(address: int) int

Read an unsigned long long value from the specified address.

mem_set_protect(address: int, length: int, new_protect: str = 'rwx') str

Set memory protection.

mem_write_bool(address: int, value: bool) bool

Write a bool value to the specified address.

mem_write_c_string(address: int, value: str) bool

Write a C-style string to the specified address. (Automatically add \x00)

mem_write_char(address: int, value: int) bool

Write a char value to the specified address.

mem_write_double(address: int, value: float) bool

Write a double value to the specified address.

mem_write_float(address: int, value: float) bool

Write a float value to the specified address.

mem_write_int16(address: int, value: int) bool

Write a short value to the specified address.

mem_write_int32(address: int, value: int) bool

Write an int value to the specified address.

mem_write_int64(address: int, value: int) bool

Write a long long value to the specified address.

mem_write_pointer(address: int, value: int) int

Write a void* value to the specified address.

mem_write_uchar(address: int, value: int) bool

Write an unsigned char value to the specified address.

mem_write_uint16(address: int, value: int) bool

Write an unsigned short value to the specified address.

mem_write_uint32(address: int, value: int) bool

Write an unsigned int value to the specified address.

mem_write_uint64(address: int, value: int) bool

Write an unsigned long long value to the specified address.

property process_id: int

PID

class uniref.util.injector.android.AndroidInjector(process_name: Optional[str], package_name: Optional[str], device_id: Optional[str], spawn: bool)

Bases: Injector

property bit_long: int

Application bit long

get_module_base(module_name: str) int

Get module base by name in the injected process.

get_proc_address(module_name: str, proc_name: str) int

Get module exported function address in the injected process.

mem_alloc(alloc_size: int = -1, protection: str = 'rwx') int

Allocate memory.

mem_free(address: int) None

Free allocated memory.

mem_read_bool(address: int) bool

Read a bool value from the specified address.

mem_read_c_string(address: int) str

Read a C-style string from the specified address.

mem_read_char(address: int) int

Read a char value from the specified address.

mem_read_double(address: int) float

Read a double value from the specified address.

mem_read_float(address: int) float

Read a float value from the specified address.

mem_read_int16(address: int) int

Read a short value from the specified address.

mem_read_int32(address: int) int

Read an int value from the specified address.

mem_read_int64(address: int) int

Read a long long value from the specified address.

mem_read_pointer(address: int) int

Read a void* value from the specified address.

mem_read_uchar(address: int) int

Read an unsigned char value from the specified address.

mem_read_uint16(address: int) int

Read an unsigned short value from the specified address.

mem_read_uint32(address: int) int

Read an unsigned int value from the specified address.

mem_read_uint64(address: int) int

Read an unsigned long long value from the specified address.

mem_set_protect(address: int, length: int, new_protect: str = 'rwx') None

Set memory protection.

mem_write_bool(address: int, value: bool) bool

Write a bool value to the specified address.

mem_write_c_string(address: int, value: str) bool

Write a C-style string to the specified address. (Automatically add \x00)

mem_write_char(address: int, value: int) bool

Write a char value to the specified address.

mem_write_double(address: int, value: float) bool

Write a double value to the specified address.

mem_write_float(address: int, value: float) bool

Write a float value to the specified address.

mem_write_int16(address: int, value: int) bool

Write a short value to the specified address.

mem_write_int32(address: int, value: int) bool

Write an int value to the specified address.

mem_write_int64(address: int, value: int) bool

Write a long long value to the specified address.

mem_write_pointer(address: int, value: int) int

Write a void* value to the specified address.

mem_write_uchar(address: int, value: int) bool

Write an unsigned char value to the specified address.

mem_write_uint16(address: int, value: int) bool

Write an unsigned short value to the specified address.

mem_write_uint32(address: int, value: int) bool

Write an unsigned int value to the specified address.

mem_write_uint64(address: int, value: int) bool

Write an unsigned long long value to the specified address.

property process_id: int

PID