Conversion of damage modifier script to conditional MIN health
Posted: Mon May 22, 2017 4:32 pm
Hi, all.
Really new to CE scripting but have had my fair share of using AOB tables. Recently got Doom 2016 on sale and found a video on YouTube for generating an infinite health script for the player (I think it went with the title "Let's Hack Doom" or something by a Stephen something guy).
Anyway, I'm hijacking his code and discovered that I don't really like the feel of the Infinite Health and decided to go Buddha mode instead. However, I'm finding my code to be a bit inelegant.
Eh, found this not immersive as well. Originally set the CMP line to lower health but if damage (which I believe is in xmm0) is greater than health, it floors me anyway. I've tried setting xmm0 to 0 but it acts as some sort of one-hit kill so I'm guessing it stores the health you will get after the damage rather than the damage itself. Tried reading up on the other threads but seems like the behavior changes from game to game.
TLDR: Is there a way to just set the min health to 1 --OR-- check ahead of time if damage is going to cause me to get negative health and ignore it if so?
Thanks!
Really new to CE scripting but have had my fair share of using AOB tables. Recently got Doom 2016 on sale and found a video on YouTube for generating an infinite health script for the player (I think it went with the title "Let's Hack Doom" or something by a Stephen something guy).
Anyway, I'm hijacking his code and discovered that I don't really like the feel of the Infinite Health and decided to go Buddha mode instead. However, I'm finding my code to be a bit inelegant.
Code: Select all
[ENABLE]
aobscanmodule(aobBuddha,DOOMx64.exe,00 F3 0F 10 74 24 40 F3 0F 11 44 1E 1C) // should be unique
alloc(newmem,$1000,"DOOMx64.exe"+3A9260)
label(code)
label(playerCheck)
label(healthCheck)
label(return)
newmem:
playerCheck:
push rax
mov rax,[rsi+rbx+30]
cmp rax,(float)12 // Check type...
pop rax
je healthCheck // If player, check health.
jne code // Else, jump to usual code.
jmp return
healthCheck:
cmp [rsi+rbx+1C],(float)50 // Check health value.
jge code // Get damaged if >=50 HP.
jmp return // Else, ignore.
code:
movss [rsi+rbx+1C],xmm0
jmp return
aobBuddha+07:
jmp playerCheck
nop
return:
registersymbol(aobBuddha)
[DISABLE]
aobBuddha+07:
db F3 0F 11 44 1E 1C
unregistersymbol(aobBuddha)
dealloc(newmem)
TLDR: Is there a way to just set the min health to 1 --OR-- check ahead of time if damage is going to cause me to get negative health and ignore it if so?
Thanks!