This commit is contained in:
Milxnor
2023-03-22 00:41:44 -04:00
parent 97ab80fef0
commit 4913d64719
16 changed files with 298 additions and 35 deletions

View File

@@ -702,6 +702,9 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
}
}
static auto SquadIdOffset = PlayerStateAthena->GetOffset("SquadId", false);
if (SquadIdOffset != 0)
PlayerStateAthena->GetSquadId() = PlayerStateAthena->GetTeamIndex() - 2;
// idk if this is needed

View File

@@ -1,12 +1,57 @@
#include "FortGameStateAthena.h"
#include "reboot.h"
#include "FortPlayerStateAthena.h"
/* void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState)
{
} */
UObject*& AFortGameStateAthena::GetCurrentPlaylist()
{
static auto CurrentPlaylistInfoOffset = GetOffset("CurrentPlaylistInfo", false);
if (CurrentPlaylistInfoOffset == 0)
{
static auto CurrentPlaylistDataOffset = GetOffset("CurrentPlaylistData");
return Get(CurrentPlaylistDataOffset);
}
auto CurrentPlaylistInfo = this->GetPtr<FFastArraySerializer>(CurrentPlaylistInfoOffset);
static auto BasePlaylistOffset = FindOffsetStruct("/Script/FortniteGame.PlaylistPropertyArray", "BasePlaylist");
return *(UObject**)(__int64(CurrentPlaylistInfo) + BasePlaylistOffset);
}
int AFortGameStateAthena::GetAircraftIndex(AFortPlayerState* PlayerState)
{
// The function has a string in it but we can just remake lol
auto PlayerStateAthena = Cast<AFortPlayerStateAthena>(PlayerState);
if (!PlayerStateAthena)
return 0;
auto CurrentPlaylist = GetCurrentPlaylist();
if (!CurrentPlaylist)
return 0;
static auto AirCraftBehaviorOffset = GetOffset("AirCraftBehavior");
if (Get<uint8_t>(AirCraftBehaviorOffset) != 1) // AirCraftBehavior != EAirCraftBehavior::OpposingAirCraftForEachTeam
return 0;
auto TeamIndex = PlayerStateAthena->GetTeamIndex();
int idfkwhatthisisimguessing = TeamIndex;
static auto DefaultFirstTeamOffset = CurrentPlaylist->GetOffset("DefaultFirstTeam");
auto DefaultFirstTeam = CurrentPlaylist->Get<int>(DefaultFirstTeamOffset);
return TeamIndex - idfkwhatthisisimguessing;
}
bool AFortGameStateAthena::IsRespawningAllowed(AFortPlayerState* PlayerState) // actually in zone
{
static auto IsRespawningAllowedFn = FindObject<UFunction>("/Script/FortniteGame.FortGameStateZone.IsRespawningAllowed");

View File

@@ -30,8 +30,11 @@ public:
return Get<EAthenaGamePhase>(GamePhaseOffset);
}
UObject*& GetCurrentPlaylist();
// void AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState);
int GetAircraftIndex(AFortPlayerState* PlayerState);
bool IsRespawningAllowed(AFortPlayerState* PlayerState); // actually in zone
void OnRep_GamePhase();
void OnRep_CurrentPlaylistInfo();

View File

@@ -304,7 +304,7 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, Aircrafts->at(0));
PlayerController->Possess(NewPawn);
// PC->ServerRestartPlayer();
// PlayerController->ServerRestartPlayer();
}
void AFortPlayerController::ServerDropAllItemsHook(AFortPlayerController* PlayerController, UFortItemDefinition* IgnoreItemDef)

View File

@@ -51,6 +51,9 @@ public:
if (CosmeticLoadoutPCOffset == 0)
CosmeticLoadoutPCOffset = this->GetOffset("CustomizationLoadout");
if (CosmeticLoadoutPCOffset == 0)
return nullptr;
auto CosmeticLoadout = this->GetPtr<FFortAthenaLoadout>(CosmeticLoadoutPCOffset);
return CosmeticLoadout;

View File

@@ -5,6 +5,18 @@
#include "SoftObjectPtr.h"
#include "globals.h"
#include "GameplayStatics.h"
#include "hooking.h"
void AFortPlayerControllerAthena::ServerRestartPlayerHook(AFortPlayerControllerAthena* Controller)
{
static auto FortPlayerControllerZoneDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortPlayerControllerZone");
static auto ServerRestartPlayerFn = FindObject<UFunction>(L"/Script/Engine.PlayerController.ServerRestartPlayer");
static auto ZoneServerRestartPlayer = __int64(FortPlayerControllerZoneDefault->VFTable[GetFunctionIdxOrPtr(ServerRestartPlayerFn) / 8]);
static void (*ZoneServerRestartPlayerOriginal)(AFortPlayerController*) = decltype(ZoneServerRestartPlayerOriginal)(__int64(ZoneServerRestartPlayer));
LOG_INFO(LogDev, "Call 0x{:x}!", ZoneServerRestartPlayer - __int64(_ReturnAddress()));
return ZoneServerRestartPlayerOriginal(Controller);
}
void AFortPlayerControllerAthena::ServerGiveCreativeItemHook(AFortPlayerControllerAthena* Controller, FFortItemEntry CreativeItem)
{
@@ -72,6 +84,7 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl
{
auto CosmeticLoadout = ControllerAsFort->GetCosmeticLoadout();
if (CosmeticLoadout)
ApplyCID(PawnAsFort, CosmeticLoadout->GetCharacter());
return;

View File

@@ -62,6 +62,7 @@ public:
return (AFortPlayerStateAthena*)GetPlayerState();
}
static void ServerRestartPlayerHook(AFortPlayerControllerAthena* Controller);
static void ServerGiveCreativeItemHook(AFortPlayerControllerAthena* Controller, FFortItemEntry CreativeItem);
static void ServerTeleportToPlaygroundLobbyIslandHook(AFortPlayerControllerAthena* Controller);
static void ServerAcknowledgePossessionHook(APlayerController* Controller, APawn* Pawn);

View File

@@ -21,9 +21,11 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
{
LOG_INFO(LogDev, "SpawnDefaultPawnFor: 0x{:x}!", __int64(_ReturnAddress()) - __int64(GetModuleHandleW(0)));
// static auto PawnClass = FindObject<UClass>("/Game/Athena/PlayerPawn_Athena.PlayerPawn_Athena_C");
// GameMode->Get<UClass*>("DefaultPawnClass") = PawnClass;
auto PawnClass = GameMode->GetDefaultPawnClassForController(NewPlayer);
// auto PawnClass = GameMode->GetDefaultPawnClassForController(NewPlayer);
// LOG_INFO(LogDev, "PawnClass: {}", PawnClass->GetFullName());
static auto PawnClass = FindObject<UClass>("/Game/Athena/PlayerPawn_Athena.PlayerPawn_Athena_C");
GameMode->Get<UClass*>("DefaultPawnClass") = PawnClass;
static auto fn = FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnAtTransform");
@@ -44,7 +46,8 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
if (!WorldInventory->GetPickaxeInstance())
{
auto CosmeticLoadoutPickaxe = NewPlayerAsAthena->GetCosmeticLoadout()->GetPickaxe();
auto CosmeticLoadout = NewPlayerAsAthena->GetCosmeticLoadout();
auto CosmeticLoadoutPickaxe = CosmeticLoadout ? CosmeticLoadout->GetPickaxe() : nullptr;
static auto WeaponDefinitionOffset = FindOffsetStruct("/Script/FortniteGame.AthenaPickaxeItemDefinition", "WeaponDefinition");
auto Pickaxe = CosmeticLoadoutPickaxe ? CosmeticLoadoutPickaxe->Get<UFortItemDefinition*>(WeaponDefinitionOffset)

View File

@@ -58,9 +58,9 @@ static FGameplayAbilitySpec* MakeNewSpec(UClass* GameplayAbilityClass, UObject*
static auto ActiveCountOffset = FindOffsetStruct("/Script/GameplayAbilities.GameplayAbilitySpec", "ActiveCount", false);
constexpr bool bUseNativeSpecConstructor = true;
bool bUseNativeSpecConstructor = Addresses::SpecConstructor;
if constexpr (bUseNativeSpecConstructor)
if (bUseNativeSpecConstructor)
{
static __int64 (*SpecConstructor)(__int64 spec, UObject* Ability, int Level, int InputID, UObject* SourceObject) = decltype(SpecConstructor)(Addresses::SpecConstructor);

View File

@@ -293,7 +293,7 @@ void Offsets::FindAll()
Offsets::Children = Engine_Version >= 425 ? 0x50 : Offsets::SuperStruct + 8;
Offsets::PropertiesSize = Offsets::Children + 8;
if (Engine_Version >= 419 && Engine_Version <= 421)
if (Engine_Version >= 416 && Engine_Version <= 421)
Offsets::Func = 0xB0;
else if (Engine_Version >= 422 && Engine_Version <= 424)
Offsets::Func = 0xC0;
@@ -324,7 +324,9 @@ void Offsets::FindAll()
else if (std::floor(Fortnite_Version) >= 21)
Offsets::ServerReplicateActors = 0x67; // checked onb 22.30
if (Engine_Version == 419)
if (Engine_Version == 416)
Offsets::ReplicationFrame = 0x288;
else if (Engine_Version == 419)
Offsets::ReplicationFrame = 0xB2;
}

View File

@@ -143,3 +143,150 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration;
}
void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
{
if (!Object || !Function)
return;
if (Globals::bLogProcessEvent)
{
auto FunctionName = Function->GetName(); // UKismetSystemLibrary::GetPathName(Function).ToString();
auto FunctionFullName = Function->GetFullName();
auto ObjectName = Object->GetName();
if (!strstr(FunctionName.c_str(), ("EvaluateGraphExposedInputs")) &&
!strstr(FunctionName.c_str(), ("Tick")) &&
!strstr(FunctionName.c_str(), ("OnSubmixEnvelope")) &&
!strstr(FunctionName.c_str(), ("OnSubmixSpectralAnalysis")) &&
!strstr(FunctionName.c_str(), ("OnMouse")) &&
!strstr(FunctionName.c_str(), ("Pulse")) &&
!strstr(FunctionName.c_str(), ("BlueprintUpdateAnimation")) &&
!strstr(FunctionName.c_str(), ("BlueprintPostEvaluateAnimation")) &&
!strstr(FunctionName.c_str(), ("BlueprintModifyCamera")) &&
!strstr(FunctionName.c_str(), ("BlueprintModifyPostProcess")) &&
!strstr(FunctionName.c_str(), ("Loop Animation Curve")) &&
!strstr(FunctionName.c_str(), ("UpdateTime")) &&
!strstr(FunctionName.c_str(), ("GetMutatorByClass")) &&
!strstr(FunctionName.c_str(), ("UpdatePreviousPositionAndVelocity")) &&
!strstr(FunctionName.c_str(), ("IsCachedIsProjectileWeapon")) &&
!strstr(FunctionName.c_str(), ("LockOn")) &&
!strstr(FunctionName.c_str(), ("GetAbilityTargetingLevel")) &&
!strstr(FunctionName.c_str(), ("ReadyToEndMatch")) &&
!strstr(FunctionName.c_str(), ("ReceiveDrawHUD")) &&
!strstr(FunctionName.c_str(), ("OnUpdateDirectionalLightForTimeOfDay")) &&
!strstr(FunctionName.c_str(), ("GetSubtitleVisibility")) &&
!strstr(FunctionName.c_str(), ("GetValue")) &&
!strstr(FunctionName.c_str(), ("InputAxisKeyEvent")) &&
!strstr(FunctionName.c_str(), ("ServerTouchActiveTime")) &&
!strstr(FunctionName.c_str(), ("SM_IceCube_Blueprint_C")) &&
!strstr(FunctionName.c_str(), ("OnHovered")) &&
!strstr(FunctionName.c_str(), ("OnCurrentTextStyleChanged")) &&
!strstr(FunctionName.c_str(), ("OnButtonHovered")) &&
!strstr(FunctionName.c_str(), ("ExecuteUbergraph_ThreatPostProcessManagerAndParticleBlueprint")) &&
!strstr(FunctionName.c_str(), "PinkOatmeal") &&
!strstr(FunctionName.c_str(), "CheckForDancingAtFish") &&
!strstr(FunctionName.c_str(), ("UpdateCamera")) &&
!strstr(FunctionName.c_str(), ("GetMutatorContext")) &&
!strstr(FunctionName.c_str(), ("CanJumpInternal")) &&
!strstr(FunctionName.c_str(), ("OnDayPhaseChanged")) &&
!strstr(FunctionName.c_str(), ("Chime")) &&
!strstr(FunctionName.c_str(), ("ServerMove")) &&
!strstr(FunctionName.c_str(), ("OnVisibilitySetEvent")) &&
!strstr(FunctionName.c_str(), "ReceiveHit") &&
!strstr(FunctionName.c_str(), "ReadyToStartMatch") &&
!strstr(FunctionName.c_str(), "K2_GetComponentToWorld") &&
!strstr(FunctionName.c_str(), "ClientAckGoodMove") &&
!strstr(FunctionName.c_str(), "Prop_WildWest_WoodenWindmill_01") &&
!strstr(FunctionName.c_str(), "ContrailCheck") &&
!strstr(FunctionName.c_str(), "B_StockBattleBus_C") &&
!strstr(FunctionName.c_str(), "Subtitles.Subtitles_C.") &&
!strstr(FunctionName.c_str(), "/PinkOatmeal/PinkOatmeal_") &&
!strstr(FunctionName.c_str(), "BP_SpectatorPawn_C") &&
!strstr(FunctionName.c_str(), "FastSharedReplication") &&
!strstr(FunctionName.c_str(), "OnCollisionHitEffects") &&
!strstr(FunctionName.c_str(), "BndEvt__SkeletalMesh") &&
!strstr(FunctionName.c_str(), ".FortAnimInstance.AnimNotify_") &&
!strstr(FunctionName.c_str(), "OnBounceAnimationUpdate") &&
!strstr(FunctionName.c_str(), "ShouldShowSoundIndicator") &&
!strstr(FunctionName.c_str(), "Primitive_Structure_AmbAudioComponent_C") &&
!strstr(FunctionName.c_str(), "PlayStoppedIdleRotationAudio") &&
!strstr(FunctionName.c_str(), "UpdateOverheatCosmetics") &&
!strstr(FunctionName.c_str(), "StormFadeTimeline__UpdateFunc") &&
!strstr(FunctionName.c_str(), "BindVolumeEvents") &&
!strstr(FunctionName.c_str(), "UpdateStateEvent") &&
!strstr(FunctionName.c_str(), "VISUALS__UpdateFunc") &&
!strstr(FunctionName.c_str(), "Flash__UpdateFunc") &&
!strstr(FunctionName.c_str(), "SetCollisionEnabled") &&
!strstr(FunctionName.c_str(), "SetIntensity") &&
!strstr(FunctionName.c_str(), "Storm__UpdateFunc") &&
!strstr(FunctionName.c_str(), "CloudsTimeline__UpdateFunc") &&
!strstr(FunctionName.c_str(), "SetRenderCustomDepth") &&
!strstr(FunctionName.c_str(), "K2_UpdateCustomMovement") &&
!strstr(FunctionName.c_str(), "AthenaHitPointBar_C.Update") &&
!strstr(FunctionName.c_str(), "ExecuteUbergraph_Farm_WeatherVane_01") &&
!strstr(FunctionName.c_str(), "HandleOnHUDElementVisibilityChanged") &&
!strstr(FunctionName.c_str(), "ExecuteUbergraph_Fog_Machine") &&
!strstr(FunctionName.c_str(), "ReceiveBeginPlay") &&
!strstr(FunctionName.c_str(), "OnMatchStarted") &&
!strstr(FunctionName.c_str(), "CustomStateChanged") &&
!strstr(FunctionName.c_str(), "OnBuildingActorInitialized") &&
!strstr(FunctionName.c_str(), "OnWorldReady") &&
!strstr(FunctionName.c_str(), "OnAttachToBuilding") &&
!strstr(FunctionName.c_str(), "Clown Spinner") &&
!strstr(FunctionName.c_str(), "K2_GetActorLocation") &&
!strstr(FunctionName.c_str(), "GetViewTarget") &&
!strstr(FunctionName.c_str(), "GetAllActorsOfClass") &&
!strstr(FunctionName.c_str(), "OnUpdateMusic") &&
!strstr(FunctionName.c_str(), "Check Closest Point") &&
!strstr(FunctionName.c_str(), "OnSubtitleChanged__DelegateSignature") &&
!strstr(FunctionName.c_str(), "OnServerBounceCallback") &&
!strstr(FunctionName.c_str(), "BlueprintGetInteractionTime") &&
!strstr(FunctionName.c_str(), "OnServerStopCallback") &&
!strstr(FunctionName.c_str(), "Light Flash Timeline__UpdateFunc") &&
!strstr(FunctionName.c_str(), "MainFlightPath__UpdateFunc") &&
!strstr(FunctionName.c_str(), "PlayStartedIdleRotationAudio") &&
!strstr(FunctionName.c_str(), "BGA_Athena_FlopperSpawn_") &&
!strstr(FunctionName.c_str(), "CheckShouldDisplayUI") &&
!strstr(FunctionName.c_str(), "Timeline_0__UpdateFunc") &&
!strstr(FunctionName.c_str(), "ClientMoveResponsePacked") &&
!strstr(FunctionName.c_str(), "ExecuteUbergraph_B_Athena_FlopperSpawnWorld_Placement") &&
!strstr(FunctionName.c_str(), "Countdown__UpdateFunc") &&
!strstr(FunctionName.c_str(), "OnParachuteTrailUpdated") &&
!strstr(FunctionName.c_str(), "Moto FadeOut__UpdateFunc") &&
!strstr(FunctionName.c_str(), "ExecuteUbergraph_Apollo_GasPump_Valet") &&
!strstr(FunctionName.c_str(), "GetOverrideMeshMaterial") &&
!strstr(FunctionName.c_str(), "VendWobble__UpdateFunc") &&
!strstr(FunctionName.c_str(), "WaitForPawn") &&
!strstr(FunctionName.c_str(), "FragmentMovement__UpdateFunc") &&
!strstr(FunctionName.c_str(), "TrySetup") &&
!strstr(FunctionName.c_str(), "Fade Doused Smoke__UpdateFunc") &&
!strstr(FunctionName.c_str(), "SetPlayerToSkydive") &&
!strstr(FunctionName.c_str(), "BounceCar__UpdateFunc") &&
!strstr(FunctionName.c_str(), "BP_CalendarDynamicPOISelect") &&
!strstr(FunctionName.c_str(), "OnComponentHit_Event_0") &&
!strstr(FunctionName.c_str(), "HandleSimulatingComponentHit") &&
!strstr(FunctionName.c_str(), "CBGA_GreenGlop_WithGrav_C") &&
!strstr(FunctionName.c_str(), "WarmupCountdownEndTimeUpdated") &&
!strstr(FunctionName.c_str(), "BP_CanInteract") &&
!strstr(FunctionName.c_str(), "AthenaHitPointBar_C") &&
!strstr(FunctionName.c_str(), "ServerFireAIDirectorEvent") &&
!strstr(FunctionName.c_str(), "BlueprintThreadSafeUpdateAnimation") &&
!strstr(FunctionName.c_str(), "On Amb Zap Spawn") &&
!strstr(FunctionName.c_str(), "ServerSetPlayerCanDBNORevive") &&
!strstr(FunctionName.c_str(), "BGA_Petrol_Pickup_C") &&
!strstr(FunctionName.c_str(), "GetMutatorsForContextActor") &&
!strstr(FunctionName.c_str(), "GetControlRotation") &&
!strstr(FunctionName.c_str(), "K2_GetComponentLocation") &&
!strstr(FunctionName.c_str(), "MoveFromOffset__UpdateFunc") &&
!strstr(FunctionFullName.c_str(), "PinkOatmeal_GreenGlop_C") &&
!strstr(ObjectName.c_str(), "CBGA_GreenGlop_WithGrav_C") &&
!strstr(FunctionFullName.c_str(), "GCNL_EnvCampFire_Fire_C"))
{
LOG_INFO(LogDev, "Function called: {} with {}", FunctionFullName, ObjectName);
}
}
return Object->ProcessEvent(Function, Parameters);
}

View File

@@ -75,6 +75,7 @@ DWORD WINAPI Main(LPVOID)
Addresses::Print();
static auto GameModeDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortGameModeAthena");
static auto FortPlayerControllerZoneDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortPlayerControllerZone");
static auto FortPlayerControllerAthenaDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortPlayerControllerAthena"); // FindObject<UClass>(L"/Game/Athena/Athena_PlayerController.Default__Athena_PlayerController_C");
static auto FortPlayerPawnAthenaDefault = FindObject<UClass>(L"/Game/Athena/PlayerPawn_Athena.Default__PlayerPawn_Athena_C");
static auto FortAbilitySystemComponentAthenaDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortAbilitySystemComponentAthena");
@@ -181,8 +182,16 @@ DWORD WINAPI Main(LPVOID)
AFortPlayerController::ServerAttemptInteractHook, (PVOID*)&AFortPlayerController::ServerAttemptInteractOriginal, false, true);
}
static auto ServerRestartPlayerFn = FindObject<UFunction>(L"/Script/Engine.PlayerController.ServerRestartPlayer");
auto ZoneServerRestartPlayer = FortPlayerControllerZoneDefault->VFTable[GetFunctionIdxOrPtr(ServerRestartPlayerFn) / 8];
LOG_INFO(LogDev, "ZoneServerRestartPlayer: 0x{:x}", __int64(ZoneServerRestartPlayer) - __int64(GetModuleHandleW(0)));
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/Engine.PlayerController.ServerAcknowledgePossession"),
AFortPlayerControllerAthena::ServerAcknowledgePossessionHook, nullptr, false);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, ServerRestartPlayerFn,
// ZoneServerRestartPlayer,
AFortPlayerControllerAthena::ServerRestartPlayerHook,
nullptr, false);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerDropAllItems"),
AFortPlayerController::ServerDropAllItemsHook, nullptr, false);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerAttemptInventoryDrop"),
@@ -302,6 +311,8 @@ DWORD WINAPI Main(LPVOID)
// Hooking::MinHook::Hook((PVOID)FindFunctionCall(L"ServerRemoveInventoryItem"), UFortInventoryInterface::RemoveInventoryItemHook);
Hooking::MinHook::Hook((PVOID)Addresses::SetZoneToIndex, (PVOID)SetZoneToIndexHook, (PVOID*)&SetZoneToIndexOriginal);
Hooking::MinHook::Hook((PVOID)Addresses::ProcessEvent, ProcessEventHook, (PVOID*)&UObject::ProcessEventOriginal);
AddVehicleHook();
LOG_INFO(LogDev, "Test: 0x{:x}", FindFunctionCall(L"ClientOnPawnDied") - __int64(GetModuleHandleW(0)));
@@ -382,6 +393,12 @@ DWORD WINAPI Main(LPVOID)
GameMode->Get<float>("WarmupEarlyCountdownDuration") = 0;
}
else if (GetAsyncKeyState(VK_F9) & 1)
{
Globals::bLogProcessEvent = !Globals::bLogProcessEvent;
}
Sleep(1000 / 30);
}

View File

@@ -66,9 +66,7 @@ static inline uintptr_t FindBytes(Memcury::Scanner& Scanner, const std::vector<u
static inline uint64 FindStaticFindObject(int StringSkip = 1)
{
if (Engine_Version == 500)
{
return Memcury::Scanner::FindPattern("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 45 33 F6 4C 8B E1 45 0F B6 E9 49 8B F8 41 8B C6").Get();
}
if (Engine_Version >= 427) // ok so like the func is split up in ida idfk what to do about it
{
@@ -78,6 +76,9 @@ static inline uint64 FindStaticFindObject(int StringSkip = 1)
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60 45 33 ED 45 8A F9 44 38 2D ? ? ? ? 49 8B F8 48 8B").Get();
}
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("4C 8B DC 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 49 89 6B F0 49 89 73 E8").Get();
auto Addr = Memcury::Scanner::FindStringRef(L"Illegal call to StaticFindObject() while serializing object data!", true, StringSkip, Engine_Version >= 427);
auto Final = FindBytes(Addr, { 0x48, 0x89, 0x5C }, 255, 0, true, 0, false); // Addr.ScanFor(bytes, false).Get();
@@ -101,15 +102,20 @@ static inline uint64 FindObjectArray()
if (Engine_Version >= 421)
return Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8B 0C C8 48 8B 04 D1").RelativeOffset(3).Get();
auto addr = Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8D 14 C8 EB 03 49 8B D6 8B 42 08 C1 E8 1D A8 01 0F 85 ? ? ? ? F7 86 ? ? ? ? ? ? ? ?", false).RelativeOffset(3).Get(); // 4.16
auto cc = Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8D 14 C8 EB 03 49 8B D6 8B 42 08 C1 E8 1D A8 01 0F 85 ? ? ? ? F7 86 ? ? ? ? ? ? ? ?", false);
auto addr = cc.Get() ? cc.RelativeOffset(3).Get() : 0; // 4.16
if (!addr)
{
if (Engine_Version >= 416 || Engine_Version <= 420)
{
addr = Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8D 1C C8 81 4B ? ? ? ? ? 49 63 76 30", false).RelativeOffset(3).Get();
auto aa = Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8D 1C C8 81 4B ? ? ? ? ? 49 63 76 30", false);
addr = aa.Get() ? aa.RelativeOffset(3).Get() : 0;
if (!addr)
addr = Memcury::Scanner::FindPattern("48 8B 05 ? ? ? ? 48 8D 1C C8 81 4B ? ? ? ? ? 49 63 76 30", false).RelativeOffset(3).Get();
}
}
return addr;
}
@@ -121,10 +127,13 @@ static inline uint64 FindCreateNetDriver()
static inline uint64 FindKickPlayer()
{
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("40 53 56 48 81 EC ? ? ? ? 48 8B DA 48 8B F1 E8 ? ? ? ? 48 8B 06 48 8B CE").Get();
if (std::floor(Fortnite_Version) == 18)
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 48 83 65 ? ? 4C 8B F2 83 65 E8 00 4C 8B E1 83 65 EC").Get();
if (Engine_Version >= 423 || Engine_Version <= 425)
if (Engine_Version >= 423 || Engine_Version <= 425) // && instead of || ??
return Memcury::Scanner::FindPattern("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC ? 49 8B F0 48 8B DA 48 85 D2").Get();
// return 0;
@@ -199,12 +208,16 @@ static inline uint64 FindPauseBeaconRequests()
if (Engine_Version == 419)
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72").Get(); // i supposed this is just because its getitng wrong string ref
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 6F 80 3D ? ? ? ? ? 72 33 48 8B 05").Get();
auto Addr = Memcury::Scanner::FindStringRef(L"All Beacon Requests Resumed.");
return FindBytes(Addr, { 0x40, 0x53 }, 1000, 0, true);
}
static inline uint64 FindGetPlayerViewpoint()
{
// return Memcury::Scanner::FindPattern("40 55 56 57 41 57 48 8B EC 48 83 EC 48 48 8B 81 ? ? ? ? 4D 8B F8 48 8B").Get(); // 12.41
return Memcury::Scanner::FindPattern("40 55 53 57 41 56 41 57 48 8B EC 48 83 EC 40 48 8B 81 ? ? ? ? 4D").Get();
auto Addr = Memcury::Scanner::FindStringRef(L"APlayerController::GetPlayerViewPoint: out_Location, ViewTarget=%s", true);
@@ -222,7 +235,7 @@ static inline uint64 FindSpawnActor()
auto Addr = Memcury::Scanner::FindStringRef(L"SpawnActor failed because no class was specified");
if (Engine_Version == 419)
if (Engine_Version >= 416 && Engine_Version <= 419)
return FindBytes(Addr, { 0x40, 0x55 }, 3000, 0, true);
return FindBytes(Addr, { 0x4C, 0x8B, 0xDC }, 3000, 0, true);
@@ -400,10 +413,10 @@ static inline uint64 FindSetZoneToIndex() // actually StartNewSafeZonePhase
// if (Fortnite_Version == 14.60)
// return __int64(GetModuleHandleW(0)) + 0x207F9B0;
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 44 8B F2 89 54 24 48 4C 8B F9 48 89 4D 90 E8 ? ? ? ? 45 33 ED 48 89 45 A0 48 8B F0").Get(); // 19.10
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 44 8B F2 89 54 24 48 4C 8B F9 48 89 4D 90 E8 ? ? ? ? 45 33 ED 48 89 45 A0 48 8B F0").Get(); // 19.10
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D 68 98 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 08 44 8B F2 89 54 24 48 48 8B F1 48 89 4C 24 ? E8 ? ? ? ? 45 33 E4 48 89 44 24 ? 4C 8B F8 48 85 C0 74 09").Get(); // 17.30
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D 68 88 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 10 44 8B F2 89 54 24 48 48 8B F1 48 89 4C 24 ? E8 ? ? ? ? 45 33 E4 48 89 45 80 4C 8B F8 48 85 C0 74 09 48 8B B8").Get(); // 17.50
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B B1 ? ? ? ? 45 33 ED 89 54 24 70 44 8B FA 48 89 4C 24").Get(); // 18.40
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B B1 ? ? ? ? 45 33 ED 89 54 24 70 44 8B FA 48 89 4C 24").Get(); // 18.40
return Memcury::Scanner::FindPattern("40 55 53 56 41 55 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 18 48 8B").Get(); // 14.60
auto Addr = Memcury::Scanner::FindStringRef(L"FortGameModeAthena: No MegaStorm on SafeZone[%d]. GridCellThickness is less than 1.0.");
@@ -442,10 +455,11 @@ static inline uint64 FindTickFlush()
// auto add = Memcury::Scanner::FindStringRef(L"UDemoNetDriver::TickFlush: ReplayStreamer ERROR: %s");
// return Memcury::Scanner(FindBytes(add, { 0xE8 }, 500, 0, true, 1)).RelativeOffset(1).Get();
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("4C 8B DC 55 53 56 57 49 8D AB ? ? ? ? 48 81 EC ? ? ? ? 41 0F 29 7B").Get(); // 2.4.2
if (Engine_Version == 419)
{
return Memcury::Scanner::FindPattern("4C 8B DC 55 49 8D AB ? ? ? ? 48 81 EC ? ? ? ? 45 0F 29 43 ? 45 0F 29 4B ? 48 8B 05 ? ? ? ? 48").Get(); // 2.4.2
}
if (Engine_Version == 427)
{
@@ -524,6 +538,9 @@ static inline uint64 FindGIsServer()
// if (Fortnite_Version == 19.10)
// return __int64(GetModuleHandleW(0)) + 0xB30CF9D;
if (Fortnite_Version == 12.41)
return __int64(GetModuleHandleW(0)) + 0x804B65A;
if (Fortnite_Version == 14.60)
return __int64(GetModuleHandleW(0)) + 0x939930E;
@@ -623,6 +640,9 @@ static inline uint64 FindGIsClient()
if (Fortnite_Version == 11.31)
return __int64(GetModuleHandleW(0)) + 0x6F41270;
if (Fortnite_Version == 12.41)
return __int64(GetModuleHandleW(0)) + 0x804B659;
if (Fortnite_Version == 14.60)
return __int64(GetModuleHandleW(0)) + 0x939930D;
@@ -796,9 +816,10 @@ static inline uint64 FindGiveAbilityAndActivateOnce()
static inline uint64 FindGiveAbility()
{
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 56 57 41 56 48 83 EC 20 83 B9").Get();
if (Engine_Version == 420)
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 56 57 41 56 48 83 EC 20 83 B9 ? ? ? ? ? 49 8B F0 4C 8B F2 48 8B D9 7E 61").Get();
if (Engine_Version == 421)
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 7C 24 ? 41 56 48 83 EC 20 83 B9 ? ? ? ? ? 49 8B E8 4C 8B F2").Get();
@@ -838,9 +859,7 @@ static inline uint64 FindReplaceBuildingActor()
if (!StringRef.Get()) // we are on a version where stats dont exist
{
// todo hardcode sigs
return 0;
return Memcury::Scanner::FindPattern("4C 89 44 24 ? 55 56 57 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 45").Get(); // 1.7.2 & 2.4.2
}
return FindBytes(StringRef, (Engine_Version == 420 || Engine_Version == 421 ? std::vector<uint8_t>{ 0x48, 0x8B, 0xC4 } : std::vector<uint8_t>{ 0x4C, 0x8B }), 1000, 0, true);
@@ -848,14 +867,16 @@ static inline uint64 FindReplaceBuildingActor()
static inline uint64 FindSendClientAdjustment()
{
if (Engine_Version == 419)
return Memcury::Scanner::FindPattern("40 53 48 83 EC 20 48 8B 99 ? ? ? ? 48 39 99 ? ? ? ? 74 0A 48 83 B9 ? ? ? ? ? 74").Get();
if (Engine_Version >= 416 && Engine_Version < 420)
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()
{
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();
if (Engine_Version == 419)
return Memcury::Scanner::FindPattern("40 55 56 41 54 41 55 41 56 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 4C 8B E9 48 8B 49 68 48").Get();
@@ -864,7 +885,7 @@ static inline uint64 FindReplicateActor()
static inline uint64 FindCreateChannel()
{
if (Engine_Version == 419)
if (Engine_Version == 416 && Engine_Version < 420)
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 0;
@@ -872,6 +893,8 @@ static inline uint64 FindCreateChannel()
static inline uint64 FindSetChannelActor()
{
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();
if (Engine_Version == 419)
return Memcury::Scanner::FindPattern("48 8B C4 55 53 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 89 70 E8 48 8B D9").Get();
@@ -880,6 +903,8 @@ static inline uint64 FindSetChannelActor()
static inline uint64 FindCallPreReplication()
{
if (Engine_Version == 416)
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)
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();

View File

@@ -6,5 +6,6 @@ namespace Globals
extern inline bool bGoingToPlayEvent = false;
extern inline bool bNoMCP = true;
extern inline bool bLateGame = false;
extern inline bool bAbilitiesEnabled = false;
extern inline bool bAbilitiesEnabled = true;
extern inline bool bLogProcessEvent = false;
}

View File

@@ -236,7 +236,7 @@ namespace Hooking
if (!DefaultClass || !DefaultClass->VFTable)
{
LOG_WARN(LogHook, "DefaultClass or the vtable is null! ({})", __int64(DefaultClass));
LOG_WARN(LogHook, "DefaultClass or the vtable for function {} is null! ({})", Function->GetName(), __int64(DefaultClass));
return false;
}

View File

@@ -334,7 +334,7 @@ static UObject* GetPlaylistToUse()
}
*/
// Playlist = FindObject("/Game/Athena/Playlists/Playground/Playlist_Playground.Playlist_Playground");
Playlist = FindObject("/Game/Athena/Playlists/Playground/Playlist_Playground.Playlist_Playground");
// Playlist = FindObject("/MoleGame/Playlists/Playlist_MoleGame.Playlist_MoleGame");
// Playlist = FindObject("/Game/Athena/Playlists/DADBRO/Playlist_DADBRO_Squads_8.Playlist_DADBRO_Squads_8");