Posted: Tue Dec 27, 2022 6:33 pm Post subject: Editing Break and Trace's TreeNode.Data
I am currently working on an extension to save snapshots of a memory region in Break and Trace instructions and I've run into a bit of a wall.
I wanted to read & modify the data the tracer writes and to my understanding, each TreeNode has a pointer to such data (TfrmTracer.lvTracer.Items[i].Data). However this pointer is to memory belonging to Cheat Engine, not the target process, and thus the read functions return nothing.
Here's an example to show what I'm talking about
Code:
-- Be sure you have a Tracer with items in it before running
function test()
for i = 0, getFormCount() - 1 do
local frm = getForm(i)
if frm.ClassName == "TfrmTracer" then
local treeView = frm.lvTracer
local dataPtr = treeView.Items[1].Data
print("dataPtr: " .. tostring(dataPtr or "nil"))
print("firstByte: " .. tostring(readBytes(dataPtr, 1) or "nil"))
-- dataPtr: 346845872
-- firstByte: nil
end
end
end
test()
Is there any way to access Cheat Engine's memory from another target process?
Is there any way to access Cheat Engine's memory from another target process?
I don't know why you're asking that. You seem to want to access CE's memory from inside of CE itself. Maybe the misunderstanding is that Lua is run inside of CE and not the target process.
There's local read functions. celua.txt:
Quote:
readBytesLocal(address,bytecount, ReturnAsTable) : See readBytes but then it's for Cheat engine's memory
readSmallIntegerLocal(address) : Reads a 16-bit integer from the specified address in CE's memory
readIntegerLocal(address) : Reads a 32-bit integer from the specified address in CE's memory
readQwordLocal(address) : Reads a 64-bit integer from the specified address in CE's memory
readPointerLocal(address) : ReadQwordLocal/ReadIntegerLocal depending on the cheat engine build
readFloatLocal(address) : Reads a single precision floating point value from the specified address in CE's memory
readDoubleLocal(address) : Reads a double precision floating point value from the specified address in CE's memory
readStringLocal(address, maxlength, widechar OPTIONAL)
You'd need to dig through CE's source to figure out what that Data field actually means. Also this could arbitrarily change on any update to CE. _________________
I don't know where I'm going, but I'll figure it out when I get there.
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