mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
reboot living up to its name
This commit is contained in:
@@ -27,7 +27,10 @@ void ABuildingGameplayActorSpawnMachine::RebootingDelegateHook(ABuildingGameplay
|
||||
LOG_INFO(LogDev, "RebootingDelegateHook!");
|
||||
|
||||
if (!SpawnMachine->GetResurrectLocation())
|
||||
{
|
||||
LOG_WARN(LogRebooting, "Reboot van did not have a resurrection location!");
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "PlayerIdsForResurrection.Num(): {}", SpawnMachine->GetPlayerIdsForResurrection().Num());
|
||||
|
||||
@@ -61,8 +64,6 @@ void ABuildingGameplayActorSpawnMachine::RebootingDelegateHook(ABuildingGameplay
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "PlayerController: {}", __int64(PlayerController));
|
||||
|
||||
if (!PlayerController)
|
||||
return;
|
||||
|
||||
@@ -91,27 +92,24 @@ void ABuildingGameplayActorSpawnMachine::RebootingDelegateHook(ABuildingGameplay
|
||||
if (!StrongResurrectionLocation)
|
||||
return;
|
||||
|
||||
// GameMode->RestartPlayerAtPlayerStart(PlayerController, StrongResurrectionLocation);
|
||||
|
||||
PlayerState->GetRespawnData()->IsRespawnDataAvailable() = false;
|
||||
PlayerController->SetPlayerIsWaiting(true);
|
||||
PlayerController->ServerRestartPlayer();
|
||||
// PlayerController->ServerRestartPlayer();
|
||||
|
||||
/* static auto PawnClass = FindObject<UClass>("/Game/Athena/PlayerPawn_Athena.PlayerPawn_Athena_C");
|
||||
auto NewPawn = GetWorld()->SpawnActor<AFortPlayerPawnAthena>(PawnClass, StrongResurrectionLocation->GetTransform());
|
||||
PlayerController->Possess(NewPawn); */
|
||||
bool bEnterSkydiving = false; // TODO get from like curve table iirc idk or the variable
|
||||
PlayerController->RespawnPlayerAfterDeath(bEnterSkydiving);
|
||||
|
||||
AFortPlayerPawn* NewPawn = Cast<AFortPlayerPawn>(PlayerController->GetMyFortPawn());
|
||||
|
||||
LOG_INFO(LogDev, "NewPawn: {}", __int64(NewPawn));
|
||||
|
||||
if (!NewPawn) // Failed to restart player
|
||||
{
|
||||
LOG_INFO(LogRebooting, "Failed to restart the player!");
|
||||
return;
|
||||
|
||||
bool bEnterSkydiving = false; // TODO get from like curve table iirc idk or the variable
|
||||
}
|
||||
|
||||
PlayerController->ClientClearDeathNotification();
|
||||
// PlayerController->RespawnPlayerAfterDeath(bEnterSkydiving);
|
||||
|
||||
NewPawn->SetHealth(100);
|
||||
NewPawn->SetMaxHealth(100);
|
||||
@@ -122,6 +120,9 @@ void ABuildingGameplayActorSpawnMachine::RebootingDelegateHook(ABuildingGameplay
|
||||
static auto OnRep_RebootCounterFn = FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerStateAthena.OnRep_RebootCounter");
|
||||
PlayerState->ProcessEvent(OnRep_RebootCounterFn);
|
||||
|
||||
auto OnPlayerPawnResurrectedFn = SpawnMachine->FindFunction("OnPlayerPawnResurrected");
|
||||
SpawnMachine->ProcessEvent(OnPlayerPawnResurrectedFn, &NewPawn);
|
||||
|
||||
static void (*AddToAlivePlayersOriginal)(AFortGameModeAthena* GameMode, AFortPlayerControllerAthena* Player) = decltype(AddToAlivePlayersOriginal)(Addresses::AddToAlivePlayers);
|
||||
|
||||
if (AddToAlivePlayersOriginal)
|
||||
@@ -129,9 +130,6 @@ void ABuildingGameplayActorSpawnMachine::RebootingDelegateHook(ABuildingGameplay
|
||||
AddToAlivePlayersOriginal(GameMode, PlayerController);
|
||||
}
|
||||
|
||||
auto OnPlayerPawnResurrectedFn = SpawnMachine->FindFunction("OnPlayerPawnResurrected");
|
||||
SpawnMachine->ProcessEvent(OnPlayerPawnResurrectedFn, &NewPawn);
|
||||
|
||||
bool IsFinalPlayerToBeRebooted = true;
|
||||
|
||||
if (IsFinalPlayerToBeRebooted)
|
||||
|
||||
@@ -687,6 +687,35 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
|
||||
LOG_INFO(LogNet, "WorldLevel {}", GameState->GetWorldLevel());
|
||||
|
||||
if (Globals::AmountOfListens == 1) // we only want to do this one time.
|
||||
{
|
||||
if (bEnableRebooting)
|
||||
{
|
||||
auto GameSessionDedicatedAthenaPatch = Memcury::Scanner::FindPattern("3B 41 38 7F ? 48 8B D0 48 8B 41 30 4C 39 04 D0 75 ? 48 8D 96", false).Get(); // todo check this sig more
|
||||
|
||||
if (GameSessionDedicatedAthenaPatch)
|
||||
{
|
||||
PatchBytes(GameSessionDedicatedAthenaPatch, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
else
|
||||
{
|
||||
auto S19Patch = Memcury::Scanner::FindPattern("74 1A 48 8D 97 ? ? ? ? 49 8B CF E8 ? ? ? ? 88 87 ? ? ? ? E9").Get();
|
||||
|
||||
if (S19Patch)
|
||||
{
|
||||
PatchByte(S19Patch, 0x75);
|
||||
}
|
||||
}
|
||||
|
||||
if (bEnableRebooting)
|
||||
{
|
||||
HookInstruction(Addresses::RebootingDelegate, (PVOID)ABuildingGameplayActorSpawnMachine::RebootingDelegateHook, "/Script/Engine.PlayerController.SetVirtualJoystickVisibility", ERelativeOffsets::LEA, FindObject("/Script/FortniteGame.Default__BuildingGameplayActorSpawnMachine"));
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "Patched GameSession!");
|
||||
}
|
||||
}
|
||||
|
||||
if (auto TeamsArrayContainer = GameState->GetTeamsArrayContainer())
|
||||
{
|
||||
GET_PLAYLIST(GameState);
|
||||
@@ -700,6 +729,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
LOG_INFO(LogDev, "TeamsArrayContainer->TeamsArray.Num() Before: {}", TeamsArrayContainer->TeamsArray.Num());
|
||||
LOG_INFO(LogDev, "TeamsArrayContainer->SquadsArray.Num() Before: {}", TeamsArrayContainer->SquadsArray.Num());
|
||||
|
||||
/*
|
||||
if (TeamsArrayContainer->TeamsArray.Num() != AllTeamsNum)
|
||||
{
|
||||
LOG_INFO(LogDev, "Filling TeamsArray!");
|
||||
@@ -713,6 +743,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
TeamsArrayContainer->SquadsArray.Free();
|
||||
TeamsArrayContainer->SquadsArray.AddUninitialized(AllTeamsNum);
|
||||
}
|
||||
*/
|
||||
|
||||
for (int i = 0; i < TeamsArrayContainer->TeamsArray.Num(); i++)
|
||||
{
|
||||
@@ -745,7 +776,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
{
|
||||
auto CurrentRebootVan = (ABuildingGameplayActorSpawnMachine*)AllRebootVans.at(i);
|
||||
static auto FortPlayerStartClass = FindObject<UClass>(L"/Script/FortniteGame.FortPlayerStart");
|
||||
CurrentRebootVan->GetResurrectLocation() = CurrentRebootVan->GetClosestActor(FortPlayerStartClass, 100);
|
||||
CurrentRebootVan->GetResurrectLocation() = CurrentRebootVan->GetClosestActor(FortPlayerStartClass, 300);
|
||||
}
|
||||
|
||||
AllRebootVans.Free();
|
||||
|
||||
@@ -294,7 +294,10 @@ void AFortGameStateAthena::OnRep_PlayersLeft()
|
||||
|
||||
TeamsArrayContainer* AFortGameStateAthena::GetTeamsArrayContainer()
|
||||
{
|
||||
if (!bEnableRebooting) // todo (milxnor) remove
|
||||
// if (!bEnableRebooting) // todo (milxnor) remove when safer
|
||||
// return nullptr;
|
||||
|
||||
if (Fortnite_Version < 8.0) // I'm pretty sure it got added on 7.40 but idk if it is structured differently.
|
||||
return nullptr;
|
||||
|
||||
static auto FriendlyFireTypeOffset = GetOffset("FriendlyFireType");
|
||||
@@ -302,7 +305,8 @@ TeamsArrayContainer* AFortGameStateAthena::GetTeamsArrayContainer()
|
||||
|
||||
if (Offset == -1)
|
||||
{
|
||||
Offset = FriendlyFireTypeOffset + 0x5;
|
||||
static int IncreaseBy = Engine_Version >= 424 ? 0x25 : 0x5;
|
||||
Offset = FriendlyFireTypeOffset + IncreaseBy;
|
||||
}
|
||||
|
||||
return Offset != -1 ? (TeamsArrayContainer*)(__int64(this) + Offset) : nullptr;
|
||||
|
||||
@@ -323,6 +323,9 @@ void UFortKismetLibrary::K2_RemoveItemFromPlayerHook(UObject* Context, FFrame& S
|
||||
|
||||
LOG_INFO(LogDev, __FUNCTION__);
|
||||
|
||||
if(!PlayerController)
|
||||
return K2_RemoveItemFromPlayerOriginal(Context, Stack, Ret);
|
||||
|
||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
|
||||
@@ -1424,7 +1424,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
||||
|
||||
LOG_INFO(LogDev, "PlayersLeft: {} IsDBNO: {}", GameState->GetPlayersLeft(), DeadPawn->IsDBNO());
|
||||
|
||||
if (!DeadPawn->IsDBNO())
|
||||
if (bHandleDeath && !DeadPawn->IsDBNO())
|
||||
{
|
||||
if (Fortnite_Version > 1.8 || Fortnite_Version == 1.11)
|
||||
{
|
||||
@@ -1513,7 +1513,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
||||
|
||||
if (CurrentPlayerState->GetPlace() <= 1)
|
||||
{
|
||||
// bDidSomeoneWin = true;
|
||||
bDidSomeoneWin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ void AFortPlayerControllerAthena::ServerRestartPlayerHook(AFortPlayerControllerA
|
||||
static auto ZoneServerRestartPlayer = __int64(FortPlayerControllerZoneDefault->VFTable[GetFunctionIdxOrPtr(ServerRestartPlayerFn) / 8]);
|
||||
static void (*ZoneServerRestartPlayerOriginal)(AFortPlayerController*) = decltype(ZoneServerRestartPlayerOriginal)(__int64(ZoneServerRestartPlayer));
|
||||
|
||||
LOG_INFO(LogDev, "Call 0x{:x} returning with 0x{:x}!", ZoneServerRestartPlayer - __int64(_ReturnAddress()), __int64(ZoneServerRestartPlayerOriginal) - __int64(GetModuleHandleW(0)));
|
||||
LOG_INFO(LogDev, "ServerRestartPlayerHook Call 0x{:x} returning with 0x{:x}!", ZoneServerRestartPlayer - __int64(_ReturnAddress()), __int64(ZoneServerRestartPlayerOriginal) - __int64(GetModuleHandleW(0)));
|
||||
return ZoneServerRestartPlayerOriginal(Controller);
|
||||
}
|
||||
|
||||
|
||||
@@ -579,6 +579,7 @@ std::vector<uint64> Addresses::GetFunctionsToNull()
|
||||
if (std::floor(Fortnite_Version) == 17)
|
||||
{
|
||||
toNull.push_back(Memcury::Scanner::FindPattern("48 8B C4 48 89 70 08 48 89 78 10 55 41 54 41 55 41 56 41 57 48 8D 68 A1 48 81 EC ? ? ? ? 45 33 ED").Get()); // collectgarbage
|
||||
toNull.push_back(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 4D 8B F9 41 8A F0 4C 8B F2 48 8B F9 45 32 E4").Get()); // No Reserve
|
||||
}
|
||||
|
||||
if (Engine_Version == 500)
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include "KismetStringLibrary.h"
|
||||
#include "DataTableFunctionLibrary.h"
|
||||
#include "FortPlaysetItemDefinition.h"
|
||||
#include "gui.h"
|
||||
|
||||
static inline void (*SetZoneToIndexOriginal)(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK);
|
||||
|
||||
static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK)
|
||||
static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK)
|
||||
{
|
||||
static auto ZoneDurationsOffset = Fortnite_Version >= 15 && Fortnite_Version < 18 ? 0x258
|
||||
: std::floor(Fortnite_Version) >= 18 ? 0x248
|
||||
@@ -103,7 +102,7 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
if (!FortGameData)
|
||||
FortGameData = FindObject<UCurveTable>(L"/Game/Balance/AthenaGameData.AthenaGameData");
|
||||
|
||||
LOG_INFO(LogDev, "FortGameData: {}", FortGameData ? FortGameData->GetFullName() : "InvalidObject");
|
||||
// LOG_INFO(LogDev, "FortGameData: {}", FortGameData ? FortGameData->GetFullName() : "InvalidObject");
|
||||
|
||||
auto ShrinkTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.ShrinkTime");
|
||||
auto HoldTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.WaitTime");
|
||||
@@ -130,6 +129,7 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
ZoneHoldDurations.at(i) = FortGameData->GetValueOfKey(FortGameData->GetKey(HoldTimeFName, i));
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < ZoneDurations.Num(); i++)
|
||||
{
|
||||
LOG_INFO(LogZone, "Move [{}] {}", i, ZoneDurations.at(i));
|
||||
@@ -139,6 +139,8 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
{
|
||||
LOG_INFO(LogZone, "Hold [{}] {}", i, ZoneHoldDurations.at(i));
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
LOG_INFO(LogZone, "SafeZonePhase: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset));
|
||||
@@ -167,7 +169,7 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration;
|
||||
}
|
||||
|
||||
void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
|
||||
static inline void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
|
||||
{
|
||||
if (!Object || !Function)
|
||||
return;
|
||||
|
||||
@@ -368,6 +368,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
Addresses::SetupVersion();
|
||||
|
||||
NumElementsPerChunk = std::floor(Fortnite_Version) >= 5 && Fortnite_Version <= 6 ? 0x10400 : 0x10000; // Idk what version tbh
|
||||
bEnableRebooting = Addresses::RebootingDelegate && Addresses::FinishResurrection;
|
||||
|
||||
Offsets::FindAll(); // We have to do this before because FindCantBuild uses FortAIController.CreateBuildingActor
|
||||
Offsets::Print();
|
||||
@@ -568,12 +569,6 @@ DWORD WINAPI Main(LPVOID)
|
||||
VirtualProtect((PVOID)func, 1, dwProtection, &dwTemp);
|
||||
}
|
||||
|
||||
if (bEnableRebooting)
|
||||
{
|
||||
auto GameSessionDedicatedAthenaPatch = Memcury::Scanner::FindPattern("3B 41 38 7F ? 48 8B D0 48 8B 41 30 4C 39 04 D0 75 ? 48 8D 96").Get(); // todo check this sig more
|
||||
PatchBytes(GameSessionDedicatedAthenaPatch, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
|
||||
if (Fortnite_Version != 22.4)
|
||||
{
|
||||
auto matchmaking = Memcury::Scanner::FindPattern("83 BD ? ? ? ? 01 7F 18 49 8D 4D D8 48 8B D6 E8 ? ? ? ? 48", false).Get();
|
||||
@@ -683,10 +678,6 @@ DWORD WINAPI Main(LPVOID)
|
||||
// HookInstruction(Addresses::UpdateTrackedAttributesLea, (PVOID)AFortPlayerControllerAthena::UpdateTrackedAttributesHook, "/Script/Engine.PlayerController.EnableCheats", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault);
|
||||
// HookInstruction(Addresses::CombinePickupLea, (PVOID)AFortPickup::CombinePickupHook, "/Script/Engine.PlayerController.SetVirtualJoystickVisibility", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault);
|
||||
|
||||
if (bEnableRebooting)
|
||||
{
|
||||
HookInstruction(Addresses::RebootingDelegate, (PVOID)ABuildingGameplayActorSpawnMachine::RebootingDelegateHook, "/Script/Engine.PlayerController.SetVirtualJoystickVisibility", ERelativeOffsets::LEA, FindObject("/Script/FortniteGame.Default__BuildingGameplayActorSpawnMachine"));
|
||||
}
|
||||
|
||||
if (Fortnite_Version == 13.40)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,12 @@ uint64 FindGetPlayerViewpoint()
|
||||
FailedToSpawnPawnAddr = FailedToSpawnPawnStrRefAddr - i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*(uint8_t*)(uint8_t*)(FailedToSpawnPawnStrRefAddr - i) == 0x48 && *(uint8_t*)(uint8_t*)(FailedToSpawnPawnStrRefAddr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(FailedToSpawnPawnStrRefAddr - i + 2) == 0x5C)
|
||||
{
|
||||
FailedToSpawnPawnAddr = FailedToSpawnPawnStrRefAddr - i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!FailedToSpawnPawnAddr)
|
||||
|
||||
@@ -171,14 +171,13 @@ static inline uint64 FindAddToAlivePlayers()
|
||||
|
||||
static inline uint64 FindFinishResurrection()
|
||||
{
|
||||
auto Addrr = FindFunctionCall(L"OnResurrectionCompleted");
|
||||
uintptr_t Addrr = Engine_Version >= 427 ? FindNameRef(L"OnResurrectionCompleted") : FindFunctionCall(L"OnResurrectionCompleted"); // Call is inlined
|
||||
|
||||
if (!Addrr)
|
||||
return 0;
|
||||
|
||||
auto addr = Memcury::Scanner::FindPattern("40 53 48 83 EC 20 0F B6 81 ? ? ? ? 83 C2 03 48 8B D9 3B D0 0F 85").Get();
|
||||
|
||||
return addr;
|
||||
// auto addr = Memcury::Scanner::FindPattern("40 53 48 83 EC 20 0F B6 81 ? ? ? ? 83 C2 03 48 8B D9 3B D0 0F 85").Get();
|
||||
// return addr;
|
||||
|
||||
LOG_INFO(LogDev, "WTF: 0x{:x}", Addrr - __int64(GetModuleHandleW(0)));
|
||||
|
||||
@@ -188,6 +187,11 @@ static inline uint64 FindFinishResurrection()
|
||||
{
|
||||
return Addrr - i;
|
||||
}
|
||||
|
||||
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0x5C)
|
||||
{
|
||||
return Addrr - i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -654,8 +658,8 @@ static inline uint64 FindSpecConstructor()
|
||||
if (Engine_Version == 427)
|
||||
return Memcury::Scanner::FindPattern("80 61 31 FE 41 83 C9 FF 80 61 29 F0 48 8B 44 24 ? 48 89 41").Get();
|
||||
|
||||
// if (Engine_Version == 500)
|
||||
// return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 83 CD FF").Get();
|
||||
if (Engine_Version == 500)
|
||||
return Memcury::Scanner::FindPattern("4C 8B C9 48 8B 44 24 ? 83 C9 FF 41 80 61 ? ? 41 80 61 ? ? 49 89 41 20 33 C0 41 88 41 30 49 89 41").Get();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "FortAthenaMutator_Heist.h"
|
||||
#include "BGA.h"
|
||||
#include "vendingmachine.h"
|
||||
#include "die.h"
|
||||
|
||||
#define GAME_TAB 1
|
||||
#define PLAYERS_TAB 2
|
||||
@@ -61,6 +62,7 @@
|
||||
#define LOADOUT_PLAYERTAB 4
|
||||
#define FUN_PLAYERTAB 5
|
||||
|
||||
extern inline bool bHandleDeath = true;
|
||||
extern inline bool bUseCustomMap = false;
|
||||
extern inline std::string CustomMapName = "";
|
||||
extern inline int AmountToSubtractIndex = 1;
|
||||
@@ -783,8 +785,12 @@ static inline void MainUI()
|
||||
|
||||
if (SafeZoneIndicator)
|
||||
{
|
||||
SetZoneToIndexHook(GameMode, -1);
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
|
||||
/*
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
|
||||
@@ -821,6 +827,8 @@ static inline void MainUI()
|
||||
Sleep(1000);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1152,8 +1160,10 @@ static inline void MainUI()
|
||||
static std::string ClassNameToDump;
|
||||
static std::string FunctionNameToDump;
|
||||
|
||||
ImGui::Checkbox("Handle Death", &bHandleDeath);
|
||||
ImGui::Checkbox("Fill Vending Machines", &Globals::bFillVendingMachines);
|
||||
ImGui::Checkbox("Enable Bot Tick", &bEnableBotTick);
|
||||
ImGui::Checkbox("Enable Rebooting", &bEnableRebooting);
|
||||
ImGui::Checkbox("Enable Combine Pickup", &bEnableCombinePickup);
|
||||
ImGui::InputInt("Amount To Subtract Index", &AmountToSubtractIndex);
|
||||
ImGui::InputText("Class Name to mess with", &ClassNameToDump);
|
||||
|
||||
@@ -20,6 +20,17 @@ struct FunctionHooks
|
||||
|
||||
static inline std::vector<FunctionHooks> AllFunctionHooks;
|
||||
|
||||
inline void PatchByte(uint64 addr, uint8_t byte)
|
||||
{
|
||||
DWORD dwProtection;
|
||||
VirtualProtect((PVOID)addr, 1, PAGE_EXECUTE_READWRITE, &dwProtection);
|
||||
|
||||
*(uint8_t*)addr = byte;
|
||||
|
||||
DWORD dwTemp;
|
||||
VirtualProtect((PVOID)addr, 1, dwProtection, &dwTemp);
|
||||
}
|
||||
|
||||
inline void PatchBytes(uint64 addr, const std::vector<uint8_t>& Bytes)
|
||||
{
|
||||
if (!addr)
|
||||
@@ -27,7 +38,7 @@ inline void PatchBytes(uint64 addr, const std::vector<uint8_t>& Bytes)
|
||||
|
||||
for (int i = 0; i < Bytes.size(); i++)
|
||||
{
|
||||
*(uint8_t*)(addr + i) = Bytes.at(i);
|
||||
PatchByte(addr + i, Bytes.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ inline void InitLogger()
|
||||
MakeLogger("LogBots");
|
||||
MakeLogger("LogCosmetics");
|
||||
MakeLogger("LogMatchmaker");
|
||||
MakeLogger("LogRebooting");
|
||||
}
|
||||
|
||||
#define LOG_DEBUG(loggerName, ...) \
|
||||
|
||||
21
vendor/memcury.h
vendored
21
vendor/memcury.h
vendored
@@ -1417,8 +1417,7 @@
|
||||
VirtualProtect(&VTable[Idx], 8, dwProtection, &dwTemp);
|
||||
}
|
||||
|
||||
// Finds a string ref, then goes searches xref of the function that it's in and returns that address.
|
||||
inline uintptr_t FindFunctionCall(const wchar_t* Name, const std::vector<uint8_t>& Bytes = std::vector<uint8_t>{ 0x48, 0x89, 0x5C }, int skip = 0) // credit ender & me
|
||||
inline uintptr_t FindNameRef(const wchar_t* Name, int skip = 0, bool bWarnStringNotFound = true)
|
||||
{
|
||||
auto StringRef = Memcury::Scanner::FindStringRef(Name, true, skip);
|
||||
|
||||
@@ -1429,14 +1428,18 @@
|
||||
|
||||
auto PtrRef = Memcury::Scanner::FindPointerRef(FunctionPtr);
|
||||
|
||||
/* if (!PtrRef.Get() || PtrRef.Get() == __int64(FunctionPtr))
|
||||
{
|
||||
std::wstring NameWStr = std::wstring(Name);
|
||||
LOG_WARN(LogMemory, "Failed to find pointer reference for {}", std::string(NameWStr.begin(), NameWStr.end()));
|
||||
return 0;
|
||||
} */
|
||||
return PtrRef.Get();
|
||||
}
|
||||
|
||||
return PtrRef.ScanFor(Bytes, false).Get();
|
||||
// Finds a string ref, then goes searches xref of the function that it's in and returns that address.
|
||||
inline uintptr_t FindFunctionCall(const wchar_t* Name, const std::vector<uint8_t>& Bytes = std::vector<uint8_t>{ 0x48, 0x89, 0x5C }, int skip = 0, bool bWarnStringNotFound = true) // credit ender & me
|
||||
{
|
||||
auto NameRef = FindNameRef(Name, skip, bWarnStringNotFound);
|
||||
|
||||
if (!NameRef)
|
||||
return 0;
|
||||
|
||||
return Memcury::Scanner(NameRef).ScanFor(Bytes, false).Get();
|
||||
}
|
||||
|
||||
inline bool IsNullSub(uint64 Addr)
|
||||
|
||||
Reference in New Issue
Block a user