Posted: Thu Sep 14, 2023 11:32 am Post subject: Coding an Offset Dumper for Cheat Engine
I'm trying to code a simple offset dumper, where I just add an empty address to the table and set the description to the pattern. then I search for that pattern and change the address to the offset.
I did something within Lua already which looks like this:
-- Perform an AOB scan for the pattern
local result = AOBScan(aobPattern)
-- Get the Cheat Engine address list
local addressList = getAddressList()
-- Iterate through the results
for i = 0, result.Count - 1 do
local addressString = result[i]
-- Convert the address string to a numerical address
local address = tonumber(addressString, 16)
-- Create a new memory record and set its description
local memoryRecord = addressList.createMemoryRecord()
memoryRecord.Description = "Found Address"
-- Set the address for the memory record
memoryRecord.Address = addressString
print("Pattern found at address: " .. addressString)
end
-- Free the result list to avoid memory leaks
result.destroy()
However I'm stuck with getting the correct offset.
on the left is obviously the Address, and on the right is the opcode showing "rax,[7FF771F6C2F8]".
I basically need the offset from the opcode and I wonder if there is an easy universal way to get that since Cheat engine basically knows that Address / Offset already since its within the [].
So if I could do something like "Address.GetOffsetFromOP" which ofc doesn't exist yet, but if there is something like that would be cool.
I mean I can basically do that within the gui, pressing right click at the opcode and selecting "Opcodes only (no address)".
Oh also I wonder if it would be better to code it as Plugin instead?
Not sure if that is easier than using Lua, and if there is a Document about coding CE Plugins to get some references?
The register RIP holds the address of the next instruction to execute. While it's executing the instruction `mov rax,[7FF771F694B0]` at the address 0x7FF770087A55, RIP will be the address of the next instruction, 0x7FF770087A5C (the former instruction takes up 7 bytes).
RIP-relative addressing addresses a memory location using a signed 32-bit displacement from RIP. The bytes `54 1A EE 01` correspond to the integer 0x1EE1A54. Add that to RIP and you get the addressed memory location: 0x7FF770087A5C + 0x1EE1A54 = 0x7FF771F694B0
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum