 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kriogenic Cheater
Reputation: -1
Joined: 13 Jun 2012 Posts: 36 Location: localhost
|
Posted: Tue Sep 26, 2023 3:27 am Post subject: How to seperate this AOB into multiple codes? |
|
|
In the game I am currently writing some cheats for, its essentially the same AOB that handles multiple codes by comparing a register.
It is not elegant by any means and needs refactoring but that comes next. I believe AOB are unique and my question is how can I create these as individual toggles?
Is it possible to have 3 empty codes in my code list and detect which ones are active or something similar?
| Code: |
[ENABLE]
aobscanmodule(SomeFunc,Heretics Fork.exe,48 8B 07 48 89 03 48 8B 9C) // should be unique
alloc(newmem,$1000,SomeFunc)
label(code)
label(return)
label(cardcost)
label(infinitemoney)
label(infinitehealth)
newmem:
cmp r14,189AF //Card Cost
je cardcost
cmp r14,18B54 //Money count
je infinitemoney
cmp r14,18B92 //Health
je infinitehealth
jmp code
cardcost:
push #6 //(int)
fild [rsp]
fstp qword ptr [rdi]
add rsp,8
jmp code
infinitemoney:
push #10000 //(int)
fild [rsp]
fstp qword ptr [rdi]
add rsp,8
jmp code
infinitehealth:
push #500 //(int)
fild [rsp]
fstp qword ptr [rdi]
add rsp,8
jmp code
code:
mov rax,[rdi]
mov [rbx],rax
jmp return
SomeFunc:
jmp newmem
nop
return:
registersymbol(SomeFunc)
[DISABLE]
SomeFunc:
db 48 8B 07 48 89 03
unregistersymbol(SomeFunc)
dealloc(newmem)
|
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4711
|
Posted: Tue Sep 26, 2023 10:36 am Post subject: |
|
|
Have a parent script do the injection, and have child scripts set flags that enable / disable cheats.
| Code: | ...
newmem:
mov eax,[is_cheat_enabled]
test eax,eax
jz code
// cheat here
mov ecx,#999
code:
// original code
mov [rbx+4C],ecx
jmp return
is_cheat_enabled:
dd 0 // 0 = false, 1 = true
registersymbol(is_cheat_enabled)
... |
| Code: | [ENABLE]
is_cheat_enabled:
dd 1
[DISABLE]
is_cheat_enabled:
dd 0 |
You don't need to resort to x87 to move doubles.
| Code: | mov rax,(double)6
mov [rdi],rax |
Injecting some place further up the callstack might be better, but that's a little more advanced.
Instead of setting a certain value, you might be able to copy the addresses instead and use those in the table. (search "injection copy") _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Kriogenic Cheater
Reputation: -1
Joined: 13 Jun 2012 Posts: 36 Location: localhost
|
Posted: Tue Sep 26, 2023 3:56 pm Post subject: |
|
|
| Awesome, thanks for the information. Setting flags in child scripts is working well. |
|
| Back to top |
|
 |
|
|
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
|
|