fix pickup notifications, fix 1.11 crash, remove pickup notifications (to fix restarting and random crashes), fix s7 crash, add delay before switching level, fix some issues with gadgets, fix character parts being buggy.
This commit is contained in:
Milxnor
2023-04-16 00:28:59 -04:00
parent bbf28ed9e9
commit 406090ddcd
15 changed files with 188 additions and 185 deletions

View File

@@ -267,11 +267,13 @@ public:
{ {
// VirtualFree(Data, _msize(Data), MEM_RELEASE); // VirtualFree(Data, _msize(Data), MEM_RELEASE);
// VirtualFree(Data, sizeof(InElementType) * ArrayNum, MEM_RELEASE); // ik this does nothing // VirtualFree(Data, sizeof(InElementType) * ArrayNum, MEM_RELEASE); // ik this does nothing
// VirtualFree(Data, 0, MEM_RELEASE); // auto res = VirtualFree(Data, 0, MEM_RELEASE);
// LOG_INFO(LogDev, "Free: {} aa: 0x{:x}", res, res ? 0 : GetLastError());
static void (*FreeOriginal)(void*) = decltype(FreeOriginal)(Addresses::Free); static void (*FreeOriginal)(void*) = decltype(FreeOriginal)(Addresses::Free);
// FreeOriginal(Data); // FreeOriginal(Data);
} }
Data = nullptr;
ArrayNum = 0; ArrayNum = 0;
ArrayMax = 0; ArrayMax = 0;
} }

View File

@@ -725,7 +725,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
} }
else else
{ {
static auto VendingMachineClass = FindObject<UClass>("/Game/Athena/Items/Gameplay/VendingMachine/B_Athena_VendingMachine.B_Athena_VendingMachine_C"); auto VendingMachineClass = FindObject<UClass>("/Game/Athena/Items/Gameplay/VendingMachine/B_Athena_VendingMachine.B_Athena_VendingMachine_C");
auto AllVendingMachines = UGameplayStatics::GetAllActorsOfClass(GetWorld(), VendingMachineClass); auto AllVendingMachines = UGameplayStatics::GetAllActorsOfClass(GetWorld(), VendingMachineClass);
for (int i = 0; i < AllVendingMachines.Num(); i++) for (int i = 0; i < AllVendingMachines.Num(); i++)

View File

@@ -146,10 +146,16 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
static auto FortItemEntryStruct = FindObject(L"/Script/FortniteGame.FortItemEntry"); static auto FortItemEntryStruct = FindObject(L"/Script/FortniteGame.FortItemEntry");
static auto FortItemEntrySize = *(int*)(__int64(FortItemEntryStruct) + Offsets::PropertiesSize); static auto FortItemEntrySize = *(int*)(__int64(FortItemEntryStruct) + Offsets::PropertiesSize);
FFortItemEntryStateValue* StateValue = Alloc<FFortItemEntryStateValue>(FFortItemEntryStateValue::GetStructSize()); bool bEnableStateValues = false;
if (bEnableStateValues)
{
FFortItemEntryStateValue* StateValue = (FFortItemEntryStateValue*)FMemory::Realloc(0, FFortItemEntryStateValue::GetStructSize(), 0);
// Alloc<FFortItemEntryStateValue>(FFortItemEntryStateValue::GetStructSize());
StateValue->GetIntValue() = bShowItemToast; StateValue->GetIntValue() = bShowItemToast;
StateValue->GetStateType() = EFortItemEntryState::ShouldShowItemToast; StateValue->GetStateType() = EFortItemEntryState::ShouldShowItemToast;
NewItemInstance->GetItemEntry()->GetStateValues().AddPtr(StateValue, FFortItemEntryStateValue::GetStructSize()); NewItemInstance->GetItemEntry()->GetStateValues().AddPtr(StateValue, FFortItemEntryStateValue::GetStructSize());
}
ItemInstances.Add(NewItemInstance); ItemInstances.Add(NewItemInstance);
GetItemList().GetReplicatedEntries().Add(*NewItemInstance->GetItemEntry(), FortItemEntrySize); GetItemList().GetReplicatedEntries().Add(*NewItemInstance->GetItemEntry(), FortItemEntrySize);
@@ -167,9 +173,14 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
{ {
if (auto GadgetItemDefinition = Cast<UFortGadgetItemDefinition>(WorldItemDefinition)) if (auto GadgetItemDefinition = Cast<UFortGadgetItemDefinition>(WorldItemDefinition))
{ {
char (*ApplyGadgetData)(UFortGadgetItemDefinition * a1, __int64 a2, UFortItem* a3, unsigned __int8 a4) = decltype(ApplyGadgetData)(Addresses::ApplyGadgetData); if (GadgetItemDefinition->ShouldDropAllItemsOnEquip()) // idk shouldnt this be auto?
{
FortPlayerController->DropAllItems({ GadgetItemDefinition });
}
bool (*ApplyGadgetData)(UFortGadgetItemDefinition * a1, __int64 a2, UFortItem* a3, unsigned __int8 a4) = decltype(ApplyGadgetData)(Addresses::ApplyGadgetData);
static auto FortInventoryOwnerInterfaceClass = FindObject<UClass>("/Script/FortniteGame.FortInventoryOwnerInterface"); static auto FortInventoryOwnerInterfaceClass = FindObject<UClass>("/Script/FortniteGame.FortInventoryOwnerInterface");
ApplyGadgetData((UFortGadgetItemDefinition*)ItemDefinition, __int64(PlayerController->GetInterfaceAddress(FortInventoryOwnerInterfaceClass)), NewItemInstance, true); LOG_INFO(LogDev, "Res: {}", ApplyGadgetData(GadgetItemDefinition, __int64(PlayerController->GetInterfaceAddress(FortInventoryOwnerInterfaceClass)), NewItemInstance, true));
} }
} }
} }

View File

@@ -182,7 +182,12 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
auto SwappedPickup = SpawnPickup(ItemEntryToSwap, PawnLoc, auto SwappedPickup = SpawnPickup(ItemEntryToSwap, PawnLoc,
EFortPickupSourceTypeFlag::Player, EFortPickupSpawnSource::Unset, Pawn); EFortPickupSourceTypeFlag::Player, EFortPickupSpawnSource::Unset, Pawn);
bWasHoldingSameItemWhenSwap = CurrentItemGuid == ItemInstanceToSwap->GetItemEntry()->GetItemGuid(); auto CurrentWeapon = Pawn->GetCurrentWeapon();
if (CurrentWeapon)
{
bWasHoldingSameItemWhenSwap = CurrentWeapon->GetItemEntryGuid() == ItemInstanceToSwap->GetItemEntry()->GetItemGuid();
}
WorldInventory->RemoveItem(CurrentItemGuid, nullptr, ItemEntryToSwap->GetCount(), true); WorldInventory->RemoveItem(CurrentItemGuid, nullptr, ItemEntryToSwap->GetCount(), true);
@@ -292,6 +297,8 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
{ {
static auto ClientEquipItemFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerControllerAthena.ClientEquipItem") ? FindObject<UFunction>("/Script/FortniteGame.FortPlayerControllerAthena.ClientEquipItem") : FindObject<UFunction>("/Script/FortniteGame.FortPlayerController.ClientEquipItem"); static auto ClientEquipItemFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerControllerAthena.ClientEquipItem") ? FindObject<UFunction>("/Script/FortniteGame.FortPlayerControllerAthena.ClientEquipItem") : FindObject<UFunction>("/Script/FortniteGame.FortPlayerController.ClientEquipItem");
if (ClientEquipItemFn)
{
struct struct
{ {
FGuid ItemGuid; // (ConstParm, Parm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) FGuid ItemGuid; // (ConstParm, Parm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
@@ -300,6 +307,7 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
PlayerController->ProcessEvent(ClientEquipItemFn, &AFortPlayerController_ClientEquipItem_Params); PlayerController->ProcessEvent(ClientEquipItemFn, &AFortPlayerController_ClientEquipItem_Params);
} }
}
return CompletePickupAnimationOriginal(Pickup); return CompletePickupAnimationOriginal(Pickup);
} }

View File

@@ -107,12 +107,17 @@ void AFortPlayerController::ApplyCosmeticLoadout()
if (!UpdatePlayerCustomCharacterPartsVisualizationFn) if (!UpdatePlayerCustomCharacterPartsVisualizationFn)
{ {
/* if (Addresses::ApplyCharacterCustomization) if (Addresses::ApplyCharacterCustomization)
{ {
static void* (*ApplyCharacterCustomizationOriginal)(AFortPlayerState* a1, AFortPawn* a3) = decltype(ApplyCharacterCustomizationOriginal)(Addresses::ApplyCharacterCustomization); static void* (*ApplyCharacterCustomizationOriginal)(AFortPlayerState* a1, AFortPawn* a3) = decltype(ApplyCharacterCustomizationOriginal)(Addresses::ApplyCharacterCustomization);
ApplyCharacterCustomizationOriginal(PlayerStateAsFort, PawnAsFort); ApplyCharacterCustomizationOriginal(PlayerStateAsFort, PawnAsFort);
PlayerStateAsFort->ForceNetUpdate();
PawnAsFort->ForceNetUpdate();
this->ForceNetUpdate();
return; return;
} */ }
auto CosmeticLoadout = this->GetCosmeticLoadout(); auto CosmeticLoadout = this->GetCosmeticLoadout();
@@ -160,12 +165,25 @@ void AFortPlayerController::ApplyCosmeticLoadout()
} }
} }
PlayerStateAsFort->ForceNetUpdate();
PawnAsFort->ForceNetUpdate();
this->ForceNetUpdate();
return; return;
} }
UFortKismetLibrary::StaticClass()->ProcessEvent(UpdatePlayerCustomCharacterPartsVisualizationFn, &PlayerStateAsFort); UFortKismetLibrary::StaticClass()->ProcessEvent(UpdatePlayerCustomCharacterPartsVisualizationFn, &PlayerStateAsFort);
} }
void AFortPlayerController::ServerLoadingScreenDroppedHook(UObject* Context, FFrame* Stack, void* Ret)
{
auto PlayerController = (AFortPlayerController*)Context;
PlayerController->ApplyCosmeticLoadout();
return ServerLoadingScreenDroppedOriginal(Context, Stack, Ret);
}
void AFortPlayerController::ServerRepairBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToRepair) void AFortPlayerController::ServerRepairBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToRepair)
{ {
if (!BuildingActorToRepair) if (!BuildingActorToRepair)
@@ -422,7 +440,7 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
if (!VehicleWeaponDefinition) if (!VehicleWeaponDefinition)
{ {
LOG_INFO(LogDev, "Invlaid VehicleWeaponDefinition!"); LOG_INFO(LogDev, "Invalid VehicleWeaponDefinition!");
return; return;
} }

View File

@@ -49,6 +49,7 @@ public:
static inline void (*ServerEditBuildingActorOriginal)(UObject* Context, FFrame& Stack, void* Ret); static inline void (*ServerEditBuildingActorOriginal)(UObject* Context, FFrame& Stack, void* Ret);
static inline void (*DropSpecificItemOriginal)(UObject* Context, FFrame& Stack, void* Ret); static inline void (*DropSpecificItemOriginal)(UObject* Context, FFrame& Stack, void* Ret);
static inline AActor* (*SpawnToyInstanceOriginal)(UObject* Context, FFrame* Stack, AActor** Ret); static inline AActor* (*SpawnToyInstanceOriginal)(UObject* Context, FFrame* Stack, AActor** Ret);
static inline void (*ServerLoadingScreenDroppedOriginal)(UObject* Context, FFrame* Stack, void* Ret);
void ClientReportDamagedResourceBuilding(ABuildingSMActor* BuildingSMActor, EFortResourceType PotentialResourceType, int PotentialResourceCount, bool bDestroyed, bool bJustHitWeakspot); void ClientReportDamagedResourceBuilding(ABuildingSMActor* BuildingSMActor, EFortResourceType PotentialResourceType, int PotentialResourceCount, bool bDestroyed, bool bJustHitWeakspot);
@@ -83,6 +84,7 @@ public:
void DropAllItems(const std::vector<UFortItemDefinition*>& IgnoreItemDefs, bool bIgnoreSecondaryQuickbar = false, bool bRemoveIfNotDroppable = false); void DropAllItems(const std::vector<UFortItemDefinition*>& IgnoreItemDefs, bool bIgnoreSecondaryQuickbar = false, bool bRemoveIfNotDroppable = false);
void ApplyCosmeticLoadout(); void ApplyCosmeticLoadout();
static void ServerLoadingScreenDroppedHook(UObject* Context, FFrame* Stack, void* Ret);
static void ServerRepairBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToRepair); static void ServerRepairBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToRepair);
static void ServerExecuteInventoryItemHook(AFortPlayerController* PlayerController, FGuid ItemGuid); static void ServerExecuteInventoryItemHook(AFortPlayerController* PlayerController, FGuid ItemGuid);
static void ServerAttemptInteractHook(UObject* Context, FFrame* Stack, void* Ret); static void ServerAttemptInteractHook(UObject* Context, FFrame* Stack, void* Ret);

View File

@@ -12,7 +12,7 @@ void AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook(UObject* Context, FFrame*
UPrimitiveComponent* OtherComp; UPrimitiveComponent* OtherComp;
int OtherBodyIndex; int OtherBodyIndex;
bool bFromSweep; bool bFromSweep;
FHitResult SweepResult = *Alloc<FHitResult>(FHitResult::GetStructSize()); auto SweepResultPtr = (FHitResult*)std::realloc(0, FHitResult::GetStructSize());
LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!"); LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!");
@@ -21,7 +21,9 @@ void AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook(UObject* Context, FFrame*
Stack->StepCompiledIn(&OtherComp); Stack->StepCompiledIn(&OtherComp);
Stack->StepCompiledIn(&OtherBodyIndex); Stack->StepCompiledIn(&OtherBodyIndex);
Stack->StepCompiledIn(&bFromSweep); Stack->StepCompiledIn(&bFromSweep);
Stack->StepCompiledIn(&SweepResult); Stack->StepCompiledIn(SweepResultPtr);
std::free(SweepResultPtr);
// LOG_INFO(LogDev, "OtherActor: {}", __int64(OtherActor)); // LOG_INFO(LogDev, "OtherActor: {}", __int64(OtherActor));
// LOG_INFO(LogDev, "OtherActorName: {}", OtherActor->IsValidLowLevel() ? OtherActor->GetName() : "BadRead") // LOG_INFO(LogDev, "OtherActorName: {}", OtherActor->IsValidLowLevel() ? OtherActor->GetName() : "BadRead")

View File

@@ -49,7 +49,7 @@ struct FGameplayAbilitySpec : FFastArraySerializerItem
static FGameplayAbilitySpec* MakeNewSpec(UClass* GameplayAbilityClass, UObject* SourceObject = nullptr, bool bAlreadyIsDefault = false) static FGameplayAbilitySpec* MakeNewSpec(UClass* GameplayAbilityClass, UObject* SourceObject = nullptr, bool bAlreadyIsDefault = false)
{ {
auto NewSpec = Alloc<FGameplayAbilitySpec>(FGameplayAbilitySpec::GetStructSize()); auto NewSpec = Alloc<FGameplayAbilitySpec>(FGameplayAbilitySpec::GetStructSize(), true);
if (!NewSpec) if (!NewSpec)
return nullptr; return nullptr;

View File

@@ -691,7 +691,7 @@ int32 UNetDriver::ServerReplicateActors_PrioritizeActors(UNetConnection* Connect
// Add in deleted actors // Add in deleted actors
for (auto& CurrentGuid : Connection_DestroyedStartupOrDormantActors) /* for (auto& CurrentGuid : Connection_DestroyedStartupOrDormantActors)
{ {
bool bFound = false; bool bFound = false;
@@ -704,7 +704,7 @@ int32 UNetDriver::ServerReplicateActors_PrioritizeActors(UNetConnection* Connect
OutPriorityActors[FinalSortedCount] = OutPriorityList + FinalSortedCount; OutPriorityActors[FinalSortedCount] = OutPriorityList + FinalSortedCount;
FinalSortedCount++; FinalSortedCount++;
DeletedCount++; DeletedCount++;
} } */
Sort(OutPriorityActors, FinalSortedCount, FCompareFActorPriority()); Sort(OutPriorityActors, FinalSortedCount, FCompareFActorPriority());
} }

View File

@@ -448,6 +448,11 @@ std::vector<uint64> Addresses::GetFunctionsToNull()
toNull.push_back(Memcury::Scanner::FindStringRef(L"Widget Class %s - Running Initialize On Archetype, %s.").ScanFor({ 0x40, 0x55 }, false).Get()); // Widget class toNull.push_back(Memcury::Scanner::FindStringRef(L"Widget Class %s - Running Initialize On Archetype, %s.").ScanFor({ 0x40, 0x55 }, false).Get()); // Widget class
} }
if (Engine_Version == 422)
{
toNull.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 48 83 EC 30 48 8B 41 28 48 8B DA 48 8B F9 48 85 C0 74 34 48 8B 4B 08 48 8D").Get()); // widget class
}
if (Engine_Version == 425) if (Engine_Version == 425)
{ {
toNull.push_back(Memcury::Scanner::FindPattern("40 57 41 56 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F B6 FA 44 8B F1 74 3A 80 3D ? ? ? ? ? 0F 82").Get()); // collect garbage toNull.push_back(Memcury::Scanner::FindPattern("40 57 41 56 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F B6 FA 44 8B F1 74 3A 80 3D ? ? ? ? ? 0F 82").Get()); // collect garbage

View File

@@ -135,6 +135,13 @@ DWORD WINAPI Main(LPVOID)
CreateThread(0, 0, GuiThread, 0, 0, 0); CreateThread(0, 0, GuiThread, 0, 0, 0);
while (SecondsUntilTravel > 0)
{
SecondsUntilTravel -= 1;
Sleep(1000);
}
static auto GameModeDefault = FindObject<AFortGameModeAthena>(L"/Script/FortniteGame.Default__FortGameModeAthena"); static auto GameModeDefault = FindObject<AFortGameModeAthena>(L"/Script/FortniteGame.Default__FortGameModeAthena");
static auto FortPlayerControllerZoneDefault = FindObject<AFortPlayerController>(L"/Script/FortniteGame.Default__FortPlayerControllerZone"); static auto FortPlayerControllerZoneDefault = FindObject<AFortPlayerController>(L"/Script/FortniteGame.Default__FortPlayerControllerZone");
static auto FortPlayerControllerAthenaDefault = FindObject<AFortPlayerControllerAthena>(L"/Script/FortniteGame.Default__FortPlayerControllerAthena"); // FindObject<UClass>(L"/Game/Athena/Athena_PlayerController.Default__Athena_PlayerController_C"); static auto FortPlayerControllerAthenaDefault = FindObject<AFortPlayerControllerAthena>(L"/Script/FortniteGame.Default__FortPlayerControllerAthena"); // FindObject<UClass>(L"/Game/Athena/Athena_PlayerController.Default__Athena_PlayerController_C");
@@ -430,6 +437,8 @@ DWORD WINAPI Main(LPVOID)
AFortPlayerController::ServerEditBuildingActorHook, (PVOID*)&AFortPlayerController::ServerEditBuildingActorOriginal, false, true); AFortPlayerController::ServerEditBuildingActorHook, (PVOID*)&AFortPlayerController::ServerEditBuildingActorOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerEndEditingBuildingActor"), Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerEndEditingBuildingActor"),
AFortPlayerController::ServerEndEditingBuildingActorHook, nullptr, false); AFortPlayerController::ServerEndEditingBuildingActorHook, nullptr, false);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerLoadingScreenDropped"),
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"), Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange"),
@@ -720,137 +729,7 @@ DWORD WINAPI Main(LPVOID)
while (true) while (true)
{ {
if (GetAsyncKeyState(VK_F7) & 1) Sleep(10000);
{
LOG_INFO(LogEvent, "Starting {} event!", GetEventName());
StartEvent();
}
else if (GetAsyncKeyState(VK_F8) & 1)
{
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
auto GameState = GameMode->GetGameState();
if (Fortnite_Version == 1.11)
{
static auto OverrideBattleBusSkin = FindObject("/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
if (OverrideBattleBusSkin)
{
static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager");
auto AssetManager = GetEngine()->Get(AssetManagerOffset);
if (AssetManager)
{
static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData");
auto AthenaGameData = AssetManager->Get(AthenaGameDataOffset);
if (AthenaGameData)
{
static auto DefaultBattleBusSkinOffset = AthenaGameData->GetOffset("DefaultBattleBusSkin");
AthenaGameData->Get(DefaultBattleBusSkinOffset) = OverrideBattleBusSkin;
}
}
static auto DefaultBattleBusOffset = GameState->GetOffset("DefaultBattleBus");
GameState->Get(DefaultBattleBusOffset) = OverrideBattleBusSkin;
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
for (int i = 0; i < AllAircrafts.Num(); i++)
{
auto Aircraft = AllAircrafts.at(i);
static auto DefaultBusSkinOffset = Aircraft->GetOffset("DefaultBusSkin");
Aircraft->Get(DefaultBusSkinOffset) = OverrideBattleBusSkin;
static auto SpawnedCosmeticActorOffset = Aircraft->GetOffset("SpawnedCosmeticActor");
auto SpawnedCosmeticActor = Aircraft->Get<AActor*>(SpawnedCosmeticActorOffset);
if (SpawnedCosmeticActor)
{
static auto ActiveSkinOffset = SpawnedCosmeticActor->GetOffset("ActiveSkin");
SpawnedCosmeticActor->Get(ActiveSkinOffset) = OverrideBattleBusSkin;
}
}
}
}
float Duration = 0;
float EarlyDuration = Duration;
float TimeSeconds = 0; // UGameplayStatics::GetTimeSeconds(GetWorld());
LOG_INFO(LogDev, "Starting bus!");
GameState->Get<float>("WarmupCountdownEndTime") = 0;
GameMode->Get<float>("WarmupCountdownDuration") = 0;
GameState->Get<float>("WarmupCountdownStartTime") = 0;
GameMode->Get<float>("WarmupEarlyCountdownDuration") = 0;
// FString cmd = L"startaircraft";
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), cmd, nullptr);
}
else if (GetAsyncKeyState(VK_F9) & 1)
{
Globals::bLogProcessEvent = !Globals::bLogProcessEvent;
}
else if (GetAsyncKeyState(VK_F10) & 1)
{
if (Engine_Version < 424)
{
FString LevelA = Engine_Version < 424
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501
? L"open Asteria_Terrain"
: Globals::bCreative ? L"open Creative_NoApollo_Terrain"
: L"open Artemis_Terrain"
: Globals::bCreative ? L"open Creative_NoApollo_Terrain"
: L"open Apollo_Terrain";
static auto BeaconClass = FindObject<UClass>(L"/Script/FortniteGame.FortOnlineBeaconHost");
auto AllFortBeacons = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BeaconClass);
for (int i = 0; i < AllFortBeacons.Num(); i++)
{
AllFortBeacons.at(i)->K2_DestroyActor();
}
AllFortBeacons.Free();
LOG_INFO(LogDev, "Switching!");
((AGameMode*)GetWorld()->GetGameMode())->RestartGame();
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), LevelA, nullptr);
// UGameplayStatics::OpenLevel(GetWorld(), UKismetStringLibrary::Conv_StringToName(LevelA), true, FString());
LOG_INFO(LogGame, "Restarting!");
AmountOfRestarts++;
}
else
{
LOG_ERROR(LogGame, "Restarting is not supported on chapter 2 and above!");
}
}
else if (GetAsyncKeyState(VK_F11) & 1)
{
std::ofstream stream("Test.log");
for (auto& Current : ReplicatedActors)
{
stream << Current << '\n';
}
}
/* else if (GetAsyncKeyState(VK_F12) & 1)
{
FillVendingMachines();
} */
Sleep(1000 / 30);
} }
return 0; return 0;

View File

@@ -669,12 +669,35 @@ static inline uint64 FindRemoveGadgetData()
{ {
if (Engine_Version <= 423) if (Engine_Version <= 423)
{ {
auto StringRef = Memcury::Scanner::FindStringRef(L"UFortGadgetItemDefinition::RemoveGadgetData - Removing Gadget Data for Gadget Item [%s]!", false); auto Addr = Memcury::Scanner::FindStringRef(L"UFortGadgetItemDefinition::RemoveGadgetData - Removing Gadget Data for Gadget Item [%s]!", false).Get();
if (!StringRef.Get()) if (!Addr)
StringRef = Memcury::Scanner::FindStringRef(L"UFortGadgetItemDefinition::RemoveGadgetData - Removing Gadget Data for Gadet Item [%s]!"); Addr = Memcury::Scanner::FindStringRef(L"UFortGadgetItemDefinition::RemoveGadgetData - Removing Gadget Data for Gadet Item [%s]!").Get();
return FindBytes(StringRef, { 0x40, 0x55 }, 1000, 0, true); if (!Addr)
return 0;
for (int i = 0; i < 1000; i++)
{
if (/* (*(uint8_t*)(uint8_t*)(Addr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x53)
|| */ (*(uint8_t*)(uint8_t*)(Addr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x55))
{
return Addr - i;
}
if (*(uint8_t*)(uint8_t*)(Addr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addr - i + 2) == 0x5C)
{
return Addr - i;
}
/* if (*(uint8_t*)(uint8_t*)(Addr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x8B && *(uint8_t*)(uint8_t*)(Addr - i + 2) == 0xC4)
{
return Addr - i;
} */
}
return 0;
// return FindBytes(StringRef, { 0x40, 0x55 }, 1000, 0, true);
} }
if (Engine_Version == 426) if (Engine_Version == 426)
return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 56 41 56 41 57 48 83 EC 30 48 8B 02 48").Get(); // 14.60 return Memcury::Scanner::FindPattern("48 85 D2 0F 84 ? ? ? ? 56 41 56 41 57 48 83 EC 30 48 8B 02 48").Get(); // 14.60
@@ -1164,7 +1187,7 @@ static inline uint64 FindApplyCharacterCustomization()
{ {
auto Addrr = Memcury::Scanner::FindStringRef(L"AFortPlayerState::ApplyCharacterCustomization - Failed initialization, using default parts. Player Controller: %s PlayerState: %s, HeroId: %s").Get(); auto Addrr = Memcury::Scanner::FindStringRef(L"AFortPlayerState::ApplyCharacterCustomization - Failed initialization, using default parts. Player Controller: %s PlayerState: %s, HeroId: %s").Get();
for (int i = 0; i < 1000; i++) for (int i = 0; i < 7000; i++)
{ {
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x53) if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x40 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x53)
{ {
@@ -1182,7 +1205,9 @@ static inline uint64 FindApplyCharacterCustomization()
} }
} }
return 0; uint64 Addr = Memcury::Scanner::FindPattern("48 8B C4 48 89 50 10 55 57 48 8D 68 A1 48 81 EC ? ? ? ? 80 B9").Get();
return Addr;
} }
static inline uint64 FindRealloc() static inline uint64 FindRealloc()

View File

@@ -53,6 +53,8 @@
#define LOADOUT_PLAYERTAB 4 #define LOADOUT_PLAYERTAB 4
#define FUN_PLAYERTAB 5 #define FUN_PLAYERTAB 5
static inline int SecondsUntilTravel = 5;
// THE BASE CODE IS FROM IMGUI GITHUB // THE BASE CODE IS FROM IMGUI GITHUB
static LPDIRECT3D9 g_pD3D = NULL; static LPDIRECT3D9 g_pD3D = NULL;
@@ -211,6 +213,16 @@ static bool bIsEditingInventory = false;
static bool bInformationTab = false; static bool bInformationTab = false;
static int playerTabTab = MAIN_PLAYERTAB; static int playerTabTab = MAIN_PLAYERTAB;
void StaticUI()
{
ImGui::Checkbox("No MCP (Don't change unless you know what this is)", &Globals::bNoMCP);
if (Addresses::ApplyGadgetData && Addresses::RemoveGadgetData)
{
ImGui::Checkbox("Enable AGIDs (Don't change unless you know what this is)", &Globals::bEnableAGIDs);
}
}
void MainTabs() void MainTabs()
{ {
// std::ofstream bannedStream(Moderation::Banning::GetFilePath()); // std::ofstream bannedStream(Moderation::Banning::GetFilePath());
@@ -346,10 +358,10 @@ void MainUI()
{ {
if (bLoaded) if (bLoaded)
{ {
StaticUI();
#ifndef PROD #ifndef PROD
ImGui::Checkbox("Log ProcessEvent", &Globals::bLogProcessEvent); ImGui::Checkbox("Log ProcessEvent", &Globals::bLogProcessEvent);
#endif #endif
ImGui::Checkbox("Enable AGIDs", &Globals::bEnableAGIDs);
ImGui::Text(std::format("Listening {}", Globals::bStartedListening).c_str()); ImGui::Text(std::format("Listening {}", Globals::bStartedListening).c_str());
static std::string ConsoleCommand; static std::string ConsoleCommand;
@@ -406,7 +418,55 @@ void MainUI()
if (ImGui::Button("Start Bus Countdown")) if (ImGui::Button("Start Bus Countdown"))
{ {
auto GameState = ((AGameMode*)GetWorld()->GetGameMode())->GetGameState(); auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
auto GameState = GameMode->GetGameState();
if (Fortnite_Version == 1.11)
{
static auto OverrideBattleBusSkin = FindObject("/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
if (OverrideBattleBusSkin)
{
static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager");
auto AssetManager = GetEngine()->Get(AssetManagerOffset);
if (AssetManager)
{
static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData");
auto AthenaGameData = AssetManager->Get(AthenaGameDataOffset);
if (AthenaGameData)
{
static auto DefaultBattleBusSkinOffset = AthenaGameData->GetOffset("DefaultBattleBusSkin");
AthenaGameData->Get(DefaultBattleBusSkinOffset) = OverrideBattleBusSkin;
}
}
static auto DefaultBattleBusOffset = GameState->GetOffset("DefaultBattleBus");
GameState->Get(DefaultBattleBusOffset) = OverrideBattleBusSkin;
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
for (int i = 0; i < AllAircrafts.Num(); i++)
{
auto Aircraft = AllAircrafts.at(i);
static auto DefaultBusSkinOffset = Aircraft->GetOffset("DefaultBusSkin");
Aircraft->Get(DefaultBusSkinOffset) = OverrideBattleBusSkin;
static auto SpawnedCosmeticActorOffset = Aircraft->GetOffset("SpawnedCosmeticActor");
auto SpawnedCosmeticActor = Aircraft->Get<AActor*>(SpawnedCosmeticActorOffset);
if (SpawnedCosmeticActor)
{
static auto ActiveSkinOffset = SpawnedCosmeticActor->GetOffset("ActiveSkin");
SpawnedCosmeticActor->Get(ActiveSkinOffset) = OverrideBattleBusSkin;
}
}
}
}
GameState->Get<float>("WarmupCountdownEndTime") = UGameplayStatics::GetTimeSeconds(GetWorld()) + 10; GameState->Get<float>("WarmupCountdownEndTime") = UGameplayStatics::GetTimeSeconds(GetWorld()) + 10;
} }
@@ -560,17 +620,8 @@ void MainUI()
void PregameUI() void PregameUI()
{ {
// ImGui::NewLine(); StaticUI();
ImGui::Checkbox("No MCP (Don't change unless you know what this is)", &Globals::bNoMCP);
if (Addresses::ClearAbility)
{
ImGui::Checkbox("Enable AGIDs (Don't change unless you know what this is)", &Globals::bEnableAGIDs);
}
if (!Globals::bInitializedPlaylist)
{
if (Engine_Version >= 422 && Engine_Version < 424) if (Engine_Version >= 422 && Engine_Version < 424)
{ {
ImGui::Checkbox("Creative", &Globals::bCreative); ImGui::Checkbox("Creative", &Globals::bCreative);
@@ -583,9 +634,9 @@ void PregameUI()
ImGui::Checkbox("Play Event", &Globals::bGoingToPlayEvent); ImGui::Checkbox("Play Event", &Globals::bGoingToPlayEvent);
} }
ImGui::SliderInt("Seconds until load into map", &SecondsUntilTravel, 1, 100);
ImGui::InputText("Playlist", &PlaylistName); ImGui::InputText("Playlist", &PlaylistName);
} }
}
DWORD WINAPI GuiThread(LPVOID) DWORD WINAPI GuiThread(LPVOID)
{ {

View File

@@ -377,9 +377,9 @@ static void CopyStruct(void* Dest, void* Src, size_t Size, UStruct* Struct = nul
} }
template <typename T = __int64> template <typename T = __int64>
static T* Alloc(size_t Size) static T* Alloc(size_t Size, bool bUseRealloc = false)
{ {
return (T*)VirtualAlloc(0, Size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); return bUseRealloc ? (T*)FMemory::Realloc(0, Size, 0) : (T*)VirtualAlloc(0, Size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
} }
namespace MemberOffsets namespace MemberOffsets

View File

@@ -187,8 +187,8 @@ static inline void FillItemCollector(ABuildingItemCollectorActor* ItemCollector,
} }
// The reason I set the curve to 0 is because it will force it to return value, probably not how we are supposed to do it but whatever. // The reason I set the curve to 0 is because it will force it to return value, probably not how we are supposed to do it but whatever.
ItemCollection->GetInputCount()->GetCurve().CurveTable = nullptr; // FortGameData; // scuffed idc ItemCollection->GetInputCount()->GetCurve().CurveTable = Fortnite_Version < 5 ? nullptr : FortGameData; // scuffed idc
ItemCollection->GetInputCount()->GetCurve().RowName = FName(0); // WoodName; // Scuffed idc ItemCollection->GetInputCount()->GetCurve().RowName = Fortnite_Version < 5 ? FName(0) : WoodName; // Scuffed idc
ItemCollection->GetInputCount()->GetValue() = RarityToUse == 0 ? CommonPrice ItemCollection->GetInputCount()->GetValue() = RarityToUse == 0 ? CommonPrice
: RarityToUse == 1 ? UncommonPrice : RarityToUse == 1 ? UncommonPrice
: RarityToUse == 2 ? RarePrice : RarityToUse == 2 ? RarePrice
@@ -234,7 +234,7 @@ static inline void FillItemCollector(ABuildingItemCollectorActor* ItemCollector,
static inline void FillVendingMachines() static inline void FillVendingMachines()
{ {
static auto VendingMachineClass = FindObject<UClass>("/Game/Athena/Items/Gameplay/VendingMachine/B_Athena_VendingMachine.B_Athena_VendingMachine_C"); auto VendingMachineClass = FindObject<UClass>("/Game/Athena/Items/Gameplay/VendingMachine/B_Athena_VendingMachine.B_Athena_VendingMachine_C");
auto AllVendingMachines = UGameplayStatics::GetAllActorsOfClass(GetWorld(), VendingMachineClass); auto AllVendingMachines = UGameplayStatics::GetAllActorsOfClass(GetWorld(), VendingMachineClass);
auto OverrideLootTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaVending"); // ItemCollector->GetLootTierGroupOverride(); auto OverrideLootTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaVending"); // ItemCollector->GetLootTierGroupOverride();