From ec30c7ecf8e569e318e0de8399b935c3063da0d2 Mon Sep 17 00:00:00 2001 From: Milxnor Date: Sun, 14 May 2023 13:51:58 -0400 Subject: [PATCH] artificial intelligence proper *****, work on ai, organize some things --- Project Reboot 3.0/AthenaDeimosRift.cpp | 7 ++ Project Reboot 3.0/AthenaDeimosRift.h | 12 +++ Project Reboot 3.0/BP_IslandScripting.cpp | 26 +++++ Project Reboot 3.0/BP_IslandScripting.h | 37 ++++++++ Project Reboot 3.0/BuildingRift.h | 8 ++ .../FortAthenaCreativePortal.cpp | 4 +- Project Reboot 3.0/FortGameModeAthena.cpp | 70 +++++++++----- .../FortPlayerControllerAthena.cpp | 8 +- Project Reboot 3.0/GameModeBase.cpp | 7 ++ Project Reboot 3.0/GameplayStatics.cpp | 8 +- Project Reboot 3.0/KismetSystemLibrary.cpp | 25 +++++ Project Reboot 3.0/KismetSystemLibrary.h | 5 + Project Reboot 3.0/LatentActionManager.h | 6 +- Project Reboot 3.0/Level.cpp | 1 + Project Reboot 3.0/LevelStreaming.h | 8 ++ Project Reboot 3.0/LevelStreamingDynamic.h | 36 +++++++ Project Reboot 3.0/Project Reboot 3.0.vcxproj | 8 ++ .../Project Reboot 3.0.vcxproj.filters | 36 +++++++ Project Reboot 3.0/World.cpp | 7 +- Project Reboot 3.0/World.h | 2 +- Project Reboot 3.0/addresses.cpp | 1 - Project Reboot 3.0/ai.h | 94 ++++++++++++++----- Project Reboot 3.0/dllmain.cpp | 28 ++++++ Project Reboot 3.0/finder.h | 28 +++++- Project Reboot 3.0/gui.h | 18 ++++ 25 files changed, 422 insertions(+), 68 deletions(-) create mode 100644 Project Reboot 3.0/AthenaDeimosRift.cpp create mode 100644 Project Reboot 3.0/AthenaDeimosRift.h create mode 100644 Project Reboot 3.0/BP_IslandScripting.cpp create mode 100644 Project Reboot 3.0/BP_IslandScripting.h create mode 100644 Project Reboot 3.0/BuildingRift.h create mode 100644 Project Reboot 3.0/KismetSystemLibrary.cpp create mode 100644 Project Reboot 3.0/LevelStreaming.h create mode 100644 Project Reboot 3.0/LevelStreamingDynamic.h diff --git a/Project Reboot 3.0/AthenaDeimosRift.cpp b/Project Reboot 3.0/AthenaDeimosRift.cpp new file mode 100644 index 0000000..726519f --- /dev/null +++ b/Project Reboot 3.0/AthenaDeimosRift.cpp @@ -0,0 +1,7 @@ +#include "AthenaDeimosRift.h" + +void AAthenaDeimosRift::QueueActorsToSpawnHook(UObject* Context, FFrame* Stack, void* Ret) +{ + LOG_INFO(LogDev, "QueueActorsToSpawnHook!"); + return QueueActorsToSpawnOriginal(Context, Stack, Ret); +} \ No newline at end of file diff --git a/Project Reboot 3.0/AthenaDeimosRift.h b/Project Reboot 3.0/AthenaDeimosRift.h new file mode 100644 index 0000000..0258bed --- /dev/null +++ b/Project Reboot 3.0/AthenaDeimosRift.h @@ -0,0 +1,12 @@ +#pragma once + +#include "BuildingRift.h" +#include "Stack.h" + +class AAthenaDeimosRift : public ABuildingRift +{ +public: + static inline void (*QueueActorsToSpawnOriginal)(UObject* Context, FFrame* Stack, void* Ret); + + static void QueueActorsToSpawnHook(UObject* Context, FFrame* Stack, void* Ret); +}; \ No newline at end of file diff --git a/Project Reboot 3.0/BP_IslandScripting.cpp b/Project Reboot 3.0/BP_IslandScripting.cpp new file mode 100644 index 0000000..2b65e76 --- /dev/null +++ b/Project Reboot 3.0/BP_IslandScripting.cpp @@ -0,0 +1,26 @@ +#include "BP_IslandScripting.h" + +void ABP_IslandScripting_C::Initialize() +{ + static auto UpdateMapOffset = GetOffset("UpdateMap", false); + + if (UpdateMapOffset != -1) + { + Get(UpdateMapOffset) = true; + this->OnRep_UpdateMap(); + } + + /* + + // This spawns the beam. + + this->IsDeimosActive() = true; + this->OnRep_IsDeimosActive(); + */ +} + +ABP_IslandScripting_C* ABP_IslandScripting_C::GetIslandScripting() +{ + auto AllIslandScriptings = UGameplayStatics::GetAllActorsOfClass(GetWorld(), StaticClass()); + return AllIslandScriptings.Num() > 0 ? (ABP_IslandScripting_C*)AllIslandScriptings.at(0) : nullptr; +} \ No newline at end of file diff --git a/Project Reboot 3.0/BP_IslandScripting.h b/Project Reboot 3.0/BP_IslandScripting.h new file mode 100644 index 0000000..1d19ae8 --- /dev/null +++ b/Project Reboot 3.0/BP_IslandScripting.h @@ -0,0 +1,37 @@ +#pragma once + +#include "reboot.h" + +#include "GameplayStatics.h" + +class ABP_IslandScripting_C : public AActor // AFortAlwaysRelevantReplicatedActor +{ +public: + bool& IsDeimosActive() + { + static auto IsDeimosActiveOffset = GetOffset("IsDeimosActive"); + return Get(IsDeimosActiveOffset); + } + + void OnRep_IsDeimosActive() + { + static auto OnRep_IsDeimosActiveFn = FindObject("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C.OnRep_IsDeimosActive"); + this->ProcessEvent(OnRep_IsDeimosActiveFn); + } + + void OnRep_UpdateMap() + { + static auto OnRep_UpdateMapFn = FindObject("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C.OnRep_UpdateMap"); + this->ProcessEvent(OnRep_UpdateMapFn); + } + + void Initialize(); + + static ABP_IslandScripting_C* GetIslandScripting(); + + static UClass* StaticClass() + { + /* static */ auto Class = FindObject("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C"); + return Class; + } +}; \ No newline at end of file diff --git a/Project Reboot 3.0/BuildingRift.h b/Project Reboot 3.0/BuildingRift.h new file mode 100644 index 0000000..0e503cb --- /dev/null +++ b/Project Reboot 3.0/BuildingRift.h @@ -0,0 +1,8 @@ +#pragma once + +#include "BuildingActor.h" + +class ABuildingRift : public ABuildingActor +{ +public: +}; \ No newline at end of file diff --git a/Project Reboot 3.0/FortAthenaCreativePortal.cpp b/Project Reboot 3.0/FortAthenaCreativePortal.cpp index f307558..c8939e0 100644 --- a/Project Reboot 3.0/FortAthenaCreativePortal.cpp +++ b/Project Reboot 3.0/FortAthenaCreativePortal.cpp @@ -5,6 +5,8 @@ void AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeHook(UObject* Context, FFrame& Stack, void* Ret) { + LOG_INFO(LogDev, "TeleportPlayerToLinkedVolumeHook!"); + auto Portal = (AFortAthenaCreativePortal*)Context; // Cast? if (!Portal) @@ -29,7 +31,7 @@ void AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeHook(UObject* Contex return TeleportPlayerToLinkedVolumeOriginal(Context, Stack, Ret); auto Location = LinkedVolume->GetActorLocation(); - Location.Z -= 1000; // proper 1:1 + Location.Z -= 10000; // proper 1:1 PlayerPawn->TeleportTo(Location, FRotator()); return TeleportPlayerToLinkedVolumeOriginal(Context, Stack, Ret); diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index b864134..0932591 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -14,10 +14,12 @@ #include "NetSerialization.h" #include "GameplayStatics.h" #include "DataTableFunctionLibrary.h" +#include "LevelStreamingDynamic.h" #include "KismetStringLibrary.h" #include "SoftObjectPtr.h" #include "discord.h" #include "BuildingGameplayActorSpawnMachine.h" +#include "BP_IslandScripting.h" #include "vehicles.h" #include "globals.h" @@ -324,18 +326,41 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (AdditionalLevelsOffset != -1) { - auto& AdditionalLevels = CurrentPlaylist->Get>>(AdditionalLevelsOffset); + auto& AdditionalLevels = CurrentPlaylist->Get>>(AdditionalLevelsOffset); LOG_INFO(LogPlaylist, "Loading {} playlist levels.", AdditionalLevels.Num()); for (int i = 0; i < AdditionalLevels.Num(); i++) { - // auto World = Cast(Playlist->AdditionalLevels[i].Get()); - // StreamLevel(UKismetSystemLibrary::GetPathName(World->PersistentLevel).ToString()); - auto LevelName = AdditionalLevels.at(i).SoftObjectPtr.ObjectID.AssetPathName.ToString(); - LOG_INFO(LogPlaylist, "Loading level {}.", LevelName); - StreamLevel(LevelName); + FName LevelFName = AdditionalLevels.at(i).SoftObjectPtr.ObjectID.AssetPathName; + auto LevelNameStr = LevelFName.ToString(); + LOG_INFO(LogPlaylist, "Loading level {}.", LevelNameStr); + auto LevelNameWStr = std::wstring(LevelNameStr.begin(), LevelNameStr.end()); + + // bruh the onrep automatically streams if no levelstreamingdynamci found + + // StreamLevel(LevelNameStr); + // FLatentActionInfo LatentInfo{}; + // UGameplayStatics::LoadStreamLevel(GetWorld(), LevelFName, true, false, LatentInfo); + + // ULevelStreamingDynamic::LoadLevelInstance(GetWorld(), LevelNameWStr.c_str(), FVector(), FRotator()); + + static auto AdditionalPlaylistLevelsStreamedOffset = GameState->GetOffset("AdditionalPlaylistLevelsStreamed", false); + + if (AdditionalPlaylistLevelsStreamedOffset != -1) // i think its valid on every version but idgaf + { + if (Fortnite_Version < 11) // IDK What verison it actually wsa but they chnaged it to a struct + { + auto& AdditionalPlaylistLevelsStreamed = GameState->Get>(AdditionalPlaylistLevelsStreamedOffset); + AdditionalPlaylistLevelsStreamed.Add(LevelFName); + } + } } + + static auto OnRep_AdditionalPlaylistLevelsStreamedFn = FindObject(L"/Script/FortniteGame.FortGameState.OnRep_AdditionalPlaylistLevelsStreamed"); + + if (OnRep_AdditionalPlaylistLevelsStreamedFn) + GameState->ProcessEvent(OnRep_AdditionalPlaylistLevelsStreamedFn); } } } @@ -344,12 +369,12 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game { if (true) // idfk if the stage only showed on marshmello playlist { - auto PleasantParkIdk = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus")); + auto PleasantParkIdk = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus"); ShowFoundation(PleasantParkIdk); } else { - auto PleasantParkGround = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault"); + auto PleasantParkGround = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault"); ShowFoundation(PleasantParkGround); } } @@ -358,44 +383,36 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game { if (Fortnite_Version != 6.10) { - auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1")); - auto Lake2 = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2"); + auto Lake = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1"); + auto Lake2 = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2"); Fortnite_Version <= 6.21 ? ShowFoundation(Lake) : ShowFoundation(Lake2); } else { - auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12")); + auto Lake = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12"); ShowFoundation(Lake); } - auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13")) : - FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland")); + auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13") : + FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland"); ShowFoundation(FloatingIsland); - UObject* Scripting = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.BP_IslandScripting3"); // bruh + auto IslandScripting = ABP_IslandScripting_C::GetIslandScripting(); - if (Scripting) + if (IslandScripting) { - static auto UpdateMapOffset = Scripting->GetOffset("UpdateMap", false); - - if (UpdateMapOffset != -1) - { - Scripting->Get(UpdateMapOffset) = true; - - static auto OnRep_UpdateMap = FindObject("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C.OnRep_UpdateMap"); - Scripting->ProcessEvent(OnRep_UpdateMap); - } + IslandScripting->Initialize(); } } if (Fortnite_Version == 14.60 && Globals::bGoingToPlayEvent) { - ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation3")); // Aircraft Carrier + ShowFoundation(FindObject(L"/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation3")); // Aircraft Carrier } - auto TheBlock = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank + auto TheBlock = FindObject(L"/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank if (TheBlock) ShowFoundation(TheBlock); @@ -567,6 +584,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game SetupAIDirector(); SetupServerBotManager(); + // SetupNavConfig(UKismetStringLibrary::Conv_StringToName(L"Deimos")); if (auto TeamsArrayContainer = GameState->GetTeamsArrayContainer()) { diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index 11670e9..ce5d298 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -391,6 +391,8 @@ void AFortPlayerControllerAthena::ServerGiveCreativeItemHook(AFortPlayerControll void AFortPlayerControllerAthena::ServerTeleportToPlaygroundLobbyIslandHook(AFortPlayerControllerAthena* Controller) { + LOG_INFO(LogDev, "ServerTeleportToPlaygroundLobbyIslandHook!"); + auto Pawn = Controller->GetMyFortPawn(); if (!Pawn) @@ -398,7 +400,7 @@ void AFortPlayerControllerAthena::ServerTeleportToPlaygroundLobbyIslandHook(AFor // TODO IsTeleportToCreativeHubAllowed - static auto FortPlayerStartCreativeClass = FindObject("/Script/FortniteGame.FortPlayerStartCreative"); + static auto FortPlayerStartCreativeClass = FindObject(L"/Script/FortniteGame.FortPlayerStartCreative"); auto AllCreativePlayerStarts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortPlayerStartCreativeClass); for (int i = 0; i < AllCreativePlayerStarts.Num(); i++) @@ -447,8 +449,10 @@ void AFortPlayerControllerAthena::ServerPlaySquadQuickChatMessageHook(AFortPlaye { using UAthenaEmojiItemDefinition = UFortItemDefinition; - static auto EmojiComm = FindObject("/Game/Athena/Items/Cosmetics/Dances/Emoji/Emoji_Comm.Emoji_Comm"); + static auto EmojiComm = FindObject(L"/Game/Athena/Items/Cosmetics/Dances/Emoji/Emoji_Comm.Emoji_Comm"); PlayerController->ServerPlayEmoteItemHook(PlayerController, EmojiComm); + + // idk what else we are supposed to do here } void AFortPlayerControllerAthena::GetPlayerViewPointHook(AFortPlayerControllerAthena* PlayerController, FVector& Location, FRotator& Rotation) diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index e9e066e..340cb63 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -232,6 +232,13 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll static auto DeathInfoStruct = FindObject(L"/Script/FortniteGame.DeathInfo"); static auto DeathInfoStructSize = DeathInfoStruct->GetPropertiesSize(); RtlSecureZeroMemory(DeathInfo, DeathInfoStructSize); + + static auto OnRep_DeathInfoFn = FindObject(L"/Script/FortniteGame.FortPlayerStateAthena.OnRep_DeathInfo"); + + if (OnRep_DeathInfoFn) + { + PlayerStateAthena->ProcessEvent(OnRep_DeathInfoFn); + } } return NewPawn; diff --git a/Project Reboot 3.0/GameplayStatics.cpp b/Project Reboot 3.0/GameplayStatics.cpp index 7d7e217..8ae158b 100644 --- a/Project Reboot 3.0/GameplayStatics.cpp +++ b/Project Reboot 3.0/GameplayStatics.cpp @@ -76,7 +76,7 @@ void UGameplayStatics::RemovePlayer(APlayerController* Player, bool bDestroyPawn AActor* UGameplayStatics::BeginDeferredActorSpawnFromClass(const UObject* WorldContextObject, UClass* ActorClass, const FTransform& SpawnTransform, ESpawnActorCollisionHandlingMethod CollisionHandlingOverride, AActor* Owner) { - static auto fn = FindObject("/Script/Engine.GameplayStatics.BeginDeferredActorSpawnFromClass"); + static auto fn = FindObject(L"/Script/Engine.GameplayStatics.BeginDeferredActorSpawnFromClass"); struct { @@ -96,7 +96,7 @@ AActor* UGameplayStatics::BeginDeferredActorSpawnFromClass(const UObject* WorldC AActor* UGameplayStatics::FinishSpawningActor(AActor* Actor, const FTransform& SpawnTransform) { - static auto FinishSpawningActorFn = FindObject("/Script/Engine.GameplayStatics.FinishSpawningActor"); + static auto FinishSpawningActorFn = FindObject(L"/Script/Engine.GameplayStatics.FinishSpawningActor"); struct { @@ -113,7 +113,7 @@ AActor* UGameplayStatics::FinishSpawningActor(AActor* Actor, const FTransform& S void UGameplayStatics::LoadStreamLevel(UObject* WorldContextObject, FName LevelName, bool bMakeVisibleAfterLoad, bool bShouldBlockOnLoad, const FLatentActionInfo& LatentInfo) { - static auto LoadStreamLevelFn = FindObject("/Script/Engine.GameplayStatics.LoadStreamLevel"); + static auto LoadStreamLevelFn = FindObject(L"/Script/Engine.GameplayStatics.LoadStreamLevel"); struct { @@ -130,7 +130,7 @@ void UGameplayStatics::LoadStreamLevel(UObject* WorldContextObject, FName LevelN void UGameplayStatics::UnloadStreamLevel(UObject* WorldContextObject, FName LevelName, const FLatentActionInfo& LatentInfo, bool bShouldBlockOnUnload) { - static auto UnloadStreamLevelFn = FindObject("/Script/Engine.GameplayStatics.UnloadStreamLevel"); + static auto UnloadStreamLevelFn = FindObject(L"/Script/Engine.GameplayStatics.UnloadStreamLevel"); struct { UObject* WorldContextObject; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) diff --git a/Project Reboot 3.0/KismetSystemLibrary.cpp b/Project Reboot 3.0/KismetSystemLibrary.cpp new file mode 100644 index 0000000..c1a2fca --- /dev/null +++ b/Project Reboot 3.0/KismetSystemLibrary.cpp @@ -0,0 +1,25 @@ +#include "KismetSystemLibrary.h" + +#include "gui.h" + +void UKismetSystemLibrary::PrintStringHook(UObject* Context, FFrame* Stack, void* Ret) +{ + UObject* WorldContextObject; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FString inString; // (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + bool bPrintToScreen; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) + bool bPrintToLog; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FLinearColor TextColor; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) + float Duration; + + Stack->StepCompiledIn(&WorldContextObject); + Stack->StepCompiledIn(&inString); + Stack->StepCompiledIn(&bPrintToScreen); + Stack->StepCompiledIn(&bPrintToLog); + Stack->StepCompiledIn(&TextColor); + Stack->StepCompiledIn(&Duration); + + if (bEngineDebugLogs) + LOG_INFO(LogDev, "GameLog: {}", inString.ToString()); + + return PrintStringOriginal(Context, Stack, Ret); +} \ No newline at end of file diff --git a/Project Reboot 3.0/KismetSystemLibrary.h b/Project Reboot 3.0/KismetSystemLibrary.h index 589d599..b1c87fb 100644 --- a/Project Reboot 3.0/KismetSystemLibrary.h +++ b/Project Reboot 3.0/KismetSystemLibrary.h @@ -4,6 +4,7 @@ #include "UnrealString.h" #include "reboot.h" +#include "Stack.h" enum class EDrawDebugTrace : uint8_t { @@ -75,6 +76,8 @@ struct FLinearColor class UKismetSystemLibrary : public UObject { public: + static inline void (*PrintStringOriginal)(UObject* Context, FFrame* Stack, void* Ret); + static FString GetPathName(UObject* Object) { static auto GetPathNameFunction = FindObject("/Script/Engine.KismetSystemLibrary.GetPathName"); @@ -207,4 +210,6 @@ public: return *(bool*)(__int64(Params) + ReturnValueOffset); } + + static void PrintStringHook(UObject* Context, FFrame* Stack, void* Ret); }; \ No newline at end of file diff --git a/Project Reboot 3.0/LatentActionManager.h b/Project Reboot 3.0/LatentActionManager.h index 2e9c149..7d18bee 100644 --- a/Project Reboot 3.0/LatentActionManager.h +++ b/Project Reboot 3.0/LatentActionManager.h @@ -4,9 +4,9 @@ struct FLatentActionInfo { - int Linkage; // 0x0000(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) - int UUID; // 0x0004(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + int Linkage = 0; // 0x0000(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + int UUID = 0; // 0x0004(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) FName ExecutionFunction; // 0x0008(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) - UObject* CallbackTarget; // 0x0010(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) + UObject* CallbackTarget = nullptr; // 0x0010(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) }; diff --git a/Project Reboot 3.0/Level.cpp b/Project Reboot 3.0/Level.cpp index a5cbc33..a206634 100644 --- a/Project Reboot 3.0/Level.cpp +++ b/Project Reboot 3.0/Level.cpp @@ -30,6 +30,7 @@ AWorldSettings* ULevel::GetWorldSettings(bool bChecked) const { // checkf(WorldSettings != nullptr, TEXT("%s"), *GetPathName()); } + static auto WorldSettingsOffset = GetOffset("WorldSettings"); return Get(WorldSettingsOffset); } \ No newline at end of file diff --git a/Project Reboot 3.0/LevelStreaming.h b/Project Reboot 3.0/LevelStreaming.h new file mode 100644 index 0000000..8737dc9 --- /dev/null +++ b/Project Reboot 3.0/LevelStreaming.h @@ -0,0 +1,8 @@ +#pragma once + +#include "Object.h" + +class ULevelStreaming : public UObject +{ +public: +}; \ No newline at end of file diff --git a/Project Reboot 3.0/LevelStreamingDynamic.h b/Project Reboot 3.0/LevelStreamingDynamic.h new file mode 100644 index 0000000..844f634 --- /dev/null +++ b/Project Reboot 3.0/LevelStreamingDynamic.h @@ -0,0 +1,36 @@ +#pragma once + +#include "LevelStreaming.h" + +#include "UnrealString.h" +#include "Rotator.h" +#include "Vector.h" + +#include "reboot.h" // too lazy to make cpp file for this + +class ULevelStreamingDynamic : public ULevelStreaming +{ +public: + static ULevelStreamingDynamic* LoadLevelInstance(UObject* WorldContextObject, FString LevelName, FVector Location, FRotator Rotation, bool* bOutSuccess = nullptr) + { + static auto LoadLevelInstanceFn = FindObject(L"/Script/Engine.LevelStreamingDynamic.LoadLevelInstance"); + + struct + { + UObject* WorldContextObject; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FString LevelName; // (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FVector Location; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FRotator Rotation; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic) + bool bOutSuccess; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + ULevelStreamingDynamic* ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + }ULevelStreamingDynamic_LoadLevelInstance_Params{ WorldContextObject, LevelName, Location, Rotation }; + + auto defaultObj = FindObject(L"/Script/Engine.Default__LevelStreamingDynamic"); + defaultObj->ProcessEvent(LoadLevelInstanceFn, &ULevelStreamingDynamic_LoadLevelInstance_Params); + + if (bOutSuccess) + *bOutSuccess = ULevelStreamingDynamic_LoadLevelInstance_Params.bOutSuccess; + + return ULevelStreamingDynamic_LoadLevelInstance_Params.ReturnValue; + } +}; \ 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 4ebd2d0..1c5039a 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -176,7 +176,9 @@ + + @@ -241,6 +243,7 @@ + @@ -274,6 +277,7 @@ + @@ -281,11 +285,13 @@ + + @@ -401,6 +407,8 @@ + + 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 83422b8..2d528fa 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -283,6 +283,15 @@ FortniteGame\Source\FortniteGame\Private\Building + + FortniteGame\Source\FortniteGame\Private\Deimos + + + FortniteGame\Source\FortniteGame\Private\Athena\Island + + + Engine\Source\Runtime\Engine\Private + @@ -877,6 +886,21 @@ FortniteGame\Source\FortniteGame\Public + + FortniteGame\Source\FortniteGame\Public\Deimos + + + FortniteGame\Source\FortniteGame\Public\Building + + + FortniteGame\Source\FortniteGame\Public\Athena\Island + + + Engine\Source\Runtime\Engine\Classes\Engine + + + Engine\Source\Runtime\Engine\Classes\Engine + @@ -1110,6 +1134,18 @@ {ade44d65-f7a4-4fc9-ac38-637c84493b58} + + {ac17e75e-ef4a-44f8-9b69-f55b6cde947d} + + + {aadf4f37-b2b9-4ce2-bebb-35719ef0aab1} + + + {7df06629-6271-4cd1-8f2c-ad8d6829b069} + + + {2d9beb55-a616-440e-8861-6a05f0ee2ef3} + diff --git a/Project Reboot 3.0/World.cpp b/Project Reboot 3.0/World.cpp index 106085d..68b37b5 100644 --- a/Project Reboot 3.0/World.cpp +++ b/Project Reboot 3.0/World.cpp @@ -7,7 +7,7 @@ AWorldSettings* UWorld::K2_GetWorldSettings() { - static auto fn = FindObject("/Script/Engine.World.K2_GetWorldSettings"); + static auto fn = FindObject(L"/Script/Engine.World.K2_GetWorldSettings"); AWorldSettings* WorldSettings; this->ProcessEvent(fn, &WorldSettings); return WorldSettings; @@ -94,7 +94,7 @@ AWorldSettings* UWorld::GetWorldSettings(const bool bCheckStreamingPersistent, c AWorldSettings* WorldSettings = nullptr; static auto PersistentLevelOffset = GetOffset("PersistentLevel"); - if (Get(PersistentLevelOffset)) + if (this->Get(PersistentLevelOffset)) { WorldSettings = Get(PersistentLevelOffset)->GetWorldSettings(bChecked); @@ -103,7 +103,7 @@ AWorldSettings* UWorld::GetWorldSettings(const bool bCheckStreamingPersistent, c static auto StreamingLevelsOffset = GetOffset("StreamingLevels"); auto& StreamingLevels = Get>(StreamingLevelsOffset); - static auto LevelStreamingPersistentClass = FindObject("/Script/Engine.LevelStreamingPersistent"); + static auto LevelStreamingPersistentClass = FindObject(L"/Script/Engine.LevelStreamingPersistent"); if (StreamingLevels.Num() > 0 && StreamingLevels.at(0) && @@ -118,5 +118,6 @@ AWorldSettings* UWorld::GetWorldSettings(const bool bCheckStreamingPersistent, c } } } + return WorldSettings; } \ No newline at end of file diff --git a/Project Reboot 3.0/World.h b/Project Reboot 3.0/World.h index ad484a5..d85943c 100644 --- a/Project Reboot 3.0/World.h +++ b/Project Reboot 3.0/World.h @@ -88,7 +88,7 @@ public: } AWorldSettings* GetWorldSettings(bool bCheckStreamingPersistent = false, bool bChecked = true) const; - AWorldSettings* K2_GetWorldSettings(); + AWorldSettings* K2_GetWorldSettings(); // DONT USE WHEN POSSIBLE void Listen(); }; \ No newline at end of file diff --git a/Project Reboot 3.0/addresses.cpp b/Project Reboot 3.0/addresses.cpp index 471911e..e37a4d4 100644 --- a/Project Reboot 3.0/addresses.cpp +++ b/Project Reboot 3.0/addresses.cpp @@ -490,7 +490,6 @@ void Addresses::Init() Addresses::SetWorld = Engine_Version < 426 ? Addresses::SetWorld : __int64(DefaultNetDriver->VFTable[Addresses::SetWorld]); UNetDriver::SetWorldOriginal = decltype(UNetDriver::SetWorldOriginal)(SetWorld); - AddNavigationSystemToWorldOriginal = decltype(AddNavigationSystemToWorldOriginal)(AddNavigationSystemToWorld); NavSystemCleanUpOriginal = decltype(NavSystemCleanUpOriginal)(Addresses::NavSystemCleanUp); LoadPlaysetOriginal = decltype(LoadPlaysetOriginal)(Addresses::LoadPlayset); AFortGameModeAthena::SetZoneToIndexOriginal = decltype(AFortGameModeAthena::SetZoneToIndexOriginal)(Addresses::SetZoneToIndex); diff --git a/Project Reboot 3.0/ai.h b/Project Reboot 3.0/ai.h index fe29840..87e04ad 100644 --- a/Project Reboot 3.0/ai.h +++ b/Project Reboot 3.0/ai.h @@ -38,37 +38,67 @@ enum class ENavSystemOverridePolicy : uint8_t extern inline void (*NavSystemCleanUpOriginal)(UNavigationSystemV1*, uint8) = nullptr; -extern inline void (*AddNavigationSystemToWorldOriginal)(UWorld& WorldOwner, EFNavigationSystemRunMode RunMode, UNavigationSystemConfig* NavigationSystemConfig, char bInitializeForWorld, - char bOverridePreviousNavSys) = nullptr; - -static void SetNavigationSystem(AAthenaNavSystemConfigOverride* NavSystemOverride) +static bool SetNavigationSystem(AAthenaNavSystemConfigOverride* NavSystemOverride) { - auto WorldSettings = GetWorld()->K2_GetWorldSettings(); + UAthenaNavSystem*& NavSystem = (UAthenaNavSystem*&)GetWorld()->Get("NavigationSystem"); - NavSystemOverride->Get("OverridePolicy") = ENavSystemOverridePolicy::Append; + LOG_INFO(LogDev, "NavSystem: {}", NavSystem->IsValidLowLevel() ? NavSystem->GetFullName() : "BadRead"); - WorldSettings->Get("NavigationSystemConfigOverride") = NavSystemOverride->Get("NavigationSystemConfig"); - WorldSettings->Get("NavigationSystemConfig")->Get("bIsOverriden") = true; + if (NavSystem) + { + return false; + NavSystemCleanUpOriginal(NavSystem, 0); + GetWorld()->Get("NavigationSystem") = nullptr; + } - auto NavSystem = (UAthenaNavSystem*)GetWorld()->Get("NavigationSystem"); + auto WorldSettings = GetWorld()->GetWorldSettings(); - NavSystemCleanUpOriginal(NavSystem, 0); + LOG_INFO(LogDev, "WorldSettings: {}", WorldSettings->IsValidLowLevel() ? WorldSettings->GetFullName() : "BadRead"); - GetWorld()->Get("NavigationSystem") = nullptr; + if (!WorldSettings) + return false; + + static auto OverridePolicyOffset = NavSystemOverride->GetOffset("OverridePolicy", false); + + if (OverridePolicyOffset != -1) + NavSystemOverride->Get(OverridePolicyOffset) = ENavSystemOverridePolicy::Append; + + static auto NavSystemOverride_NavigationSystemConfigOffset = NavSystemOverride->GetOffset("NavigationSystemConfig"); + + WorldSettings->Get("NavigationSystemConfigOverride") = NavSystemOverride->Get(NavSystemOverride_NavigationSystemConfigOffset); + + LOG_INFO(LogDev, "WorldSettings_NavigationSystemConfig: {}", __int64(WorldSettings->Get("NavigationSystemConfig"))); + + if (WorldSettings->Get("NavigationSystemConfig")) + WorldSettings->Get("NavigationSystemConfig")->Get("bIsOverriden") = true; if (!NavSystemOverride->Get("NavigationSystemConfig")) - return; + { + LOG_ERROR(LogAI, "No NavigationSystemConfig!"); + return false; + } auto& ClassPath = NavSystemOverride->Get("NavigationSystemConfig")->Get("NavigationSystemClass"); auto NewNavSystemClass = FindObject(ClassPath.AssetPathName.ToString()); if (!NewNavSystemClass) - return; + { + LOG_ERROR(LogAI, "No NavigationSystemClass!"); + return false; + } LOG_INFO(LogAI, "Setup navigation system."); - AddNavigationSystemToWorldOriginal(*GetWorld(), EFNavigationSystemRunMode::GameMode, NavSystemOverride->Get("NavigationSystemConfig"), true, false); + // if (Fortnite_Version >= 10.40) // idk when they added the fifth arg or does it even matter???? + { + static void (*AddNavigationSystemToWorldOriginal)(UWorld * WorldOwner, EFNavigationSystemRunMode RunMode, UNavigationSystemConfig * NavigationSystemConfig, char bInitializeForWorld, char bOverridePreviousNavSys) = + decltype(AddNavigationSystemToWorldOriginal)(Addresses::AddNavigationSystemToWorld); + + AddNavigationSystemToWorldOriginal(GetWorld(), EFNavigationSystemRunMode::GameMode, NavSystemOverride->Get("NavigationSystemConfig"), true, false); + } + + return true; } static void SetupServerBotManager() @@ -76,7 +106,7 @@ static void SetupServerBotManager() auto GameState = Cast(GetWorld()->GetGameState()); auto GameMode = Cast(GetWorld()->GetGameMode()); - static auto FortServerBotManagerClass = FindObject("/Script/FortniteGame.FortServerBotManagerAthena"); // Is there a BP for this? // GameMode->ServerBotManagerClass + static auto FortServerBotManagerClass = FindObject(L"/Script/FortniteGame.FortServerBotManagerAthena"); // Is there a BP for this? // GameMode->ServerBotManagerClass if (!FortServerBotManagerClass) return; @@ -95,10 +125,10 @@ static void SetupServerBotManager() static auto CachedGameStateOffset = ServerBotManager->GetOffset("CachedGameState", false); if (CachedGameStateOffset != -1) - ServerBotManager->Get(CachedGameStateOffset) = GameState; + ServerBotManager->Get(CachedGameStateOffset) = GameState; static auto CachedBotMutatorOffset = ServerBotManager->GetOffset("CachedBotMutator"); - ServerBotManager->Get(CachedBotMutatorOffset) = FindFirstMutator(FindObject("/Script/FortniteGame.FortAthenaMutator_Bots")); + ServerBotManager->Get(CachedBotMutatorOffset) = FindFirstMutator(FindObject(L"/Script/FortniteGame.FortAthenaMutator_Bots")); } } @@ -107,7 +137,7 @@ static void SetupAIDirector() auto GameState = Cast(GetWorld()->GetGameState()); auto GameMode = Cast(GetWorld()->GetGameMode()); - static auto AIDirectorClass = FindObject("/Script/FortniteGame.AthenaAIDirector"); // Probably wrong class + static auto AIDirectorClass = FindObject(L"/Script/FortniteGame.AthenaAIDirector"); // Probably wrong class if (!AIDirectorClass) return; @@ -119,28 +149,46 @@ static void SetupAIDirector() if (GameMode->Get(AIDirectorOffset)) { + LOG_INFO(LogAI, "Successfully spawned AIDirector!"); + static auto ActivateFn = FindObject("/Script/FortniteGame.FortAIDirector.Activate"); + + if (ActivateFn) // ? + GameMode->Get(AIDirectorOffset)->ProcessEvent(ActivateFn); // ? } } static void SetupNavConfig(const FName& AgentName) { - static auto AthenaNavSystemConfigOverrideClass = FindObject("/Script/FortniteGame.AthenaNavSystemConfigOverride"); + static auto AthenaNavSystemConfigOverrideClass = FindObject(L"/Script/FortniteGame.AthenaNavSystemConfigOverride"); auto NavSystemOverride = GetWorld()->SpawnActor(AthenaNavSystemConfigOverrideClass); if (!NavSystemOverride) return; - static auto AthenaNavSystemConfigClass = FindObject("/Script/FortniteGame.AthenaNavSystemConfig"); + static auto AthenaNavSystemConfigClass = FindObject(L"/Script/FortniteGame.AthenaNavSystemConfig"); auto AthenaNavConfig = (UAthenaNavSystemConfig*)UGameplayStatics::SpawnObject(AthenaNavSystemConfigClass, NavSystemOverride); AthenaNavConfig->Get("bUseBuildingGridAsNavigableSpace") = false; - AthenaNavConfig->Get("bUsesStreamedInNavLevel") = true; + + static auto bUsesStreamedInNavLevelOffset = AthenaNavConfig->GetOffset("bUsesStreamedInNavLevel", false); + + if (bUsesStreamedInNavLevelOffset != -1) + AthenaNavConfig->Get(bUsesStreamedInNavLevelOffset) = true; + AthenaNavConfig->Get("bAllowAutoRebuild") = true; AthenaNavConfig->Get("bCreateOnClient") = true; // BITFIELD AthenaNavConfig->Get("bAutoSpawnMissingNavData") = true; // BITFIELD AthenaNavConfig->Get("bSpawnNavDataInNavBoundsLevel") = true; // BITFIELD - AthenaNavConfig->Get("bUseNavigationInvokers") = false; - AthenaNavConfig->Get("DefaultAgentName") = AgentName; + + static auto bUseNavigationInvokersOffset = AthenaNavConfig->GetOffset("bUseNavigationInvokers", false); + + if (bUseNavigationInvokersOffset != -1) + AthenaNavConfig->Get(bUseNavigationInvokersOffset) = false; + + static auto DefaultAgentNameOffset = AthenaNavConfig->GetOffset("DefaultAgentName", false); + + if (DefaultAgentNameOffset != -1) + AthenaNavConfig->Get(DefaultAgentNameOffset) = AgentName; // NavSystemOverride->Get("OverridePolicy") = ENavSystemOverridePolicy::Append; NavSystemOverride->Get("NavigationSystemConfig") = AthenaNavConfig; diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 25a107e..1572536 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 "AthenaDeimosRift.h" enum class EMeshNetworkNodeType : uint8_t { @@ -101,6 +102,20 @@ static __int64 DispatchRequestHook(__int64 a1, __int64* a2, int a3) return DispatchRequestOriginal(a1, a2, 3); } +static bool (*CanCreateInCurrentContextOriginal)(UObject* Template); + +bool CanCreateInCurrentContextHook(UObject* Template) +{ + auto originalRet = CanCreateInCurrentContextOriginal(Template); + + if (!originalRet) + { + LOG_INFO(LogDev, "CanCreateInCurrentContextHook false but returning true for {}!", Template->IsValidLowLevel() ? Template->GetPathName() : "BadRead"); + } + + return true; +} + void (*ApplyHomebaseEffectsOnPlayerSetupOriginal)( __int64* GameState, __int64 a2, @@ -259,7 +274,9 @@ 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 LogBuilding 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); @@ -320,6 +337,11 @@ DWORD WINAPI Main(LPVOID) // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3DE5998), (PVOID)SpecialEventScript_ActivatePhaseHook, (PVOID*)&SpecialEventScript_ActivatePhaseOriginal); // 7FF7E5565998 } + if (Fortnite_Version == 6.21) + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x191D2E0), (PVOID)CanCreateInCurrentContextHook, (PVOID*)&CanCreateInCurrentContextOriginal); + else if (Fortnite_Version == 10.40) + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x22A30C0), (PVOID)CanCreateInCurrentContextHook, (PVOID*)&CanCreateInCurrentContextOriginal); + if (bUseSwitchLevel) { static auto SwitchLevel = FindObject(L"/Script/Engine.PlayerController.SwitchLevel"); @@ -535,6 +557,9 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FortWeaponDefault, FindObject(L"/Script/FortniteGame.FortWeapon.ServerReleaseWeaponAbility"), AFortWeapon::ServerReleaseWeaponAbilityHook, (PVOID*)&AFortWeapon::ServerReleaseWeaponAbilityOriginal, false, true); + Hooking::MinHook::Hook(FindObject("/Script/Engine.Default__KismetSystemLibrary"), FindObject(L"/Script/Engine.KismetSystemLibrary.PrintString"), + UKismetSystemLibrary::PrintStringHook, (PVOID*)&UKismetSystemLibrary::PrintStringOriginal, false, true); + Hooking::MinHook::Hook((PVOID)Addresses::GetSquadIdForCurrentPlayer, (PVOID)AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook); auto OnPlayImpactFXStringRef = Memcury::Scanner::FindStringRef(L"OnPlayImpactFX", true, 0); @@ -755,6 +780,9 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItems"), UInventoryManagementLibrary::SwapItemsHook, (PVOID*)&UInventoryManagementLibrary::SwapItemsOriginal, false, true); + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__AthenaDeimosRift"), FindObject(L"/Script/FortniteGame.AthenaDeimosRift.QueueActorsToSpawn"), + AAthenaDeimosRift::QueueActorsToSpawnHook, (PVOID*)&AAthenaDeimosRift::QueueActorsToSpawnOriginal, false, true); + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortAthenaVehicleSpawner"), FindObject(L"/Script/FortniteGame.FortAthenaVehicleSpawner.SpawnVehicle"), AFortAthenaVehicleSpawner::SpawnVehicleHook, nullptr, false); diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index e75daa3..124075f 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -1221,17 +1221,37 @@ static inline uint64 FindTickFlush() static inline uint64 FindAddNavigationSystemToWorld() { - return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 33 ED 41", false).Get(); + uint64 addr = 0; + + if (Engine_Version == 421) + addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 83 B9 ? ? ? ? ? 41 0F B6 F1 0F B6 FA 48", false).Get(); + if (Engine_Version == 423) + addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 33 ED 41", false).Get(); + + return addr; } static inline uint64 FindNavSystemCleanUp() { - auto Addr = Memcury::Scanner::FindStringRef(L"UNavigationSystemV1::CleanUp", false); + auto Addrr = Memcury::Scanner::FindStringRef(L"UNavigationSystemV1::CleanUp", false).Get(); - if (!Addr.Get()) + if (!Addrr) return 0; - return FindBytes(Addr, { 0x48, 0x89, 0x5C }, 500, 0, true); + for (int i = 0; i < 500; i++) + { + if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0x5C) + { + return Addrr - i; + } + + if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x53) + { + return Addrr - i; + } + } + + return 0; } static inline uint64 FindLoadPlayset(const std::vector& Bytes = std::vector({ 0x48, 0x89, 0x5C }), int recursive = 0) diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index d6bdcee..5775b8b 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -69,6 +69,7 @@ extern inline bool bEnableBotTick = false; extern inline bool bEnableCombinePickup = false; extern inline int AmountOfBotsToSpawn = 0; extern inline bool bEnableRebooting = false; +extern inline bool bEngineDebugLogs = false; // THE BASE CODE IS FROM IMGUI GITHUB @@ -515,6 +516,22 @@ 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"); + Mission->Get(bCalendarAllowsSpawningOffset) = true; + } + } + if (!bIsInAutoRestart && (Engine_Version < 424 && ImGui::Button("Restart"))) { if (Engine_Version < 424) @@ -983,6 +1000,7 @@ static inline void MainUI() { ImGui::Checkbox("Looting Debug Log", &bDebugPrintLooting); ImGui::Checkbox("Swapping Debug Log", &bDebugPrintSwapping); + ImGui::Checkbox("Engine Debug Log", &bEngineDebugLogs); } else if (Tab == SETTINGS_TAB) {