Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help Needed] Help with scanning and foundlists !

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
alexbull_uk
How do I cheat?
Reputation: 0

Joined: 07 Sep 2012
Posts: 1
Location: UK

PostPosted: Fri Sep 07, 2012 6:27 pm    Post subject: [Help Needed] Help with scanning and foundlists ! Reply with quote

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.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Sep 08, 2012 3:20 am    Post subject: Reply with quote

you can try to find pointer for that address, read whole thread http://forum.cheatengine.org/viewtopic.php?t=556747
_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites