User Tools

Site Tools


addons:functions:memory

This is an old revision of the document!


Memory Namespace

The memory namespace contains functions that interact with the game clients memory.

You can access these functions via:

ashita.memory.

ashita.memory.get_baseaddr

ashita.memory.get_base

Obtains the base address of a module.

number ashita.memory.get_base(name);
  • Parameters
    • name - (string) The name of the module to obtain the base address of.
  • Returns
    • number - The base address if valid, 0 otherwise.

ashita.memory.get_modulesize

ashita.memory.get_size

Obtains the size of a module.

number ashita.memory.get_size(name);
  • Parameters
    • name - (string) The name of the module to obtain the size of.
  • Returns
    • number - The size if valid, 0 otherwise.

ashita.memory.unprotect_memory

ashita.memory.unprotect

Unprotects an area of memory, setting its page access to 'PAGE_EXECUTE_READWRITE'.

bool ashita.memory.unprotect(addr, size);
  • Parameters
    • addr - (number) The starting address to unprotect.
    • size - (number) The size of data to unprotect.
  • Returns
    • bool - True on success, false otherwise.

ashita.memory.allocate_memory

ashita.memory.allocate

ashita.memory.alloc

Allocates an area of memory.

number ashita.memory.alloc(size);
  • Parameters
    • size - (number) The size of data to allocate.
  • Returns
    • number - The base address of the new allocation on success, nil otherwise.

ashita.memory.deallocate_memory

ashita.memory.deallocate

ashita.memory.dealloc

Deallocates an area of memory.

bool ashita.memory.dealloc(addr, size);
  • Parameters
    • addr - (number) The base address of the memory to deallocate.
    • size - (number) The size of data to deallocate.
  • Returns
    • bool - True on success, false otherwise.

ashita.memory.findpattern

ashita.memory.find

Scans memory for a given pattern.

number ashita.memory.find(baseAddress, size, pattern, offset, usage);
  • Parameters
    • baseAddress - (number) The base address of the memory to scan within.
    • size - (number) The size of data to scan within.
    • pattern - (string) The pattern to scan for.
    • offset - (number) The offset to add to the result, if found.
    • usage - (number) The usage count to use if the pattern is expected to be found more than once.
  • Returns
    • number - The address where the pattern was found on success, 0 otherwise.
number ashita.memory.find(moduleName, size, pattern, offset, usage);
  • Parameters
    • moduleName - (string) The name of the module to scan within. (Using this method of this function will use the base and size of the module automatically.)
    • size - (number) Unused, this can be left 0 when using this style of the method.
    • pattern - (string) The pattern to scan for.
    • offset - (number) The offset to add to the result, if found.
    • usage - (number) The usage count to use if the pattern is expected to be found more than once.
  • Returns
    • number - The address where the pattern was found on success, 0 otherwise.

ashita.memory.read_uint8


ashita.memory.read_uint16


ashita.memory.read_uint32


ashita.memory.read_uint64


ashita.memory.read_int8


ashita.memory.read_int16


ashita.memory.read_int32


ashita.memory.read_int64


ashita.memory.read_float


ashita.memory.read_double


ashita.memory.read_array


ashita.memory.read_string


ashita.memory.write_uint8


ashita.memory.write_uint16


ashita.memory.write_uint32


ashita.memory.write_uint64


ashita.memory.write_int8


ashita.memory.write_int16


ashita.memory.write_int32


ashita.memory.write_int64


ashita.memory.write_float


ashita.memory.write_double


ashita.memory.write_array


ashita.memory.write_string

addons/functions/memory.1492839332.txt.gz · Last modified: 2017/04/21 22:35 by atom0s