update enemy HP bars patch

This commit is contained in:
Martin Michelsen
2024-06-28 19:24:39 -07:00
parent 2ff9df19c8
commit c250a2dbc4
18 changed files with 665 additions and 106 deletions
@@ -0,0 +1,30 @@
ret
# Call table: 2 functions (on_window_created, on_hp_updated)
jmp on_window_created
on_hp_updated:
call rewrite_string
movsx ecx, word [ebp + 0x02BC] # Replaced opcode at callsite
ret
on_window_created:
mov [0x00010C08], eax # prev_desc
push ebp
mov ebp, ebx
call rewrite_string
pop ebp
mov dword [esp + 4], 0x00010C1C # Change first argument to desc_buf
jmp [0x00010C04] # Call original function
rewrite_string:
movsx eax, word [ebp + 0x02BC] # max HP
push eax
movsx eax, word [ebp + 0x0330] # current HP
push eax
push dword [0x00010C08] # prev_desc
push 0x00010C0C # desc_template
push 0x00010C1C # desc_buf
call [0x00010C00] # sprintf
add esp, 0x14
ret