feat(Protection): Improve Sound Crash Protection (#767)

Closes #762
This commit is contained in:
Aure7138 authored and GitHub committed 2022-12-30 01:45:04 +00:00
1 parent 2df690b2c8
commit 441b86c207
3 files changed
+35

No files matched your search

@@ -0,0 +1,21 @@
EXTERN g_sound_overload_ret_addr: DQ
.CODE
sound_overload_detour PROC
movzx eax, r8w
lea rdx, [rcx + rcx * 2]
cmp rdx, 190
jle label_1
mov rdx, 0
jmp label_2
label_1:
inc ecx
cmp r8w, [rbx + 28]
label_2:
push 0
mov r11, g_sound_overload_ret_addr
mov [rsp], r11
ret
sound_overload_detour ENDP
END