alexbull_uk How do I cheat? Reputation: 0
Joined: 07 Sep 2012 Posts: 1 Location: UK
|
Posted: Fri Sep 07, 2012 6:27 pm Post subject: [Help Needed] Help with scanning and foundlists ! |
|
|
Hi there! I'm creating a trainer for the prototype version of Crash Bandicoot that will force-load levels when you type in their ID. But I'm having problems!
The address changes each time you run the emulator - so it must be found first. I'm doing this by first searching for the value '4294967295', and then (when you load the map in the emulator) quickly searching for '25' - which will yield one address; the one that I want.
Now, this works fine if I do it in CE, but I can't make it work with my LUA script. Here's the code I've written so far:
Code: |
function attachToPSX()
pid = getProcessIDFromProcessName("psxfin.exe")
if(pid~=nil) then
openProcess(pid)
showMessage("Attached to pSX successfully!")
else
showMessage("pSX is not running.")
return
end
end
ms = createMemScan(true)
found = createFoundList(ms)
function doFirstScan()
memscan_firstScan(ms, soExactValue, vtDword, rtRounded, "4294967295", nil, 0, 0xffffffffffffffff, "+W-C", fsmAligned, "4", false, false, false, false)
memscan_waitTillDone(ms)
foundlist_initialize(found)
showMessage("Scan done!")
end
function doNextScan()
memscan_nextScan(ms, soExactValue, rtRounded, "25", nil, false, false, false, false, false, "RESULT")
memscan_waitTillDone(ms)
foundlist_initialize(found)
addr = foundlist_getAddress(found, 0)
showMessage(addr)
end
|
(I have two buttons on the form. One that calls 'doFirstScan' and another that calls 'doNextScan'. Attaching to the process is called when the window is shown.)
My problem is that I don't get the correct address from this code. At the end when I call 'showMessage' it shows a (random?) number that isn't the actual address. Can anyone tell me why?
_________________
I started out with nothing, and I still have most of it left. |
|