From e73e2b73be5cb091910bc90fad546c9a3d85a741 Mon Sep 17 00:00:00 2001 From: Milxnor Date: Sat, 1 Apr 2023 19:30:06 -0400 Subject: [PATCH] aa --- Project Reboot 3.0/FortGameModeAthena.cpp | 5 +++-- Project Reboot 3.0/FortPlayerController.cpp | 6 +++++- Project Reboot 3.0/FortPlayerStateAthena.cpp | 2 +- Project Reboot 3.0/addresses.cpp | 9 ++++++++- Project Reboot 3.0/dllmain.cpp | 9 +++++---- Project Reboot 3.0/events.h | 1 + Project Reboot 3.0/finder.h | 15 +++++++++------ Project Reboot 3.0/globals.h | 1 - 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index d45ef6a..a4eb8e3 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -285,7 +285,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (Fortnite_Version >= 4) SetPlaylist(PlaylistToUse, true); - LOG_INFO(LogDev, "Set playlist!"); + auto CurrentPlaylist = GameState->GetCurrentPlaylist(); + LOG_INFO(LogDev, "Set playlist to {}!", CurrentPlaylist->IsValidLowLevel() ? CurrentPlaylist->GetFullName() : "Invalid"); } // if (false) @@ -766,7 +767,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena LOG_INFO(LogDev, "Spawned loot!"); } - if (Engine_Version >= 423 && Engine_Version < 426) // 423+ we need to spawn manually and vehicle sync doesn't work on >S13. + if (Engine_Version >= 423 && Fortnite_Version <= 12.41) // 423+ we need to spawn manually and vehicle sync doesn't work on >S13. { static int LastNum420 = 1; diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index 5dae15d..f095618 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -463,9 +463,13 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra auto MatDefinition = UFortKismetLibrary::K2_GetResourceItemDefinition(BuildingActor->GetResourceType()); auto WorldInventory = PlayerController->GetWorldInventory(); + + if (!WorldInventory) + return ServerCreateBuildingActorOriginal(Context, Stack, Ret); + auto MatInstance = WorldInventory->FindItemInstance(MatDefinition); - bool bShouldDestroy = MatInstance ? PlayerController->DoesBuildFree() ? false : MatInstance->GetItemEntry()->GetCount() < 10 : true; + bool bShouldDestroy = MatInstance ? (PlayerController->DoesBuildFree() ? false : MatInstance->GetItemEntry()->GetCount() < 10) : true; if (bShouldDestroy) { diff --git a/Project Reboot 3.0/FortPlayerStateAthena.cpp b/Project Reboot 3.0/FortPlayerStateAthena.cpp index 8c29902..e6cd407 100644 --- a/Project Reboot 3.0/FortPlayerStateAthena.cpp +++ b/Project Reboot 3.0/FortPlayerStateAthena.cpp @@ -21,7 +21,7 @@ void AFortPlayerStateAthena::ServerSetInAircraftHook(UObject* Context, FFrame& S auto& ItemInstances = InventoryList.GetItemInstances(); - if ((/* (bNewInAircraft && !PlayerController->IsInAircraft()) || */ (Globals::bLateGame ? bNewInAircraft : true)) && ItemInstances.Num()) + if (/* (bNewInAircraft && !PlayerController->IsInAircraft()) || */ /* (Globals::bLateGame ? bNewInAircraft : true)) && */ ItemInstances.Num()) { // std::cout << "InventoryList.ItemInstances.Num(): " << InventoryList.ItemInstances.Num() << '\n'; diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index 738de7d..624b105 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -380,7 +380,7 @@ std::vector Addresses::GetFunctionsToNull() 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 - // toNull.push_back(Memcury::Scanner::FindPattern("E8 ? ? ? ? EB 26 40 38 3D ? ? ? ?").RelativeOffset(1).Get()); // collectgarbage + toNull.push_back(Memcury::Scanner::FindPattern("E8 ? ? ? ? EB 26 40 38 3D ? ? ? ?").RelativeOffset(1).Get()); // collectgarbage } if (Engine_Version == 421) @@ -393,8 +393,15 @@ std::vector Addresses::GetFunctionsToNull() toNull.push_back(Memcury::Scanner::FindPattern("40 57 41 56 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F B6 FA 44 8B F1 74 3A 80 3D ? ? ? ? ? 0F 82").Get()); // collect garbage } + if (Fortnite_Version == 12.41) + { + toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 54 41 56 41 57 48 83 EC 70 48 8B 35").Get()); // random travis crash + toNull.push_back(Memcury::Scanner::FindPattern("40 57 41 56 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F B6 FA 44 8B F1 74 3A 80 3D ? ? ? ? ? 0F").Get()); // collect garbage + } + if (Fortnite_Version == 12.61) { + toNull.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 55 57 41 54 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 20 4C 8B A5").Get()); // idfk // toNull.push_back(Memcury::Scanner::FindPattern("48 89 4C 24 ? 55 56 57 41 56 48 81 EC ? ? ? ? 4C 8B B1 ? ? ? ? 33 F6 4C 89 B4 24 ? ? ? ? 48 8B").Get()); // fritter crash } diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 1409c24..e69752a 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -138,6 +138,7 @@ DWORD WINAPI Main(LPVOID) *(bool*)FindGIsClient() = false; } + bool bUseRemovePlayer = false; bool bUseSwitchLevel = false; if (bUseSwitchLevel) @@ -155,7 +156,7 @@ DWORD WINAPI Main(LPVOID) } else { - if (true) + if (!bUseRemovePlayer) { auto& LocalPlayers = GetLocalPlayers(); @@ -164,7 +165,7 @@ DWORD WINAPI Main(LPVOID) LocalPlayers.Remove(0); } } - else if (false) + else if (bUseRemovePlayer) { UGameplayStatics::RemovePlayer((APlayerController*)GetLocalPlayerController(), true); } @@ -191,7 +192,7 @@ DWORD WINAPI Main(LPVOID) if (bUseSwitchLevel) { - if (true) + if (!bUseRemovePlayer) { auto& LocalPlayers = GetLocalPlayers(); @@ -200,7 +201,7 @@ DWORD WINAPI Main(LPVOID) LocalPlayers.Remove(0); } } - else if (false) + else if (bUseRemovePlayer) { UGameplayStatics::RemovePlayer((APlayerController*)GetLocalPlayerController(), true); } diff --git a/Project Reboot 3.0/events.h b/Project Reboot 3.0/events.h index dcae8a0..da50d3f 100644 --- a/Project Reboot 3.0/events.h +++ b/Project Reboot 3.0/events.h @@ -147,6 +147,7 @@ static inline std::vector Events = "/Fritter/BP_Fritter_Script.BP_Fritter_Script_C", "/Game/Athena/Playlists/Fritter/Playlist_Fritter_High.Playlist_Fritter_High", + //"/Game/Athena/Playlists/Fritter/Playlist_Fritter_Lowest.Playlist_Fritter_Lowest", 12.61 ), Event diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 372afef..20b9e56 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -294,8 +294,10 @@ static inline uint64 FindGetMaxTickRate() // Uengine::getmaxtickrate static inline uint64 FindGetPlayerViewpoint() { - if (Engine_Version == 420) + if (Engine_Version == 420 && Fortnite_Version < 4.5) + { return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 55 41 56 41 57 48 8B EC 48 83 EC 50").Get(); // idk why finder doesnt work and cba to debug + } auto Addrr = Memcury::Scanner::FindStringRef(L"APlayerController::GetPlayerViewPoint: out_Location, ViewTarget=%s").Get(); @@ -488,7 +490,7 @@ static inline uint64 FindCompletePickupAnimation() if (Engine_Version == 421) { - auto adda = Memcury::Scanner::FindPattern("40 53 56 48 83 EC 38 4C 89 6C 24 ? 48 8B F1 4C 8B A9").Get(); + auto adda = Memcury::Scanner::FindPattern("40 53 56 48 83 EC 38 4C 89 6C 24 ? 48 8B F1 4C 8B A9", false).Get(); if (!adda) adda = Memcury::Scanner::FindPattern("40 53 56 57 48 83 EC 30 4C 89 6C 24 ? 48 8B F1 4C 8B A9 ? ? ? ? 4D 85 ED 0F 84").Get(); // 6.21 @@ -527,6 +529,9 @@ static inline uint64 FindNoMCP() return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 20 65 48 8B 04 25 ? ? ? ? BA ? ? ? ? 48 8B 08 8B 04 0A 39 05 ? ? ? ? 7F 23 8A 05 ? ? ? ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 8B 74 24 ? 48 83 C4 20 41 5F 41 5E 41 5D 41 5C 5F C3 48 8D 0D ? ? ? ? E8 ? ? ? ? 83 3D ? ? ? ? ? 75 C8 E8 ? ? ? ? 45 33").Get(); } */ + if (Fortnite_Version == 4.5) + return Memcury::Scanner::FindPattern("E8 ? ? ? ? 90 EB EA").RelativeOffset(1).Get(); + if (std::floor(Fortnite_Version) == 3) return Memcury::Scanner::FindPattern("E8 ? ? ? ? 83 A7 ? ? ? ? ? 48 8D 4C 24 ?").RelativeOffset(1).Get(); @@ -914,16 +919,14 @@ static inline uint64 FindGIsClient() // return __int64(GetModuleHandleW(0)) + 0x46AD734; if (Fortnite_Version == 4.1) return __int64(GetModuleHandleW(0)) + 0x4BF6F17; - if (Fortnite_Version == 11.31) return __int64(GetModuleHandleW(0)) + 0x6F41270; - if (Fortnite_Version == 12.41) return __int64(GetModuleHandleW(0)) + 0x804B659; - + if (Fortnite_Version == 12.61) + return __int64(GetModuleHandleW(0)) + 0x8237B86; if (Fortnite_Version == 14.60) return __int64(GetModuleHandleW(0)) + 0x939930D; - if (Fortnite_Version == 17.30) return __int64(GetModuleHandleW(0)) + 0x973E49B; diff --git a/Project Reboot 3.0/globals.h b/Project Reboot 3.0/globals.h index 711aec5..1edf640 100644 --- a/Project Reboot 3.0/globals.h +++ b/Project Reboot 3.0/globals.h @@ -5,7 +5,6 @@ namespace Globals extern inline bool bCreative = false; extern inline bool bGoingToPlayEvent = false; extern inline bool bNoMCP = true; - extern inline bool bLateGame = false; extern inline bool bAbilitiesEnabled = true; extern inline bool bLogProcessEvent = false; } \ No newline at end of file