Sleepy debug + Scuffed leaky

This commit is contained in:
YesseYesseY
2025-07-17 13:15:25 +02:00
parent 8752228569
commit 76a02275b8
3 changed files with 77 additions and 17 deletions

View File

@@ -160,7 +160,7 @@ namespace Calendar
static void (*OnDamageServerSleepyOriginal)(UObject* SleepyProp, FFrame& Stack, void* Ret); static void (*OnDamageServerSleepyOriginal)(UObject* SleepyProp, FFrame& Stack, void* Ret);
static void OnDamageServerSleepyHook(UObject* SleepyProp, FFrame& Stack, void* Ret) static void OnDamageServerSleepyHook(UObject* SleepyProp, FFrame& Stack, void* Ret)
{ {
static auto DamageOffset = FindOffsetStruct("/Game/Athena/Prototype/Blueprints/Sleepy/BP_Sleepy_M.BP_Sleepy_M_C.RootUpdateDamage", "Damage"); static auto DamageOffset = FindOffsetStruct("/Game/Athena/Prototype/Blueprints/Sleepy/BP_Sleepy_M.BP_Sleepy_M_C.OnDamageServer", "Damage");
int Damage = (int)(*(float*)(__int64(Stack.Locals) + DamageOffset)); int Damage = (int)(*(float*)(__int64(Stack.Locals) + DamageOffset));
static UObject* SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap:PersistentLevel.BP_Sleepy_M_2"); static UObject* SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap:PersistentLevel.BP_Sleepy_M_2");
@@ -168,4 +168,27 @@ namespace Calendar
SleepyM->ProcessEvent(RootUpdateDamage, &Damage); SleepyM->ProcessEvent(RootUpdateDamage, &Damage);
OnDamageServerSleepyOriginal(SleepyProp, Stack, Ret); OnDamageServerSleepyOriginal(SleepyProp, Stack, Ret);
} }
static void (*OnDamageServerLeakyOriginal)(UObject* SleepyProp, FFrame& Stack, void* Ret);
static void OnDamageServerLeakyHook(UObject* LeakyProp, FFrame& Stack, void* Ret)
{
static auto DamageOffset = FindOffsetStruct("/Game/Athena/Prototype/Blueprints/Leaky/BP_LeakyProp.BP_LeakyProp_C.OnDamageServer", "Damage");
int Damage = (int)(*(float*)(__int64(Stack.Locals) + DamageOffset));
static UObject* LeakyHandler = FindObject("/Game/Athena/Maps/Test/S8/LeakyMap.LeakyMap:PersistentLevel.BP_LeakyHandler_2");
static UFunction* RootUpdateRotationValue = LeakyHandler->FindFunction("RootUpdateRotationValue");
struct
{
int32 Damage;
int8 PropIndex;
} Params;
static auto ColorOfBeaconOffset = LeakyProp->GetOffset("Color of Beacon");
Params.Damage = Damage;
Params.PropIndex = LeakyProp->Get<int>(ColorOfBeaconOffset);
LeakyHandler->ProcessEvent(RootUpdateRotationValue, &Params);
OnDamageServerLeakyOriginal(LeakyProp, Stack, Ret);
}
} }

View File

@@ -31,10 +31,10 @@ namespace Globals
extern inline int NumToSubtractFromSquadId = 0; // I think 2? extern inline int NumToSubtractFromSquadId = 0; // I think 2?
extern inline std::string PlaylistName = extern inline std::string PlaylistName =
"/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo"; //"/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo";
// "/Game/Athena/Playlists/gg/Playlist_Gg_Reverse.Playlist_Gg_Reverse"; // "/Game/Athena/Playlists/gg/Playlist_Gg_Reverse.Playlist_Gg_Reverse";
// "/Game/Athena/Playlists/Playlist_DefaultDuo.Playlist_DefaultDuo"; // "/Game/Athena/Playlists/Playlist_DefaultDuo.Playlist_DefaultDuo";
// "/Game/Athena/Playlists/Playground/Playlist_Playground.Playlist_Playground"; "/Game/Athena/Playlists/Playground/Playlist_Playground.Playlist_Playground";
// "/Game/Athena/Playlists/Carmine/Playlist_Carmine.Playlist_Carmine"; // "/Game/Athena/Playlists/Carmine/Playlist_Carmine.Playlist_Carmine";
// "/Game/Athena/Playlists/Fill/Playlist_Fill_Solo.Playlist_Fill_Solo"; // "/Game/Athena/Playlists/Fill/Playlist_Fill_Solo.Playlist_Fill_Solo";
// "/Game/Athena/Playlists/Low/Playlist_Low_Solo.Playlist_Low_Solo"; // "/Game/Athena/Playlists/Low/Playlist_Low_Solo.Playlist_Low_Solo";

View File

@@ -971,31 +971,68 @@ static inline void MainUI()
static UObject* SAR = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations:PersistentLevel.BP_SnowAlwaysRelevant_2"); static UObject* SAR = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations:PersistentLevel.BP_SnowAlwaysRelevant_2");
if (SAR) if (SAR)
{ {
static bool LoadedSleepy = false;
static bool InitSleepy = false;
if (!LoadedSleepy)
{ {
if (ImGui::Button("Load Sleepy")) static bool LoadedSleepy = false;
if (!LoadedSleepy && ImGui::Button("Load Sleepy"))
{ {
SAR->ProcessEvent(SAR->FindFunction("LoadSleepy")); SAR->ProcessEvent(SAR->FindFunction("LoadSleepy"));
//SAR->ProcessEvent(SAR->FindFunction("LoadLeaky")); //SAR->ProcessEvent(SAR->FindFunction("LoadLeaky"));
LoadedSleepy = true; LoadedSleepy = true;
}
}
if (LoadedSleepy && !InitSleepy)
{
UObject* SleepyProp = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap:PersistentLevel.BP_Sleepy_Prop_0");
UObject* SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap:PersistentLevel.BP_Sleepy_M_2");
if (SleepyProp && SleepyM) UObject* SleepyProp = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap.PersistentLevel.BP_Sleepy_Prop_0");
{ UObject* SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap.PersistentLevel.BP_Sleepy_M_2");
InitSleepy = true;
while (!SleepyProp && !SleepyM)
{
SleepyProp = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap.PersistentLevel.BP_Sleepy_Prop_0");
SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap.PersistentLevel.BP_Sleepy_M_2");
}
Hooking::MinHook::Hook(SleepyProp, SleepyProp->FindFunction("OnDamageServer"), Calendar::OnDamageServerSleepyHook, (void**)&Calendar::OnDamageServerSleepyOriginal, false, true); Hooking::MinHook::Hook(SleepyProp, SleepyProp->FindFunction("OnDamageServer"), Calendar::OnDamageServerSleepyHook, (void**)&Calendar::OnDamageServerSleepyOriginal, false, true);
int FiveHundred = 500; int FiveHundred = 500;
*SleepyM->GetPtr<int>("MaxHealth") = 500; *SleepyM->GetPtr<int>("MaxHealth") = 500;
SleepyM->ProcessEvent(SleepyM->FindFunction("RootSetProgress"), &FiveHundred); SleepyM->ProcessEvent(SleepyM->FindFunction("RootSetProgress"), &FiveHundred);
LOG_INFO(LogDev, "Sleepy loaded!");
}
if (LoadedSleepy)
{
static int SleepyProgress = 0;
ImGui::SliderInt("Sleepy Progress", &SleepyProgress, 0, 1000);
if (ImGui::Button("Move Sleepy"))
{
static UObject* SleepyM = FindObject("/Game/Athena/Maps/Test/S8/SleepyMap.SleepyMap.PersistentLevel.BP_Sleepy_M_2");
static auto ProgressOffset = SleepyM->GetOffset("Progress");
*SleepyM->GetPtr<float>(ProgressOffset) = (float)SleepyProgress * (1.0f / 1000.0f);
static int EntryPoint = 929;
static auto ExecUbergraph = SleepyM->FindFunction("ExecuteUbergraph_BP_Sleepy_M");
SleepyM->ProcessEvent(ExecUbergraph, &EntryPoint);
}
}
}
ImGui::Separator();
{
static bool LoadedLeaky = false;
if (!LoadedLeaky && ImGui::Button("Load Leaky"))
{
SAR->ProcessEvent(SAR->FindFunction("LoadLeaky"));
LoadedLeaky = true;
UObject* LeakyHandler = FindObject("/Game/Athena/Maps/Test/S8/LeakyMap.LeakyMap.PersistentLevel.BP_LeakyHandler_2");
while (!LeakyHandler)
{
LeakyHandler = FindObject("/Game/Athena/Maps/Test/S8/LeakyMap.LeakyMap.PersistentLevel.BP_LeakyHandler_2");
}
UObject* LeakyProp = FindObject("/Game/Athena/Maps/Test/S8/LeakyMap.LeakyMap:PersistentLevel.BP_LeakyProp2");
Hooking::MinHook::Hook(LeakyProp, LeakyProp->FindFunction("OnDamageServer"), Calendar::OnDamageServerLeakyHook, (void**)&Calendar::OnDamageServerLeakyOriginal, false, true);
//LeakyHandler->ProcessEvent(LeakyHandler->FindFunction("TestDirt"));
LOG_INFO(LogDev, "Leaky loaded!");
} }
} }
} }