View previous topic :: View next topic |
Author |
Message |
j.c How do I cheat? Reputation: 0
Joined: 27 Aug 2022 Posts: 7
|
Posted: Sat Apr 22, 2023 5:49 pm Post subject: Why does the game crash when the enemy takes damage? |
|
|
I have found the health value for the player and the enemy uses the same code to deduct damage. I am trying to make damage multipliers so I take less damage and the enemy takes double damage. I have done a few different commonality scans and tried different values/offsets but the result is the same. The player takes reduced damage as expected everything works fine. However when the enemy takes damage the game crashes. Here is my code
Code: |
aobscanmodule(plahealth,ZingangGame-Win64-Shipping.exe,F3 0F 5C D1 F3 0F 5F D0) // should be unique
alloc(newmem,$1000,plahealth)
alloc(pmult,4,plahealth)
alloc(emult,4,plahealth)
label(code)
label(return)
pmult:
dd (float)0.25
emult:
dd (float)2
newmem:
code:
cmp [r15+2c0],1 // 1 is enemy this is the line where the game crashes only when the enemy takes damage
je enemy
mulss xmm1,[pmult]
subss xmm2,xmm1
maxss xmm2,xmm0
jmp return
enemy:
mulss xmm1,[emult]
subss xmm2,xmm1
maxss xmm2,xmm0
jmp return
plahealth:
jmp newmem
nop 3
return:
registersymbol(plahealth)
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
plahealth:
db F3 0F 5C D1 F3 0F 5F D0
unregistersymbol(*)
dealloc(*)
|
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Sat Apr 22, 2023 8:24 pm Post subject: |
|
|
If that line crashes the game, it's the distinction you found that's wrong. Find something better to distinguish enemies from yourself.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sun Apr 23, 2023 1:41 am Post subject: |
|
|
what ParkourPenguin or use {$try}/{$except}
if it's the enemy the code at except will execute lol
_________________
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 |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Apr 23, 2023 2:45 am Post subject: |
|
|
Change your code as follows:
Code: | //cmp [r15+2c0],1
jmp enemy |
If the game does not crash, then see the previous comments and fix your compare. If the game does crash, then you may need to reduce your multiplier.
|
|
Back to top |
|
|
j.c How do I cheat? Reputation: 0
Joined: 27 Aug 2022 Posts: 7
|
Posted: Sun Apr 23, 2023 5:24 am Post subject: |
|
|
Turns out I might have been using the results of the scanner, I am now using which now the game doesnt crash but now regardless of if it was the player or not it jumps to where I want the player to go every time. I will keep trying a few more and report back on what I find.
EDIT
In my post I should have been using the without the brackets, the game no longer crashes but it resulted in both the player and the enemy taking the same path.
I cant double post here is my solution, I just had to keep digging more:
|
|
Back to top |
|
|
|