diff --git a/Project Reboot 3.0/Class.cpp b/Project Reboot 3.0/Class.cpp index 47b738a..c2dfa29 100644 --- a/Project Reboot 3.0/Class.cpp +++ b/Project Reboot 3.0/Class.cpp @@ -7,6 +7,14 @@ UObject* UClass::CreateDefaultObject() { static std::unordered_map defaultAbilities; // normal class name, default ability. + static int LastNum1 = 151; + + if (LastNum1 != Globals::AmountOfListens) + { + LastNum1 = Globals::AmountOfListens; + defaultAbilities.clear(); + } + auto name = this->GetFullName(); if (name.contains("Default__")) diff --git a/Project Reboot 3.0/FortAthenaSupplyDrop.cpp b/Project Reboot 3.0/FortAthenaSupplyDrop.cpp index b49d688..fdc5e4f 100644 --- a/Project Reboot 3.0/FortAthenaSupplyDrop.cpp +++ b/Project Reboot 3.0/FortAthenaSupplyDrop.cpp @@ -27,6 +27,8 @@ AFortPickup* AFortAthenaSupplyDrop::SpawnGameModePickupHook(UObject* Context, FF if (!ItemDefinition || !PickupClass) return nullptr; + LOG_INFO(LogDev, "Spawning GameModePickup with ItemDefinition: {}", ItemDefinition->GetFullName()); + *Ret = AFortPickup::SpawnPickup(ItemDefinition, Position, NumberToSpawn, EFortPickupSourceTypeFlag::Other, EFortPickupSpawnSource::SupplyDrop, -1, TriggeringPawn, PickupClass); return *Ret; } diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index be5038a..8c91e0a 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -722,6 +722,8 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint static int NextTeamIndex = DefaultFirstTeam; + LOG_INFO(LogTeams, "Before team assigning NextTeamIndex: {} CurrentTeamMembers: {}", NextTeamIndex, CurrentTeamMembers); + if (!bShouldSpreadTeams) { if (CurrentTeamMembers >= MaxSquadSize) @@ -738,7 +740,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint if (CurrentTeamMembers >= 1) // We spread every player. { - if (Idx > TeamsNum) + if (Idx >= TeamsNum) NextTeamIndex = DefaultFirstTeam; else NextTeamIndex++; @@ -747,7 +749,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint } } - LOG_INFO(LogTeams, "Spreading Teams {} Player is going on team {} with {} members.", bShouldSpreadTeams, NextTeamIndex, CurrentTeamMembers); + LOG_INFO(LogTeams, "Spreading Teams {} [{}] Player is going on team {} with {} members.", bShouldSpreadTeams, TeamsNum, NextTeamIndex, CurrentTeamMembers); CurrentTeamMembers++; diff --git a/Project Reboot 3.0/FortGameModePickup.h b/Project Reboot 3.0/FortGameModePickup.h new file mode 100644 index 0000000..f8db792 --- /dev/null +++ b/Project Reboot 3.0/FortGameModePickup.h @@ -0,0 +1,13 @@ +#pragma once + +#include "FortPickup.h" + +class AFortGameModePickup : public AFortPickup//Athena +{ +public: + static UClass* StaticClass() + { + static auto Class = FindObject("/Script/FortniteGame.FortGameModePickup"); + return Class; + } +}; \ No newline at end of file diff --git a/Project Reboot 3.0/FortInventory.cpp b/Project Reboot 3.0/FortInventory.cpp index e560853..7704ded 100644 --- a/Project Reboot 3.0/FortInventory.cpp +++ b/Project Reboot 3.0/FortInventory.cpp @@ -192,6 +192,7 @@ std::pair, std::vector> AFortInventory::AddI if (WorldItemDefinition->ShouldFocusWhenAdded()) // Should we also do this for stacking? { + LOG_INFO(LogDev, "Force focus {}", ItemDefinition->GetFullName()); FortPlayerController->ServerExecuteInventoryItemHook(FortPlayerController, NewItemInstance->GetItemEntry()->GetItemGuid()); } } diff --git a/Project Reboot 3.0/FortPickup.cpp b/Project Reboot 3.0/FortPickup.cpp index ba63975..855a27e 100644 --- a/Project Reboot 3.0/FortPickup.cpp +++ b/Project Reboot 3.0/FortPickup.cpp @@ -4,6 +4,7 @@ #include "FortItemDefinition.h" #include "FortPlayerState.h" #include "FortPlayerPawn.h" +#include "FortGameModePickup.h" #include "FortPlayerController.h" #include @@ -34,32 +35,33 @@ AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Locatio static auto PawnWhoDroppedPickupOffset = Pickup->GetOffset("PawnWhoDroppedPickup"); Pickup->Get(PawnWhoDroppedPickupOffset) = Pawn; - /* static auto SpecialActorIDOffset = Pickup->GetOffset("SpecialActorID"); - - if (auto WorldItemDefinition = Cast(ItemDef)) - { - static auto PickupSpecialActorUniqueIDOffset = WorldItemDefinition->GetOffset("PickupSpecialActorUniqueID"); - auto& PickupSpecialActorUniqueID = WorldItemDefinition->Get(PickupSpecialActorUniqueIDOffset); - Pickup->Get(SpecialActorIDOffset) = PickupSpecialActorUniqueID; - } */ - auto PrimaryPickupItemEntry = Pickup->GetPrimaryPickupItemEntry(); - auto OldGuid = PrimaryPickupItemEntry->GetItemGuid(); - - if (false) + if (Addresses::PickupInitialize) { - CopyStruct(PrimaryPickupItemEntry, ItemEntry, FFortItemEntry::GetStructSize(), FFortItemEntry::GetStruct()); + static void (*SetupPickup)(AFortPickup * Pickup, __int64 ItemEntry, TArray<__int64> MultiItemPickupEntriesIGuess, bool bSplitOnPickup) + = decltype(SetupPickup)(Addresses::PickupInitialize); // Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 41 56 48 83 EC 20 80 B9 ? ? ? ? ? 45 0F B6 F1 49 8B E8").Get()); + TArray<__int64> MultiItemPickupEntriesIGuess{}; + SetupPickup(Pickup, __int64(ItemEntry), MultiItemPickupEntriesIGuess, false); } else { - PrimaryPickupItemEntry->GetItemDefinition() = ItemEntry->GetItemDefinition(); - PrimaryPickupItemEntry->GetLoadedAmmo() = ItemEntry->GetLoadedAmmo(); + auto OldGuid = PrimaryPickupItemEntry->GetItemGuid(); + + if (false) + { + CopyStruct(PrimaryPickupItemEntry, ItemEntry, FFortItemEntry::GetStructSize(), FFortItemEntry::GetStruct()); + } + else + { + PrimaryPickupItemEntry->GetItemDefinition() = ItemEntry->GetItemDefinition(); + PrimaryPickupItemEntry->GetLoadedAmmo() = ItemEntry->GetLoadedAmmo(); + } } PrimaryPickupItemEntry->GetCount() = OverrideCount == -1 ? ItemEntry->GetCount() : OverrideCount; - PrimaryPickupItemEntry->GetItemGuid() = OldGuid; + // PrimaryPickupItemEntry->GetItemGuid() = OldGuid; // Pickup->OnRep_PrimaryPickupItemEntry(); @@ -133,6 +135,12 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup) if (!PickupItemDefinition) return CompletePickupAnimationOriginal(Pickup); + if (auto GameModePickup = Cast(Pickup)) + { + LOG_INFO(LogDev, "GameModePickup!"); + return CompletePickupAnimationOriginal(Pickup); + } + auto& ItemInstances = WorldInventory->GetItemList().GetItemInstances(); auto& CurrentItemGuid = Pickup->GetPickupLocationData()->GetPickupGuid(); // Pawn->CurrentWeapon->ItemEntryGuid; diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index a712f23..917cdd1 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -20,13 +20,22 @@ void AFortPlayerControllerAthena::StartGhostModeHook(UObject* Context, FFrame* S Stack->StepCompiledIn(&ItemProvidingGhostMode); if (!ItemProvidingGhostMode) + { + LOG_INFO(LogDev, "Null item!"); return StartGhostModeOriginal(Context, Stack, Ret); + } - // if (!Controller->HasAuthority) return StartGhostModeOriginal(Context, Stack, Ret); + // if (!Controller->HasAuthority()) return StartGhostModeOriginal(Context, Stack, Ret); + + LOG_INFO(LogDev, "Attempting to give item {}", ItemProvidingGhostMode->IsValidLowLevel() ? ItemProvidingGhostMode->GetFullName() : "BadRead"); auto GhostModeRepData = Controller->GetGhostModeRepData(); - if (GhostModeRepData->IsInGhostMode()) return StartGhostModeOriginal(Context, Stack, Ret); + if (GhostModeRepData->IsInGhostMode()) + { + LOG_INFO(LogDev, "Player is already in ghost mode!"); + return StartGhostModeOriginal(Context, Stack, Ret); + } auto WorldInventory = Controller->GetWorldInventory(); @@ -44,6 +53,7 @@ void AFortPlayerControllerAthena::StartGhostModeHook(UObject* Context, FFrame* S WorldInventory->Update(); Controller->ServerExecuteInventoryItemHook(Controller, GhostModeItemInstance->GetItemEntry()->GetItemGuid()); + LOG_INFO(LogDev, "Finished!"); return StartGhostModeOriginal(Context, Stack, Ret); } diff --git a/Project Reboot 3.0/FortPlaylist.h b/Project Reboot 3.0/FortPlaylist.h index 2901fb2..f7016b3 100644 --- a/Project Reboot 3.0/FortPlaylist.h +++ b/Project Reboot 3.0/FortPlaylist.h @@ -203,7 +203,7 @@ public: auto& CurrentAbilitySetSoft = CurrentAbilitySets.at(j); auto CurrentAbilitySet = CurrentAbilitySetSoft.Get(UFortAbilitySet::StaticClass(), true); - if (!CurrentAbilitySet) + if (!CurrentAbilitySet->IsValidLowLevel()) continue; CurrentAbilitySet->GiveToAbilitySystem(AbilitySystemComponent); diff --git a/Project Reboot 3.0/PlayerState.h b/Project Reboot 3.0/PlayerState.h index 4648b51..349d5b6 100644 --- a/Project Reboot 3.0/PlayerState.h +++ b/Project Reboot 3.0/PlayerState.h @@ -5,5 +5,5 @@ class APlayerState : public AActor { public: - int& GetPlayerID(); + int& GetPlayerID(); // for future me to deal with (this is a short on some versions). }; \ No newline at end of file diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj b/Project Reboot 3.0/Project Reboot 3.0.vcxproj index 5c52850..2e57785 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -315,6 +315,7 @@ + diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters index 7f3b257..44f6e4f 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -803,6 +803,9 @@ Engine\Source\Runtime\Core\Public\Templates + + FortniteGame\Source\FortniteGame\Public\Items + diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index f75c1fb..b411376 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -268,6 +268,9 @@ void Addresses::FindAll() LOG_INFO(LogDev, "Finding SetTimer"); Addresses::SetTimer = FindSetTimer(); + LOG_INFO(LogDev, "Finding PickupInitialize"); + Addresses::PickupInitialize = FindPickupInitialize(); + LOG_INFO(LogDev, "Finished finding!"); } @@ -329,6 +332,7 @@ void Addresses::Print() LOG_INFO(LogDev, "ApplyCharacterCustomization: 0x{:x}", ApplyCharacterCustomization - Base); LOG_INFO(LogDev, "EnterAircraft: 0x{:x}", EnterAircraft - Base); LOG_INFO(LogDev, "SetTimer: 0x{:x}", SetTimer - Base); + LOG_INFO(LogDev, "PickupInitialize: 0x{:x}", PickupInitialize - Base); } void Offsets::FindAll() diff --git a/Project Reboot 3.0/addresses.h b/Project Reboot 3.0/addresses.h index eab627f..720bf65 100644 --- a/Project Reboot 3.0/addresses.h +++ b/Project Reboot 3.0/addresses.h @@ -62,6 +62,7 @@ namespace Addresses extern inline uint64 GetInterfaceAddress = 0; extern inline uint64 EnterAircraft = 0; extern inline uint64 SetTimer = 0; + extern inline uint64 PickupInitialize = 0; void SetupVersion(); // Finds Engine Version void FindAll(); diff --git a/Project Reboot 3.0/commands.h b/Project Reboot 3.0/commands.h index 4e99036..5afb338 100644 --- a/Project Reboot 3.0/commands.h +++ b/Project Reboot 3.0/commands.h @@ -497,6 +497,18 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) LoopMutators(SpawnBigWall); } + else if (Command == "printpawn") + { + auto Pawn = Cast(ReceivingController->GetPawn()); + + if (!Pawn) + { + SendMessageToConsole(PlayerController, L"No pawn to print!"); + return; + } + + LOG_INFO(LogDev, "Pawn: 0x{:x}", __int64(Pawn)); + } else { bSendHelpMessage = true; }; } else { bSendHelpMessage = true; }; diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index b70ec24..d5f9a4f 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -142,6 +142,16 @@ static inline uint64 FindObjectArray() return addr; } +static inline uint64 FindPickupInitialize() +{ + if (Engine_Version == 423) + { + return Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 41 56 41 57 48 83 EC 30 80 B9 ? ? ? ? ? 45 0F B6 F1 4D").Get(); + } + + return 0; +} + static inline uint64 FindCreateNetDriver() { return 0; diff --git a/Project Reboot 3.0/globals.h b/Project Reboot 3.0/globals.h index 8c427fc..aa31b2a 100644 --- a/Project Reboot 3.0/globals.h +++ b/Project Reboot 3.0/globals.h @@ -33,4 +33,5 @@ extern inline std::string PlaylistName = // "/Game/Athena/Playlists/Fill/Playlist_Fill_Solo.Playlist_Fill_Solo"; // "/Game/Athena/Playlists/Low/Playlist_Low_Solo.Playlist_Low_Solo"; // "/Game/Athena/Playlists/Bling/Playlist_Bling_Solo.Playlist_Bling_Solo"; -// "/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2"; \ No newline at end of file +// "/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2"; +// "/Game/Athena/Playlists/Ashton/Playlist_Ashton_Sm.Playlist_Ashton_Sm"; \ No newline at end of file diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 75538af..278d2b6 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -810,7 +810,7 @@ void MainUI() { static std::string ClassNameToDump; - ImGui::InputText("Class Name to get VFT", &ClassNameToDump); + ImGui::InputText("Class Name to mess with", &ClassNameToDump); if (ImGui::Button("Print Class VFT")) { @@ -827,6 +827,17 @@ void MainUI() } } + /* if (ImGui::Button("Load BGA Class (and spawn so no GC)")) + { + static auto BGAClass = FindObject("/Script/Engine.BlueprintGeneratedClass"); + auto Class = LoadObject(ClassNameToDump, BGAClass); + + if (Class) + { + GetWorld()->SpawnActor(Class, FVector()); + } + } */ + /* ImGui::Text(std::format("Amount of hooks {}", AllFunctionHooks.size()).c_str());