Help with one hit kill

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
daninthemix
Expert Cheater
Expert Cheater
Posts: 245
Joined: Tue Jul 18, 2017 6:31 pm
Reputation: 79

Help with one hit kill

Post by daninthemix »

I have found the instruction that affects enemy health:

fstp dword ptr [esi+000001F8]

My problem is, if I change that line in any way, the game crashes. For instance:

mov [esi+000001F8],(float)0

or even

nop

I'm trying to make a one-hit kill. Does anyone have any ideas?

Thanks

User avatar
Marc
Table Makers
Table Makers
Posts: 378
Joined: Mon Mar 26, 2018 2:35 pm
Reputation: 377

Re: Help with one hit kill

Post by Marc »

fstp is somewhat evil, because it changes not only it's target address, but also the stack, take a look [Link].

In your case, I'd copy the fstp-instruction 1:1 in my own code, and just kill the target addresses value after that.

Most likely, this shoud do the trick:
fstp dword ptr [esi+000001F8]
mov[esi+000001F8],0


have fun,
Marc

daninthemix
Expert Cheater
Expert Cheater
Posts: 245
Joined: Tue Jul 18, 2017 6:31 pm
Reputation: 79

Re: Help with one hit kill

Post by daninthemix »

Thanks for the reply! I think my crashes were because of shared code and I already had an infinite health cheat on. I did some dissecting and so far this is working without a crash:

cmp [esi+00000000],00004811
je exit
mov [esi+000001F8],(float)-19.85407257
jmp exit


And then some enemies have armour as well - decreasing their armour is handled by another instruction. I did try and combine the two so its still a one hit kill, but oddly they end up with a small amount of health still:

cmp [esi+00000000],00004811
je exit
mov [esi+000001FC],(float)-19.85407257
mov [esi+000001F8],(float)-19.85407257
jmp exit


Have not yet noticed any issues by omitting the fstp, but I will bear in mind what you have said.

EDIT: well the answer seems to be: just drop tehir health bar when their armour gets hit. Don't worry about the armour value:

cmp [esi+00000000],00004811
je exit
mov [esi+000001F8],(float)-19.85407257
jmp exit

ShyTwig16
Expert Cheater
Expert Cheater
Posts: 335
Joined: Thu Apr 06, 2017 7:14 pm
Reputation: 19

Re: Help with one hit kill

Post by ShyTwig16 »

Just make sure you clean up the stack, else you can get undesired effects. But all you need in this case is fstp st(0).

User avatar
PeaceBeUponYou
Expert Cheater
Expert Cheater
Posts: 77
Joined: Sat Dec 12, 2020 8:09 am
Reputation: 124

Re: Help with one hit kill

Post by PeaceBeUponYou »

reset the x87 FPU TOS using either

Code: Select all

fstp st(0)
or this and then load 0 and write it to the dword

Code: Select all

ffree st(0)
fincstp
fldz
fstp dword ptr [esi+1F8]

daninthemix
Expert Cheater
Expert Cheater
Posts: 245
Joined: Tue Jul 18, 2017 6:31 pm
Reputation: 79

Re: Help with one hit kill

Post by daninthemix »

So this is what I've got right now:

Code: Select all

fstp st(0)
cmp [esi+00000000],00004811 //Main character
je exit
cmp [esi+00000000],00001811 //Eve
je exit
cmp [esi+00000000],00004B91 //Helicopter
je exit
mov [esi+000001F8],(float)-19.85407257
jmp exit
It's working pretty well - I need the one hit kill to exclude the main character, the girl you have to protect, and the helicopter you fly in. The one part where they're shooting at you in the helicopter and the girl went a bit weird - I modified the above code to protect the helicopter, but then the girl was dying. I couldn't figure it out so for that very small part I just disabled the cheat. So far everywhere else, its working.

User avatar
EpicBirdi
Fearless Donors
Fearless Donors
Posts: 64
Joined: Sat Jul 21, 2018 2:22 pm
Reputation: 58

Re: Help with one hit kill

Post by EpicBirdi »

If you're checking things in this manner, the helicopter check may be overriding Eve if they're both true, although I'm not certain how you would fix that myself. I ran into the same issue today with sharedcode for three resources in another game.. when one was infinite the others weren't anymore. My only guess would be to check a higher function and compare against what's writing to the normal register that writes into esi+1F8

Post Reply

Who is online

Users browsing this forum: No registered users