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?