From 80b4b20d73610f2f05612e6112cf2600519a0fa8 Mon Sep 17 00:00:00 2001 From: Milxnor Date: Sun, 9 Apr 2023 01:16:08 -0400 Subject: [PATCH] a lot fix looting s5, fix mcp skins on (FortWorldMarkerDataSize); static auto IconOffset = FindOffsetStruct("/Script/FortniteGame.MarkedActorDisplayInfo", "Icon"); + static auto DisplayNameOffset = FindOffsetStruct("/Script/FortniteGame.MarkedActorDisplayInfo", "DisplayName"); static auto WorldPositionOffset = FindOffsetStruct("/Script/FortniteGame.FortWorldMarkerData", "WorldPosition", false); static auto WorldPositionOffsetOffset = FindOffsetStruct("/Script/FortniteGame.FortWorldMarkerData", "WorldPositionOffset", false); @@ -39,14 +42,15 @@ void UAthenaMarkerComponent::ServerAddMapMarkerHook(UAthenaMarkerComponent* Mark MarkerData->GetWorldPositionOffset() = MarkerRequestPtr->GetWorldPositionOffset(); MarkerData->GetMarkerID() = MarkerID; MarkerData->GetMarkedActorClass().SoftObjectPtr.WeakPtr.ObjectIndex = -1; - MarkerData->GetMarkedActorClass().SoftObjectPtr.TagAtLastTest = -1; + MarkerData->GetMarkedActorClass().SoftObjectPtr.TagAtLastTest = 0; MarkerData->GetMarkedActorClass().SoftObjectPtr.WeakPtr.ObjectSerialNumber = 0; MarkerData->GetMarkedActor().SoftObjectPtr.WeakPtr.ObjectIndex = -1; - MarkerData->GetMarkedActor().SoftObjectPtr.TagAtLastTest = -1; + MarkerData->GetMarkedActor().SoftObjectPtr.TagAtLastTest = 0; MarkerData->GetMarkedActor().SoftObjectPtr.WeakPtr.ObjectSerialNumber = 0; ((TSoftObjectPtr*)(__int64(MarkerData->GetCustomDisplayInfo()) + IconOffset))->SoftObjectPtr.WeakPtr.ObjectIndex = -1; - ((TSoftObjectPtr*)(__int64(MarkerData->GetCustomDisplayInfo()) + IconOffset))->SoftObjectPtr.TagAtLastTest = -1; + ((TSoftObjectPtr*)(__int64(MarkerData->GetCustomDisplayInfo()) + IconOffset))->SoftObjectPtr.TagAtLastTest = 0; ((TSoftObjectPtr*)(__int64(MarkerData->GetCustomDisplayInfo()) + IconOffset))->SoftObjectPtr.WeakPtr.ObjectSerialNumber = 0; + *(FText*)(__int64(MarkerData->GetCustomDisplayInfo()) + DisplayNameOffset) = UKismetTextLibrary::Conv_StringToText(L""); /* if (MarkerRequest.MarkedActor) { diff --git a/Project Reboot 3.0/AthenaMarkerComponent.h b/Project Reboot 3.0/AthenaMarkerComponent.h index 917f659..da5fb5c 100644 --- a/Project Reboot 3.0/AthenaMarkerComponent.h +++ b/Project Reboot 3.0/AthenaMarkerComponent.h @@ -9,6 +9,8 @@ struct FMarkerID { int PlayerID; int InstanceID; }; struct FFortClientMarkerRequest { + char pad[0x20]; // real + int& GetInstanceID() { static auto InstanceIDOffset = FindOffsetStruct("/Script/FortniteGame.FortClientMarkerRequest", "InstanceID"); diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index eea2d7c..fa9ea36 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -42,12 +42,14 @@ enum class EDynamicFoundationType : uint8_t EDynamicFoundationType_MAX = 4 }; -std::string PlaylistName = +std::string PlaylistName = "/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo"; +// "/Game/Athena/Playlists/Playlist_DefaultDuo.Playlist_DefaultDuo"; // "/Game/Athena/Playlists/Playground/Playlist_Playground.Playlist_Playground"; // "/Game/Athena/Playlists/Carmine/Playlist_Carmine.Playlist_Carmine"; // "/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"; static UFortPlaylist* GetPlaylistToUse() { diff --git a/Project Reboot 3.0/FortLootPackage.cpp b/Project Reboot 3.0/FortLootPackage.cpp index c2e5941..01f5659 100644 --- a/Project Reboot 3.0/FortLootPackage.cpp +++ b/Project Reboot 3.0/FortLootPackage.cpp @@ -415,6 +415,12 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs } } + if (LTDTables.size() <= 0 || LPTables.size() <= 0) + { + LOG_WARN(LogLoot, "Empty tables! ({} {})", LTDTables.size(), LPTables.size()); + return LootDrops; + } + std::vector TierGroupLTDs; for (int p = 0; p < LTDTables.size(); p++) @@ -426,7 +432,7 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs if (!LTD->IsValidLowLevel()) { - if (bPrint) + // if (bPrint) LOG_INFO(LogLoot, "BadRead!"); continue; diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index b0fc4fe..374b82a 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -100,7 +100,7 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl CopyStruct(PawnAsFort->GetPtr<__int64>(Pawn_CosmeticLoadoutOffset), CosmeticLoadout, FFortAthenaLoadout::GetStructSize()); } */ - ApplyCID(PawnAsFort, CosmeticLoadout->GetCharacter(), true); + ApplyCID(PawnAsFort, CosmeticLoadout->GetCharacter(), false); auto Backpack = CosmeticLoadout->GetBackpack(); diff --git a/Project Reboot 3.0/KismetTextLibrary.cpp b/Project Reboot 3.0/KismetTextLibrary.cpp new file mode 100644 index 0000000..03eb964 --- /dev/null +++ b/Project Reboot 3.0/KismetTextLibrary.cpp @@ -0,0 +1,25 @@ +#include "KismetTextLibrary.h" + +#include "reboot.h" + +FText UKismetTextLibrary::Conv_StringToText(const FString& inString) +{ + static auto Conv_StringToTextFn = FindObject("/Script/Engine.KismetTextLibrary.Conv_StringToText"); + + struct + { + FString inString; // (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FText ReturnValue; // (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic) + }UKismetTextLibrary_Conv_StringToText_Params{inString}; + + static auto Default__KismetTextLibrary = FindObject("/Script/Engine.Default__KismetTextLibrary"); + Default__KismetTextLibrary->ProcessEvent(Conv_StringToTextFn, &UKismetTextLibrary_Conv_StringToText_Params); + + return UKismetTextLibrary_Conv_StringToText_Params.ReturnValue; +} + +UClass* UKismetTextLibrary::StaticClass() +{ + static auto Class = FindObject("/Script/Engine.KismetTextLibrary"); + return Class; +} \ No newline at end of file diff --git a/Project Reboot 3.0/KismetTextLibrary.h b/Project Reboot 3.0/KismetTextLibrary.h new file mode 100644 index 0000000..5eff3c2 --- /dev/null +++ b/Project Reboot 3.0/KismetTextLibrary.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Object.h" +#include "UnrealString.h" +#include "Text.h" + +class UKismetTextLibrary : public UObject +{ +public: + static FText Conv_StringToText(const FString& inString); + + static UClass* StaticClass(); +}; \ No newline at end of file diff --git a/Project Reboot 3.0/Object.cpp b/Project Reboot 3.0/Object.cpp index fa7b954..50e0838 100644 --- a/Project Reboot 3.0/Object.cpp +++ b/Project Reboot 3.0/Object.cpp @@ -165,6 +165,9 @@ void UObject::AddToRoot() bool UObject::IsValidLowLevel() { + if (std::floor(Fortnite_Version) == 5) // real 1:1 + return true; + if (this == nullptr) { // UE_LOG(LogUObjectBase, Warning, TEXT("NULL object")); diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj b/Project Reboot 3.0/Project Reboot 3.0.vcxproj index 8483e97..9b071d8 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -213,6 +213,7 @@ + @@ -313,6 +314,7 @@ + @@ -337,11 +339,13 @@ + + 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 b7a9c1d..2205e15 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -185,6 +185,9 @@ FortniteGame\Source\FortniteGame\Private\Abilities + + Engine\Source\Runtime\Engine\Private + @@ -557,6 +560,15 @@ Engine\Source\Runtime\Core\Public\Delegates + + Engine\Source\Runtime\Core\Public\Internationalization + + + Engine\Source\Runtime\Core\Public\Templates + + + Engine\Source\Runtime\Engine\Classes\Kismet + @@ -754,6 +766,9 @@ {d01c7b5d-ef89-43ec-b94f-882c419aa74b} + + {b00f4455-11e7-4fd9-aa6d-2d814788b544} + diff --git a/Project Reboot 3.0/SharedPointer.h b/Project Reboot 3.0/SharedPointer.h index d9a2b0a..3e09418 100644 --- a/Project Reboot 3.0/SharedPointer.h +++ b/Project Reboot 3.0/SharedPointer.h @@ -1,5 +1,7 @@ #pragma once +#include "SharedPointerInternals.h" + template< class ObjectType> class TSharedPtr { @@ -33,4 +35,12 @@ public: { return Object; } +}; + +template< class ObjectType, ESPMode Mode > +class TSharedRef +{ +public: + ObjectType* Object; + FSharedReferencer SharedReferenceCount; }; \ No newline at end of file diff --git a/Project Reboot 3.0/SharedPointerInternals.h b/Project Reboot 3.0/SharedPointerInternals.h new file mode 100644 index 0000000..8fc59dc --- /dev/null +++ b/Project Reboot 3.0/SharedPointerInternals.h @@ -0,0 +1,47 @@ +#pragma once + +#ifndef PLATFORM_CPU_ARM_FAMILY +#if (defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || defined(_M_ARM64)) +#define PLATFORM_CPU_ARM_FAMILY 1 +#else +#define PLATFORM_CPU_ARM_FAMILY 0 +#endif +#endif +#define PLATFORM_WEAKLY_CONSISTENT_MEMORY PLATFORM_CPU_ARM_FAMILY +#define FORCE_THREADSAFE_SHAREDPTRS PLATFORM_WEAKLY_CONSISTENT_MEMORY + +enum class ESPMode +{ + /** Forced to be not thread-safe. */ + NotThreadSafe = 0, + + /** + * Fast, doesn't ever use atomic interlocks. + * Some code requires that all shared pointers are thread-safe. + * It's better to change it here, instead of replacing ESPMode::Fast to ESPMode::ThreadSafe throughout the code. + */ + Fast = FORCE_THREADSAFE_SHAREDPTRS ? 1 : 0, + + /** Conditionally thread-safe, never spin locks, but slower */ + ThreadSafe = 1 +}; + +class FReferenceControllerBase +{ +public: + FORCEINLINE explicit FReferenceControllerBase() + : SharedReferenceCount(1) + , WeakReferenceCount(1) + { + } + + int32 SharedReferenceCount; + int32 WeakReferenceCount; +}; + +template< ESPMode Mode > +class FSharedReferencer +{ +public: + FReferenceControllerBase* ReferenceController; +}; \ No newline at end of file diff --git a/Project Reboot 3.0/Text.h b/Project Reboot 3.0/Text.h new file mode 100644 index 0000000..f30a18d --- /dev/null +++ b/Project Reboot 3.0/Text.h @@ -0,0 +1,16 @@ +#pragma once + +#include "SharedPointer.h" +#include "inc.h" + +struct ITextData +{ + +}; + +class FText +{ +public: + TSharedRef TextData; + uint32 Flags; +}; \ No newline at end of file diff --git a/Project Reboot 3.0/UObjectArray.h b/Project Reboot 3.0/UObjectArray.h index 20b3b2c..50c3815 100644 --- a/Project Reboot 3.0/UObjectArray.h +++ b/Project Reboot 3.0/UObjectArray.h @@ -163,7 +163,7 @@ extern inline FFixedUObjectArray* UnchunkedObjects = 0; FORCEINLINE UObject* GetObjectByIndex(int32 Index) { - return ChunkedObjects ? ChunkedObjects->GetObjectByIndex(Index) : UnchunkedObjects->GetObjectByIndex(Index); + return ChunkedObjects ? ChunkedObjects->GetObjectByIndex(Index) : UnchunkedObjects ? UnchunkedObjects->GetObjectByIndex(Index) : nullptr; } FORCEINLINE FUObjectItem* GetItemByIndex(int32 Index) diff --git a/Project Reboot 3.0/UnrealString.h b/Project Reboot 3.0/UnrealString.h index 6422597..b9865fb 100644 --- a/Project Reboot 3.0/UnrealString.h +++ b/Project Reboot 3.0/UnrealString.h @@ -32,7 +32,7 @@ public: void Set(const wchar_t* NewStr) // by fischsalat { - if (!NewStr || std::wcslen(NewStr) == 0) return; + if (!NewStr/* || std::wcslen(NewStr) == 0 */) return; Data.ArrayMax = Data.ArrayNum = *NewStr ? (int)std::wcslen(NewStr) + 1 : 0; diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 9d3de3b..8956066 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -59,6 +59,8 @@ static __int64 DispatchRequestHook(__int64 a1, __int64* a2, int a3) if (Engine_Version >= 423) return DispatchRequestOriginal(a1, a2, 3); + // LOG_INFO(LogDev, "Dispatch Request!"); + static auto Offset = FindMcpIsDedicatedServerOffset(); *(int*)(__int64(a2) + Offset) = 3; @@ -523,7 +525,7 @@ DWORD WINAPI Main(LPVOID) AFortPlayerController::ServerAttemptAircraftJumpHook, nullptr, false); } - if (false) + // if (false) { if (Fortnite_Version >= 8.3) // I can't remember, so ServerAddMapMarker existed on like 8.0 or 8.1 or 8.2 but it didn't have the same params. { diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 33dfcdc..82f1b45 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -581,6 +581,9 @@ static inline uint64 FindNoMCP() if (std::floor(Fortnite_Version) == 4) return Memcury::Scanner::FindPattern("E8 ? ? ? ? 83 A7 ? ? ? ? ? 83 E0 01").RelativeOffset(1).Get(); + if (std::floor(Fortnite_Version) == 5) + return Memcury::Scanner::FindPattern("E8 ? ? ? ? 84 C0 75 CE").RelativeOffset(1).Get(); + auto fn = FindObject("/Script/FortniteGame.FortKismetLibrary.IsRunningNoMCP"); LOG_INFO(LogDev, "fn: {}", __int64(fn)); @@ -979,7 +982,7 @@ static inline uint64 FindGIsClient() { // if (Fortnite_Version == 2.5) // return __int64(GetModuleHandleW(0)) + 0x46AD734; - if (Fortnite_Version == 1.72) + /* if (Fortnite_Version == 1.72) return __int64(GetModuleHandleW(0)) + 0x6536B65; if (Fortnite_Version == 1.8) return __int64(GetModuleHandleW(0)) + 0x66637E5; @@ -998,15 +1001,15 @@ static inline uint64 FindGIsClient() if (Fortnite_Version == 14.60) return __int64(GetModuleHandleW(0)) + 0x939930D; if (Fortnite_Version == 17.30) - return __int64(GetModuleHandleW(0)) + 0x973E49B; + return __int64(GetModuleHandleW(0)) + 0x973E49B; */ - return 0; + // return 0; auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering"); - std::vector> BytesArray = { { 0xC6, 0x05 }, { 0x88, 0x1D } }; + std::vector> BytesArray = {{0xC6, 0x05}, {0x88, 0x1D}, { 0x44, 0x88 } }; - int Skip = 2; + int Skip = Engine_Version <= 420 ? 1 : 2; uint64 Addy; @@ -1019,6 +1022,8 @@ static inline uint64 FindGIsClient() bool ShouldBreak = false; + LOG_INFO(LogDev, "[{}] Byte: 0x{:x}", i, (int)CurrentByte); + for (auto& Bytes : BytesArray) { if (CurrentByte == Bytes[0]) @@ -1034,7 +1039,8 @@ static inline uint64 FindGIsClient() } if (Found) { - LOG_INFO(LogDev, "[{}] Skip: 0x{:x}", Skip, Memcury::Scanner(Addr.Get() - i).RelativeOffset(2).Get() - __int64(GetModuleHandleW(0))); + int Relative = Bytes[0] == 0x44 ? 3 : 2; + LOG_INFO(LogDev, "[{}] No Rel 0x{:x} Rel: 0x{:x}", Skip, Memcury::Scanner(Addr.Get() - i).Get() - __int64(GetModuleHandleW(0)), Memcury::Scanner(Addr.Get() - i).RelativeOffset(Relative).Get() - __int64(GetModuleHandleW(0))); if (Skip > 0) { @@ -1042,7 +1048,7 @@ static inline uint64 FindGIsClient() continue; } - Addy = Addr.Get() - i; + Addy = Memcury::Scanner(Addr.Get() - i).RelativeOffset(Relative).Get(); ShouldBreak = true; break; } @@ -1055,14 +1061,9 @@ static inline uint64 FindGIsClient() // std::cout << std::format("CurrentByte: 0x{:x}\n", (uint8_t)CurrentByte); } - /* int Skip = 2; - auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, Skip); - Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, Skip); - Addy = Addy ? Addy : FindBytes(Addr, { 0x88, 0x1D }, 50, 0, true, Skip); */ - LOG_INFO(LogDev, "Addy: 0x{:x}", Addy - __int64(GetModuleHandleW(0))); - return Memcury::Scanner(Addy).RelativeOffset(2).Get(); + return Addy; // 0; // Memcury::Scanner(Addy3).RelativeOffset(2).Get(); /* auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering"); diff --git a/Project Reboot 3.0/reboot.h b/Project Reboot 3.0/reboot.h index 09b3bbc..dc2155c 100644 --- a/Project Reboot 3.0/reboot.h +++ b/Project Reboot 3.0/reboot.h @@ -35,7 +35,14 @@ static inline T* LoadObject(const TCHAR* Name, UClass* Class = T::StaticClass(), return FindObject(Name, Class, Outer); } - return (T*)StaticLoadObjectOriginal(Class, Outer, Name, nullptr, 0, nullptr, false); + auto Object = (T*)StaticLoadObjectOriginal(Class, Outer, Name, nullptr, 0, nullptr, false); + + if (!Object) + { + LOG_WARN(LogDev, "Failed to load object!"); + } + + return Object; } template