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 Not working in Trainer EXE but works in Cheat Engine

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

Joined: 07 Oct 2023
Posts: 4

PostPosted: Sat Oct 07, 2023 8:18 am    Post subject: aobScan Not working in Trainer EXE but works in Cheat Engine Reply with quote

Hello, so i have this specific piece of code :
Code:

autoAssemble([[
aobScan(adr1,80 80 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?0 00 00 00 00 00 00 00 ?? 00 00 00 00 00 00 0? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0? 00 ?? 0? F? 00 00 00 00 00 00 00 00 00 ?? ?? 00 00 00 00 00 00 ?0 00 ?? 0? ?? 0?,"")
registersymbol(adr1)
]]
)
addr11=getAddressSafe('adr1')
print(addr11)


When i ran it inside the Cheat Engine, it worked perfectly and printed the specific address, but when i tried it in the EXE Trainer and .CETrainer, it returns nil instead.

I have tried 32-bit,64-bit, and renaming the exe file and it still cant work, anyone can help? thanks
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Sat Oct 07, 2023 10:08 am    Post subject: Reply with quote

Your parameters for aobscan are wrong. In Auto Assembler the function is defined as:
Code:

aobScan(SymbolName, AOBString)


So this should be:
Code:

autoAssemble([[
aobScan(adr1,80 80 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?0 00 00 00 00 00 00 00 ?? 00 00 00 00 00 00 0? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0? 00 ?? 0? F? 00 00 00 00 00 00 00 00 00 ?? ?? 00 00 00 00 00 00 ?0 00 ?? 0? ?? 0?)
registersymbol(adr1)
]]
)
addr11=getAddressSafe('adr1')
print(addr11)


EDIT: Corrected my mistake as pointed out by parkourpenguin (Thank you).


Last edited by LeFiXER on Sat Oct 07, 2023 12:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
kazuryo
How do I cheat?
Reputation: 0

Joined: 07 Oct 2023
Posts: 4

PostPosted: Sat Oct 07, 2023 10:16 am    Post subject: Reply with quote

LeFiXER wrote:
Your parameters for aobscan are wrong. In Auto Assembler the function is defined as:
Code:

aobScan(SymbolName, AOBString)


So this should be:
Code:

autoAssemble([[
aobScan(adr1,"80 80 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?0 00 00 00 00 00 00 00 ?? 00 00 00 00 00 00 0? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0? 00 ?? 0? F? 00 00 00 00 00 00 00 00 00 ?? ?? 00 00 00 00 00 00 ?0 00 ?? 0? ?? 0?")
registersymbol(adr1)
]]
)
addr11=getAddressSafe('adr1')
print(addr11)


Doesnt work, unfotunately
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4715

PostPosted: Sat Oct 07, 2023 10:21 am    Post subject: Reply with quote

The string passed to the call to autoAssemble is an AA script. You don't need quotes around the bytes in an AA script. See the aobscan template in an AA window.

There's too many things that could be wrong here. Maybe you're not attaching to the process- e.g. the trainer is named the same as the game. Maybe the pattern is bad. Maybe that autoAssemble isn't being run for whatever reason.

Regardless, you should be doing error handling with any call to autoAssemble. Or just do it in Lua w/ `AOBScan` and `registerSymbol` functions.

_________________
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
kazuryo
How do I cheat?
Reputation: 0

Joined: 07 Oct 2023
Posts: 4

PostPosted: Sat Oct 07, 2023 10:25 am    Post subject: Reply with quote

ParkourPenguin wrote:
The string passed to the call to autoAssemble is an AA script. You don't need quotes around the bytes in an AA script. See the aobscan template in an AA window.

There's too many things that could be wrong here. Maybe you're not attaching to the process- e.g. the trainer is named the same as the game. Maybe the pattern is bad. Maybe that autoAssemble isn't being run for whatever reason.

Regardless, you should be doing error handling with any call to autoAssemble. Or just do it in Lua w/ `AOBScan` and `registerSymbol` functions.


I am doing this inside the LUA engine inside CE, my original code worked inside CE but then when i make a trainer EXE from it, the code suddenly returned nil.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Oct 07, 2023 11:28 am    Post subject: Reply with quote

Are you sure that code runs after the process has been properly attached to, and not before


and is it attached to the correct process? e.g there might be another process with the same name

_________________
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
kazuryo
How do I cheat?
Reputation: 0

Joined: 07 Oct 2023
Posts: 4

PostPosted: Sat Oct 07, 2023 3:00 pm    Post subject: Reply with quote

Dark Byte wrote:
Are you sure that code runs after the process has been properly attached to, and not before


and is it attached to the correct process? e.g there might be another process with the same name


I tried printing the processID and prints the correct one, everything else works correctly except for the aobScan
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