Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static IntPtr getDeltaTimePtr;
- static unsafe float GetGameDeltaTime()
- {
- return *(float*)((*(uint*)(getDeltaTimePtr.ToInt64() + 4)) + (getDeltaTimePtr.ToInt64() + 8));
- }
- private delegate void VehicleWheelTestDelegate(IntPtr wheel, IntPtr vehicle, float delta);
- private delegate void BreakVehicleWheelOffDelegate(IntPtr infoAboutVeh, int wheelIndex, float x, float y, float z, int randomizeMaybe, int b);
- static unsafe void BreakWheelsTest(Vehicle veh, int index, float x, float y, float z, int a, int b)
- {
- IntPtr vehicleWheelTestFuncPtr = Game.FindPattern("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 30 F3 0F 10 89 ?? ?? ?? ??");
- VehicleWheelTestDelegate vehicleWheelTestFunc = Marshal.GetDelegateForFunctionPointer<VehicleWheelTestDelegate>(vehicleWheelTestFuncPtr);
- long baseAddress = Process.GetCurrentProcess().MainModule.BaseAddress.ToInt64();
- IntPtr breakVehWheelOffFuncPtr = new IntPtr(baseAddress + 0xE6C47C);
- BreakVehicleWheelOffDelegate breakVehWheelOffFunc = Marshal.GetDelegateForFunctionPointer<BreakVehicleWheelOffDelegate>(breakVehWheelOffFuncPtr);
- Int64* CWheelArray = (Int64*)*(Int64*)(veh.MemoryAddress.ToInt64() + 0x0AB0);
- Int64 CWheel = CWheelArray[index];
- float deltaTime = GetGameDeltaTime();
- vehicleWheelTestFunc(new IntPtr(CWheel), veh.MemoryAddress, deltaTime);
- breakVehWheelOffFunc(new IntPtr((long*)(veh.MemoryAddress.ToInt64() + 0x350)), index, x, y, z, a, b);
- }
- public static unsafe void Main()
- {
- getDeltaTimePtr = Game.FindPattern("F3 0F 10 0D ?? ?? ?? ?? 48 8D 8B ?? ?? ?? ?? 45 33 C0 E8 ?? ?? ?? ?? B2 01");
- while (true)
- {
- GameFiber.Yield();
- Game.DisplayHelp(GetGameDeltaTime().ToString());
- if (Game.IsKeyDown(Keys.Y) && Game.LocalPlayer.Character.IsInAnyVehicle(false))
- {
- BreakWheelsTest(Game.LocalPlayer.Character.CurrentVehicle, 0, 0.030000f, 0.28999999f, 0.20999999f, 0, 1);
- }
- }
- }
Add Comment
Please, Sign In to add comment