diff --git a/Project Reboot 3.0/EnvQuery.h b/Project Reboot 3.0/EnvQuery.h new file mode 100644 index 0000000..cce6e3f --- /dev/null +++ b/Project Reboot 3.0/EnvQuery.h @@ -0,0 +1,8 @@ +#pragma once + +#include "Object.h" + +class UEnvQuery : public UObject // UDataAsset +{ +public: +}; \ No newline at end of file diff --git a/Project Reboot 3.0/EnvQueryTypes.h b/Project Reboot 3.0/EnvQueryTypes.h new file mode 100644 index 0000000..65972d1 --- /dev/null +++ b/Project Reboot 3.0/EnvQueryTypes.h @@ -0,0 +1,18 @@ +#pragma once + +#include "NameTypes.h" + +enum class EAIParamType : uint8 +{ + Float, + Int, + Bool + // MAX UMETA(Hidden) +}; + +struct FEnvNamedValue // i dont thin kthis ever changes +{ + FName ParamName; + EAIParamType ParamType; + float Value; +}; \ No newline at end of file diff --git a/Project Reboot 3.0/FortAIEncounterInfo.h b/Project Reboot 3.0/FortAIEncounterInfo.h new file mode 100644 index 0000000..f304569 --- /dev/null +++ b/Project Reboot 3.0/FortAIEncounterInfo.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Actor.h" +#include "EnvQuery.h" +#include "reboot.h" +#include "EnvQueryTypes.h" + +struct FEncounterEnvironmentQueryInfo // idk what file this actually goes in or if this struct ever actaully changes +{ + static UStruct* GetStruct() + { + static auto Struct = FindObject(L"/Script/FortniteGame.EncounterEnvironmentQueryInfo"); + return Struct; + } + + static int GetPropertiesSize() { return GetStruct()->GetPropertiesSize(); } + + UEnvQuery*& GetEnvironmentQuery() + { + static auto EnvironmentQueryOffset = FindOffsetStruct("/Script/FortniteGame.EncounterEnvironmentQueryInfo", "EnvironmentQuery"); + return *(UEnvQuery**)(__int64(this) + EnvironmentQueryOffset); + } + + TArray& GetQueryParams() + { + static auto QueryParamsOffset = FindOffsetStruct("/Script/FortniteGame.EncounterEnvironmentQueryInfo", "QueryParams"); + return *(TArray*)(__int64(this) + QueryParamsOffset); + } + + bool& IsDirectional() + { + static auto bIsDirectionalOffset = FindOffsetStruct("/Script/FortniteGame.EncounterEnvironmentQueryInfo", "bIsDirectional"); + return *(bool*)(__int64(this) + bIsDirectionalOffset); + } +}; + +class UFortAIEncounterInfo : public UObject +{ +public: +}; \ No newline at end of file diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index fc705e6..688f283 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -208,6 +208,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game LOG_INFO(LogDev, "Presetup!"); + SetupAIGoalManager(); + SetupAIDirector(); + SetupServerBotManager(); + // SetupNavConfig(UKismetStringLibrary::Conv_StringToName(L"MANG")); + static auto WarmupRequiredPlayerCountOffset = GameMode->GetOffset("WarmupRequiredPlayerCount"); GameMode->Get(WarmupRequiredPlayerCountOffset) = 1; @@ -332,7 +337,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (AdditionalLevelsServerOnlyOffset != -1) { - TArray>& AdditionalLevelsServerOnly = CurrentPlaylist->Get>>(AdditionalLevelsServerOnlyOffset); + /* TArray>& AdditionalLevelsServerOnly = CurrentPlaylist->Get>>(AdditionalLevelsServerOnlyOffset); LOG_INFO(LogPlaylist, "Loading {} playlist server levels.", AdditionalLevelsServerOnly.Num()); for (int i = 0; i < AdditionalLevelsServerOnly.Num(); i++) @@ -343,7 +348,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game auto LevelNameWStr = std::wstring(LevelNameStr.begin(), LevelNameStr.end()); GameState->AddToAdditionalPlaylistLevelsStreamed(LevelFName, true); - } + } */ } LOG_INFO(LogPlaylist, "Loading {} playlist levels.", AdditionalLevels.Num()); @@ -450,10 +455,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game static auto bWorldIsReadyOffset = GameMode->GetOffset("bWorldIsReady"); SetBitfield(GameMode->GetPtr(bWorldIsReadyOffset), 1, true); // idk when we actually set this (probably after we listen) - SetupAIDirector(); - SetupServerBotManager(); - // SetupNavConfig(UKismetStringLibrary::Conv_StringToName(L"MANG")); - // Calendar::SetSnow(1000); Globals::bInitializedPlaylist = true; diff --git a/Project Reboot 3.0/FortGameStateAthena.cpp b/Project Reboot 3.0/FortGameStateAthena.cpp index 8456a1e..20bc112 100644 --- a/Project Reboot 3.0/FortGameStateAthena.cpp +++ b/Project Reboot 3.0/FortGameStateAthena.cpp @@ -5,6 +5,7 @@ #include "FortGameModeAthena.h" #include "FortAthenaMutator.h" #include "gui.h" +#include "LevelStreamingDynamic.h" /* void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState) { @@ -274,6 +275,12 @@ TeamsArrayContainer* AFortGameStateAthena::GetTeamsArrayContainer() void AFortGameStateAthena::AddToAdditionalPlaylistLevelsStreamed(const FName& Name, bool bServerOnly) { + auto NameStr = Name.ToString(); + auto NameWStr = std::wstring(NameStr.begin(), NameStr.end()); + + StreamLevel(Name.ToString()); // skunke bozo (I didn't test the next code too much soo) + /* ULevelStreamingDynamic::LoadLevelInstance(GetWorld(), NameWStr.c_str(), FVector(), FRotator()); + static auto AdditionalPlaylistLevelsStreamedOffset = this->GetOffset("AdditionalPlaylistLevelsStreamed", false); if (!FAdditionalLevelStreamed::GetStruct()) @@ -289,7 +296,7 @@ void AFortGameStateAthena::AddToAdditionalPlaylistLevelsStreamed(const FName& Na NewLevelStreamed->IsServerOnly() = bServerOnly; AdditionalPlaylistLevelsStreamed.AddPtr(NewLevelStreamed, FAdditionalLevelStreamed::GetStructSize()); - } + } */ } UClass* AFortGameStateAthena::StaticClass() diff --git a/Project Reboot 3.0/FortKismetLibrary.cpp b/Project Reboot 3.0/FortKismetLibrary.cpp index 57603b3..8a1bcad 100644 --- a/Project Reboot 3.0/FortKismetLibrary.cpp +++ b/Project Reboot 3.0/FortKismetLibrary.cpp @@ -3,6 +3,7 @@ #include "FortPickup.h" #include "FortLootPackage.h" #include "AbilitySystemComponent.h" +#include "FortGameModeAthena.h" UFortResourceItemDefinition* UFortKismetLibrary::K2_GetResourceItemDefinition(EFortResourceType ResourceType) { @@ -524,6 +525,32 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook(UObject* Con return *Ret; } +UObject* UFortKismetLibrary::GetAIDirectorHook(UObject* Context, FFrame& Stack, UObject** Ret) +{ + auto GameMode = Cast(GetWorld()->GetGameMode()); + static auto AIDirectorOffset = GameMode->GetOffset("AIDirector"); + + auto AIDirector = GameMode->Get(AIDirectorOffset); + + GetAIDirectorOriginal(Context, Stack, Ret); + + *Ret = AIDirector; + return *Ret; +} + +UObject* UFortKismetLibrary::GetAIGoalManagerHook(UObject* Context, FFrame& Stack, UObject** Ret) +{ + auto GameMode = Cast(GetWorld()->GetGameMode()); + static auto AIGoalManagerOffset = GameMode->GetOffset("AIGoalManager"); + + auto GoalManager = GameMode->Get(AIGoalManagerOffset); + + GetAIGoalManagerOriginal(Context, Stack, Ret); + + *Ret = GoalManager; + return *Ret; +} + AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldHook(UObject* Context, FFrame& Stack, AFortPickup** Ret) { UObject* WorldContextObject; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) diff --git a/Project Reboot 3.0/FortKismetLibrary.h b/Project Reboot 3.0/FortKismetLibrary.h index 5a21618..a322173 100644 --- a/Project Reboot 3.0/FortKismetLibrary.h +++ b/Project Reboot 3.0/FortKismetLibrary.h @@ -81,6 +81,8 @@ public: static inline void (*SpawnItemVariantPickupInWorldOriginal)(UObject* Context, FFrame& Stack, void* Ret); static inline void (*K2_GiveBuildingResourceOriginal)(UObject* Context, FFrame& Stack, void* Ret); static inline void (*PickLootDropsWithNamedWeightsOriginal)(UObject* Context, FFrame& Stack, void* Ret); + static inline UObject* (*GetAIDirectorOriginal)(UObject* Context, FFrame& Stack, UObject** Ret); + static inline UObject* (*GetAIGoalManagerOriginal)(UObject* Context, FFrame& Stack, UObject** Ret); static UFortResourceItemDefinition* K2_GetResourceItemDefinition(EFortResourceType ResourceType); static void ApplyCharacterCosmetics(UObject* WorldContextObject, const TArray& CharacterParts, UObject* PlayerState, bool* bSuccess); @@ -99,6 +101,8 @@ public: static void K2_RemoveFortItemFromPlayerHook(UObject* Context, FFrame& Stack, void* Ret); static AFortPickup* K2_SpawnPickupInWorldHook(UObject* Context, FFrame& Stack, AFortPickup** Ret); static AFortPickup* K2_SpawnPickupInWorldWithClassHook(UObject* Context, FFrame& Stack, AFortPickup** Ret); + static UObject* GetAIDirectorHook(UObject* Context, FFrame& Stack, UObject** Ret); + static UObject* GetAIGoalManagerHook(UObject* Context, FFrame& Stack, UObject** Ret); static bool PickLootDropsHook(UObject* Context, FFrame& Stack, bool* Ret); static UClass* StaticClass(); diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj b/Project Reboot 3.0/Project Reboot 3.0.vcxproj index a38bd50..b57a1bc 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -313,9 +313,12 @@ + + + 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 af5809f..085b6fa 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -904,6 +904,15 @@ FortniteGame\Source\FortniteGame\Public\Athena + + FortniteGame\Source\FortniteGame\Public\AI + + + Engine\Source\Runtime\AIModule\Classes\EnvironmentQuery + + + Engine\Source\Runtime\AIModule\Classes\EnvironmentQuery + @@ -1149,6 +1158,15 @@ {8953303f-bfb2-4d61-945e-994fb1761cd8} + + {7442549c-8d75-4bdb-a44a-df55140720c9} + + + {ababaf56-50f2-4d78-baa6-bad1b5ca1cf1} + + + {9b5483b5-3984-4fe1-96d2-e37d72642efd} + diff --git a/Project Reboot 3.0/ai.h b/Project Reboot 3.0/ai.h index 87e04ad..891e675 100644 --- a/Project Reboot 3.0/ai.h +++ b/Project Reboot 3.0/ai.h @@ -132,6 +132,26 @@ static void SetupServerBotManager() } } +static void SetupAIGoalManager() +{ + // There is some virtual function in the gamemode that calls a spawner for this, it gets the class from GameData, not sure why this doesn't work automatically or if we should even spawn this. + + auto GameMode = Cast(GetWorld()->GetGameMode()); + static auto AIGoalManagerOffset = GameMode->GetOffset("AIGoalManager"); + + static auto AIGoalManagerClass = FindObject(L"/Script.FortniteGame.FortAIGoalManager"); + + LOG_INFO(LogDev, "AIGoalManager Before: {}", __int64(GameMode->Get(AIGoalManagerOffset))); + + if (!GameMode->Get(AIGoalManagerOffset)) + GameMode->Get(AIGoalManagerOffset) = GetWorld()->SpawnActor(AIGoalManagerClass); + + if (GameMode->Get(AIGoalManagerOffset)) + { + LOG_INFO(LogAI, "Successfully spawned AIGoalManager!"); + } +} + static void SetupAIDirector() { auto GameState = Cast(GetWorld()->GetGameState()); @@ -144,6 +164,8 @@ static void SetupAIDirector() static auto AIDirectorOffset = GameMode->GetOffset("AIDirector"); + LOG_INFO(LogDev, "AIDirector Before: {}", __int64(GameMode->Get(AIDirectorOffset))); + if (!GameMode->Get(AIDirectorOffset)) GameMode->Get(AIDirectorOffset) = GetWorld()->SpawnActor(AIDirectorClass); @@ -151,7 +173,14 @@ static void SetupAIDirector() { LOG_INFO(LogAI, "Successfully spawned AIDirector!"); - static auto ActivateFn = FindObject("/Script/FortniteGame.FortAIDirector.Activate"); + // we have to set so much more from data tables.. + + static auto OurEncounterClass = FindObject(L"/Script/FortniteGame.FortAIEncounterInfo"); // ??? + static auto BaseEncounterClassOffset = GameMode->Get(AIDirectorOffset)->GetOffset("BaseEncounterClass"); + + GameMode->Get(AIDirectorOffset)->Get(BaseEncounterClassOffset) = OurEncounterClass; + + static auto ActivateFn = FindObject(L"/Script/FortniteGame.FortAIDirector.Activate"); if (ActivateFn) // ? GameMode->Get(AIDirectorOffset)->ProcessEvent(ActivateFn); // ? diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 94b7576..21c2c4a 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -44,6 +44,7 @@ #include "PlaysetLevelStreamComponent.h" #include "FortAthenaVehicleSpawner.h" #include "FortGameSessionDedicatedAthena.h" +#include "FortAIEncounterInfo.h" enum class EMeshNetworkNodeType : uint8_t { @@ -82,6 +83,20 @@ static int Return2Hook() { return 2; } static bool NoMCPHook() { return Globals::bNoMCP; } static void CollectGarbageHook() { return; } +static __int64 (*ConstructEmptyQueryInfoOriginal)(FEncounterEnvironmentQueryInfo* a1); + +static __int64 ConstructEmptyQueryInfoHook(FEncounterEnvironmentQueryInfo* a1) +{ + auto ret = ConstructEmptyQueryInfoOriginal(a1); + + a1->GetEnvironmentQuery() = FindObject(L"/Game/Athena/Deimos/AIDirector/EQS/Deimos_EQS_RiftSlots.Deimos_EQS_RiftSlots"); + a1->IsDirectional() = true; + + LOG_INFO(LogDev, "ConstructEmptyQueryInfoHook!"); + + return ret; +} + static __int64 (*DispatchRequestOriginal)(__int64 a1, __int64* a2, int a3); static __int64 DispatchRequestHook(__int64 a1, __int64* a2, int a3) @@ -207,7 +222,7 @@ __int64 FlowStep_SetPhaseToActiveHook(AActor* SpecialEventPhase) auto ret = FlowStep_SetPhaseToActiveOriginal(SpecialEventPhase); // idk if three actually is a ret - static auto OnRep_PhaseState = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventPhase.OnRep_PhaseState"); + static auto OnRep_PhaseState = FindObject(L"/Script/SpecialEventGameplayRuntime.SpecialEventPhase.OnRep_PhaseState"); SpecialEventPhase->ProcessEvent(OnRep_PhaseState); SpecialEventPhase->ForceNetUpdate(); @@ -215,6 +230,26 @@ __int64 FlowStep_SetPhaseToActiveHook(AActor* SpecialEventPhase) return ret; } +UObject* GetGoalManagerHook(UObject* WorldContextObject) +{ + auto GameMode = Cast(GetWorld()->GetGameMode()); + static auto AIGoalManagerOffset = GameMode->GetOffset("AIGoalManager"); + + LOG_INFO(LogDev, "WHAT A BOZO GetGoalManagerHook RET: 0x{:x}", __int64(_ReturnAddress()) - __int64(GetModuleHandleW(0))); + + return GameMode->Get(AIGoalManagerOffset); +} + +UObject* GetAIDirectorHook() +{ + auto GameMode = Cast(GetWorld()->GetGameMode()); + static auto AIDirectorOffset = GameMode->GetOffset("AIDirector"); + + LOG_INFO(LogDev, "WHAT A BOZO GetAIDirectorHook RET: 0x{:x}", __int64(_ReturnAddress()) - __int64(GetModuleHandleW(0))); + + return GameMode->Get(AIDirectorOffset); +} + DWORD WINAPI Main(LPVOID) { InitLogger(); @@ -273,14 +308,18 @@ DWORD WINAPI Main(LPVOID) // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNetPackageMap VeryVerbose", nullptr); // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNetTraffic VeryVerbose", nullptr); // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNet VeryVerbose", nullptr); - UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNavigation VeryVerbose", nullptr); + // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNavigation VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortMission VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAIGoalSelection VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogBuilding VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAI VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAIDirector VeryVerbose", nullptr); // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortQuest VeryVerbose", nullptr); // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortUIDirector NoLogging", nullptr); // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogAbilitySystem VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogDataTable VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogMeshNetwork VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogEQS VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFort VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogGameMode VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogSpecialEvent VeryVerbose", nullptr); @@ -319,6 +358,39 @@ DWORD WINAPI Main(LPVOID) FindObject(L"/Script/FortniteGame.BuildingFoundation.SetDynamicFoundationEnabled"), ABuildingFoundation::SetDynamicFoundationEnabledHook, (PVOID*)&ABuildingFoundation::SetDynamicFoundationEnabledOriginal, false, true); */ + /* + if (Fortnite_Version == 6.21) // ur trolling + { + std::string AIDirectorFuncName = "/Script/Engine.PlayerController.FOV"; // "/Script/Engine.PlayerController.ClientVoiceHandshakeComplete"; + std::string GoalManagerFuncName = "/Script/Engine.PlayerController.EnableCheats"; + + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0xAADD50), (PVOID)ConstructEmptyQueryInfoHook, (PVOID*)&ConstructEmptyQueryInfoOriginal); // 7FF7E556D158 + + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB10480, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xABBAB9, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB1E2BC, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB25EAA, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xABFDC1, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xAEC76D, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xA9C62C, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xAA1165, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xA9F5C0, (PVOID)GetGoalManagerHook, GoalManagerFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x10975EE, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xAC1C15, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB2096E, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x107B6A5, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB213DC, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xAB51D2, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB21BB8, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xABE6AC, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0xB2247D, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x10988B7, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x107C7B6, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x1096D21, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + HookInstruction(__int64(GetModuleHandleW(0)) + 0x1097982, (PVOID)GetAIDirectorHook, AIDirectorFuncName, ERelativeOffsets::CALL, FortPlayerControllerAthenaDefault); + } + */ + if (Fortnite_Version == 17.30) // Rift Tour stuff { Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E07910), (PVOID)GetMeshNetworkNodeTypeHook, nullptr); @@ -330,7 +402,7 @@ DWORD WINAPI Main(LPVOID) } else if (Fortnite_Version == 18.40) { - Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E07910), (PVOID)GetMeshNetworkNodeTypeHook, nullptr); + // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)GetMeshNetworkNodeTypeHook, nullptr); Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416AAB8), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EAAB8 Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416A840), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EA840 Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416A93C), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EA93C @@ -549,7 +621,7 @@ DWORD WINAPI Main(LPVOID) auto FortServerRestartPlayer = FortPlayerControllerDefault->VFTable[ServerReturnToMainMenuIdx]; VirtualSwap(FortPlayerControllerAthenaDefault->VFTable, ServerReturnToMainMenuIdx, FortServerRestartPlayer); - HookInstruction(Addresses::UpdateTrackedAttributesLea, (PVOID)AFortPlayerControllerAthena::UpdateTrackedAttributesHook, "/Script/Engine.PlayerController.EnableCheats", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault); + // HookInstruction(Addresses::UpdateTrackedAttributesLea, (PVOID)AFortPlayerControllerAthena::UpdateTrackedAttributesHook, "/Script/Engine.PlayerController.EnableCheats", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault); // HookInstruction(Addresses::CombinePickupLea, (PVOID)AFortPickup::CombinePickupHook, "/Script/Engine.PlayerController.SetVirtualJoystickVisibility", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault); if (bEnableRebooting) @@ -696,6 +768,10 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortAthenaMutator_GiveItemsAtGamePhaseStep"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_GiveItemsAtGamePhaseStep.OnGamePhaseStepChanged"), AFortAthenaMutator_GiveItemsAtGamePhaseStep::OnGamePhaseStepChangedHook, (PVOID*)&AFortAthenaMutator_GiveItemsAtGamePhaseStep::OnGamePhaseStepChangedOriginal, false, true); + Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.GetAIDirector"), + UFortKismetLibrary::GetAIDirectorHook, (PVOID*)&UFortKismetLibrary::GetAIDirectorOriginal, false, true); + Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.GetAIGoalManager"), + UFortKismetLibrary::GetAIGoalManagerHook, (PVOID*)&UFortKismetLibrary::GetAIGoalManagerOriginal, false, true); Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveItemToPlayer"), UFortKismetLibrary::K2_GiveItemToPlayerHook, (PVOID*)&UFortKismetLibrary::K2_GiveItemToPlayerOriginal, false, true); Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveBuildingResource"), diff --git a/Project Reboot 3.0/globals.h b/Project Reboot 3.0/globals.h index f418272..2e5e77d 100644 --- a/Project Reboot 3.0/globals.h +++ b/Project Reboot 3.0/globals.h @@ -20,7 +20,7 @@ namespace Globals extern inline bool bHitReadyToStartMatch = false; extern inline bool bInitializedPlaylist = false; extern inline bool bStartedListening = false; - extern inline bool bAutoRestart = true; + extern inline bool bAutoRestart = true; // doesnt work fyi extern inline bool bFillVendingMachines = true; extern inline int AmountOfListens = 0; // TODO: Switch to this for LastNum } diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 1c6b0a5..66fed20 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -275,7 +275,7 @@ static inline void StaticUI() { if (IsRestartingSupported()) { - ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart); + // ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart); if (Globals::bAutoRestart) { @@ -517,23 +517,6 @@ static inline void MainUI() } */ - if (ImGui::Button("aaa")) - { - static auto Clasda = FindObject(L"/Script/FortniteGame.FortMission_RiftSpawners"); - auto AllMissions = UGameplayStatics::GetAllActorsOfClass(GetWorld(), Clasda); - - LOG_INFO(LogDev, "AllMissions.Num(): {}", AllMissions.Num()); - - for (int i = 0; i < AllMissions.Num(); i++) - { - auto Mission = AllMissions.at(i); - - static auto bCalendarAllowsSpawningOffset = Mission->GetOffset("bCalendarAllowsSpawning"); - LOG_INFO(LogDev, "Mission->Get(bCalendarAllowsSpawningOffset) Original: {}", Mission->Get(bCalendarAllowsSpawningOffset)); - Mission->Get(bCalendarAllowsSpawningOffset) = true; - } - } - if (!bIsInAutoRestart && (Engine_Version < 424 && ImGui::Button("Restart"))) { if (Engine_Version < 424) @@ -935,6 +918,29 @@ static inline void MainUI() ImGui::InputText("Function Name to mess with", &FunctionNameToDump); + if (ImGui::Button("Find all classes that inherit")) + { + auto ClassToScuff = FindObject(ClassNameToDump); + + if (ClassToScuff) + { + auto ObjectNum = ChunkedObjects ? ChunkedObjects->Num() : UnchunkedObjects ? UnchunkedObjects->Num() : 0; + + for (int i = 0; i < ObjectNum; i++) + { + auto CurrentObject = GetObjectByIndex(i); + + if (!CurrentObject || CurrentObject == ClassToScuff) + continue; + + if (!CurrentObject->IsA(ClassToScuff)) + continue; + + LOG_INFO(LogDev, "Class Name: {}", CurrentObject->GetPathName()); + } + } + } + if (ImGui::Button("Print Class VFT")) { auto Class = FindObject(ClassNameToDump); diff --git a/Project Reboot 3.0/hooking.h b/Project Reboot 3.0/hooking.h index 0f7c196..1f725d8 100644 --- a/Project Reboot 3.0/hooking.h +++ b/Project Reboot 3.0/hooking.h @@ -381,7 +381,7 @@ static inline void HookInstruction(uint64 instrAddr, void* Detour, const std::st if (__int64(instrAddr) - FunctionAddr < 0) // We do not want the FunctionAddr (detour) to be less than where we are replacing. { - LOG_INFO(LogDev, "Hooking Instruction will not work! Function is after ({})!", FunctionToReplace); + LOG_ERROR(LogDev, "Hooking Instruction will not work! Function is after ({})!", FunctionToReplace); return; } diff --git a/Project Reboot 3.0/inc.h b/Project Reboot 3.0/inc.h index bf8418b..55af9a0 100644 --- a/Project Reboot 3.0/inc.h +++ b/Project Reboot 3.0/inc.h @@ -18,7 +18,7 @@ extern inline int Engine_Version = 0; // For example, 420, 421, etc. // Prevent 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 PROD // this doesnt do anything besides remove processeventhook and some assert stuff +#define PROD // this doesnt do anything besides remove processeventhook and some assert stuff struct PlaceholderBitfield {