LehaFH

PlaneCollisionFix

Sep 4th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. static int _CPlaneConstructorJMP = AddressByVersion(0x54B210, 0x54B390, 0x54B340);
  2. void __declspec(naked) patch__CPlaneConstructor()
  3. {
  4.     __asm
  5.     {
  6.         mov     al, [ebx+51h]
  7.         and     al, 0FEh
  8.         or      al, 1
  9.         mov     [ebx+51h], al
  10.     }
  11.     _asm jmp _CPlaneConstructorJMP
  12. }
  13.  
  14. static int UpdateRwFrame__7CEntityFv = AddressByVersion(0x474330, 0x474330, 0x474330);
  15. static int RemoveAndAdd__9CPhysicalFv = AddressByVersion(0x495540, 0x495600, 0x495590);
  16. static int _CPlaneProcessControlJMP =  AddressByVersion(0x54DD49, 0x54DEC9, 0x54DE79);
  17. void __declspec(naked) patch__CPlaneProcessControl()
  18. {
  19.     __asm
  20.     {
  21.         mov     ecx, ebp
  22.         call    UpdateRwFrame__7CEntityFv
  23.  
  24.         mov     ecx, ebp
  25.         call    RemoveAndAdd__9CPhysicalFv     
  26.     }
  27.  
  28.      _asm jmp _CPlaneProcessControlJMP
  29. }
  30.  
  31. BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
  32. {
  33.     if(reason == DLL_PROCESS_ATTACH)
  34.     {
  35.         CPatch::RedirectJump(AddressByVersion(0x54B208, 0x54B388, 0x54B338), patch__CPlaneConstructor);
  36.         CPatch::RedirectJump(AddressByVersion(0x54DD42, 0x54DEC2, 0x54DE72), patch__CPlaneProcessControl);
  37.     }
  38.     return TRUE;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment