View previous topic :: View next topic |
Author |
Message |
LewcowVaal Advanced Cheater Reputation: 0
Joined: 30 Dec 2017 Posts: 63
|
Posted: Sat Apr 06, 2024 4:57 am Post subject: Conditional AOBScan on a single Script |
|
|
I have a classic Script made with the AOB Injection template of CE (that, of course, registers a SymbolName at the found address).
What i would like to do is to check if the SymbolName already exists. If not, run the aobscan, otherwise, use the already existing Symbol for the ASM code, all in a single Script.
What's the best way of doing it? Is it possible to do it with ASM only or is it better to use LUA in this case?
I was thinking about doing something like this:
Code: |
[ENABLE]
{$LUA}
if not getAddressSafe'mynewaob' then
local resultaddr = AOBScan('48 63 52 34 89 95 80 FD FF FF')
registerSymbol('mynewaob', resultaddr)
end
{$ASM}
// aobscan(mynewaob,48 63 52 34 89 95 80 FD FF FF) // this is commented out
alloc(newmem,$1000,mynewaob)
label(code)
label(return)
newmem:
code:
// code here
jmp return
mynewaob:
jmp newmem
nop 5
return:
// registersymbol(mynewaob) //commented
[DISABLE]
mynewaob:
db 48 63 52 34 89 95 80 FD FF FF
//unregistersymbol(mynewaob) i don't want to unregister it since i'm gonna reuse it later.
dealloc(newmem) |
Beside the fact that Cheat Engine tells me that the code is not Injectable (the AutoAssembler does not understand what mynewaob is since i defined it in LUA and not in the ASM part), i think i am misunderstanding code execution order (between LUA and ASM).
What's the best practice? Is it possible to do it in ASM only?
Thanks!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 459
Joined: 09 May 2003 Posts: 25317 Location: The netherlands
|
Posted: Sat Apr 06, 2024 6:49 am Post subject: |
|
|
Code: |
{$lua}
if not getAddressSafe("symbol") then
return [[aobscan(symbol, xx xx xx)
registersymbol(symbol)
]]
end
{$asm}
|
_________________
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 |
|
|
LewcowVaal Advanced Cheater Reputation: 0
Joined: 30 Dec 2017 Posts: 63
|
Posted: Sat Apr 06, 2024 7:00 am Post subject: |
|
|
Dark Byte wrote: | Code: |
{$lua}
if not getAddressSafe("symbol") then
return [[aobscan(symbol, xx xx xx)
registersymbol(symbol)
]]
end
{$asm}
|
|
Works perfectly.
Am i returning ASM? Also, is it possible to define custom templates in the Auto Assemble?
Thanks!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 459
Joined: 09 May 2003 Posts: 25317 Location: The netherlands
|
|
Back to top |
|
|
LewcowVaal Advanced Cheater Reputation: 0
Joined: 30 Dec 2017 Posts: 63
|
Posted: Sat Apr 06, 2024 11:15 am Post subject: |
|
|
That's perfect. Thank you
Is the default AOB Injection template written in LUA? So i can look at it and make my own modifications
EDIT: I found what i was looking for, boss
|
|
Back to top |
|
|
|