From cfabe62d47167e13944e91cc9016a68ea9b54f35 Mon Sep 17 00:00:00 2001 From: ALittlePatate <48603993+ALittlePatate@users.noreply.github.com> Date: Fri, 31 May 2024 11:44:00 +0200 Subject: [PATCH 1/6] fix: typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b6a4dc..a6f052d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Not detected. * Player ESP * Player Snaplines * Spawn any item -* Force Star The Game +* Force Start The Game * Instant Win * TP to Azazel * Fly -- 2.52.0 From 58e36f2eb934ace99f3995c2cf61c170e1f8c549 Mon Sep 17 00:00:00 2001 From: Jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Fri, 31 May 2024 23:24:48 +0300 Subject: [PATCH 2/6] added IsNull function IsNull(app::Object_1*): detects whether objects are null, works more efficiently than a nullptr check. --- lib/ClientHelper.cpp | 8 ++++++++ lib/ClientHelper.h | 1 + lib/UnityCore.h | 16 ++++++++------- user/players/players.cpp | 42 ++++++++++++++++++++++++++-------------- 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/lib/ClientHelper.cpp b/lib/ClientHelper.cpp index 12418aa..7c69e7b 100644 --- a/lib/ClientHelper.cpp +++ b/lib/ClientHelper.cpp @@ -73,6 +73,14 @@ bool IsInGame() return false; } +bool IsNull(app::Object_1* obj) +{ + if (obj == nullptr) + return true; + + return !app::Object_1_op_Implicit(obj, nullptr); +} + app::GameObject* GetAzazel(app::Survival* survival) { app::GameObject* ai = app::Survival_GetAzazel(survival, nullptr); diff --git a/lib/ClientHelper.h b/lib/ClientHelper.h index 653c061..c417a92 100644 --- a/lib/ClientHelper.h +++ b/lib/ClientHelper.h @@ -8,6 +8,7 @@ bool IsLocalPlayer(app::NolanBehaviour* player); bool IsPlayerCrawling(); bool IsPlayerCrawling(app::GameObject* go); bool IsInGame(); +bool IsNull(app::Object_1* obj); app::GameObject* GetAzazel(app::Survival* survival); diff --git a/lib/UnityCore.h b/lib/UnityCore.h index 69eb5fd..aec0950 100644 --- a/lib/UnityCore.h +++ b/lib/UnityCore.h @@ -3,6 +3,7 @@ #include "Wrapper.h" #include #include +#include "ClientHelper.h" namespace Unity { namespace GameObject { @@ -10,14 +11,14 @@ namespace Unity { app::Component* GetComponentByName(app::GameObject* go, const char* type); } - namespace Math{ + namespace Math { namespace Vector3 { std::string ToString(app::Vector3* v); std::string ToString(app::Vector3 v); } } - namespace Transform{ + namespace Transform { app::Transform* Get(app::GameObject* go); app::Vector3 Position(app::Transform* transform); } @@ -44,11 +45,12 @@ namespace UnityCore { app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast(object), nullptr); - if (obj_1) { - T* foundObject = reinterpret_cast(obj_1); - if (foundObject) { - return foundObject; - } + if (IsNull(obj_1) || obj_1 == nullptr) return nullptr; + + T* foundObject = reinterpret_cast(obj_1); + + if (foundObject) { + return foundObject; } } diff --git a/user/players/players.cpp b/user/players/players.cpp index 5b8be28..c5d85ef 100644 --- a/user/players/players.cpp +++ b/user/players/players.cpp @@ -3,6 +3,7 @@ #include "players.h" #include +#include "ClientHelper.h" app::GameObject__Array* Players::GetAllPlayers() @@ -22,6 +23,18 @@ app::GameObject__Array* Players::GetAllPlayers() app::GameObject* Player::GetLocalPlayer() { + static app::GameObject* cachedLocalPlayer = nullptr; + + if (cachedLocalPlayer != nullptr) { + // Check if cached player is still valid + if (IsNull((app::Object_1*)cachedLocalPlayer)) { + cachedLocalPlayer = nullptr; + } + else { + return cachedLocalPlayer; + } + } + app::GameObject__Array* playerList = Players::GetAllPlayers(); app::String* NolanBehaviourStr = reinterpret_cast(il2cpp_string_new("NolanBehaviour")); @@ -32,24 +45,23 @@ app::GameObject* Player::GetLocalPlayer() for (int i = 0; i < _size; i++) { app::GameObject* currentPlayer = playerList->vector[i]; - if (app::GameObject_GetComponentByName) { - app::Component* nbComponent = app::GameObject_GetComponentByName(currentPlayer, NolanBehaviourStr, nullptr); + if (IsNull((app::Object_1*)currentPlayer)) { + return nullptr; + } + else { + if (app::GameObject_GetComponentByName) { + app::Component* nbComponent = app::GameObject_GetComponentByName(currentPlayer, NolanBehaviourStr, nullptr); - if (nbComponent) { - app::NolanBehaviour* nb = reinterpret_cast(nbComponent); + if (nbComponent) { + app::NolanBehaviour* nb = reinterpret_cast(nbComponent); - if (nb) { - - if (app::BoltEntity_get_IsOwner != nullptr && currentPlayer != nullptr) { - - app::BoltEntity* entity = nb->fields._._._._._entity; - - if (entity) { - if (app::BoltEntity_get_IsOwner(entity, nullptr)) { - return currentPlayer; - } + if (nb) { + if (IsLocalPlayer(nb)) { + return currentPlayer; + } + else { + return nullptr; } - } } } -- 2.52.0 From be5f59f1b5800557baca564404784c3f238962e6 Mon Sep 17 00:00:00 2001 From: Jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Fri, 31 May 2024 23:51:08 +0300 Subject: [PATCH 3/6] fixed logic bug and added cache for nolan --- user/features/misc/misc.cpp | 1 + user/players/players.cpp | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp index 738edff..91d7e94 100644 --- a/user/features/misc/misc.cpp +++ b/user/features/misc/misc.cpp @@ -147,6 +147,7 @@ void Misc::Fly(float speed) { if (localPlayer == nullptr) return; auto nb = Player::GetNolan(); + app::Transform* _transform = Unity::Transform::Get(localPlayer); if (_transform) { diff --git a/user/players/players.cpp b/user/players/players.cpp index c5d85ef..e841720 100644 --- a/user/players/players.cpp +++ b/user/players/players.cpp @@ -46,7 +46,7 @@ app::GameObject* Player::GetLocalPlayer() app::GameObject* currentPlayer = playerList->vector[i]; if (IsNull((app::Object_1*)currentPlayer)) { - return nullptr; + continue; } else { if (app::GameObject_GetComponentByName) { @@ -55,13 +55,9 @@ app::GameObject* Player::GetLocalPlayer() if (nbComponent) { app::NolanBehaviour* nb = reinterpret_cast(nbComponent); - if (nb) { - if (IsLocalPlayer(nb)) { - return currentPlayer; - } - else { - return nullptr; - } + if (nb && IsLocalPlayer(nb)) { + cachedLocalPlayer = currentPlayer; + return currentPlayer; } } } @@ -72,24 +68,28 @@ app::GameObject* Player::GetLocalPlayer() app::NolanBehaviour* Player::GetNolan() { - app::GameObject* localPlayer = Player::GetLocalPlayer(); - app::String* NolanBehaviourStr = reinterpret_cast(il2cpp_string_new("NolanBehaviour")); + static app::NolanBehaviour* cachedNolan = nullptr; + static app::GameObject* lastLocalPlayer = nullptr; - if (localPlayer) { + app::GameObject* localPlayer = Player::GetLocalPlayer(); + if (localPlayer == nullptr) return nullptr; + + if (lastLocalPlayer != localPlayer) { + app::String* NolanBehaviourStr = reinterpret_cast(il2cpp_string_new("NolanBehaviour")); if (app::GameObject_GetComponentByName) { app::Component* nbComponent = app::GameObject_GetComponentByName(localPlayer, NolanBehaviourStr, nullptr); if (nbComponent) { app::NolanBehaviour* nb = reinterpret_cast(nbComponent); - if (nb) { - return nb; + cachedNolan = nb; + lastLocalPlayer = localPlayer; } } } } - return nullptr; + return cachedNolan; } -- 2.52.0 From 01c16909bfb449e151b88a502a7808da9b736f68 Mon Sep 17 00:00:00 2001 From: Jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Sat, 1 Jun 2024 19:47:24 +0300 Subject: [PATCH 4/6] changes & fixed issues causing game crashes + flying speed increased from 15 to 20 + NolanBehavior_Update hooked + fullbright, player speed and fly moved to nolan's update hook + added NolanBehaviour parameter to Misc::FullBright function - fly function removed from misc namespace (this function will be re-added in the near future after further improvements and testing.) --- user/features/menu.cpp | 2 +- user/features/misc/misc.cpp | 58 +--------------- user/features/misc/misc.h | 3 +- user/hooks/hooks.cpp | 129 ++++++++++++++++++++++++++---------- 4 files changed, 97 insertions(+), 95 deletions(-) diff --git a/user/features/menu.cpp b/user/features/menu.cpp index 686dacf..4f3ef4a 100644 --- a/user/features/menu.cpp +++ b/user/features/menu.cpp @@ -318,7 +318,7 @@ void DrawMiscTab() { */ ImGui::Checkbox("Fly", &settings::fly); - ImGui::SliderFloat("Speed: ", &settings::fly_speed, 5.f, 15.f); + ImGui::SliderFloat("Speed: ", &settings::fly_speed, 5.f, 20.f); /* if (ImGui::Button("Make random noise")) { diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp index 91d7e94..218a05d 100644 --- a/user/features/misc/misc.cpp +++ b/user/features/misc/misc.cpp @@ -138,54 +138,6 @@ void Misc::InstantWin() } } -// This function has not been tested -// This function has not been tested -// This function has not been tested -void Misc::Fly(float speed) { - auto localPlayer = Player::GetLocalPlayer(); - - if (localPlayer == nullptr) return; - - auto nb = Player::GetNolan(); - - app::Transform* _transform = Unity::Transform::Get(localPlayer); - - if (_transform) { - app::Vector3 pos = Unity::Transform::Position(_transform); - - if (GetAsyncKeyState('W') & 0x8000) { - pos = pos + (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime()); - } - if (GetAsyncKeyState('S') & 0x8000) { - pos = pos - (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime()); - } - if (GetAsyncKeyState('D') & 0x8000) { - pos = pos + (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime()); - } - if (GetAsyncKeyState('A') & 0x8000) { - pos = pos - (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime()); - } - if (GetAsyncKeyState(VK_SPACE) & 0x8000) { - pos = pos + (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime()); - } - if (GetAsyncKeyState(VK_LCONTROL) & 0x8000) { - pos = pos - (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime()); - } - - auto component = Unity::GameObject::GetComponentByName(localPlayer, "UltimateCharacterLocomotion"); - - if (component) { - app::UltimateCharacterLocomotion* locomotion = reinterpret_cast(component); - - if (locomotion) { - if (app::UltimateCharacterLocomotion_SetPosition_1 == nullptr) return; - - app::UltimateCharacterLocomotion_SetPosition_1(locomotion, pos, false, nullptr); - } - } - } -} - void Misc::CustomizedLobby() { @@ -254,16 +206,8 @@ void Misc::RankSpoofer(int value) { } } -void Misc::FullBright() +void Misc::FullBright(app::NolanBehaviour* nb) { - std::string _scene = SceneName(); - - if (_scene == std::string("Menu")) { - return; - } - - app::NolanBehaviour* nb = Player::GetNolan(); - if (nb != nullptr) { app::Light* _flashlight = nb->fields.flashlightSpot; diff --git a/user/features/misc/misc.h b/user/features/misc/misc.h index 8f649d9..825b332 100644 --- a/user/features/misc/misc.h +++ b/user/features/misc/misc.h @@ -9,10 +9,9 @@ namespace Misc { void CarryItem(const char* itemName); void CarryAnimal(const char* animalName); void InstantWin(); - void Fly(float speed); void CustomizedLobby(); void SpawnPrefab(const char* prefabName); - void FullBright(); + void FullBright(app::NolanBehaviour* nb); void Revive(bool self); void GetKeys(); void Jumpscare(); diff --git a/user/hooks/hooks.cpp b/user/hooks/hooks.cpp index 9e74a36..deab431 100644 --- a/user/hooks/hooks.cpp +++ b/user/hooks/hooks.cpp @@ -22,26 +22,26 @@ bool open_menu = false; /* - //Code about hooking stuff - //Exemple of hooked function : - typedef int (__stdcall* TEST)(); //We define the function, must be the EXACT same definition as the original one - TEST test_org = NULL; - int __stdcall test_hook() //MUST BE the original calling convention - { - std::cout << "called" << std::endl; - return test_org(); //if we want to call the original one, we can just return 1 otherwise - } + //Code about hooking stuff + //Exemple of hooked function : + typedef int (__stdcall* TEST)(); //We define the function, must be the EXACT same definition as the original one + TEST test_org = NULL; + int __stdcall test_hook() //MUST BE the original calling convention + { + std::cout << "called" << std::endl; + return test_org(); //if we want to call the original one, we can just return 1 otherwise + } - //Exemple : - MH_STATUS status_test = MH_CreateHook((LPVOID*)test_sig, &test_hook, reinterpret_cast(&test_org)); - //We say that for every call to the test_sig address we want to redirect it to the address of the function named test_hook (& gives the pointer to it) - //We can store the original pointer to the original function into test_org if we want to call the org later --> trampoline hook - //original_sum can be NULL if we don't want to trampoline hook + //Exemple : + MH_STATUS status_test = MH_CreateHook((LPVOID*)test_sig, &test_hook, reinterpret_cast(&test_org)); + //We say that for every call to the test_sig address we want to redirect it to the address of the function named test_hook (& gives the pointer to it) + //We can store the original pointer to the original function into test_org if we want to call the org later --> trampoline hook + //original_sum can be NULL if we don't want to trampoline hook - if (status_test != MH_OK) { //If it failed - print(MH_StatusToString(status)); //If we are in debug mode, we print the fail status into the console - return 0; //We exit - } + if (status_test != MH_OK) { //If it failed + print(MH_StatusToString(status)); //If we are in debug mode, we print the fail status into the console + return 0; //We exit + } */ typedef void(__stdcall* TDebug_2_Log)(app::Object*, MethodInfo*); @@ -60,6 +60,72 @@ void __stdcall hNolanBehaviour_OnAttributeUpdateValue(app::NolanBehaviour* __thi oNolanBehaviour_OnAttributeUpdateValue(__this, attribute, method); } +// DO_APP_FUNC(0x004AABA0, void, NolanBehaviour_Update, (NolanBehaviour * __this, MethodInfo * method)); +typedef void(__stdcall* TNolanBehaviour_Update)(app::NolanBehaviour*, MethodInfo*); +TNolanBehaviour_Update oNolanBehaviour_Update = NULL; +void __stdcall hNolanBehaviour_Update(app::NolanBehaviour* __this, MethodInfo* method) { + + if (settings::fly && IsLocalPlayer(__this)) { + + float speed = settings::fly_speed; + + app::Transform* transform = app::Component_get_transform((app::Component*)__this, nullptr); + + if (transform) { + + app::Vector3 pos = Unity::Transform::Position(transform); + + if (GetAsyncKeyState('W') & 0x8000) { + pos = pos + (app::Transform_get_forward(transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('S') & 0x8000) { + pos = pos - (app::Transform_get_forward(transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('D') & 0x8000) { + pos = pos + (app::Transform_get_right(transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('A') & 0x8000) { + pos = pos - (app::Transform_get_right(transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState(VK_SPACE) & 0x8000) { + pos = pos + (app::Transform_get_up(transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState(VK_LCONTROL) & 0x8000) { + pos = pos - (app::Transform_get_up(transform, nullptr) * speed * Time_DeltaTime()); + } + + + app::GameObject* thisGameObject = app::Component_get_gameObject((app::Component*)__this, nullptr); + + if (thisGameObject != nullptr || !IsNull((app::Object_1*)thisGameObject)) { + app::Component* _UltimateCharacterLocomotion = Unity::GameObject::GetComponentByName(thisGameObject, "UltimateCharacterLocomotion"); + + if (_UltimateCharacterLocomotion != nullptr && !IsNull((app::Object_1*)_UltimateCharacterLocomotion)) { + if (app::UltimateCharacterLocomotion_SetPosition_1) { + app::UltimateCharacterLocomotion_SetPosition_1((app::UltimateCharacterLocomotion*)_UltimateCharacterLocomotion, pos, false, nullptr); + } + } + } + } + } + + if (settings::change_player_speed && IsLocalPlayer(__this)) { + // Apply Sprint Speed + if (__this->fields.speedChangeAbility) + { + __this->fields.speedChangeAbility->fields.m_SpeedChangeMultiplier = (float)settings::new_speed; + __this->fields.speedChangeAbility->fields.m_MaxSpeedChangeValue = (float)settings::new_speed; + } + } + + if (settings::fullBright && IsLocalPlayer(__this)) { + Misc::FullBright(__this); + } + + oNolanBehaviour_Update(__this, method); +} + + // DO_APP_FUNC(0x004A7D70, void, NolanBehaviour_FixedUpdate, (NolanBehaviour* __this, MethodInfo* method)); typedef void(__stdcall* TNolanBehaviour_FixedUpdate)(app::NolanBehaviour*, MethodInfo*); TNolanBehaviour_FixedUpdate oNolanBehaviour_FixedUpdate = NULL; @@ -83,16 +149,6 @@ void __stdcall hNolanBehaviour_FixedUpdate(app::NolanBehaviour* __this, MethodIn } } - - if (settings::change_player_speed && IsLocalPlayer(__this)) { - // Apply Sprint Speed - if (__this->fields.speedChangeAbility) - { - __this->fields.speedChangeAbility->fields.m_SpeedChangeMultiplier = (float)settings::new_speed; - __this->fields.speedChangeAbility->fields.m_MaxSpeedChangeValue = (float)settings::new_speed; - } - } - oNolanBehaviour_FixedUpdate(__this, method); } @@ -377,7 +433,14 @@ void CreateHooks() { return; } - // NOLAN HOOK + // NOLAN UPDATE HOOK + MH_STATUS status_nolanUpdate = MH_CreateHook((LPVOID*)app::NolanBehaviour_Update, &hNolanBehaviour_Update, reinterpret_cast(&oNolanBehaviour_Update)); + if (status_nolanUpdate != MH_OK) { + std::cout << "Failed to create nolan update hook: " << MH_StatusToString(status_nolanUpdate) << std::endl; + return; + } + + // NOLAN FIXED HOOK MH_STATUS status_nolan = MH_CreateHook((LPVOID*)app::NolanBehaviour_FixedUpdate, &hNolanBehaviour_FixedUpdate, reinterpret_cast(&oNolanBehaviour_FixedUpdate)); if (status_nolan != MH_OK) { std::cout << "Failed to create nolan hook: " << MH_StatusToString(status_nolan) << std::endl; @@ -631,15 +694,11 @@ HRESULT __stdcall hookD3D11Present(IDXGISwapChain* pSwapChain, UINT SyncInterval if (open_menu) { DrawMenu(open_menu); } - + + // to-do: move it to "fixed update" hook if (settings::player_esp) ESP::RunPlayersESP(); - if (settings::fly) - Misc::Fly(settings::fly_speed); - - if (settings::fullBright) - Misc::FullBright(); ImGui::GetIO().MouseDrawCursor = open_menu; -- 2.52.0 From 3c474a398eee3272feed743ff6437d71280fe3cf Mon Sep 17 00:00:00 2001 From: Jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:27:40 +0300 Subject: [PATCH 5/6] steam name changer added + Horror.menu update hooked + UnlockAchievements added but crashes when used --- user/features/menu.cpp | 12 +++------ user/features/misc/misc.cpp | 49 +++++++++++++++++++++++++++++++++++++ user/features/misc/misc.h | 1 + user/hooks/hooks.cpp | 33 +++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 9 deletions(-) diff --git a/user/features/menu.cpp b/user/features/menu.cpp index 4f3ef4a..06d4778 100644 --- a/user/features/menu.cpp +++ b/user/features/menu.cpp @@ -300,25 +300,19 @@ void DrawMiscTab() { //ImGui::Checkbox("Chat spam", &settings::chat_spam); //ImGui::InputText("Message", &settings::message); - /* if (ImGui::Button("Unlock Achievements")) { - Misc::CustomizedLobby(); + Misc::UnlockAchievements(); } - + /* if (ImGui::Button("TP Keys")) { //Misc::TPKeys(); } + */ ImGui::Checkbox("Change Steam name", &settings::steam_name_spoof); ImGui::InputText("New name##steam", &settings::new_name); - ImGui::Checkbox("Change server name", &settings::server_name_spoof); - ImGui::InputText("New name##server", &settings::server_name); - */ - - ImGui::Checkbox("Fly", &settings::fly); - ImGui::SliderFloat("Speed: ", &settings::fly_speed, 5.f, 20.f); /* if (ImGui::Button("Make random noise")) { diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp index 218a05d..ccbc825 100644 --- a/user/features/misc/misc.cpp +++ b/user/features/misc/misc.cpp @@ -416,3 +416,52 @@ void Misc::TpToAzazel() } } } + +void Misc::UnlockAchievements() +{ + app::AchievementHelpers* achievementsSingleton = app::AchievementHelpers_get_singleton(nullptr); + + if (achievementsSingleton != nullptr) { + + const char* achievements[] = { + "ACH_ALL_CLIPBOARDS_READ", "ACH_ALL_NOTES_READ", "ACH_UNLOCKED_CAGE", + "ACH_UNLOCKED_ATTIC_CAGE", "ACH_CALMED_ANNA", "ACH_FRIED_RAT", + "ACH_BURNT_GOAT", "ACH_KNOCKED_OUT_BY_ANNA", "ACH_KNOCKOUT_OUT_BY_DEMON", + "ACH_KNOCKED_OUT_IN_HIDING", "STAT_NUM_BLEACH_USED", "ACH_WON_SP", + "ACH_WIN_NIGHTMARE", "ACH_WON_HARD_SP", "ACH_WON_COOP", "ACH_WON_HARD", + "ACH_WIN_NIGHTMARE_SP", "ACH_LOST", "ACH_NEVER_KNOCKED_OUT", + "ACH_ONLY_ONE_KNOCKED_OUT", "ACH_WON_HARD_NO_MEDKITS", "ACH_WON_NO_MEDKITS", + "ACH_WON_NO_BATTERIES", "ACH_WON_NIGHTMARE_NO_MEDKITS", + "ACH_WON_NO_KNOCKOUT_COOP", "ACH_WON_HARD_NO_BATTERIES", + "ACH_WON_HARD_{0}", "ACH_WON_NIGHTMARE_{0}", "ACH_WON_NIGHTMARE_NO_BATTERIES", + "ACH_SURVIVED_TO_7_GOATS", "ACH_SURVIVED_TO_5_GOATS", "ACH_SURVIVED_TO_3_GOATS", + "ACH_WON_Manor_NIGHTMARE_SP", "ACH_WON_NIGHTMARE_", "ACH_WON_MANOR_NIGHTMARE_SP", + "ACH_WON_TOWN_HARD", "ACH_WON_INN_HARD_SP", "ACH_ALL_FEATHERS", + "ACH_WON_SLAUGHTERHOUSE_COOP", "ACH_ALL_BARBED_WIRES", "ACH_WON_INN_HARD", + "ACH_WON_MOLLY_HARD", "ACH_ALL_HORSESHOES", "ACH_WON_MOLLY_HARD_SP", + "ACH_WON_TOWN_NIGHTMARE_SP", "ACH_100_GASOLINE_USED", "ACH_WON_INN_SP", + "ACH_WON_MANOR_HARD_SP", "ACH_WON_MOLLY_SP", "ACH_1000_PIGS_DESTROYED", + "ACH_1000_MIRRORS_DESTROYED", "ACH_100_EGGS_DESTROYED", "ACH_WON_SLAUGHTERHOUSE_HARD_SP", + "ACH_WON_TOWN_COOP", "ACH_100_FUSES_USED", "ACH_WON_MOLLY_COOP", + "ACH_WON_MOLLY_NIGHTMARE_SP", "ACH_1000_BOOKS_DESTROYED", "ACH_ALL_PATCHES", + "ACH_WON_SLAUGHTERHOUSE_SP", "ACH_WON_TOWN_NIGHTMARE", "ACH_WON_INN_COOP", + "ACH_ALL_CHERRY_BLOSSOM", "ACH_WON_TOWN_HARD_SP", "ACH_WON_MOLLY_NIGHTMARE", + "ACH_WON_INN_NIGHTMARE_SP", "ACH_ALL_ROSES", "ACH_WON_TOWN_SP", + "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE_SP", "ACH_WON_INN_NIGHTMARE", + "ACH_WON_MANOR_COOP", "ACH_WON_SLAUGHTERHOUSE_HARD", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE", + "ACH_WON_MANOR_HARD", "ACH_WON_MANOR_NIGHTMARE", "ACH_WON_MANOR_SP" + }; + + + int size = sizeof(achievements) / sizeof(achievements[0]); + + std::cout << "Achievements length: " << size << "\n"; + + for (int i = 0; i < size; ++i) { + app::String* currentachievements = reinterpret_cast(il2cpp_string_new(achievements[i])); + + // crash + app::AchievementHelpers_Unlock(achievementsSingleton, currentachievements, false, nullptr); + } + } +} diff --git a/user/features/misc/misc.h b/user/features/misc/misc.h index 825b332..9ce7bb3 100644 --- a/user/features/misc/misc.h +++ b/user/features/misc/misc.h @@ -18,4 +18,5 @@ namespace Misc { void Kill(bool self); void RankSpoofer(int value); void TpToAzazel(); + void UnlockAchievements(); } \ No newline at end of file diff --git a/user/hooks/hooks.cpp b/user/hooks/hooks.cpp index deab431..ea9bee1 100644 --- a/user/hooks/hooks.cpp +++ b/user/hooks/hooks.cpp @@ -60,6 +60,32 @@ void __stdcall hNolanBehaviour_OnAttributeUpdateValue(app::NolanBehaviour* __thi oNolanBehaviour_OnAttributeUpdateValue(__this, attribute, method); } + +// DO_APP_FUNC(0x006406A0, void, Menu_Update, (Menu * __this, MethodInfo * method)); +typedef void(__stdcall* TMenu_Update)(app::Menu*, MethodInfo*); +TMenu_Update oMenu_Update = NULL; +void __stdcall hMenu_Update(app::Menu* __this, MethodInfo* method) { + + if (settings::steam_name_spoof) { + + Il2CppString* steamId = il2cpp_string_new("43634643643"); + Il2CppString* new_name = il2cpp_string_new(settings::new_name.c_str()); + + __this->fields.steamID = reinterpret_cast(steamId); + __this->fields.steamName = reinterpret_cast(new_name); + } + + if (settings::server_name_spoof) { + app::String* newServerName = reinterpret_cast(il2cpp_string_new(settings::server_name.c_str())); + + if (app::Text_set_text != nullptr) { + app::Text_set_text(__this->fields.serverNameText, newServerName, nullptr); + } + } + + oMenu_Update(__this, method); +} + // DO_APP_FUNC(0x004AABA0, void, NolanBehaviour_Update, (NolanBehaviour * __this, MethodInfo * method)); typedef void(__stdcall* TNolanBehaviour_Update)(app::NolanBehaviour*, MethodInfo*); TNolanBehaviour_Update oNolanBehaviour_Update = NULL; @@ -433,6 +459,13 @@ void CreateHooks() { return; } + // Horror.Menu Hook + MH_STATUS status_Menu_Update = MH_CreateHook((LPVOID*)app::Menu_Update, &hMenu_Update, reinterpret_cast(&oMenu_Update)); + if (status_Menu_Update != MH_OK) { + std::cout << "Failed to create status_Menu_Update hook: " << MH_StatusToString(status_Menu_Update) << std::endl; + return; + } + // NOLAN UPDATE HOOK MH_STATUS status_nolanUpdate = MH_CreateHook((LPVOID*)app::NolanBehaviour_Update, &hNolanBehaviour_Update, reinterpret_cast(&oNolanBehaviour_Update)); if (status_nolanUpdate != MH_OK) { -- 2.52.0 From 40569f886c1654f10bb1aa747b0b6b4474bc1cb5 Mon Sep 17 00:00:00 2001 From: K4SPERSKY9655 Date: Sat, 1 Jun 2024 21:10:48 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6965bce..11fa686 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Not detected. * Instant Win * TP to Azazel * Fly +* Unlock Achievements +* Change Steam Name * EXP Modifier * Unlock all, including flashlights, perks, outfits. Active by default, can't be turned off, no persistance. * Disable long interact -- 2.52.0