![Cheat Engine Forum Index](templates/subSilver/images/logo_phpBB.gif) |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
StepbyStep How do I cheat?
Reputation: 0
Joined: 26 May 2024 Posts: 2
|
Posted: Sun Jun 30, 2024 3:44 am Post subject: Script that checks every memory address accessed by function |
|
|
I want to make a script where I pick a function call and get every memory addressed that's being either written or read from until the function returns. Honestly I feel like this should've been a feature with break and trace but I just don't know how to do it, it would really save a lot of headache. Thanks in advance |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Dark Byte Site Admin
Reputation: 462
Joined: 09 May 2003 Posts: 25452 Location: The netherlands
|
Posted: Sun Jun 30, 2024 7:43 am Post subject: |
|
|
Normally such a list will be so huge it's not useful
but you could use this lua script:
Code: |
function cleanList()
list={}
end
function parse(address)
if list[address]==nil then
list[address]=1
else
list[address]=list[address]+1
end
return false --make search continue
end
function printlist()
local r={}
for k,v in pairs(list) do
local e={}
e.address=k
e.count=v
table.insert(r,e)
end
table.sort(r,function(a,b) return a.address<b.address end)
for i=1,#r do
printf("%x = %d",r[i].address, r[i].count)
end
end
cleanList()
|
then search the break and trace at the start for
Code: |
parse(referencedAddress)
|
and then when done execute lua command printlist()
when doing it again, execute cleanList() first _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
luigimud Newbie cheater
Reputation: 0
Joined: 04 Jul 2024 Posts: 10
|
Posted: Fri Jul 05, 2024 1:55 pm Post subject: |
|
|
Thank you for the script! It works well for tracking memory addresses.
I noticed that the list can still become quite large and I find myself unable to manage. To make the output perhaps useful, I added a filter to only include addresses that are accessed more than a certain number of times.
I hope this helps if you are a newbie like me
function cleanList()
list = {}
end
function parse(address)
if list[address] == nil then
list[address] = 1
else
list[address] = list[address] + 1
end
return false -- make search continue
end
function printlist(minCount)
local r = {}
for k, v in pairs(list) do
if v > minCount then
local e = {}
e.address = k
e.count = v
table.insert(r, e)
end
end
table.sort(r, function(a, b) return a.address < b.address end)
for i = 1, #r do
printf("%x = %d", r[i].address, r[i].count)
end
end
cleanList()
what I am struggling with is when not dealing with smaller functions. e.g. a fairly complex function that accesses a large number of memory addresses, and then list gets quite overwhelming.
Any recommendation on how to manage this, is quite appreciated.
I am thinking of a few modifications to filter out addresses that are accessed less frequently (a specified number of times).
Please let me know if my thinking is on the right track |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Csimbi I post too much
Reputation: 96
Joined: 14 Jul 2007 Posts: 3179
|
Posted: Mon Jul 08, 2024 5:27 am Post subject: |
|
|
To me, it'd more interesting to track variables through a function.
For example, I could say, here, the value is in edx before the call.
Tell me what happened with the value in edx.
(added, subtracted, XORed, converted, put into the stack, used as a multiplier, etc.)
Sort of an AI buddy that can follow something for you. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|
|