Memory Chunk Class
A "Memory Chunk" in this context refers to a section of data that has been pulled directly from
a processes memory. You may extract any number of separate variables out of a memory chunk. See
process.readChunk() on details on how to read
a chunk from a target process's memory
Returns the size, in bytes, of a memory chunk.
Returns the start address that a memory chunk was read from.
number offset, number length)
Extracts an actual, usable piece of data, such as a number or
string, from a memory chunk.
If you are reading a string, you must also specify the maximum length
to try reading with the 'length' parameter.
'type' should be a string that represents the type of data to read
("byte", "ubyte", "int", "uint", "int64", "uint64", "float", "double", "string", etc.). See
Data Types for more information on
'offset' should be the number of bytes after the start address to read data from.
local procId = process.findByExe("ExampleGame.exe");
local proc = process.open();
local characterAddress = 0x4A7A00;
local hpOffset = 0x0C;
local maxHpOffset = 0x10;
local mpOffset = 0x14;
local maxMpOffset = 0x18;
local nameOffset = 0xD0;
local nameSize = 16;
local charStructSize = 0xFF;
if( not proc ) then
error("Unable to open handle to target process.");
-- Read our character's stats (example only)
characterChunk = process.readChunk(proc, characterAddress, charStructSize);
-- We just read in the whole character struct as a 255-byte (0xFF) chunk. Extract data from it now.
local hp = characterChunk:getData("int", hpOffset);
local maxHp = characterChunk:getData("int", maxHpOffset);
local mp = characterChunk:getData("int", mpOffset);
local maxMp = characterChunk:getData("int", maxMpOffset);
local name = characterChunk:getData("string", nameOffset, nameSize);
Page last updated at 2018-09-25 20:48:08