parent
bd7bc362e3
commit
055bb3e939
21
src/hooks/protections/sound_overload_detour_asm.asm
Normal file
21
src/hooks/protections/sound_overload_detour_asm.asm
Normal file
@ -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
|
@ -5,6 +5,9 @@
|
||||
#include "security/RageSecurity.hpp"
|
||||
#include "hooking.hpp"
|
||||
|
||||
extern "C" void sound_overload_detour();
|
||||
std::uint64_t g_sound_overload_ret_addr;
|
||||
|
||||
namespace big
|
||||
{
|
||||
pointers::pointers()
|
||||
@ -762,6 +765,15 @@ namespace big
|
||||
m_chat_gamer_info = ptr.add(1).rip().add(6).rip().as<rage::rlGamerInfo*>();
|
||||
});
|
||||
|
||||
// Sound Overload Detour
|
||||
main_batch.add("SOD", "66 45 3B C1 74 38", [this](memory::handle ptr)
|
||||
{
|
||||
g_sound_overload_ret_addr = ptr.add(13 + 15).as<decltype(g_sound_overload_ret_addr)>();
|
||||
std::vector<byte> bytes = { 0xFF,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90 }; // far jump opcode + a nop opcode
|
||||
*(void**)(bytes.data() + 6) = sound_overload_detour;
|
||||
memory::byte_patch::make(ptr.add(13).as<void*>(), bytes)->apply();
|
||||
});
|
||||
|
||||
auto mem_region = memory::module("GTA5.exe");
|
||||
main_batch.run(mem_region);
|
||||
|
||||
|
@ -22,6 +22,8 @@ namespace rage
|
||||
class rlGamerInfo;
|
||||
}
|
||||
|
||||
extern "C" std::uint64_t g_sound_overload_ret_addr;
|
||||
|
||||
namespace big
|
||||
{
|
||||
class pointers
|
||||
|
Reference in New Issue
Block a user