# Original code by Ralf @ GC-Forever and Aleron Ives # https://www.gc-forever.com/forums/viewtopic.php?t=2050 # https://www.gc-forever.com/forums/viewtopic.php?t=2049 # Xbox port by fuzziqersoftware .meta visibility="all" .meta key="EnemyHPBars" .meta name="Enemy HP bars" .meta description="Shows HP bars in\nenemy info windows" .versions 4OED 4OEU 4OJB 4OJD 4OJU 4OPD 4OPU entry_ptr: reloc0: .offsetof start start: .include WriteCodeBlocks .data .data 0x00000001 .binary C0 .data .data 0x00000001 .binary FA .data .data 0x00000004 .binary 836004FD .data .data 0x00000004 .data 0x42960000 .data .data 0x00000004 .data 0x42960000 .data .data 0x00000004 .data 0x42960000 .data .data 0x00000004 .data 0x42960000 .data .data 0x00000004 .data 0x42780000 .data .data 0x00000004 .data 0xFF00FF15 .data 0x00010C00 .deltaof str_data_start, str_data_end str_data_start: .data # sprintf .data # Original function for on_window_created callsite .data 0x00000000 .binary "%s\n\nHP:%d/%d" .data 0x00000000 .data 0x00000000 str_data_end: # WARNING: FlickeringStatusIcons patch starts immediately after this segment; if the size of this is changed, that # patch will have to be changed too .data .deltaof new_code_start, new_code_end new_code_start: # Replacement for handle_0E (do nothing) 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 new_code_end: .data .data 0x00000007 nop nop .binary # call on_hp_updated .data .data 0x00000005 .binary # call on_window_created .data 0x00000000 .data 0x00000000