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 


Using an aobscan with multiple results

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sun Feb 13, 2011 6:34 am    Post subject: Using an aobscan with multiple results Reply with quote

The Lua version of aobScan returns all the addresses with the specified bytes instead of only the first one like auto assembler does

If you know that the one you need is the second or third and not the first then this script might be useful (Of course, i still recommend just adding a few more bytes to your array of bytes string)

Code:

function _memrec_myCheat_activating(mr)
  results=AOBScan("29 83")
  if (results~=nil) then
    count=stringlist_getCount(results)
    if (count>1) then
      address=stringlist_getString(results,1) --counts from 0, so 0 = first, 1=second, etc...
      --seems I forgot to add a registersymbol command so use AA for this
      script=[[
        label(aobresult_myCheat) 
        registersymbol(aobresult_myCheat)
        ]]..address..[[:
        aobresult_myCheat:
        ]]   
      autoAssemble(script);
    end
    object_destroy(results)
    results=nil
  end
end


This registers an onActive event for a cheat table with the name "myCheat"
when myCheat gets activated this function gets executed which does the Lua version AOBscan , gets the second entry of the results and then registers that result as a symbol.
After that the cheat entry can then make use of it. (Auto assembler script that hooks a function for example)

I've attached an example cheat table that implements this. (For the tutorial that comes with ce)

_________________
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
View user's profile Send private message MSN Messenger
Recifense
I post too much
Reputation: 166

Joined: 17 Mar 2008
Posts: 3688
Location: Pernambuco - Brazil

PostPosted: Sun Feb 13, 2011 1:53 pm    Post subject: Reply with quote

Hi DB,

I use the LUA aobscan for adapting my scripts for new version of games and it is really useful.

I will see what I can do with this approach.

Congrats!

Cheers!
Back to top
View user's profile Send private message Send e-mail
Jeffrey_
Expert Cheater
Reputation: 1

Joined: 10 Jun 2011
Posts: 164

PostPosted: Tue Jun 14, 2011 1:00 pm    Post subject: Reply with quote

Hey i really dont get this but if someone helps me understand i will be able to make good hacks with it.
So someone plz make a tutorial and make it clear so i can undrestand. Confused
Back to top
View user's profile Send private message
oLaudix
Expert Cheater
Reputation: 3

Joined: 25 Mar 2010
Posts: 138

PostPosted: Mon Jun 18, 2012 7:08 pm    Post subject: Reply with quote

Any chance for You to reupload the example cheat table for this?
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 42

Joined: 09 Nov 2005
Posts: 2672

PostPosted: Tue Jul 01, 2014 8:56 pm    Post subject: Reply with quote

This is really interesting, however, the download is gone. Perhaps after the recent forum crash.

Is there a chance you could have the table still lying somewhere DB ?.

Dark Byte wrote:
The Lua version of aobScan returns all the addresses with the specified bytes instead of only the first one like auto assembler does

If you know that the one you need is the second or third and not the first then this script might be useful (Of course, i still recommend just adding a few more bytes to your array of bytes string)

Code:

function _memrec_myCheat_activating(mr)
results=AOBScan("29 83")
if (results~=nil)deviattedthen
count=stringlist_getCount(results)
if (count>1) then
address=stringlist_getString(results,1) --counts from 0, so 0 = first, 1=second, etc...
--seems I forgot to add a registersymbol command so use AA for this
script=[[
label(aobresult_myCheat)
registersymbol(aobresult_myCheat)
]]..address..[[:
aobresult_myCheat:
]]
autoAssemble(script);
end
object_destroy(results)
results=nil
end
end



This registers an onActive event for a cheat table with the name "myCheat"
when myCheat gets activated this function gets executed which does the Lua version AOBscan , gets the second entry of the results and then registers that result as a symbol.
After that the cheat entry can then make use of it. (Auto assembler script that hooks a function for example)

I've attached an example cheat table that implements this. (For the tutorial that comes with ce)


_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com


Last edited by STN on Mon Apr 18, 2016 9:38 am; edited 2 times in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Jul 01, 2014 9:23 pm    Post subject: Reply with quote

It's just a memoryrecord with name myCheat and a script like above

Anyhow, this is old code.
It's now recommended to get the record from the addresslist and assign the OnActivate property a function which gets called when the checkbox is checked

_________________
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
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 Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites