if you not familiar with Pointer Scanning please read this post
i have while using cheat-engine to find static address in game or any programme using a Pointer Scanning method now i start thinking of make in my own trainer so after some search i find this: pseudocode
list<int> pointerScan(target, maxAdd, maxDepth) {
for address = BASE, 0x7FFFFFF, 4 {
ret = rScan(address, target, maxAdd, maxDepth, 1)
if (ret.len > 0) {
ret.pushFront(address)
return ret
}
}
return {}
}
list<int> rScan(address, target, maxAdd, maxDepth, curDepth)
{
for offset = 0, maxAdd, 4
{
value = read(address + offset)
if (value == target)
return list<int>(offset)
}
if (curDepth < maxDepth)
{
curDepth++
for offset = 0, maxAdd, 4
{
ret = rScan(address + offset, target, maxAdd, maxDepth, curDepth)
if (ret.len > 0)
{
ret.pushFront(offset)
{
return ret
}
}
}
return {}
}
}
target is the dynamic memory address to find
maxAdd is the maximum value of any offset
maxDepth is the maximum length of the pointer path
pointerScan()
The pointerScan()
function is the entry point to the scan. It takes the parameters target (the dynamic memory address to find), maxAdd (the maximum
value of any offset), and maxDepth (the maximum length of the pointer path).
It then loops through every 4-byte aligned address in the game, calling
rScan()
with the parameters address (the address in the current iteration),
target, maxAdd, maxDepth, and curDepth (the depth of the path, which is always 1
in this case).
rScan()
The rScan()
function reads memory from every 4-byte aligned offset between
0 and maxAdd , and returns if a result is equal to target . If rScan()
doesn’t
return in the frst loop and the recursion is not too deep , it increments
curDepth and again loops over each offset , calling itself for each iteration.
my problem with this pseudocode is i could not understand why address + offset
in
ret = rScan(address + offset, target, maxAdd, maxDepth, curDepth)
i think has no effect some tell me that increasing the depth but i could not see the point from increasing address because the first function (pointerScan) loop over all address that align in 4 byte