diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index 2f910ca..ef06f26 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -595,6 +595,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (ActorsNum == 0) return false; + + // I don't think this map info check is proper.. We can loop through the Actors in the World's PersistentLevel and check if there is a MapInfo, if there is then we can wait, else don't. auto MapInfo = GameState->GetMapInfo(); @@ -884,9 +886,9 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (GameState->GetPlayersLeft() >= GameMode->Get(WarmupRequiredPlayerCountOffset)) { - if (MapInfo) + // if (MapInfo) { - static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos"); + // static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos"); // if (MapInfo->Get>(FlightInfosOffset).ArrayNum > 0) { diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index f63e505..5b6e8ba 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -312,6 +312,9 @@ void Addresses::FindAll() LOG_INFO(LogDev, "Finding AddToAlivePlayers"); Addresses::AddToAlivePlayers = FindAddToAlivePlayers(); + // LOG_INFO(LogDev, "Finding GetSessionInterface"); + // Addresses::GetSessionInterface = FindGetSessionInterface(); + LOG_INFO(LogDev, "Applying GameSessionPatch"); ApplyGameSessionPatch(); @@ -388,6 +391,7 @@ void Addresses::Print() LOG_INFO(LogDev, "GetSquadIdForCurrentPlayer: 0x{:x}", GetSquadIdForCurrentPlayer - Base); LOG_INFO(LogDev, "FinishResurrection: 0x{:x}", FinishResurrection - Base); LOG_INFO(LogDev, "AddToAlivePlayers: 0x{:x}", AddToAlivePlayers - Base); + LOG_INFO(LogDev, "GetSessionInterface: 0x{:x}", GetSessionInterface - Base); } void Offsets::FindAll() @@ -519,6 +523,33 @@ void Addresses::Init() else UnchunkedObjects = decltype(UnchunkedObjects)(ObjectArray); } +std::vector Addresses::GetFunctionsToReturnTrue() +{ + std::vector toReturnTrue; + + if (Fortnite_Version == 1.11 || Fortnite_Version >= 2.2 && Fortnite_Version <= 2.4) + { + toReturnTrue.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 48 8B 01 49 8B E9 45 0F B6 F8").Get()); // No Reserve + } + + if (std::floor(Fortnite_Version) == 17) + { + toReturnTrue.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 4D 8B F9 41 8A F0 4C 8B F2 48 8B F9 45 32 E4").Get()); // No Reserve + } + + if (Fortnite_Version >= 19) + { + // toReturnTrue.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B 01 49 8B F0 33 DB FF 50 20 48 8B F8").Get()); // funny session thingy + } + + if (Engine_Version >= 426) + { + toReturnTrue.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 49 8B D9 45 8A").Get()); // No reserve + } + + return toReturnTrue; +} + std::vector Addresses::GetFunctionsToNull() { std::vector toNull; @@ -528,11 +559,6 @@ std::vector Addresses::GetFunctionsToNull() toNull.push_back(Memcury::Scanner::FindPattern("48 89 54 24 ? 48 89 4C 24 ? 55 53 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 8B 41 08 C1 E8 05").Get()); // Widget class } - if (Fortnite_Version == 1.11 || Fortnite_Version >= 2.2 && Fortnite_Version <= 2.4) - { - toNull.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 48 8B 01 49 8B E9 45 0F B6 F8").Get()); // No Reserve - } - if (Fortnite_Version > 2.5 && Engine_Version == 420) { toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 57 48 81 EC ? ? ? ? 4C 8B 82 ? ? ? ? 48 8B F9 0F 29 70 E8 0F 29 78 D8").Get()); // Pawn Overlap @@ -580,7 +606,6 @@ std::vector Addresses::GetFunctionsToNull() if (std::floor(Fortnite_Version) == 17) { toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 70 08 48 89 78 10 55 41 54 41 55 41 56 41 57 48 8D 68 A1 48 81 EC ? ? ? ? 45 33 ED").Get()); // collectgarbage - toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 4D 8B F9 41 8A F0 4C 8B F2 48 8B F9 45 32 E4").Get()); // No Reserve } if (Engine_Version == 500) @@ -591,11 +616,6 @@ std::vector Addresses::GetFunctionsToNull() toNull.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 55 41 56 48 8B EC 48 83 EC 50 83 65 28 00 40 B6 05 40 38 35 ? ? ? ? 4C").Get()); // InitializeUI } - if (Engine_Version >= 426) - { - toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 49 8B D9 45 8A").Get()); // No reserve - } - toNull.push_back(Addresses::ChangeGameSessionId); return toNull; diff --git a/Project Reboot 3.0/addresses.h b/Project Reboot 3.0/addresses.h index 001ddf3..6f057a1 100644 --- a/Project Reboot 3.0/addresses.h +++ b/Project Reboot 3.0/addresses.h @@ -75,12 +75,14 @@ namespace Addresses extern inline uint64 FinishResurrection = 0; extern inline uint64 AddToAlivePlayers = 0; extern inline uint64 GameSessionPatch = 0; + extern inline uint64 GetSessionInterface = 0; // Matchmaking void SetupVersion(); // Finds Engine Version void FindAll(); void Print(); void Init(); - + + std::vector GetFunctionsToReturnTrue(); std::vector GetFunctionsToNull(); } diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 5319b57..4971f0c 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -549,6 +549,7 @@ DWORD WINAPI Main(LPVOID) LOG_INFO(LogDev, "Switch levels."); auto AddressesToNull = Addresses::GetFunctionsToNull(); + const auto AddressesToReturnTrue = Addresses::GetFunctionsToReturnTrue(); auto ServerCheatAllIndex = GetFunctionIdxOrPtr(FindObject(L"/Script/FortniteGame.FortPlayerController.ServerCheatAll")); @@ -571,6 +572,17 @@ DWORD WINAPI Main(LPVOID) VirtualProtect((PVOID)func, 1, dwProtection, &dwTemp); } + for (auto func : AddressesToReturnTrue) + { + if (func == 0) + continue; + + LOG_INFO(LogDev, "Forcing return true on 0x{:x}", func - __int64(GetModuleHandleW(0))); + + MH_CreateHook((PVOID)func, ReturnTrueHook, nullptr); + MH_EnableHook((PVOID)func); + } + if (Fortnite_Version != 22.4) { auto matchmaking = Memcury::Scanner::FindPattern("83 BD ? ? ? ? 01 7F 18 49 8D 4D D8 48 8B D6 E8 ? ? ? ? 48", false).Get(); diff --git a/Project Reboot 3.0/finder.cpp b/Project Reboot 3.0/finder.cpp index 045a57f..0e5f49c 100644 --- a/Project Reboot 3.0/finder.cpp +++ b/Project Reboot 3.0/finder.cpp @@ -3,6 +3,32 @@ #include "reboot.h" #include "FortPlayerControllerAthena.h" +uint64 FindGetSessionInterface() +{ + auto strRef = Memcury::Scanner::FindStringRef(L"OnDestroyReservedSessionComplete %s bSuccess: %d", true, 0, Fortnite_Version >= 19).Get(); + + LOG_INFO(LogDev, "strRef: 0x{:x}", strRef - __int64(GetModuleHandleW(0))); + + int NumCalls = 0; + NumCalls -= Fortnite_Version >= 19; + + for (int i = 0; i < 2000; i++) + { + if (*(uint8_t*)(strRef + i) == 0xE8) + { + LOG_INFO(LogDev, "Found call 0x{:x}", __int64(strRef + i) - __int64(GetModuleHandleW(0))); + NumCalls++; + + if (NumCalls == 2) // First is a FMemory::Free + { + return Memcury::Scanner(strRef + i).RelativeOffset(1).Get(); + } + } + } + + return 0; +} + uint64 FindGetPlayerViewpoint() { // We find FailedToSpawnPawn and then go back on VFT by 1. diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index ebe9a70..2b31019 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -495,6 +495,7 @@ static inline uint64 FindGetMaxTickRate() // UEngine::getmaxtickrate // return FindBytes(stringRef, Fortnite_Version <= 4.1 ? std::vector{ 0x40, 0x53 } : std::vector{ 0x48, 0x89, 0x5C }, 1000, 0, true); } +uint64 FindGetSessionInterface(); uint64 FindGetPlayerViewpoint(); uint64 ApplyGameSessionPatch(); diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 0c98762..bc655df 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -572,7 +572,7 @@ static inline void MainUI() } */ - if (!bIsInAutoRestart && (Engine_Version < 424 && ImGui::Button("Restart"))) + if (!bIsInAutoRestart && Engine_Version < 424 && ImGui::Button("Restart")) { if (Engine_Version < 424) { @@ -586,42 +586,16 @@ static inline void MainUI() } /* - if (ImGui::Button("TEST")) + if (ImGui::Button("Test bruh")) { - auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode(); - auto GameState = GameMode->GetGameState(); + __int64 bruh; + __int64* (*sub_7FF7476F4458)(__int64* a1, UWorld* a2, __int64 a3) = decltype(sub_7FF7476F4458)(Addresses::GetSessionInterface); - static auto mutatorClass = FindObject("/Script/FortniteGame.FortAthenaMutator"); - auto AllMutators = UGameplayStatics::GetAllActorsOfClass(GetWorld(), mutatorClass); + sub_7FF7476F4458(&bruh, GetWorld(), 0); - for (int i = 0; i < AllMutators.Num(); ++i) - { - auto Mutator = AllMutators.at(i); - - LOG_INFO(LogDev, "[{}] Mutator: {}", i, Mutator->GetFullName()); - - if (auto DiscoMutator = Cast(Mutator)) - { - auto& ControlPointSpawnData = DiscoMutator->GetControlPointSpawnData(); - - LOG_INFO(LogDev, "ControlPointSpawnData.Num(): {}", ControlPointSpawnData.Num()); - } - else if (auto HeistMutator = Cast(Mutator)) - { - auto& HeistExitCraftSpawnData = HeistMutator->GetHeistExitCraftSpawnData(); - - LOG_INFO(LogDev, "HeistExitCraftSpawnData.Num(): {}", HeistExitCraftSpawnData.Num()); - - for (int j = 0; j < HeistExitCraftSpawnData.Num(); j++) - { - auto& CurrentHeistExitCraftSpawnData = HeistExitCraftSpawnData.at(j); - auto CurveTable = CurrentHeistExitCraftSpawnData.SpawnDelayTime.GetCurve().CurveTable; - - // LOG_INFO(LogDev, "{} {}", CurveTable ? CurveTable->GetFullName() : "InvalidTable", - // CurrentHeistExitCraftSpawnData.SpawnDelayTime.GetCurve().RowName.IsValid() ? CurrentHeistExitCraftSpawnData.SpawnDelayTime.GetCurve().RowName.ToString() : "InvalidName"); - } - } - } + LOG_INFO(LogDev, "bruh: 0x{:x}", bruh); + auto VFT = *(__int64*)bruh; + LOG_INFO(LogDev, "VFT: 0x{:x}", VFT - __int64(GetModuleHandleW(0))); } */