Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Aim Crash Fix
- {
- struct AimCrashFix_Code : Xbyak::CodeGenerator {
- AimCrashFix_Code(void * buf, UInt64 funcAddr) : Xbyak::CodeGenerator(4096, buf)
- {
- Xbyak::Label funcLabel;
- Xbyak::Label retnLabel;
- mov(rcx, rax);
- call(ptr [rip + funcLabel]);
- mov(ptr[rbx+0xB8], rax);
- jmp(ptr [rip + retnLabel]);
- L(funcLabel);
- dq(funcAddr);
- L(retnLabel);
- dq(AimCrashFix_Start.GetUIntPtr() + 0x7);
- }
- };
- void * codeBuf = g_localTrampoline.StartAlloc();
- AimCrashFix_Code code(codeBuf, (uintptr_t)AimCrashFix_Hook);
- g_localTrampoline.EndAlloc(code.getCurr());
- g_branchTrampoline.Write6Branch(AimCrashFix_Start.GetUIntPtr(), uintptr_t(code.getCode()));
- }
- RelocAddr<uintptr_t> NiNode_Vtbl(0x02DBDDC8);
- RelocAddr<uintptr_t> AimCrashFix_Start(0x00FD7DD0);
- uintptr_t * AimCrashFix_Hook(uintptr_t * object)
- {
- if(object) {
- if(*(uintptr_t*)object != NiNode_Vtbl.GetUIntPtr())
- return nullptr;
- return object;
- }
- return nullptr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement