# memory

Memory is a direct access library to reading/writing into memory.


# memory.module

{
    name: string,
    address: memory.address,
    base: memory.address,
    size: number
}

# Functions

# memory.address(value: number | string | function | userdata): memory.address

memory.address(value: number | string | function | userdata): memory.address
  • Creates a new address class.
  • Using a string will attempt for format a hex-string to address.
  • Using cfunctions or userdata retrives their absolute location in memory.

# memory.module(name?: string): memory.module

memory.module(name?: string): memory.module
  • Attempts to retreive a loaded module.
  • Windows are usually named .dll, while linux are .so

# memory.modules(): memory.module[]

memory.modules(): memory.module[]
  • Lists all modules that has been loaded.
  • Windows are usually named .dll, while linux are .so

# memory.base(addr: memory.address): memory.module?

memory.base(addr: memory.address): memory.module?
  • Attempts to locate the base module based on the address.
  • This only works if the address with within the address-space of a module.

# memory.fetch(module: memory.module, name: string): memory.address

memory.fetch(module: memory.module, name: string): memory.address
  • Attempts to search for existing routines or variables that are disclosed.

# memory.interface(module: memory.module, name: string): memory.address?

memory.interface(module: memory.module, name: string): memory.address?
  • Attempt to search for various interface routines & calls them.

# memory.index(input: memory.address, index: number): memory.address?

memory.index(input: memory.address, index: number): memory.address?
  • Performs a simple indexing on an address.
  • This equates to simply ((void**)input)[index]

# memory.offset(input: memory.address, offset: number): memory.address

memory.offset(input: memory.address, offset: number): memory.address
  • Performs a simple offset to an address
  • This equates to simply (void*)input + offset

# memory.relative(input: memory.address, offset: number, size: number): memory.address?

memory.relative(input: memory.address, offset: number, size: number): memory.address?
  • Performs a relative instruction operation.
  • For windows-x64-intel this peaks into a subroutine using "call" opcode -> memory.relative(addr, 0x1, 0x5)

# memory.vtable(input: memory.address): memory.address?

memory.vtable(input: memory.address): memory.address?
  • Performs a de-reference to a class for it's vtable.
  • This equates to simply *reinterpret_cast<void***>(address)

# memory.read.bool(input: memory.address): boolean?

# memory.aob.hex(module: memory.module, pattern: string): memory.address?

memory.aob.hex(module: memory.module, pattern: string): memory.address?
  • Performs a hex-style signature scan on a module.
  • Example: \xA0?\xB1

# memory.aob.ida(module: memory.module, pattern: string): memory.address?

memory.aob.ida(module: memory.module, pattern: string): memory.address?
  • Performs a ida-style signature scan on a module.
  • Example: A0 ? B1
memory.read.bool(input: memory.address): boolean?
  • Attempts to read a boolean value.
  • Typically the size of a boolean is defined as 1 bit.
  • However some systems differ claiming 1 byte or 8 bits.

# memory.read.char(input: memory.address): number?

memory.read.char(input: memory.address): number?
  • Attempts to read a char value.
  • Size: 1 Byte - 8 Bits

# memory.read.uchar(input: memory.address): number?

memory.read.uchar(input: memory.address): number?
  • Attempts to read a unsigned char value.
  • Size: 1 Byte - 8 Bits

# memory.read.short(input: memory.address): number?

memory.read.short(input: memory.address): number?
  • Attempts to read a short value.
  • Size: 2 Bytes - 16 Bits

# memory.read.ushort(input: memory.address): number?

memory.read.ushort(input: memory.address): number?
  • Attempts to read a unsigned short value.
  • Size: 2 Bytes - 16 Bits

# memory.read.int(input: memory.address): number?

memory.read.int(input: memory.address): number?
  • Attempts to read a int value.
  • Size: 4 Bytes - 32 Bits

# memory.read.uint(input: memory.address): number?

memory.read.uint(input: memory.address): number?
  • Attempts to read a unsigned int value.
  • Size: 4 Bytes - 32 Bits

# memory.read.long(input: memory.address): number?

memory.read.long(input: memory.address): number?
  • Attempts to read a long value.
  • Size: 4 Bytes - 32 Bits (Win) | 8 Bytes - 64 Bits (Linux)

# memory.read.ulong(input: memory.address): number?

memory.read.ulong(input: memory.address): number?
  • Attempts to read a unsigned long value.
  • Size: 4 Bytes - 32 Bits (Win) | 8 Bytes - 64 Bits (Linux)

# memory.read.float(input: memory.address): number?

memory.read.float(input: memory.address): number?
  • Attempts to read a float value.
  • Size: 4 Bytes - 32 Bits

# memory.read.double(input: memory.address): number?

memory.read.double(input: memory.address): number?
  • Attempts to read a double value.
  • Size: 8 Bytes - 64 Bits

# memory.read.sequence(input: memory.address, size: number): string

memory.read.sequence(input: memory.address, size: number): string
  • Attempts to read a sequence of bytes.
  • Example returns: A1 B2 C3

# memory.read.address(input: memory.address): memory.address?

memory.read.address(input: memory.address): memory.address?
  • Attempts to read a void* value.

# memory.write.bool(input: memory.address, value: boolean)

memory.write.bool(input: memory.address, value: boolean)
  • Attempts to write a boolean value.
  • Typically the size of a boolean is defined as 1 bit.
  • However some systems differ claiming 1 byte or 8 bits.

# memory.write.char(input: memory.address, value: number)

memory.write.char(input: memory.address, value: number)
  • Attempts to write a char value.
  • Size: 1 Byte - 8 Bits

# memory.write.uchar(input: memory.address, value: number)

memory.write.uchar(input: memory.address, value: number)
  • Attempts to write a unsigned char value.
  • Size: 1 Byte - 8 Bits

# memory.write.short(input: memory.address, value: number)

memory.write.short(input: memory.address, value: number)
  • Attempts to write a short value.
  • Size: 2 Bytes - 16 Bits

# memory.write.ushort(input: memory.address, value: number)

memory.write.ushort(input: memory.address, value: number)
  • Attempts to write a unsigned short value.
  • Size: 2 Bytes - 16 Bits

# memory.write.int(input: memory.address, value: number)

memory.write.int(input: memory.address, value: number)
  • Attempts to write a int value.
  • Size: 4 Bytes - 32 Bits

# memory.write.uint(input: memory.address, value: number)

memory.write.uint(input: memory.address, value: number)
  • Attempts to write a unsigned int value.
  • Size: 4 Bytes - 32 Bits

# memory.write.long(input: memory.address, value: number)

memory.write.long(input: memory.address, value: number)
  • Attempts to write a long value.
  • Size: 4 Bytes - 32 Bits (Win) | 8 Bytes - 64 Bits (Linux)

# memory.write.ulong(input: memory.address, value: number)

memory.write.ulong(input: memory.address, value: number)
  • Attempts to write a unsigned long value.
  • Size: 4 Bytes - 32 Bits (Win) | 8 Bytes - 64 Bits (Linux)

# memory.write.float(input: memory.address, value: number)

memory.write.float(input: memory.address, value: number)
  • Attempts to write a float value.
  • Size: 4 Bytes - 32 Bits

# memory.write.double(input: memory.address, value: number)

memory.write.double(input: memory.address, value: number)
  • Attempts to write a double value.
  • Size: 8 Bytes - 64 Bits

# memory.write.sequence(input: memory.address, value: number)

memory.write.sequence(input: memory.address, value: string, size: number)
  • Attempts to write a sequence of bytes to the address.
  • Example sequences that are valid: A1 B2 C3 or A1B2C3

# memory.write.address(input: memory.address, value: number)

memory.write.address(input: memory.address, value: memory.address)
  • Attempts to write a address value.