This commit is contained in:
Gray
2024-03-12 19:58:43 -04:00
parent 512fb16ee4
commit 72a2afcb72
9 changed files with 62 additions and 26 deletions

View File

@@ -918,6 +918,13 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
} }
} }
static auto ReplicationDriverOffset = GetWorld()->GetNetDriver()->GetOffset("ReplicationDriver", false); // If netdriver is null the world blows up
Globals::bShouldUseReplicationGraph = (!(ReplicationDriverOffset == -1 || Fortnite_Version >= 20))
&& Fortnite_Version != 3.3; // RepGraph is half implemented
LOG_INFO(LogDev, "bShouldUseReplicationGraph: {}", Globals::bShouldUseReplicationGraph);
Globals::bStartedListening = true; Globals::bStartedListening = true;
} }
@@ -1351,7 +1358,8 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
} }
} }
NewPlayer->GetMatchReport() = (UAthenaPlayerMatchReport*)UGameplayStatics::SpawnObject(UAthenaPlayerMatchReport::StaticClass(), NewPlayer); // idk when to do this if (auto MatchReportPtr = NewPlayer->GetMatchReport())
*MatchReportPtr = (UAthenaPlayerMatchReport*)UGameplayStatics::SpawnObject(UAthenaPlayerMatchReport::StaticClass(), NewPlayer); // idk when to do this
static auto SquadIdOffset = PlayerStateAthena->GetOffset("SquadId", false); static auto SquadIdOffset = PlayerStateAthena->GetOffset("SquadId", false);

View File

@@ -26,7 +26,15 @@ void AFortPickup::SpawnMovementComponent()
static auto ProjectileMovementComponentClass = FindObject<UClass>("/Script/Engine.ProjectileMovementComponent"); // UFortProjectileMovementComponent static auto ProjectileMovementComponentClass = FindObject<UClass>("/Script/Engine.ProjectileMovementComponent"); // UFortProjectileMovementComponent
static auto MovementComponentOffset = this->GetOffset("MovementComponent"); static auto MovementComponentOffset = this->GetOffset("MovementComponent");
this->Get(MovementComponentOffset) = UGameplayStatics::SpawnObject(ProjectileMovementComponentClass, this);
if (auto NewComponent = UGameplayStatics::SpawnObject(ProjectileMovementComponentClass, this))
{
this->Get(MovementComponentOffset) = NewComponent;
}
else
{
}
} }
AFortPickup* AFortPickup::SpawnPickup(PickupCreateData& PickupData) AFortPickup* AFortPickup::SpawnPickup(PickupCreateData& PickupData)

View File

@@ -201,10 +201,10 @@ public:
this->ProcessEvent(ClientClearDeathNotificationFn); this->ProcessEvent(ClientClearDeathNotificationFn);
} }
UAthenaPlayerMatchReport*& GetMatchReport() UAthenaPlayerMatchReport** GetMatchReport()
{ {
static auto MatchReportOffset = GetOffset("MatchReport"); static auto MatchReportOffset = GetOffset("MatchReport", false);
return Get<UAthenaPlayerMatchReport*>(MatchReportOffset); return MatchReportOffset == -1 ? nullptr : GetPtr<UAthenaPlayerMatchReport*>(MatchReportOffset);
} }
void ClientSendTeamStatsForPlayer(FAthenaMatchTeamStats* TeamStats) void ClientSendTeamStatsForPlayer(FAthenaMatchTeamStats* TeamStats)

View File

@@ -56,17 +56,14 @@ void UNetDriver::TickFlushHook(UNetDriver* NetDriver)
if (Globals::bStartedListening) if (Globals::bStartedListening)
{ {
static auto ReplicationDriverOffset = NetDriver->GetOffset("ReplicationDriver"/*, false */); if (!Globals::bShouldUseReplicationGraph)
// LOG_INFO(LogDev, "ReplicationDriverOffset{}", ReplicationDriverOffset);
// if (ReplicationDriverOffset == -1)
if (ReplicationDriverOffset == -1 || Fortnite_Version >= 20)
{ {
NetDriver->ServerReplicateActors(); NetDriver->ServerReplicateActors();
} }
else else
{ {
static auto ReplicationDriverOffset = NetDriver->GetOffset("ReplicationDriver"/*, false */);
if (auto ReplicationDriver = NetDriver->Get(ReplicationDriverOffset)) if (auto ReplicationDriver = NetDriver->Get(ReplicationDriverOffset))
{ {
reinterpret_cast<void(*)(UObject*)>(ReplicationDriver->VFTable[Offsets::ServerReplicateActors])(ReplicationDriver); reinterpret_cast<void(*)(UObject*)>(ReplicationDriver->VFTable[Offsets::ServerReplicateActors])(ReplicationDriver);
@@ -654,6 +651,7 @@ int32 UNetDriver::ServerReplicateActors()
std::vector<FActorDestructionInfo*> DeletionEntries; std::vector<FActorDestructionInfo*> DeletionEntries;
#if 0
auto ConnectionDestroyedStartupOrDormantActors = GetDestroyedStartupOrDormantActors(Connection); auto ConnectionDestroyedStartupOrDormantActors = GetDestroyedStartupOrDormantActors(Connection);
if (ConnectionDestroyedStartupOrDormantActors) if (ConnectionDestroyedStartupOrDormantActors)
@@ -683,6 +681,7 @@ int32 UNetDriver::ServerReplicateActors()
} }
LOG_INFO(LogDev, "DeletionEntries: {}", DeletionEntries.size()); LOG_INFO(LogDev, "DeletionEntries: {}", DeletionEntries.size());
#endif
for (FActorDestructionInfo* DeletionEntry : DeletionEntries) for (FActorDestructionInfo* DeletionEntry : DeletionEntries)
{ {

View File

@@ -471,11 +471,25 @@ void Offsets::FindAll()
Offsets::NetworkObjectList = 0x4F0; Offsets::NetworkObjectList = 0x4F0;
Offsets::ReplicationFrame = 0x328; Offsets::ReplicationFrame = 0x328;
} }
if (Fortnite_Version == 3.1 || Fortnite_Version == 3.2) if (Fortnite_Version == 3.1)
{ {
Offsets::NetworkObjectList = 0x4F8; Offsets::NetworkObjectList = 0x4F8;
Offsets::ClientWorldPackageName = 0x1818; Offsets::ClientWorldPackageName = 0x1818;
} }
if (Fortnite_Version == 3.2)
{
Offsets::NetworkObjectList = 0x4F8;
Offsets::ClientWorldPackageName = 0x1820;
}
if (Fortnite_Version == 3.2 || Fortnite_Version == 3.3)
{
Offsets::ReplicationFrame = 0x330;
}
if (Fortnite_Version == 3.3)
{
Offsets::NetworkObjectList = 0x508;
Offsets::ClientWorldPackageName = 0x1828;
}
if (Engine_Version == 419) // checked 2.4.2 & 2.2 & 1.11 if (Engine_Version == 419) // checked 2.4.2 & 2.2 & 1.11
{ {
Offsets::NetworkObjectList = 0x490; Offsets::NetworkObjectList = 0x490;

View File

@@ -95,7 +95,7 @@ namespace Offsets
extern inline uint64 SuperStruct = 0; extern inline uint64 SuperStruct = 0;
extern inline uint64 Offset_Internal = 0; extern inline uint64 Offset_Internal = 0;
extern inline uint64 ServerReplicateActors = 0; extern inline uint64 ServerReplicateActors = 0;
extern inline uint64 ReplicationFrame = 0; extern inline uint64 ReplicationFrame = 0; // Attempt to replicate function '%s' on Actor '%s' while it is in the middle of variable replication!
extern inline uint64 IsNetRelevantFor = 0; extern inline uint64 IsNetRelevantFor = 0;
extern inline uint64 NetworkObjectList = 0; extern inline uint64 NetworkObjectList = 0;
extern inline uint64 ClientWorldPackageName = 0; extern inline uint64 ClientWorldPackageName = 0;

View File

@@ -970,7 +970,7 @@ DWORD WINAPI Main(LPVOID)
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameMode.ReadyToStartMatch"), AFortGameModeAthena::Athena_ReadyToStartMatchHook, Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameMode.ReadyToStartMatch"), AFortGameModeAthena::Athena_ReadyToStartMatchHook,
(PVOID*)&AFortGameModeAthena::Athena_ReadyToStartMatchOriginal, false, false, true); (PVOID*)&AFortGameModeAthena::Athena_ReadyToStartMatchOriginal, false, false, true);
if (Fortnite_Version != 3.3) // 0xE9 on 3.3 if (Fortnite_Version > 3.3) // 0xE9 on 3.3 (assumed every build below)
{ {
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftEnteredDropZone"), AFortGameModeAthena::OnAircraftEnteredDropZoneHook, Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftEnteredDropZone"), AFortGameModeAthena::OnAircraftEnteredDropZoneHook,
(PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true); (PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true);
@@ -1094,8 +1094,12 @@ DWORD WINAPI Main(LPVOID)
AFortPlayerController::ServerLoadingScreenDroppedHook, (PVOID*)&AFortPlayerController::ServerLoadingScreenDroppedOriginal, false, true); AFortPlayerController::ServerLoadingScreenDroppedHook, (PVOID*)&AFortPlayerController::ServerLoadingScreenDroppedOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerReadyToStartMatch"), Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerReadyToStartMatch"),
AFortPlayerControllerAthena::ServerReadyToStartMatchHook, (PVOID*)&AFortPlayerControllerAthena::ServerReadyToStartMatchOriginal, false); AFortPlayerControllerAthena::ServerReadyToStartMatchHook, (PVOID*)&AFortPlayerControllerAthena::ServerReadyToStartMatchOriginal, false);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange"),
AFortPlayerControllerAthena::ServerRequestSeatChangeHook, (PVOID*)&AFortPlayerControllerAthena::ServerRequestSeatChangeOriginal, false); auto ServerRequestSeatChangeFn = FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange");
if (ServerRequestSeatChangeFn)
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange"),
AFortPlayerControllerAthena::ServerRequestSeatChangeHook, (PVOID*)&AFortPlayerControllerAthena::ServerRequestSeatChangeOriginal, false);
// if (false) // if (false)
if (Fortnite_Version > 6.10) // so on 6.10 there isa param and our little finder dont work for that so if (Fortnite_Version > 6.10) // so on 6.10 there isa param and our little finder dont work for that so

View File

@@ -1760,18 +1760,15 @@ static inline uint64 FindReplaceBuildingActor()
static inline uint64 FindSendClientAdjustment() static inline uint64 FindSendClientAdjustment()
{ {
if (Fortnite_Version <= 3.2) return Memcury::Scanner::FindPattern("40 53 48 83 EC 20 48 8B 99 ? ? ? ? 48 39 99 ? ? ? ? 74 0A 48 83 B9", false).Get();
return Memcury::Scanner::FindPattern("40 53 48 83 EC 20 48 8B 99 ? ? ? ? 48 39 99 ? ? ? ? 74 0A 48 83 B9").Get();
if (Fortnite_Version >= 20)
return Memcury::Scanner::FindPattern("40 53 48 83 EC 20 48 8B 99 ? ? ? ? 48 39 99 ? ? ? ? 74 0A 48 83 B9").Get();
return 0;
} }
static inline uint64 FindReplicateActor() static inline uint64 FindReplicateActor()
{ {
if (Engine_Version == 416) if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("40 55 53 57 41 56 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8D 59 68 4C 8B F1 48 8B").Get(); return Memcury::Scanner::FindPattern("40 55 53 57 41 56 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8D 59 68 4C 8B F1 48 8B").Get();
if (Fortnite_Version == 3.3)
return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 A8 0F 29 78 98 48 89 70 E8 4C").Get();
if (Engine_Version >= 419 && Fortnite_Version <= 3.2) if (Engine_Version >= 419 && Fortnite_Version <= 3.2)
{ {
auto addr = Memcury::Scanner::FindPattern("40 55 56 57 41 54 41 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 4C", false).Get(); // 3.0, we could just use this sig for everything? auto addr = Memcury::Scanner::FindPattern("40 55 56 57 41 54 41 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 4C", false).Get(); // 3.0, we could just use this sig for everything?
@@ -1790,7 +1787,7 @@ static inline uint64 FindReplicateActor()
static inline uint64 FindCreateChannel() static inline uint64 FindCreateChannel()
{ {
if (Fortnite_Version <= 3.2) if (Fortnite_Version <= 3.3)
return Memcury::Scanner::FindPattern("40 56 57 41 54 41 55 41 57 48 83 EC 60 48 8B 01 41 8B F9 45 0F B6 E0").Get(); return Memcury::Scanner::FindPattern("40 56 57 41 54 41 55 41 57 48 83 EC 60 48 8B 01 41 8B F9 45 0F B6 E0").Get();
if (Fortnite_Version >= 20) if (Fortnite_Version >= 20)
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 44 89 4C 24 ? 55 57 41 54 41 56 41 57 48 8B EC 48 83 EC 50 45 33 E4 48 8D 05 ? ? ? ? 44 38 25").Get(); return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 44 89 4C 24 ? 55 57 41 54 41 56 41 57 48 8B EC 48 83 EC 50 45 33 E4 48 8D 05 ? ? ? ? 44 38 25").Get();
@@ -1800,14 +1797,19 @@ static inline uint64 FindCreateChannel()
static inline uint64 FindSetChannelActor() static inline uint64 FindSetChannelActor()
{ {
// string ref??
if (Engine_Version == 416) if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("4C 8B DC 55 53 57 41 54 49 8D AB ? ? ? ? 48 81 EC ? ? ? ? 45 33").Get(); return Memcury::Scanner::FindPattern("4C 8B DC 55 53 57 41 54 49 8D AB ? ? ? ? 48 81 EC ? ? ? ? 45 33").Get();
if (Engine_Version >= 419 && Fortnite_Version <= 3.2) if (Engine_Version >= 419 && Fortnite_Version <= 3.3)
{ {
if (Fortnite_Version == 3.3)
return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 10 48 8B D9 48 89 78 18 48 8D 35").Get();
auto aa = Memcury::Scanner::FindPattern("48 8B C4 55 53 57 41 54 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 45 33 E4 48 89 70", false).Get(); auto aa = Memcury::Scanner::FindPattern("48 8B C4 55 53 57 41 54 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 45 33 E4 48 89 70", false).Get();
if (!aa) if (!aa)
return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 E8 48 8B D9").Get(); return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 E8 48 8B D9").Get(); // 3.2
return aa; return aa;
} }
@@ -1823,7 +1825,7 @@ static inline uint64 FindCallPreReplication()
return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 8B C4 55 57 41 57 48 8D 68 A1 48 81 EC").Get(); return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 8B C4 55 57 41 57 48 8D 68 A1 48 81 EC").Get();
if (Engine_Version == 419) if (Engine_Version == 419)
return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 8B C4 55 57 41 54 48 8D 68 A1 48 81 EC ? ? ? ? 48 89 58 08 4C").Get(); return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 8B C4 55 57 41 54 48 8D 68 A1 48 81 EC ? ? ? ? 48 89 58 08 4C").Get();
if (Fortnite_Version >= 2.5 && Fortnite_Version <= 3.2) if (Fortnite_Version >= 2.5 && Fortnite_Version <= 3.3)
return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 56 41 56 48 83 EC 38 4C 8B F2").Get(); return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 56 41 56 48 83 EC 38 4C 8B F2").Get();
if (Fortnite_Version >= 20) if (Fortnite_Version >= 20)
return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC 40 F6 41 58 30 48 8B EA 48 8B D9 40 B6 01").Get(); return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC 40 F6 41 58 30 48 8B EA 48 8B D9 40 B6 01").Get();

View File

@@ -16,6 +16,7 @@ namespace Globals
extern inline bool bInfiniteMaterials = false; extern inline bool bInfiniteMaterials = false;
extern inline bool bInfiniteAmmo = false; extern inline bool bInfiniteAmmo = false;
extern inline bool bShouldUseReplicationGraph = false;
extern inline bool bHitReadyToStartMatch = false; extern inline bool bHitReadyToStartMatch = false;
extern inline bool bInitializedPlaylist = false; extern inline bool bInitializedPlaylist = false;