Advertisement
expired6978

WTFCRASH

Apr 29th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. // Aim Crash Fix
  2.     {
  3.         struct AimCrashFix_Code : Xbyak::CodeGenerator {
  4.             AimCrashFix_Code(void * buf, UInt64 funcAddr) : Xbyak::CodeGenerator(4096, buf)
  5.             {
  6.                 Xbyak::Label funcLabel;
  7.                 Xbyak::Label retnLabel;
  8.  
  9.                 mov(rcx, rax);
  10.                 call(ptr [rip + funcLabel]);
  11.                 mov(ptr[rbx+0xB8], rax);
  12.                 jmp(ptr [rip + retnLabel]);
  13.  
  14.                 L(funcLabel);
  15.                 dq(funcAddr);
  16.  
  17.                 L(retnLabel);
  18.                 dq(AimCrashFix_Start.GetUIntPtr() + 0x7);
  19.             }
  20.         };
  21.  
  22.         void * codeBuf = g_localTrampoline.StartAlloc();
  23.         AimCrashFix_Code code(codeBuf, (uintptr_t)AimCrashFix_Hook);
  24.         g_localTrampoline.EndAlloc(code.getCurr());
  25.  
  26.         g_branchTrampoline.Write6Branch(AimCrashFix_Start.GetUIntPtr(), uintptr_t(code.getCode()));
  27.     }
  28.  
  29.  
  30. RelocAddr<uintptr_t> NiNode_Vtbl(0x02DBDDC8);
  31. RelocAddr<uintptr_t> AimCrashFix_Start(0x00FD7DD0);
  32.  
  33. uintptr_t * AimCrashFix_Hook(uintptr_t * object)
  34. {
  35.     if(object) {
  36.         if(*(uintptr_t*)object != NiNode_Vtbl.GetUIntPtr())
  37.             return nullptr;
  38.         return object;
  39.     }
  40.  
  41.     return nullptr;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement