LostProphet

Untitled

Aug 22nd, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private static IntPtr getDeltaTimePtr;
  2.         static unsafe float GetGameDeltaTime()
  3.         {
  4.             return *(float*)((*(uint*)(getDeltaTimePtr.ToInt64() + 4)) + (getDeltaTimePtr.ToInt64() + 8));
  5.         }
  6.  
  7.         private delegate void VehicleWheelTestDelegate(IntPtr wheel, IntPtr vehicle, float delta);
  8.         private delegate void BreakVehicleWheelOffDelegate(IntPtr infoAboutVeh, int wheelIndex, float x, float y, float z, int randomizeMaybe, int b);
  9.         static unsafe void BreakWheelsTest(Vehicle veh, int index, float x, float y, float z, int a, int b)
  10.         {
  11.  
  12.             IntPtr vehicleWheelTestFuncPtr = Game.FindPattern("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 30 F3 0F 10 89 ?? ?? ?? ??");
  13.             VehicleWheelTestDelegate vehicleWheelTestFunc = Marshal.GetDelegateForFunctionPointer<VehicleWheelTestDelegate>(vehicleWheelTestFuncPtr);
  14.  
  15.  
  16.             long baseAddress = Process.GetCurrentProcess().MainModule.BaseAddress.ToInt64();
  17.             IntPtr breakVehWheelOffFuncPtr = new IntPtr(baseAddress + 0xE6C47C);
  18.             BreakVehicleWheelOffDelegate breakVehWheelOffFunc = Marshal.GetDelegateForFunctionPointer<BreakVehicleWheelOffDelegate>(breakVehWheelOffFuncPtr);
  19.  
  20.             Int64* CWheelArray = (Int64*)*(Int64*)(veh.MemoryAddress.ToInt64() + 0x0AB0);
  21.             Int64 CWheel = CWheelArray[index];
  22.  
  23.             float deltaTime = GetGameDeltaTime();
  24.             vehicleWheelTestFunc(new IntPtr(CWheel), veh.MemoryAddress, deltaTime);
  25.             breakVehWheelOffFunc(new IntPtr((long*)(veh.MemoryAddress.ToInt64() + 0x350)), index, x, y, z, a, b);
  26.         }
  27.  
  28.  
  29.         public static unsafe void Main()
  30.         {
  31.             getDeltaTimePtr = Game.FindPattern("F3 0F 10 0D ?? ?? ?? ?? 48 8D 8B ?? ?? ?? ?? 45 33 C0 E8 ?? ?? ?? ?? B2 01");
  32.  
  33.             while (true)
  34.             {
  35.                 GameFiber.Yield();
  36.  
  37.  
  38.                 Game.DisplayHelp(GetGameDeltaTime().ToString());
  39.  
  40.                 if (Game.IsKeyDown(Keys.Y) && Game.LocalPlayer.Character.IsInAnyVehicle(false))
  41.                 {
  42.                     BreakWheelsTest(Game.LocalPlayer.Character.CurrentVehicle, 0, 0.030000f, 0.28999999f, 0.20999999f, 0, 1);
  43.                 }
  44.             }
  45.         }
Add Comment
Please, Sign In to add comment