add xbox rare drop notifs patch

This commit is contained in:
Martin Michelsen
2024-04-25 20:00:19 -07:00
parent 7decab75c2
commit 594ffbe7e6
7 changed files with 567 additions and 0 deletions
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172350
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172375
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x001725D2
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16E8C6 # 002E0EA0 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (001725E0)
dot3_end:
# Notification sound hook
.data 0x00188538
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188A52
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x162732 # 002EB190 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188A91
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172360
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172385
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x001725E2
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16ED86 # 002E1370 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (001725F0)
dot3_end:
# Notification sound hook
.data 0x00188578
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188A92
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x162912 # 002EB3B0 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188AD1
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172220
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172245
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x001724A2
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16CA96 # 002DEF40 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (001724B0)
dot3_end:
# Notification sound hook
.data 0x00188388
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x001888A2
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x160982 # 002E9230 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x001888E1
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172310
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172335
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x00172592
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16D526 # 002DFAC0 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (001725A0)
dot3_end:
# Notification sound hook
.data 0x00188548
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188A62
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x161342 # 002E9DB0 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188AA1
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x001723F0
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172415
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x00172672
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16ECD6 # 002E1350 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (00172680)
dot3_end:
# Notification sound hook
.data 0x00188648
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188B62
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x162822 # 002EB390 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188BA1
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172370
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172395
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x001725F2
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16E8D6 # 002E0ED0 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (00172600)
dot3_end:
# Notification sound hook
.data 0x00188558
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188A72
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x162742 # 002EB1C0 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188AB1
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,81 @@
.meta name="Rare alerts"
.meta description="Show rare items on\nthe map and play a\nsound when a rare\nitem drops"
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
# Map dot render hook
.data 0x00172320
.deltaof dot1_start, dot1_end
dot1_start:
cmp byte [esi + 0x000000EF], 0x4
jne +0x280 # skip_dot
jmp +0x16 # dot2_start
dot1_end:
.data 0x00172345
.deltaof dot2_start, dot2_end
dot2_start:
push 0x00
push 0x01
push 0xFFFFFFFF # White
jmp +0x252 # dot3_start
dot2_end:
.data 0x001725A2
.deltaof dot3_start, dot3_end
dot3_start:
lea edx, [esi + 0x38]
call +0x16EDF6 # 002E13A0 = minimap_render_dot
add esp, 0xC
skip_dot:
mov eax, esi
pop esi
# Falls through to the original tail-call-optimized target (001725B0)
dot3_end:
# Notification sound hook
.data 0x00188538
.deltaof sound1_start, sound1_end
sound1_start:
pop edi # From original function; shorter replacement for add esp, 4
pop edi # From original function
pop esi # From original function
add esp, 0xC # From original function
cmp byte [eax + 0xEF], 0x4
je do_sound
ret
do_sound:
xor ecx, ecx
push ecx
jmp +0x502 # sound2_start
sound1_end:
.data 0x00188A52
.deltaof sound2_start, sound2_end
sound2_start:
push ecx
push ecx
push 0x0000055E
call +0x162982 # 002EB3E0 => play_sound(0x55E, nullptr, 0, 0);
jmp +0x31 # sound3_start
sound2_end:
.data 0x00188A91
.deltaof sound3_start, sound3_end
sound3_start:
add esp, 0x10
ret
sound3_end:
.data 0x00000000
.data 0x00000000