From 7d136f2b8b371125901dff5f87ef5db0adaca243 Mon Sep 17 00:00:00 2001 From: Milxnor Date: Sun, 2 Apr 2023 00:30:06 -0400 Subject: [PATCH] legacy fixed pickaxes with mcp, 1.11 fixed --- Project Reboot 3.0/Actor.cpp | 6 +++ Project Reboot 3.0/Actor.h | 3 +- Project Reboot 3.0/FortGameModeAthena.cpp | 17 ++----- Project Reboot 3.0/FortInventory.cpp | 43 ++++++++-------- Project Reboot 3.0/FortLootPackage.cpp | 25 ++++++---- Project Reboot 3.0/FortPlayerController.cpp | 8 +++ .../FortPlayerControllerAthena.cpp | 35 +++++++++++-- .../FortPlayerControllerAthena.h | 2 + Project Reboot 3.0/FortWorldItemDefinition.h | 6 ++- Project Reboot 3.0/GameModeBase.cpp | 3 +- Project Reboot 3.0/NetDriver.cpp | 50 ++++++++++++------- Project Reboot 3.0/addresses.cpp | 27 +++++++--- Project Reboot 3.0/dllmain.cpp | 3 ++ Project Reboot 3.0/finder.h | 35 +++++++++++-- Project Reboot 3.0/inc.h | 1 + 15 files changed, 186 insertions(+), 78 deletions(-) diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index 20b3382..7cae305 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -120,6 +120,12 @@ void AActor::SetOwner(AActor* Owner) this->ProcessEvent(SetOwnerFn, &Owner); } +void AActor::ForceNetUpdate() +{ + static auto ForceNetUpdateFn = FindObject("/Script/Engine.Actor.ForceNetUpdate"); + this->ProcessEvent(ForceNetUpdateFn); +} + bool AActor::IsAlwaysRelevant() { static auto bAlwaysRelevantOffset = GetOffset("bAlwaysRelevant"); diff --git a/Project Reboot 3.0/Actor.h b/Project Reboot 3.0/Actor.h index 030b75c..fd93499 100644 --- a/Project Reboot 3.0/Actor.h +++ b/Project Reboot 3.0/Actor.h @@ -24,6 +24,7 @@ public: bool CanBeDamaged(); void SetCanBeDamaged(bool NewValue); void SetOwner(AActor* Owner); - + void ForceNetUpdate(); + static class UClass* StaticClass(); }; \ No newline at end of file diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index a4eb8e3..d49bda6 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -806,6 +806,8 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena Parts[(int)EFortCustomPartType::Head] = headPart; Parts[(int)EFortCustomPartType::Body] = bodyPart; + + // if (Fortnite_Version > 2.5) Parts[(int)EFortCustomPartType::Backpack] = backpackPart; static auto OnRep_CharacterPartsFn = FindObject("/Script/FortniteGame.FortPlayerState.OnRep_CharacterParts"); @@ -1057,21 +1059,10 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena LOG_INFO(LogDev, "HandleStartingNewPlayer end"); - if (Fortnite_Version <= 2.5) - { - static auto QuickBarsOffset = NewPlayer->GetOffset("QuickBars", false); - - if (QuickBarsOffset != -1) - { - static auto FortQuickBarsClass = FindObject("/Script/FortniteGame.FortQuickBars"); - NewPlayer->Get(QuickBarsOffset) = GetWorld()->SpawnActor(FortQuickBarsClass); - NewPlayer->Get(QuickBarsOffset)->SetOwner(NewPlayer); - } - } - - if (Engine_Version <= 420) // not sure if needed on s3-s4 + if (Engine_Version <= 420) { static auto OverriddenBackpackSizeOffset = NewPlayer->GetOffset("OverriddenBackpackSize"); + // LOG_INFO(LogDev, "NewPlayer->Get(OverriddenBackpackSizeOffset): {}", NewPlayer->Get(OverriddenBackpackSizeOffset)); NewPlayer->Get(OverriddenBackpackSizeOffset) = 5; } diff --git a/Project Reboot 3.0/FortInventory.cpp b/Project Reboot 3.0/FortInventory.cpp index 0824710..f8f1807 100644 --- a/Project Reboot 3.0/FortInventory.cpp +++ b/Project Reboot 3.0/FortInventory.cpp @@ -138,29 +138,32 @@ std::pair, std::vector> AFortInventory::AddI static auto QuickBarsOffset = FortPlayerController->GetOffset("QuickBars", false); auto QuickBars = FortPlayerController->Get(QuickBarsOffset); - enum class EFortQuickBars : uint8_t + if (QuickBars) { - Primary = 0, - Secondary = 1, - Max_None = 2, - EFortQuickBars_MAX = 3 - }; + enum class EFortQuickBars : uint8_t + { + Primary = 0, + Secondary = 1, + Max_None = 2, + EFortQuickBars_MAX = 3 + }; - struct - { - FGuid Item; // (Parm, IsPlainOldData) - EFortQuickBars InQuickBar; // (Parm, ZeroConstructor, IsPlainOldData) - int Slot; // (Parm, ZeroConstructor, IsPlainOldData) + struct + { + FGuid Item; // (Parm, IsPlainOldData) + EFortQuickBars InQuickBar; // (Parm, ZeroConstructor, IsPlainOldData) + int Slot; // (Parm, ZeroConstructor, IsPlainOldData) + } + AFortQuickBars_ServerAddItemInternal_Params + { + NewItemInstance->GetItemEntry()->GetItemGuid(), + IsPrimaryQuickbar(ItemDefinition) ? EFortQuickBars::Primary : EFortQuickBars::Secondary, + -1 + }; + + static auto ServerAddItemInternalFn = FindObject("/Script/FortniteGame.FortQuickBars.ServerAddItemInternal"); + QuickBars->ProcessEvent(ServerAddItemInternalFn, &AFortQuickBars_ServerAddItemInternal_Params); } - AFortQuickBars_ServerAddItemInternal_Params - { - NewItemInstance->GetItemEntry()->GetItemGuid(), - IsPrimaryQuickbar(ItemDefinition) ? EFortQuickBars ::Primary : EFortQuickBars::Secondary, - -1 - }; - - static auto ServerAddItemInternalFn = FindObject("/Script/FortniteGame.FortQuickBars.ServerAddItemInternal"); - QuickBars->ProcessEvent(ServerAddItemInternalFn, &AFortQuickBars_ServerAddItemInternal_Params); } if (bShouldUpdate) diff --git a/Project Reboot 3.0/FortLootPackage.cpp b/Project Reboot 3.0/FortLootPackage.cpp index 4e6d87f..ee30d1e 100644 --- a/Project Reboot 3.0/FortLootPackage.cpp +++ b/Project Reboot 3.0/FortLootPackage.cpp @@ -160,19 +160,10 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs auto GameState = ((AFortGameModeAthena*)GetWorld()->GetGameMode())->GetGameStateAthena(); static auto CurrentPlaylistDataOffset = GameState->GetOffset("CurrentPlaylistData", false); -#define BELUGA - -#ifndef BELUGA - /* static */ std::vector LTDTables; - /* static */ std::vector LPTables; - - /* static */ bool bHasFoundTables = false; -#else static std::vector LTDTables; static std::vector LPTables; static bool bHasFoundTables = false; -#endif auto CurrentPlaylist = CurrentPlaylistDataOffset == -1 && Fortnite_Version < 6 ? nullptr : GameState->GetCurrentPlaylist(); @@ -222,7 +213,6 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs // LTDTables.push_back(LoadObject(L"/Game/Athena/Playlists/Playground/AthenaLootTierData_Client.AthenaLootTierData_Client")); // LPTables.push_back(LoadObject(L"/Game/Athena/Playlists/Playground/AthenaLootPackages_Client.AthenaLootPackages_Client")); -#ifdef BELUGA static auto FortGameFeatureDataClass = FindObject("/Script/FortniteGame.FortGameFeatureData"); if (FortGameFeatureDataClass) @@ -366,7 +356,6 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs } } } -#endif for (int i = 0; i < LTDTables.size(); i++) { @@ -381,6 +370,15 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs } } + if (Engine_Version < 420) // ahhh + { + LTDTables.clear(); + LPTables.clear(); + + LTDTables.push_back(LoadObject(L"/Game/Items/Datatables/AthenaLootTierData_Client.AthenaLootTierData_Client")); + LPTables.push_back(LoadObject(L"/Game/Items/Datatables/AthenaLootPackages_Client.AthenaLootPackages_Client")); + } + std::vector TierGroupLTDs; for (int p = 0; p < LTDTables.size(); p++) @@ -391,7 +389,12 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs // LOG_INFO(LogLoot, "LTD: {}", !LTD->IsValidLowLevel() ? "BadRead" : LTD->GetFullName()); if (!LTD->IsValidLowLevel()) + { + if (bPrint) + LOG_INFO(LogLoot, "BadRead!"); + continue; + } auto& LTDRowMap = LTD->GetRowMap(); auto LTDRowMapNum = LTDRowMap.Pairs.Elements.Num(); diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index f095618..ce415b0 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -37,6 +37,14 @@ bool AFortPlayerController::DoesBuildFree() void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController* PlayerController, FGuid ItemGuid) { + if (Engine_Version <= 420) + { + static auto OverriddenBackpackSizeOffset = PlayerController->GetOffset("OverriddenBackpackSize"); + LOG_INFO(LogDev, "PlayerController->Get(OverriddenBackpackSizeOffset): {}", PlayerController->Get(OverriddenBackpackSizeOffset)); + // PlayerController->Get(OverriddenBackpackSizeOffset) = 5; + // PlayerController->ForceNetUpdate(); + } + auto ItemInstance = PlayerController->GetWorldInventory()->FindItemInstance(ItemGuid); auto Pawn = Cast(PlayerController->GetPawn()); diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index 70f3885..b2407ab 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -68,13 +68,13 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl static auto AcknowledgedPawnOffset = Controller->GetOffset("AcknowledgedPawn"); Controller->Get(AcknowledgedPawnOffset) = Pawn; - if (Globals::bNoMCP) - return; - auto ControllerAsFort = Cast(Controller); auto PawnAsFort = Cast(Pawn); auto PlayerStateAsFort = Cast(Pawn->GetPlayerState()); + if (Globals::bNoMCP) + return; + if (!PawnAsFort) return; @@ -114,4 +114,33 @@ void AFortPlayerControllerAthena::GetPlayerViewPointHook(AFortPlayerControllerAt } return AFortPlayerControllerAthena::GetPlayerViewPointOriginal(PlayerController, Location, Rotation); +} + +void AFortPlayerControllerAthena::ServerReadyToStartMatchHook(AFortPlayerControllerAthena* PlayerController) +{ + LOG_INFO(LogDev, "ServerReadyToStartMatch!"); + + if (Fortnite_Version <= 2.5) // techinally we should do this at the end of OnReadyToStartMatch + { + static auto QuickBarsOffset = PlayerController->GetOffset("QuickBars", false); + + if (QuickBarsOffset != -1) + { + auto& QuickBars = PlayerController->Get(QuickBarsOffset); + + if (QuickBars) + return ServerReadyToStartMatchOriginal(PlayerController); + + static auto FortQuickBarsClass = FindObject("/Script/FortniteGame.FortQuickBars"); + + QuickBars = GetWorld()->SpawnActor(FortQuickBarsClass); + + if (!QuickBars) + return ServerReadyToStartMatchOriginal(PlayerController); + + PlayerController->Get(QuickBarsOffset)->SetOwner(PlayerController); + } + } + + return ServerReadyToStartMatchOriginal(PlayerController); } \ No newline at end of file diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.h b/Project Reboot 3.0/FortPlayerControllerAthena.h index 1bd185d..1e424c5 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.h +++ b/Project Reboot 3.0/FortPlayerControllerAthena.h @@ -57,6 +57,7 @@ class AFortPlayerControllerAthena : public AFortPlayerController { public: static inline void (*GetPlayerViewPointOriginal)(AFortPlayerControllerAthena* PlayerController, FVector& Location, FRotator& Rotation); + static inline void (*ServerReadyToStartMatchOriginal)(AFortPlayerControllerAthena* PlayerController); AFortPlayerStateAthena* GetPlayerStateAthena() { @@ -75,6 +76,7 @@ public: static void ServerAcknowledgePossessionHook(APlayerController* Controller, APawn* Pawn); static void ServerPlaySquadQuickChatMessage(AFortPlayerControllerAthena* PlayerController, __int64 ChatEntry, __int64 SenderID); static void GetPlayerViewPointHook(AFortPlayerControllerAthena* PlayerController, FVector& Location, FRotator& Rotation); + static void ServerReadyToStartMatchHook(AFortPlayerControllerAthena* PlayerController); static UClass* StaticClass() { diff --git a/Project Reboot 3.0/FortWorldItemDefinition.h b/Project Reboot 3.0/FortWorldItemDefinition.h index ae7bfbe..7859f18 100644 --- a/Project Reboot 3.0/FortWorldItemDefinition.h +++ b/Project Reboot 3.0/FortWorldItemDefinition.h @@ -21,7 +21,11 @@ public: bool ShouldPersistWhenFinalStackEmpty() { - static auto bPersistInInventoryWhenFinalStackEmptyOffset = GetOffset("bPersistInInventoryWhenFinalStackEmpty"); + static auto bPersistInInventoryWhenFinalStackEmptyOffset = GetOffset("bPersistInInventoryWhenFinalStackEmpty", false); + + if (bPersistInInventoryWhenFinalStackEmptyOffset == -1) + return false; + static auto bPersistInInventoryWhenFinalStackEmptyFieldMask = GetFieldMask(GetProperty("bPersistInInventoryWhenFinalStackEmpty")); return ReadBitfieldValue(bPersistInInventoryWhenFinalStackEmptyOffset, bPersistInInventoryWhenFinalStackEmptyFieldMask); } diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index f6b97f9..b4caae4 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -77,11 +77,10 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll auto CosmeticLoadoutPickaxe = CosmeticLoadout ? CosmeticLoadout->GetPickaxe() : nullptr; static auto WeaponDefinitionOffset = FindOffsetStruct("/Script/FortniteGame.AthenaPickaxeItemDefinition", "WeaponDefinition"); - auto Pickaxe = CosmeticLoadoutPickaxe ? CosmeticLoadoutPickaxe->Get(WeaponDefinitionOffset) + auto PickaxeDefinition = CosmeticLoadoutPickaxe ? CosmeticLoadoutPickaxe->Get(WeaponDefinitionOffset) : FindObject(L"/Game/Athena/Items/Weapons/WID_Harvest_Pickaxe_Athena_C_T01.WID_Harvest_Pickaxe_Athena_C_T01"); static UFortItemDefinition* EditToolItemDefinition = FindObject(L"/Game/Items/Weapons/BuildingTools/EditTool.EditTool"); - static UFortItemDefinition* PickaxeDefinition = Pickaxe; static UFortItemDefinition* BuildingItemData_Wall = FindObject(L"/Game/Items/Weapons/BuildingTools/BuildingItemData_Wall.BuildingItemData_Wall"); static UFortItemDefinition* BuildingItemData_Floor = FindObject(L"/Game/Items/Weapons/BuildingTools/BuildingItemData_Floor.BuildingItemData_Floor"); static UFortItemDefinition* BuildingItemData_Stair_W = FindObject(L"/Game/Items/Weapons/BuildingTools/BuildingItemData_Stair_W.BuildingItemData_Stair_W"); diff --git a/Project Reboot 3.0/NetDriver.cpp b/Project Reboot 3.0/NetDriver.cpp index adb165c..523c39a 100644 --- a/Project Reboot 3.0/NetDriver.cpp +++ b/Project Reboot 3.0/NetDriver.cpp @@ -39,6 +39,7 @@ int32 ServerReplicateActors_PrepConnections(UNetDriver* NetDriver) // checkSlow(Connection->GetUChildConnection() == NULL); AActor* OwningActor = Connection->GetOwningActor(); + if (OwningActor != NULL) // && /* Connection->State == USOCK_Open && */ (Connection->Driver->Time - Connection->LastReceiveTime < 1.5f)) { // check(World == OwningActor->GetWorld()); @@ -46,7 +47,19 @@ int32 ServerReplicateActors_PrepConnections(UNetDriver* NetDriver) bFoundReadyConnection = true; // the view target is what the player controller is looking at OR the owning actor itself when using beacons - Connection->GetViewTarget() = Connection->GetPlayerController() ? Connection->GetPlayerController()->GetViewTarget() : OwningActor; + // Connection->GetViewTarget() = Connection->GetPlayerController() ? Connection->GetPlayerController()->GetViewTarget() : OwningActor; + + AActor* DesiredViewTarget = OwningActor; + + if (Connection->GetPlayerController()) + { + if (AActor* ViewTarget = Connection->GetPlayerController()->GetViewTarget()) + { + DesiredViewTarget = ViewTarget; + } + } + + Connection->GetViewTarget() = DesiredViewTarget; } else { @@ -239,7 +252,7 @@ int32 UNetDriver::ServerReplicateActors() { int32 Updated = 0; - ++*(int*)(this + Offsets::ReplicationFrame); + ++(*(int*)(__int64(this) + Offsets::ReplicationFrame)); const int32 NumClientsToTick = ServerReplicateActors_PrepConnections(this); @@ -298,24 +311,27 @@ int32 UNetDriver::ServerReplicateActors() auto Channel = FindChannel(Actor, Connection); - static void (*ActorChannelClose)(UActorChannel*) = decltype(ActorChannelClose)(Addresses::ActorChannelClose); - - std::vector ConnectionViewers; - ConnectionViewers.push_back(ConstructNetViewer(Connection)); - - if (!Actor->IsAlwaysRelevant() && !Actor->UsesOwnerRelevancy() && !Actor->IsOnlyRelevantToOwner()) + if (Addresses::ActorChannelClose && Offsets::IsNetRelevantFor) { - if (Connection && Connection->GetViewTarget()) + static void (*ActorChannelClose)(UActorChannel*) = decltype(ActorChannelClose)(Addresses::ActorChannelClose); + + std::vector ConnectionViewers; + ConnectionViewers.push_back(ConstructNetViewer(Connection)); + + if (!Actor->IsAlwaysRelevant() && !Actor->UsesOwnerRelevancy() && !Actor->IsOnlyRelevantToOwner()) { - auto Viewer = Connection->GetViewTarget(); - auto Loc = Viewer->GetActorLocation(); - - if (!IsActorRelevantToConnection(Actor, ConnectionViewers)) + if (Connection && Connection->GetViewTarget()) { - if (Channel) - ActorChannelClose(Channel); + auto Viewer = Connection->GetViewTarget(); + auto Loc = Viewer->GetActorLocation(); - continue; + if (!IsActorRelevantToConnection(Actor, ConnectionViewers)) + { + if (Channel) + ActorChannelClose(Channel); + + continue; + } } } } @@ -326,7 +342,7 @@ int32 UNetDriver::ServerReplicateActors() if (!Channel) { - if (Actor->IsA(APlayerController::StaticClass()) && Actor != Connection->GetPlayerController()) // isnetreelvantfor should handle this iirc + if (Actor->IsA(APlayerController::StaticClass()) && Actor != Connection->GetPlayerController()) // isnetrelevantfor should handle this iirc continue; Channel = (UActorChannel*)CreateChannel(Connection, 2, true, -1); diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index 624b105..a25b6a2 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -45,7 +45,6 @@ void Addresses::SetupVersion() std::string FNVer = FullVersion; std::string EngineVer = FullVersion; std::string CLStr; - int CL = 0; if (!FullVersion.contains("Live") && !FullVersion.contains(("Next")) && !FullVersion.contains(("Cert"))) { @@ -82,14 +81,23 @@ void Addresses::SetupVersion() // Engine_Version = FullVersion.contains(("Next")) ? 419 : 416; CLStr = FullVersion.substr(FullVersion.find_first_of('-') + 1); CLStr = CLStr.substr(0, CLStr.find_first_of('+')); - CL = std::stoi(CLStr); - Engine_Version = CL <= 3775276 ? 416 : 419; // std::stoi(FullVersion.substr(0, FullVersion.find_first_of('-'))); + Fortnite_CL = std::stoi(CLStr); + Engine_Version = Fortnite_CL <= 3775276 ? 416 : 419; // std::stoi(FullVersion.substr(0, FullVersion.find_first_of('-'))); Fortnite_Version = FullVersion.contains(("Next")) ? 2.4 : 1.8; } // Fortnite_Season = std::floor(Fortnite_Version); FFastArraySerializer::bNewSerializer = Fortnite_Version >= 8.30; + + if (Fortnite_CL == 3807424) + Fortnite_Version = 1.11; + if (Fortnite_CL == 3700114) + Fortnite_Version = 1.72; + if (Fortnite_CL == 3724489) + Fortnite_Version = 1.8; + if (Fortnite_CL == 3870737) + Fortnite_Version = 2.42; } void Addresses::FindAll() @@ -323,12 +331,14 @@ void Offsets::FindAll() else if (std::floor(Fortnite_Version) >= 21) Offsets::ServerReplicateActors = 0x67; // checked onb 22.30 - if (Engine_Version == 416) + if (Engine_Version == 416) // checked on 1.7.2 & 1.8 Offsets::ReplicationFrame = 0x288; - else if (Engine_Version == 419) + if (Fortnite_Version == 2.42) Offsets::ReplicationFrame = 0xB2; - else if (Fortnite_Version == 2.5) + if (Fortnite_Version == 2.5) Offsets::ReplicationFrame = 0xCA; + if (Fortnite_Version == 1.11) + Offsets::ReplicationFrame = 0x2C8; Offsets::IsNetRelevantFor = FindIsNetRelevantForOffset(); } @@ -377,6 +387,11 @@ std::vector Addresses::GetFunctionsToNull() { std::vector toNull; + if (Fortnite_Version == 1.11) + { + 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 diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index e69752a..7b8a7bf 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -89,6 +89,7 @@ DWORD WINAPI Main(LPVOID) Addresses::Init(); Addresses::Print(); + LOG_INFO(LogDev, "Fortnite_CL: {}", Fortnite_CL); LOG_INFO(LogDev, "Version: {}", Fortnite_Version); static auto GameModeDefault = FindObject(L"/Script/FortniteGame.Default__FortGameModeAthena"); @@ -288,6 +289,8 @@ DWORD WINAPI Main(LPVOID) AFortPlayerController::ServerEditBuildingActorHook, (PVOID*)&AFortPlayerController::ServerEditBuildingActorOriginal, false, true); Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerController.ServerEndEditingBuildingActor"), AFortPlayerController::ServerEndEditingBuildingActorHook, nullptr, false); + Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerController.ServerReadyToStartMatch"), + AFortPlayerControllerAthena::ServerReadyToStartMatchHook, (PVOID*)&AFortPlayerControllerAthena::ServerReadyToStartMatchOriginal, false); Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerControllerAthena.ServerGiveCreativeItem"), AFortPlayerControllerAthena::ServerGiveCreativeItemHook, nullptr, true); Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerControllerAthena.ServerPlaySquadQuickChatMessage"), diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 20b9e56..11ef8f9 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -79,6 +79,9 @@ static inline uint64 FindStaticFindObject(int StringSkip = 1) if (Engine_Version == 416) return Memcury::Scanner::FindPattern("4C 8B DC 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 49 89 6B F0 49 89 73 E8").Get(); + if (Engine_Version == 419) + return Memcury::Scanner::FindPattern("4C 8B DC 49 89 5B 08 49 89 6B 18 49 89 73 20 57 41 56 41 57 48 83 EC 60 80 3D").Get(); + auto Addr = Memcury::Scanner::FindStringRef(L"Illegal call to StaticFindObject() while serializing object data!", true, StringSkip, Engine_Version >= 427); auto Final = FindBytes(Addr, { 0x48, 0x89, 0x5C }, 255, 0, true, 0, false); // Addr.ScanFor(bytes, false).Get(); @@ -208,7 +211,14 @@ static inline uint64 FindPauseBeaconRequests() return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72 2C 48 8B 05 ? ? ? ? 4C 8D 44").Get(); if (Engine_Version == 419) - return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72").Get(); // i supposed this is just because its getitng wrong string ref + { + auto aa = Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 6F 80 3D", false).Get(); + + if (!aa) + return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72").Get(); // i supposed this is just because its getitng wrong string ref + + return aa; + } if (Engine_Version == 416) return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 6F 80 3D ? ? ? ? ? 72 33 48 8B 05").Get(); @@ -337,8 +347,10 @@ static inline uint64 FindGetPlayerViewpoint() static inline uint64 FindIsNetRelevantForOffset() { - if (Engine_Version == 416) - return 648 / 8; + if (Engine_Version == 416) // checked on 1.7.2 & 1.8 + return 0x420 / 8; + if (Fortnite_Version == 1.11 || Fortnite_Version == 2.42 || Fortnite_Version == 2.5) + return 0x418 / 8; return 0; } @@ -917,6 +929,12 @@ static inline uint64 FindGIsClient() { // if (Fortnite_Version == 2.5) // return __int64(GetModuleHandleW(0)) + 0x46AD734; + if (Fortnite_Version == 1.72) + return __int64(GetModuleHandleW(0)) + 0x6536B65; + if (Fortnite_Version == 1.8) + return __int64(GetModuleHandleW(0)) + 0x66637E5; + if (Fortnite_Version == 1.11) + return __int64(GetModuleHandleW(0)) + 0x5BAA38F; if (Fortnite_Version == 4.1) return __int64(GetModuleHandleW(0)) + 0x4BF6F17; if (Fortnite_Version == 11.31) @@ -1139,6 +1157,8 @@ static inline uint64 FindGiveAbility() { if (Engine_Version == 416) return Memcury::Scanner::FindPattern("48 89 5C 24 ? 56 57 41 56 48 83 EC 20 83 B9").Get(); + if (Fortnite_Version == 1.11) + return Memcury::Scanner::FindPattern("48 89 5C 24 ? 56 57 41 56 48 83 EC 20 83 B9 ? ? ? ? ? 49 8B F0").Get(); if (Engine_Version == 420) return Memcury::Scanner::FindPattern("48 89 5C 24 ? 56 57 41 56 48 83 EC 20 83 B9 ? ? ? ? ? 49 8B F0 4C 8B F2 48 8B D9 7E 61").Get(); if (Engine_Version == 421) @@ -1223,7 +1243,14 @@ static inline uint64 FindSetChannelActor() if (Engine_Version == 416) return Memcury::Scanner::FindPattern("4C 8B DC 55 53 57 41 54 49 8D AB ? ? ? ? 48 81 EC ? ? ? ? 45 33").Get(); if (Engine_Version >= 419 && Fortnite_Version <= 2.5) - return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 E8 48 8B D9").Get(); + { + auto aa = Memcury::Scanner::FindPattern("48 8B C4 55 53 57 41 54 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 45 33 E4 48 89 70", false).Get(); + + if (!aa) + return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 E8 48 8B D9").Get(); + + return aa; + } return 0; } diff --git a/Project Reboot 3.0/inc.h b/Project Reboot 3.0/inc.h index b6ea0b2..63880ea 100644 --- a/Project Reboot 3.0/inc.h +++ b/Project Reboot 3.0/inc.h @@ -14,6 +14,7 @@ typedef unsigned __int64 uint64; extern inline int Engine_Version = 0; // For example, 420, 421, etc. // Prevent using this when possible. extern inline double Fortnite_Version = 0; // For example, 4.1, 6.21, etc. // Prevent using this when possible. +extern inline int Fortnite_CL = 0; #define MS_ALIGN(n) __declspec(align(n)) #define FORCENOINLINE __declspec(noinline)