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 


AOB scan pause and resume ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 90

PostPosted: Mon Jun 06, 2022 8:53 pm    Post subject: AOB scan pause and resume ? Reply with quote

Code:
[ENABLE]
{$lua}
if syntaxcheck then return end
function aob_register(sym, pat)
  instr = AOBScan(pat, "+r+w")
  addy = instr[0]
  instr.destroy()
  addy = tonumber(addy, 16)
  unregisterSymbol(sym)
  registerSymbol(sym, addy)
end
pause()
aob_register("name?","00 10 02 33")
unpause()

{$asm}

[DISABLE]

unregistersymbol(name?)


When I run this it pauses, but doesn't unpause after the scan turns up with nothing. It will unpause if it does find a value though.

What do I need to do?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Jun 06, 2022 9:16 pm    Post subject: Reply with quote

Check if it returns nothing. AOBScan returns nil on no results found
Other tweaks:
  • Use local variables
  • Use AOBScanUnique if you assume the pattern is unique (this returns an integer, not a stringlist)
  • "+r" isn't a protection specifier
Code:
...
function aob_register(sym, pat)
  local addy = AOBScanUnique(pat, "+w")
  if not addy then return end
  unregisterSymbol(sym)
  registerSymbol(sym, addy)
end
...

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 90

PostPosted: Mon Jun 06, 2022 9:26 pm    Post subject: Reply with quote

That worked but, the scan is 10x slower.. Anyway to speed this up?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Jun 06, 2022 9:51 pm    Post subject: Reply with quote

Specify better alignment, or scan for something non-writable (e.g. injection copy).
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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