rajada1 Newbie cheater
Reputation: 0
Joined: 02 Jan 2017 Posts: 12
|
Posted: Sun Feb 20, 2022 11:09 am Post subject: Edit Lua File and Find Reference in Memory |
|
|
I have a game, where I can edit some lua files.
I have for example the value 123456 that I wrote in the lua file,
how can i find this value in the memory of the running game?
|
|
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sun Feb 20, 2022 11:44 am Post subject: |
|
|
You should locate the address the value is held at with Cheat Engine. From there you can use Lua to read the address according to its data type:
| Code: |
readShortInteger(address) / readByte(address) : Reads an 8-bit integer from the specified address
readSmallInteger(address) : Reads a 16-bit integer from the specified address
readInteger(address) : Reads a 32-bit integer from the specified address
readQword(address): Reads a 64-bit integer from the specified address
readPointer(address): In a 64-bit target this equals readQword, in a 32-bit target readInteger()
readFloat(address) : Reads a single precision floating point value from the specified address
readDouble(address) : Reads a double-precision floating point value from the specified address
readString(address, maxlength, widechar OPTIONAL) : Reads a string till it encounters a 0-terminator. Maxlength is just so you won't freeze for too long, set to 6000 if you don't care too much. Set WideChar to true if it is encoded using a widechar format
writeShortInteger(address,value) / writeByte(address,value) : Writes a 16-bit integer to the specified address. Returns true on success
writeSmallInteger(address,value) : Writes a 16-bit integer to the specified address. Returns true on success
writeInteger(address,value) : Writes a 32-bit integer to the specified address. Returns true on success
writeQword(address, value): Write a 64-bit integer to the specified address. Returns true on success
writePointer(address,value)
writeFloat(address,value) : Writes a single precision floating point to the specified address. Returns true on success
writeDouble(address,value) : Writes a double precision floating point to the specified address. Returns true on success
|
It really depends on the data type to which function you use for reading the value. You can create a variable like:
| Code: |
local myvalue = readInteger(address)
|
Where address is the address that holds the value. Bare in mind that it's likely the address will change when you restart the game.
|
|