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 


aobscan a specific region of memory

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

Joined: 19 Mar 2021
Posts: 4

PostPosted: Tue Nov 23, 2021 6:43 am    Post subject: aobscan a specific region of memory Reply with quote

Currently I have a aobscan script that nops a health function. my problem is this takes around 30 seconds or longer to enable. would like to put a specific region in this scrip to hopefully cut down the time.


<AssemblerScript>[ENABLE]
aobscan(inj_health,0F 38 F1 44 19 2C 75 09 48 83 C4 28 E9 F3 0C 00 00)

label(health)
registersymbol(health)

inj_health:
health:
db 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

[DISABLE]

health:
db 0F 38 F1 44 19 2C 75 09 48 83 C4 28 E9 F3 0C 00 00
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Tue Nov 23, 2021 9:22 am    Post subject: Reply with quote

Firstly, this isn't Lua, it's auto assembler.

Secondly, use code tags when submitting code please [ code ] ... [ /code ] (without spaces).

Lastly, you should use aobscanregion
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Tue Nov 23, 2021 12:22 pm    Post subject: Reply with quote

If you know it's in a specific module, use the aobscanmodule AA function.

Otherwise, more advanced logic can be done in Lua. e.g. only scan through executable read-only regions instead of everything. See celua.txt for documentation.
Lua code can be run when the script is enabled/disabled with {$lua} blocks like so:
Code:
[ENABLE]
{$lua}
if syntaxcheck then return 'define(foo,0)' end

local result = assert(AOBScan('0F 38 F1 44...', '+X-C-W'))
local addr = getAddress(result[0])
result.destroy()
return ('define(foo,%08X)'):format(addr)
{$asm}
registersymbol(foo)
...

_________________
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
Csimbi
I post too much
Reputation: 92

Joined: 14 Jul 2007
Posts: 3102

PostPosted: Wed Nov 24, 2021 11:34 am    Post subject: Reply with quote

Look into mgr.inz.Player's aobscan Nth result extension here.
That starts searching where you tell it to.
Back to top
View user's profile Send private message
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