This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
addons:functions:memory [2017/04/21 23:48] atom0s [Memory Namespace] |
addons:functions:memory [2017/04/22 00:03] (current) atom0s |
||
---|---|---|---|
Line 23: | Line 23: | ||
Obtains the size of a module. | Obtains the size of a module. | ||
- | <code lua>number ashita.memory.get_size(name);</code> | + | <sxh lua>number ashita.memory.get_size(name);</sxh> |
* **Parameters** | * **Parameters** | ||
* name - (string) The name of the module to obtain the size of. | * name - (string) The name of the module to obtain the size of. | ||
Line 34: | Line 34: | ||
Unprotects an area of memory, setting its page access to 'PAGE_EXECUTE_READWRITE'. | Unprotects an area of memory, setting its page access to 'PAGE_EXECUTE_READWRITE'. | ||
- | <code lua>bool ashita.memory.unprotect(addr, size);</code> | + | <sxh lua>bool ashita.memory.unprotect(addr, size);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The starting address to unprotect. | * addr - (number) The starting address to unprotect. | ||
Line 47: | Line 47: | ||
Allocates an area of memory. | Allocates an area of memory. | ||
- | <code lua>number ashita.memory.alloc(size);</code> | + | <sxh lua>number ashita.memory.alloc(size);</sxh> |
* **Parameters** | * **Parameters** | ||
* size - (number) The size of data to allocate. | * size - (number) The size of data to allocate. | ||
Line 59: | Line 59: | ||
Deallocates an area of memory. | Deallocates an area of memory. | ||
- | <code lua>bool ashita.memory.dealloc(addr, size);</code> | + | <sxh lua>bool ashita.memory.dealloc(addr, size);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The base address of the memory to deallocate. | * addr - (number) The base address of the memory to deallocate. | ||
Line 71: | Line 71: | ||
Scans memory for a given pattern. | Scans memory for a given pattern. | ||
- | <code lua>number ashita.memory.find(baseAddress, size, pattern, offset, usage);</code> | + | <sxh lua>number ashita.memory.find(baseAddress, size, pattern, offset, usage);</sxh> |
* **Parameters** | * **Parameters** | ||
* baseAddress - (number) The base address of the memory to scan within. | * baseAddress - (number) The base address of the memory to scan within. | ||
Line 81: | Line 81: | ||
* number - The address where the pattern was found on success, 0 otherwise. | * number - The address where the pattern was found on success, 0 otherwise. | ||
- | <code lua>number ashita.memory.find(moduleName, size, pattern, offset, usage);</code> | + | <sxh lua>number ashita.memory.find(moduleName, size, pattern, offset, usage);</sxh> |
* **Parameters** | * **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.) | * 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.) | ||
Line 95: | Line 95: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_uint8(addr);</code> | + | <sxh lua>number ashita.memory.read_uint8(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 105: | Line 105: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_uint16(addr);</code> | + | <sxh lua>number ashita.memory.read_uint16(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 115: | Line 115: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_uint32(addr);</code> | + | <sxh lua>number ashita.memory.read_uint32(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 125: | Line 125: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_uint64(addr);</code> | + | <sxh lua>number ashita.memory.read_uint64(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 135: | Line 135: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_int8(addr);</code> | + | <sxh lua>number ashita.memory.read_int8(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 145: | Line 145: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_int16(addr);</code> | + | <sxh lua>number ashita.memory.read_int16(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 155: | Line 155: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_int32(addr);</code> | + | <sxh lua>number ashita.memory.read_int32(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 165: | Line 165: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_int64(addr);</code> | + | <sxh lua>number ashita.memory.read_int64(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 175: | Line 175: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_float(addr);</code> | + | <sxh lua>number ashita.memory.read_float(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 185: | Line 185: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_double(addr);</code> | + | <sxh lua>number ashita.memory.read_double(addr);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 195: | Line 195: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_array(addr, size);</code> | + | <sxh lua>number ashita.memory.read_array(addr, size);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 206: | Line 206: | ||
Reads a value from memory at the given address. | Reads a value from memory at the given address. | ||
- | <code lua>number ashita.memory.read_string(addr, size);</code> | + | <sxh lua>number ashita.memory.read_string(addr, size);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to read the value of. | * addr - (number) The address to read the value of. | ||
Line 217: | Line 217: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_uint8(addr, value);</code> | + | <sxh lua>void ashita.memory.write_uint8(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 228: | Line 228: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_uint16(addr, value);</code> | + | <sxh lua>void ashita.memory.write_uint16(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 239: | Line 239: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_uint32(addr, value);</code> | + | <sxh lua>void ashita.memory.write_uint32(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 250: | Line 250: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_uint64(addr, value);</code> | + | <sxh lua>void ashita.memory.write_uint64(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 261: | Line 261: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_int8(addr, value);</code> | + | <sxh lua>void ashita.memory.write_int8(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 272: | Line 272: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_int16(addr, value);</code> | + | <sxh lua>void ashita.memory.write_int16(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 283: | Line 283: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_int32(addr, value);</code> | + | <sxh lua>void ashita.memory.write_int32(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 294: | Line 294: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_int64(addr, value);</code> | + | <sxh lua>void ashita.memory.write_int64(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 305: | Line 305: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_float(addr, value);</code> | + | <sxh lua>void ashita.memory.write_float(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 316: | Line 316: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_double(addr, value);</code> | + | <sxh lua>void ashita.memory.write_double(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 327: | Line 327: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_array(addr, value);</code> | + | <sxh lua>void ashita.memory.write_array(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. | ||
Line 338: | Line 338: | ||
Writes a value to memory at the given address. | Writes a value to memory at the given address. | ||
- | <code lua>void ashita.memory.write_string(addr, value);</code> | + | <sxh lua>void ashita.memory.write_string(addr, value);</sxh> |
* **Parameters** | * **Parameters** | ||
* addr - (number) The address to write the value to. | * addr - (number) The address to write the value to. |