This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
addons:functions:memory [2017/04/21 22:35] atom0s created |
addons:functions:memory [2017/04/21 23:48] atom0s [Memory Namespace] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOTOC~~ | ||
===== Memory Namespace ===== | ===== Memory Namespace ===== | ||
Line 5: | Line 4: | ||
You can access these functions via: | You can access these functions via: | ||
- | <code lua>ashita.memory.</code> | + | <sxh lua>ashita.memory.</sxh> |
---- | ---- | ||
Line 12: | Line 12: | ||
Obtains the base address of a module. | Obtains the base address of a module. | ||
- | <code lua>number ashita.memory.get_base(name);</code> | + | <sxh lua>number ashita.memory.get_base(name);</sxh> |
* **Parameters** | * **Parameters** | ||
* name - (string) The name of the module to obtain the base address of. | * name - (string) The name of the module to obtain the base address of. | ||
Line 93: | Line 93: | ||
---- | ---- | ||
==== ashita.memory.read_uint8 ==== | ==== ashita.memory.read_uint8 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_uint8(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_uint16 ==== | ==== ashita.memory.read_uint16 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_uint16(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_uint32 ==== | ==== ashita.memory.read_uint32 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_uint32(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_uint64 ==== | ==== ashita.memory.read_uint64 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_uint64(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_int8 ==== | ==== ashita.memory.read_int8 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_int8(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_int16 ==== | ==== ashita.memory.read_int16 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_int16(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_int32 ==== | ==== ashita.memory.read_int32 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_int32(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_int64 ==== | ==== ashita.memory.read_int64 ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_int64(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_float ==== | ==== ashita.memory.read_float ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_float(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_double ==== | ==== ashita.memory.read_double ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_double(addr);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * **Returns** | ||
+ | * number - The value of the address, 0 on error. | ||
---- | ---- | ||
==== ashita.memory.read_array ==== | ==== ashita.memory.read_array ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_array(addr, size);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * size - (number) The size of data to read. | ||
+ | * **Returns** | ||
+ | * table - The values read from the given address, nil on error. | ||
---- | ---- | ||
==== ashita.memory.read_string ==== | ==== ashita.memory.read_string ==== | ||
+ | |||
+ | Reads a value from memory at the given address. | ||
+ | <code lua>number ashita.memory.read_string(addr, size);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to read the value of. | ||
+ | * size - (number) The size of the string to read. | ||
+ | * **Returns** | ||
+ | * string - The string read from the given address, nil on error. | ||
---- | ---- | ||
==== ashita.memory.write_uint8 ==== | ==== ashita.memory.write_uint8 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_uint8(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_uint16 ==== | ==== ashita.memory.write_uint16 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_uint16(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_uint32 ==== | ==== ashita.memory.write_uint32 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_uint32(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_uint64 ==== | ==== ashita.memory.write_uint64 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_uint64(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_int8 ==== | ==== ashita.memory.write_int8 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_int8(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_int16 ==== | ==== ashita.memory.write_int16 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_int16(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_int32 ==== | ==== ashita.memory.write_int32 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_int32(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_int64 ==== | ==== ashita.memory.write_int64 ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_int64(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_float ==== | ==== ashita.memory.write_float ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_float(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_double ==== | ==== ashita.memory.write_double ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_double(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (number) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_array ==== | ==== ashita.memory.write_array ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_array(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (table) The array of data to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
---- | ---- | ||
==== ashita.memory.write_string ==== | ==== ashita.memory.write_string ==== | ||
+ | |||
+ | Writes a value to memory at the given address. | ||
+ | <code lua>void ashita.memory.write_string(addr, value);</code> | ||
+ | * **Parameters** | ||
+ | * addr - (number) The address to write the value to. | ||
+ | * value - (string) The value to write to memory. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||