Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Why Does This Code Give One Hit Kills, And Mine Doesn't?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
GreatUnknown
Cheater
Reputation: 0

Joined: 19 Oct 2014
Posts: 47

PostPosted: Sun Jul 30, 2017 3:46 pm    Post subject: Why Does This Code Give One Hit Kills, And Mine Doesn't? Reply with quote

Does anyone else know why Sneaky Mofos DOOM Inf Health Script give one hit kills? The globalalloc bit I get (kinda don't know why when they are using same instruction but hey) but when I use 0 to make a one hit kill the enemies just go into the mode where you can hit them with f and they die. Where as with this code they just die when shot....

Code:
https://pastebin.com/sGakyjfH


And my code:
Code:
https://pastebin.com/WwpyaqzF


Sneaky Mofos video:
https://www.youtube.com/watch?v=hL2sjkt1vE8
Back to top
View user's profile Send private message
Prehistoricman
Advanced Cheater
Reputation: 0

Joined: 02 Aug 2016
Posts: 53

PostPosted: Sun Jul 30, 2017 5:02 pm    Post subject: Reply with quote

Look at your injected code in the disassembler and see if it matches what you've written. Often you can't fit such much into a single instruction. I reckon that Sneaky has written the asm the way he has due to limitations such as this.
_________________
Er, hi
Back to top
View user's profile Send private message
GreatUnknown
Cheater
Reputation: 0

Joined: 19 Oct 2014
Posts: 47

PostPosted: Mon Jul 31, 2017 12:29 am    Post subject: Reply with quote

Prehistoricman wrote:
Look at your injected code in the disassembler and see if it matches what you've written. Often you can't fit such much into a single instruction. I reckon that Sneaky has written the asm the way he has due to limitations such as this.

I made sure mine was the same was he put into the AA, and tried them both out and his does give one hit kills + inf health which is confusing. I can't see his code injected but I think because he didn't shoot an enemy he made a one hit kill without noticing it and noticed later and renamed the video. But to you does his script make a one hit kill cause it doesn't to me?

EDIT:
Code:
code:
  code:
  movss [rbx+1C],xmm0
    push rax
  lea rax,[rsi+rbx+1C]
  mov [enemyHealthAddress],rax
  pop rax
  jmp return


Mine is:
Code:
code:
  movss [rsi+rbx+1C],xmm0
  push rax
  lea rax,[rsi+rbx+1C]
  mov [playerHealthAddress],rax
  pop rax
  jmp return


The movss rbx+1C makes it a one hit kill, I'd like to know why so I can make it a flag to turn on and off
RSI contains 0 oddly enough... still it's not enough for me to know what causes this but I want to know the reason why :S
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 137

Joined: 25 Jan 2006
Posts: 7291
Location: 127.0.0.1

PostPosted: Mon Jul 31, 2017 12:51 pm    Post subject: Reply with quote

Difference is:
Code:
movss [rbx+1C],xmm0

and
Code:
movss [rsi+rbx+1C],xmm0


While rsi does contain 0 for the current debugging point you see, it may be a function reused by multiple things which is causing rsi to not be 0 all the time. If that's the case then it will be writing to different spots than just the intended one each time. If it is a health function, it's a high chance that every entity in the game uses the same function.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
GreatUnknown
Cheater
Reputation: 0

Joined: 19 Oct 2014
Posts: 47

PostPosted: Mon Jul 31, 2017 7:02 pm    Post subject: Reply with quote

atom0s wrote:
Difference is:
Code:
movss [rbx+1C],xmm0

and
Code:
movss [rsi+rbx+1C],xmm0


While rsi does contain 0 for the current debugging point you see, it may be a function reused by multiple things which is causing rsi to not be 0 all the time. If that's the case then it will be writing to different spots than just the intended one each time. If it is a health function, it's a high chance that every entity in the game uses the same function.

Thanks I noticed that just after posting this but internet went down, I've mde a one hit kill toggle for it, removing the rsi so the one hit kill causes one hit kills.
Otherwise enemies don't die one one shot but only two, one puts them in a sort of fatality mode the second shot kills them. I've tried using negative numbers and looking what numbers the enemies addresses are when they die but that's just zero. So I don't know how to make it a one hit kill without making it unstable. It does turn on the PF flag.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites