From b3c71855a8ce2ffeec45697436e05ec7c50b75fc Mon Sep 17 00:00:00 2001 From: raax7 Date: Sun, 17 Mar 2024 16:17:05 +0000 Subject: [PATCH] Minor Push - Fixed a couple things - Added revert all to AutoRevertFeature - Added NoTilting to vehicle fly - Removed double SetReloadTime --- Fortnite Internal/Configs/Config.h | 3 +- Fortnite Internal/Entry.cpp | 3 + .../Game/Features/Exploits/Vehicles.cpp | 125 ++++++++++-------- .../Game/Features/Exploits/Vehicles.h | 3 + .../Game/Features/Exploits/Weapons.cpp | 1 - Fortnite Internal/Game/Features/Features.h | 4 + Fortnite Internal/Game/Game.cpp | 11 +- Fortnite Internal/Game/SDK/SDK.cpp | 3 - 8 files changed, 84 insertions(+), 69 deletions(-) diff --git a/Fortnite Internal/Configs/Config.h b/Fortnite Internal/Configs/Config.h index c06afd7..3841b43 100644 --- a/Fortnite Internal/Configs/Config.h +++ b/Fortnite Internal/Configs/Config.h @@ -108,12 +108,11 @@ namespace Config { } namespace Vehicle { - inline bool Enabled = false; - inline bool InfiniteBoost = false; inline bool Fly = false; inline bool FlyThroughWalls = false; inline bool FreezeInAir = false; + inline bool NoTilting = false; inline float FlySpeed = 35.f; } diff --git a/Fortnite Internal/Entry.cpp b/Fortnite Internal/Entry.cpp index a7d5af3..abed803 100644 --- a/Fortnite Internal/Entry.cpp +++ b/Fortnite Internal/Entry.cpp @@ -6,6 +6,7 @@ #include "Drawing/RaaxGUI/RaaxGUI.h" #endif // _ENGINE +#include "Game/Features/Features.h" #include "Game/Input/Input.h" #include "Game/SDK/SDK.h" #include "Hooks/Hooks.h" @@ -58,6 +59,8 @@ VOID UnloadThread() { RaaxDx::Unhook(); #endif // _IMGUI + Features::RevertAll(); + // Free library LI_FN(FreeLibraryAndExitThread).safe()(ThisModule, 0); } diff --git a/Fortnite Internal/Game/Features/Exploits/Vehicles.cpp b/Fortnite Internal/Game/Features/Exploits/Vehicles.cpp index 5fbd55f..27dde46 100644 --- a/Fortnite Internal/Game/Features/Exploits/Vehicles.cpp +++ b/Fortnite Internal/Game/Features/Exploits/Vehicles.cpp @@ -7,90 +7,99 @@ #include "../../Actors/ActorCache.h" #include "../../Input/Input.h" -#include "../../../Utilities/Math.h" - std::chrono::steady_clock::time_point Features::Exploits::Vehicle::LastTeleportTime = std::chrono::steady_clock::now(); +void* Features::Exploits::Vehicle::VehicleLastTick = nullptr; +bool Features::Exploits::Vehicle::WasNoCollisionLastTick = false; void Features::Exploits::Vehicle::Tick() { SDK::AFortAthenaVehicle* Vehicle = reinterpret_cast(SDK::GetLocalPawn())->GetVehicle(); if (Vehicle) { - if (Config::Exploits::Vehicle::Enabled) { - if (Config::Exploits::Vehicle::InfiniteBoost) { - if (Vehicle->IsA(SDK::AFortAthenaAntelopeVehicle::StaticClass())) { - SDK::AFortAthenaAntelopeVehicle* Antelope = reinterpret_cast(Vehicle); + VehicleLastTick = Vehicle; - Antelope->FortAntelopeVehicleConfigs()->SetBoostAccumulationRate(FLT_MAX, &Config::Exploits::Vehicle::InfiniteBoost); - Antelope->FortAntelopeVehicleConfigs()->SetBoostExpenseRate(0.f, &Config::Exploits::Vehicle::InfiniteBoost); - } + if (Config::Exploits::Vehicle::InfiniteBoost) { + if (Vehicle->IsA(SDK::AFortAthenaAntelopeVehicle::StaticClass())) { + SDK::AFortAthenaAntelopeVehicle* Antelope = reinterpret_cast(Vehicle); - if (Vehicle->IsA(SDK::AFortAthenaJackalVehicle::StaticClass())) { - SDK::AFortAthenaJackalVehicle* Jackal = reinterpret_cast(Vehicle); + Antelope->FortAntelopeVehicleConfigs()->SetBoostAccumulationRate(FLT_MAX, &Config::Exploits::Vehicle::InfiniteBoost); + Antelope->FortAntelopeVehicleConfigs()->SetBoostExpenseRate(0.f, &Config::Exploits::Vehicle::InfiniteBoost); + } - for (int i = 0; i < Jackal->BoostTimers().Num(); i++) { - Jackal->BoostTimers()[i].SetCharge(1.0f); - } - } + if (Vehicle->IsA(SDK::AFortAthenaJackalVehicle::StaticClass())) { + SDK::AFortAthenaJackalVehicle* Jackal = reinterpret_cast(Vehicle); - if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass())) { - SDK::AFortAthenaDoghouseVehicle* Doghouse = reinterpret_cast(Vehicle); - - Doghouse->BoostAction()->SetCharge(1.0f); + for (int i = 0; i < Jackal->BoostTimers().Num(); i++) { + Jackal->BoostTimers()[i].SetCharge(1.0f); } } - if (Config::Exploits::Vehicle::Fly) { - float MoveForwardBackward = 0.0f; - float MoveLeftRight = 0.0f; - float MoveUpDown = 0.0f; + if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass())) { + SDK::AFortAthenaDoghouseVehicle* Doghouse = reinterpret_cast(Vehicle); - if (Input::IsKeyDown(Input::KeyName::W)) MoveForwardBackward += 1.0f; - if (Input::IsKeyDown(Input::KeyName::S)) MoveForwardBackward -= 1.0f; - if (Input::IsKeyDown(Input::KeyName::A)) MoveLeftRight -= 1.0f; - if (Input::IsKeyDown(Input::KeyName::D)) MoveLeftRight += 1.0f; - if (Input::IsKeyDown(Input::KeyName::SpaceBar)) MoveUpDown += 1.0f; - if (Input::IsKeyDown(Input::KeyName::LeftControl)) MoveUpDown -= 1.0f; + Doghouse->BoostAction()->SetCharge(1.0f); + } + } - SDK::FRotator ModifiedRotation = Actors::MainCamera.Rotation; - // Make the camera be looking more downward so the player doesn't have to look so high they can't see the floor just to go straight forward - ModifiedRotation.Pitch -= 20.f; - // Normalize the pitch so it doesn't go over 90 or under -90 - ModifiedRotation.Pitch = Math::NormalizeAngle(ModifiedRotation.Pitch); + if (Config::Exploits::Vehicle::Fly) { + float MoveForwardBackward = 0.0f; + float MoveLeftRight = 0.0f; + float MoveUpDown = 0.0f; - SDK::FVector ForwardVector = SDK::UKismetMathLibrary::StaticClass()->GetForwardVector(Actors::MainCamera.Rotation); + if (Input::IsKeyDown(Input::KeyName::W)) MoveForwardBackward += 1.0f; + if (Input::IsKeyDown(Input::KeyName::S)) MoveForwardBackward -= 1.0f; + if (Input::IsKeyDown(Input::KeyName::A)) MoveLeftRight -= 1.0f; + if (Input::IsKeyDown(Input::KeyName::D)) MoveLeftRight += 1.0f; + if (Input::IsKeyDown(Input::KeyName::SpaceBar)) MoveUpDown += 1.0f; + if (Input::IsKeyDown(Input::KeyName::LeftControl)) MoveUpDown -= 1.0f; - SDK::FVector MovementDirection = ForwardVector * MoveForwardBackward + - SDK::UKismetMathLibrary::StaticClass()->GetRightVector(Actors::MainCamera.Rotation) * MoveLeftRight + - SDK::FVector(0, 0, 1) * MoveUpDown; + SDK::FRotator CameraRotation = Actors::MainCamera.Rotation; + SDK::FVector ForwardVector = SDK::FVector(); - SDK::FVector NewLocation = Vehicle->GetRootComponent()->GetPosition() + (MovementDirection * Config::Exploits::Vehicle::FlySpeed); - // Adjust NewLocation for 60 FPS using LastTeleportTime (so it doesn't depend on FPS) - NewLocation = NewLocation + MovementDirection * (Config::Exploits::Vehicle::FlySpeed / 60.f) * std::chrono::duration_cast(std::chrono::steady_clock::now() - LastTeleportTime).count(); + if (Config::Exploits::Vehicle::NoTilting) { + SDK::FRotator AdjustedCameraRotation = Actors::MainCamera.Rotation; + AdjustedCameraRotation.Pitch = 0.f; - if (MovementDirection != SDK::FVector()) { - Vehicle->K2_TeleportTo(NewLocation, Actors::MainCamera.Rotation); + ForwardVector = SDK::UKismetMathLibrary::StaticClass()->GetForwardVector(AdjustedCameraRotation); - if (Config::Exploits::Vehicle::FlyThroughWalls) { - Vehicle->SetActorEnableCollision(false); // ADD AUTO REVERT TO THIS - } - else { - Vehicle->SetActorEnableCollision(true); // ADD AUTO REVERT TO THIS - } + ForwardVector.Z = 0.f; + CameraRotation.Pitch = 0.f; + } + else { + ForwardVector = SDK::UKismetMathLibrary::StaticClass()->GetForwardVector(Actors::MainCamera.Rotation); + } - // If FreezeInAir is off, only freeze the vehicle when it's flying - if (Config::Exploits::Vehicle::FreezeInAir == false) { - Vehicle->GetRootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName()); - } + SDK::FVector MovementDirection = ForwardVector * MoveForwardBackward + + SDK::UKismetMathLibrary::StaticClass()->GetRightVector(Actors::MainCamera.Rotation) * MoveLeftRight + + SDK::FVector(0, 0, 1) * MoveUpDown; + + SDK::FVector NewLocation = Vehicle->GetRootComponent()->GetPosition() + (MovementDirection * Config::Exploits::Vehicle::FlySpeed); + // Adjust NewLocation for 60 FPS using LastTeleportTime (so it doesn't depend on FPS) + NewLocation = NewLocation + MovementDirection * (Config::Exploits::Vehicle::FlySpeed / 60.f) * std::chrono::duration_cast(std::chrono::steady_clock::now() - LastTeleportTime).count(); + + if (MovementDirection != SDK::FVector()) { + Vehicle->K2_TeleportTo(NewLocation, CameraRotation); + + if (Config::Exploits::Vehicle::FlyThroughWalls) { + WasNoCollisionLastTick = true; + Vehicle->SetActorEnableCollision(false); // ADD AUTO REVERT TO THIS } else { - Vehicle->K2_SetActorRotation(Actors::MainCamera.Rotation, true); + Vehicle->SetActorEnableCollision(true); // ADD AUTO REVERT TO THIS } - if (Config::Exploits::Vehicle::FreezeInAir) { + // If FreezeInAir is off, only freeze the vehicle when it's flying + if (Config::Exploits::Vehicle::FreezeInAir == false) { Vehicle->GetRootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName()); } + } + else { + Vehicle->K2_SetActorRotation(CameraRotation, true); + } - LastTeleportTime = std::chrono::steady_clock::now(); - } - } + if (Config::Exploits::Vehicle::FreezeInAir) { + Vehicle->GetRootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName()); + } + + LastTeleportTime = std::chrono::steady_clock::now(); + } } } \ No newline at end of file diff --git a/Fortnite Internal/Game/Features/Exploits/Vehicles.h b/Fortnite Internal/Game/Features/Exploits/Vehicles.h index 019b9ac..bfc0203 100644 --- a/Fortnite Internal/Game/Features/Exploits/Vehicles.h +++ b/Fortnite Internal/Game/Features/Exploits/Vehicles.h @@ -9,6 +9,9 @@ namespace Features { public: static void Tick(); + static bool WasNoCollisionLastTick; + static void* VehicleLastTick; + static const float IntervalSeconds; static std::chrono::steady_clock::time_point LastTeleportTime; }; diff --git a/Fortnite Internal/Game/Features/Exploits/Weapons.cpp b/Fortnite Internal/Game/Features/Exploits/Weapons.cpp index f1b9223..ec9a78a 100644 --- a/Fortnite Internal/Game/Features/Exploits/Weapons.cpp +++ b/Fortnite Internal/Game/Features/Exploits/Weapons.cpp @@ -40,7 +40,6 @@ void Features::Exploits::Weapons::Tick(SDK::AFortWeapon* Weapon) { if (Config::Exploits::Weapon::NoReload) { RangedWeaponStats->SetReloadTime(0.f, &Config::Exploits::Weapon::NoReload); - RangedWeaponStats->SetReloadTime(0.f, &Config::Exploits::Weapon::NoReload); } if (Config::Exploits::Weapon::NoRecoil) { diff --git a/Fortnite Internal/Game/Features/Features.h b/Fortnite Internal/Game/Features/Features.h index 4715523..5ccc565 100644 --- a/Fortnite Internal/Game/Features/Features.h +++ b/Fortnite Internal/Game/Features/Features.h @@ -137,6 +137,10 @@ namespace Features { } } + inline void RevertAll() { + AutoRevertFeatures.clear(); + } + namespace Aimbot { diff --git a/Fortnite Internal/Game/Game.cpp b/Fortnite Internal/Game/Game.cpp index c42b24e..9776368 100644 --- a/Fortnite Internal/Game/Game.cpp +++ b/Fortnite Internal/Game/Game.cpp @@ -216,13 +216,14 @@ void Game::MenuCallback() { break; case 3: { - ImGui::Checkbox(skCrypt("Enabled").decrypt(), &Config::Exploits::Vehicle::Enabled); - ImGui::Checkbox(skCrypt("Infinite Boost").decrypt(), &Config::Exploits::Vehicle::InfiniteBoost); ImGui::Checkbox(skCrypt("Fly").decrypt(), &Config::Exploits::Vehicle::Fly); - ImGui::Checkbox(skCrypt("Fly Through Walls").decrypt(), &Config::Exploits::Vehicle::FlyThroughWalls); - ImGui::Checkbox(skCrypt("Freeze In Air").decrypt(), &Config::Exploits::Vehicle::FreezeInAir); - ImGui::SliderFloat(skCrypt("Fly Speed").decrypt(), &Config::Exploits::Vehicle::FlySpeed, 35.f, 1000.f); + if (Config::Exploits::Vehicle::Fly) { + ImGui::Checkbox(skCrypt("Fly Through Walls (also makes flying better)").decrypt(), &Config::Exploits::Vehicle::FlyThroughWalls); + ImGui::Checkbox(skCrypt("Freeze In Air").decrypt(), &Config::Exploits::Vehicle::FreezeInAir); + ImGui::Checkbox(skCrypt("No Tilting").decrypt(), &Config::Exploits::Vehicle::NoTilting); + ImGui::SliderFloat(skCrypt("Fly Speed").decrypt(), &Config::Exploits::Vehicle::FlySpeed, 35.f, 1000.f); + } } break; case 4: diff --git a/Fortnite Internal/Game/SDK/SDK.cpp b/Fortnite Internal/Game/SDK/SDK.cpp index 2cba779..08e093c 100644 --- a/Fortnite Internal/Game/SDK/SDK.cpp +++ b/Fortnite Internal/Game/SDK/SDK.cpp @@ -98,10 +98,7 @@ void SDK::Init() { }; std::vector Offsets { - // REQUIRED FOR INITIALIZATION OffsetSearch { skCrypt("GameViewportClient").decrypt(), skCrypt("GameInstance").decrypt(), &SDK::Cached::Offsets::GameViewportClient::GameInstance, nullptr }, - // REQUIRED FOR INITIALIZATION - OffsetSearch { skCrypt("Engine").decrypt(), skCrypt("GameViewport").decrypt(), &SDK::Cached::Offsets::Engine::GameViewport, nullptr }, OffsetSearch { skCrypt("GameViewportClient").decrypt(), skCrypt("World").decrypt(), &SDK::Cached::Offsets::GameViewportClient::World, nullptr }, OffsetSearch { skCrypt("GameInstance").decrypt(), skCrypt("LocalPlayers").decrypt(), &SDK::Cached::Offsets::GameInstance::LocalPlayers, nullptr },