diff --git a/DevourClient/Callbacks/OnUpdate.cpp b/DevourClient/Callbacks/OnUpdate.cpp index e8a5e31..5676b04 100644 --- a/DevourClient/Callbacks/OnUpdate.cpp +++ b/DevourClient/Callbacks/OnUpdate.cpp @@ -1,12 +1,16 @@ #include "OnUpdate.hpp" +#include + #include "../Utils/Settings/Settings.hpp" #include "../Dependencies/IL2CPP_Resolver/il2cpp_resolver.hpp" #include "../Utils/Players/Players.hpp" -#include + +#include "../Features/Misc/Misc.hpp" + void OnUpdate() { - if (settings::big_flashlight) { - + if (settings::spoof_level) { + Misc::SetRank(settings::new_level); } } \ No newline at end of file diff --git a/DevourClient/Features/Menu.cpp b/DevourClient/Features/Menu.cpp index 3270517..a99412f 100644 --- a/DevourClient/Features/Menu.cpp +++ b/DevourClient/Features/Menu.cpp @@ -220,9 +220,9 @@ void DrawMiscTab() { #if _DEBUG ImGui::Spacing(); - std::string component = "PlayerCharacterBehaviour"; - ImGui::InputText("##PlayerCharacterBehaviour", &component); - if (ImGui::Button("Dump component")) { + static std::string component = "NolanBehaviour"; + ImGui::InputText("##component", &component); + if (ImGui::Button("FindObjectsOfType")) { Dump(component); } #endif diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index e69de29..8b5ec8e 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -0,0 +1,5 @@ +#include "Misc.hpp" + +void Misc::SetRank(int rank) { + Players::LocalPlayer->GetComponent("NolanRankController")->CallMethodSafe("SetRank", rank); +} \ No newline at end of file diff --git a/DevourClient/Features/Misc/Misc.hpp b/DevourClient/Features/Misc/Misc.hpp index a460f3f..cf3f356 100644 --- a/DevourClient/Features/Misc/Misc.hpp +++ b/DevourClient/Features/Misc/Misc.hpp @@ -1,3 +1,11 @@ #pragma once -//misc hacks go here \ No newline at end of file +#include "../Dependencies/IL2CPP_Resolver/il2cpp_resolver.hpp" +#include "../../Utils/Players/Players.hpp" +#include "../../Utils/Settings/Settings.hpp" +#include + +namespace Misc { + + void SetRank(int rank); +} \ No newline at end of file diff --git a/DevourClient/Hooks/Hooks.cpp b/DevourClient/Hooks/Hooks.cpp index 2d778b8..7bf9bd7 100644 --- a/DevourClient/Hooks/Hooks.cpp +++ b/DevourClient/Hooks/Hooks.cpp @@ -1,5 +1,6 @@ #include "Hooks.hpp" #include "../Utils/Output/Output.hpp" +#include "../Dependencies/IL2CPP_Resolver/il2cpp_resolver.hpp" #include "../Features/Menu.hpp" #include "../dllmain.hpp" @@ -31,6 +32,17 @@ } */ + +void CreateHooks() { + /* + //Exemple : + MH_STATUS SceneLoadLocalDoneStatus = MH_CreateHook((LPVOID*)test_sig, &hkSceneLoadLocalDone, reinterpret_cast(&oSceneLoadLocalDone)); + //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 + */ +} + typedef HRESULT(__stdcall* D3D11PresentHook) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); D3D11PresentHook phookD3D11Present = NULL; diff --git a/DevourClient/Hooks/Hooks.hpp b/DevourClient/Hooks/Hooks.hpp index 3a204fc..5939352 100644 --- a/DevourClient/Hooks/Hooks.hpp +++ b/DevourClient/Hooks/Hooks.hpp @@ -10,5 +10,6 @@ bool HookDX11(); +void CreateHooks(); bool InitializeHooks(); void DisableHooks(); \ No newline at end of file diff --git a/DevourClient/Utils/Players/Players.cpp b/DevourClient/Utils/Players/Players.cpp index 9918e47..63382c5 100644 --- a/DevourClient/Utils/Players/Players.cpp +++ b/DevourClient/Utils/Players/Players.cpp @@ -5,6 +5,7 @@ namespace Players { Unity::CGameObject* LocalPlayer = NULL; } + void Players::GetPlayersThread() { /* * Will always lop and get the players + the localplayer @@ -16,21 +17,23 @@ void Players::GetPlayersThread() { while (1) { PlayerList.clear(); - auto list = Unity::Object::FindObjectsOfType("PlayerCharacterBehaviour"); + auto list = Unity::Object::FindObjectsOfType("NolanBehaviour"); for (int i = 0; i < list->m_uMaxLength + 1; i++) { if (!list->operator[](i)) continue; Unity::CGameObject* object = list->operator[](i)->GetMemberValue("gameObject"); //SurvivalPlayer(Clone) - if (object != NULL) { - PlayerList.push_back(object); + if (!object) { + continue; } + PlayerList.push_back(object); + Unity::CComponent* BoltEntity = object->GetComponent("BoltEntity"); if (BoltEntity) { - if (BoltEntity->CallMethod("get_IsOwner"))//local player check + if (BoltEntity->GetMemberValue("IsOwner"))//local player check { LocalPlayer = object; } diff --git a/DevourClient/dllmain.cpp b/DevourClient/dllmain.cpp index 934b082..e863915 100644 --- a/DevourClient/dllmain.cpp +++ b/DevourClient/dllmain.cpp @@ -57,6 +57,8 @@ DWORD WINAPI Main() { return false; } + CreateHooks(); + print("[+] Created hooks\n"); IL2CPP::Callback::Initialize(); IL2CPP::Callback::OnUpdate::Add(OnUpdate);