I've found the value/location. That's easy. The same routine is used to futz with both the player and the enemies health. So the obvious thing is to find a value to compare against. I've done that as well, but it still doesn't work.
In the above image, [rdi+30] holds the current players health, [RDI+28] holds the maximum health (which the game moves into different xmm registers I've noticed). Also of note is that [rdi+30] is always the same, '1' for the enemies and '0.349999994' for the player. So I thought I would write the following code to differentiate between the player and the enemy:
Code: Select all
label(code) label(return) label(player) newmem: push rax mov rax, [rdi+30] cmp rax,(float)1 pop rax jl player code: movss [rdi+34],xmm15 jmp return player: mov [rdi+14],(float)100 movss xmm15,[rdi+14] jmp code