Looking for help with OHK (One Hit Kill)

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
moonity
Noobzor
Noobzor
Posts: 8
Joined: Sun Jul 08, 2018 11:20 am
Reputation: 1

Looking for help with OHK (One Hit Kill)

Post by moonity »

A few days ago I've stumbled upon an old game called "Hard to be a God" I thought it would be a good idea to try to make my first one hit kill script. So, I've followed GH's guide on OHK and tried making the script. I ended up making a slightly different one since the instructions aren't the same. In my scenario, highlighted instruction on pic. below(in disassembler) accesses player's and enemies' HP (though enemies HP value is multiplied by 2 for whatever reason, lol). I've compared a bunch of structures multiple times on different enemies/saves to find out the right offsets and came up with those shown in table comments on my pic. below
However, these 2 scripts are having an unexpected behavior. The one on the left makes enemies one-hit-killable, but whenever you're loading a game or going through map change with the script enabled, you're also dying instantly. Script on the right instantly kills all the enemies nearby and also sets my max (and current) hp and stamina to 1. I couldn't really figure out how can I fix this and damage multiplier would be a good workaround for this, but I wasn't really able to find an instruction that has anything to do with damage output. Any Ideas? I'm totally stumped
Image

GreenHouse
Expert Cheater
Expert Cheater
Posts: 855
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 891

Re: Looking for help with OHK (One Hit Kill)

Post by GreenHouse »

I'm not sure I fully understand what you're doing there, but in terms of the enemies dying when loading a map is that it might not be a function that does Damage to an entity, but one that sets health to an entity. So when a map is loaded, and an Entity is created, it will set their health to the proper value, and you're setting it to 0, so they die. And then the check that you're using to differentiate between Player and Enemy is something else and not what you think it is. And that value is the same for the Player and Enemies when loading until it's set at any point.

Also, on your left script, why are you comparing the current health with eax? And on the right one, there's a random compare that does nothing with the result.

You should explain a bit more of what you're doing there. Other than that, you might want to compare use the "Break&Trace" option or check what accesses that ret and go to that address, to see which function calls that function and try to find the one that is actually the "Do Damage" one.

Can't say much else without checking it myself or extra information, but I hope that's enough.

moonity
Noobzor
Noobzor
Posts: 8
Joined: Sun Jul 08, 2018 11:20 am
Reputation: 1

Re: Looking for help with OHK (One Hit Kill)

Post by moonity »

GreenHouse wrote:
Sat Jul 23, 2022 9:55 pm
You should explain a bit more of what you're doing there. Other than that, you might want to compare use the "Break&Trace" option or check what accesses that ret and go to that address, to see which function calls that function and try to find the one that is actually the "Do Damage" one.
Hey, thank you for the response! I was trying to compare and came up with this. For some reason, this particular health function is called every other tick and not when you actually deal damage to the enemies. I tried break&tracing both mov & ret, but it immediately traces instructions once I unpause the game and not when I actually deal or take damage so It makes me wonder if this game actually has a real "do damage" instruction. I might as well try just going up the stack manually but that's gonna be hell of a headache. Any way, I'll take a further look and see what I can do. Thank you! :roll:

Post Reply

Who is online

Users browsing this forum: No registered users