|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Hadaar How do I cheat? Reputation: 0
Joined: 08 May 2020 Posts: 5 Location: Anywhere
|
Posted: Mon Aug 02, 2021 10:52 am Post subject: [Help] Compare 2 addresses |
|
|
Hey guys
I want to make an One Hit Kill script for a game, and i want to use my health address to differentiate myself from the others
But when i try to compare My Health Address with Target Health Address, game crash.
This is my script:
Code: | [ENABLE]
aobscanmodule(OHK,GameAssembly.dll,C4 08 89 48 18 5D C3) // should be unique
alloc(newmem,$1000)
label(origin)
label(return)
label(_ohk)
label(_p_Heal)
label(target)
newmem:
// Get my Health Address
push edx
lea edx,[[_pHealth]+18] // "_pHealth" its Player Base Address and 0x18 its the Health offset
mov [_p_Heal],edx
pop edx
// Get others Health Address
push edx
mov edx,eax
lea edx,[edx+18] // "edx+18" its others health address
mov [target],edx
pop edx
cmp target,_p_Heal // Here its the problem, when i compare these 2, game crashes
jne _ohk
mov [eax+18],ecx
pop ebp
ret
jmp return
_ohk:
mov [eax+18],00
pop ebp
ret
jmp return
origin:
mov [eax+18],ecx
pop ebp
ret
jmp return
_p_Heal:
dq 0
target:
dq 0
OHK+02:
jmp newmem
return:
registersymbol(OHK _p_Heal target)
[DISABLE]
OHK+02:
db 89 48 18 5D C3
unregistersymbol(OHK _p_Heal target)
dealloc(newmem) |
If someone can help me, I would appreciate
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Mon Aug 02, 2021 4:27 pm Post subject: |
|
|
I'm thinking this should work.
Code: | [ENABLE]
aobscanmodule(OHK,GameAssembly.dll,C4 08 89 48 18 5D C3) // should be unique
alloc(newmem,$1000)
// label(origin)
label(return)
label(_ohk)
label(target)
newmem:
cmp [_pHealth],eax
jne _ohk
mov [eax+18],ecx
pop ebp
ret
jmp return
_ohk:
mov [eax+18],00
pop ebp
ret
jmp return
// origin:
// mov [eax+18],ecx
// pop ebp
// ret
// jmp return
OHK+02:
jmp newmem
return:
registersymbol(OHK)
[DISABLE]
OHK+02:
db 89 48 18 5D C3
unregistersymbol(OHK)
dealloc(newmem) |
_________________
|
|
Back to top |
|
|
Hadaar How do I cheat? Reputation: 0
Joined: 08 May 2020 Posts: 5 Location: Anywhere
|
Posted: Tue Aug 03, 2021 8:25 am Post subject: |
|
|
Thanks for your answer, but that solution its not working.
It's like the script jumps every time, without compare.
I tried this script.
With this he "je" every time, even if My Base Addres and Other Base Address are different.
Code: | [ENABLE]
aobscanmodule(OHK,GameAssembly.dll,C4 08 89 48 18 5D C3) // should be unique
alloc(newmem,$1000)
// label(origin)
label(return)
label(_ohk)
label(cmpFlag)
label(target2)
label(test1)
newmem:
// Get others Base address
push edx
mov edx,eax
mov [target2],edx
pop edx
cmp [_pHealth],eax
je test1 // He jump always, even if those 2 addresses are different
mov [cmpFlag],00
mov [eax+18],00
pop ebp
ret
jmp return
test1:
mov [cmpFlag],01 // This flag its always 1, so that script jump every time.
jmp _ohk
_ohk:
mov [eax+18],ecx
pop ebp
ret
jmp return
cmpFlag:
db 0
target2:
db 0
// origin:
// mov [eax+18],ecx
// pop ebp
// ret
// jmp return
OHK+02:
jmp newmem
return:
registersymbol(OHK cmpFlag target2)
[DISABLE]
OHK+02:
db 89 48 18 5D C3
unregistersymbol(OHK target target2)
dealloc(newmem) |
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Tue Aug 03, 2021 3:57 pm Post subject: |
|
|
At this point you should set a breakpoint and step though the code to see what's going on.
_________________
|
|
Back to top |
|
|
Birdi Expert Cheater Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Wed Aug 04, 2021 2:42 am Post subject: |
|
|
As above, you can just step through the function with a breakpoint to find out why the cmp is valid or not, in both cases.
If you'd like more specific help you could namedrop the game and see if we can help directly.
|
|
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
|
|