From a205e7ff60aa5b73f0cba2242f9f03af7d64787c Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 24 Nov 2022 01:20:40 +0300 Subject: [PATCH 1/8] added function for freeze azazel button --- DevourClient/Features/Menu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DevourClient/Features/Menu.cpp b/DevourClient/Features/Menu.cpp index 76b0882..7532fc1 100644 --- a/DevourClient/Features/Menu.cpp +++ b/DevourClient/Features/Menu.cpp @@ -140,6 +140,10 @@ void DrawEntitiesTab() { if (ImGui::Button("TP items to you")) { //call tp items } + + if (ImGui::Button("Freeze Azazel")) { + Misc::FreezeAzazel(); + } ImGui::Spacing(); ImGui::Text("Azazel & Demons"); -- 2.52.0 From c36821c09adf349f19be622e72b5a042b9beaf60 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 24 Nov 2022 01:20:42 +0300 Subject: [PATCH 2/8] add: FreezeAzazel function --- DevourClient/Features/Misc/Misc.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/DevourClient/Features/Misc/Misc.hpp b/DevourClient/Features/Misc/Misc.hpp index 0108fbd..c90a524 100644 --- a/DevourClient/Features/Misc/Misc.hpp +++ b/DevourClient/Features/Misc/Misc.hpp @@ -23,4 +23,5 @@ namespace Misc { void TPKeys(); void ShootEveryone(bool shootEveryone, bool hit); void Jumpscare(bool inHidingSpot); + void FreezeAzazel(); } -- 2.52.0 From d691a8defdd7a445572c8aa324d9395408b3295c Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 24 Nov 2022 01:20:44 +0300 Subject: [PATCH 3/8] add: FreezeAzazel function --- DevourClient/Features/Misc/Misc.cpp | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index f189237..3a4fe16 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -784,3 +784,42 @@ void Misc::Jumpscare(bool inHidingSpot) { } } } + +void Misc::FreezeAzazel() { + if (Helpers::GetActiveScene() == std::string("Menu")) { + return; + } + + float azazelTimeScale = 1; + + Unity::il2cppArray* Azazel = Unity::GameObject::FindWithTag("Azazel"); + + for (int j = 0; j < Azazel->m_uMaxLength + 1; j++) + { + if (!Azazel->operator[](j)) { + return; + } + + Unity::CGameObject* AzazelObj = Azazel->operator[](j)->GetMemberValue("gameObject"); + + if (!AzazelObj) { + return; + } + + Unity::CComponent* AzazelComp = AzazelObj->GetComponent("Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion"); + + if (AzazelComp != NULL) { + float currentAzazelTimeScale = AzazelComp->GetMemberValue("TimeScale"); + + if (currentAzazelTimeScale == azazelTimeScale) { + AzazelComp->SetMemberValue("TimeScale", 0); + } + else { + AzazelComp->SetMemberValue("TimeScale", azazelTimeScale); + } + } + else { + return; + } + } +} -- 2.52.0 From 01bce17ee43430d3fd3932cfe2ccda28ac7beb0a Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:02:27 +0300 Subject: [PATCH 4/8] add: function for the "Unlock Doors" button --- DevourClient/Features/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DevourClient/Features/Menu.cpp b/DevourClient/Features/Menu.cpp index 7532fc1..6c6c754 100644 --- a/DevourClient/Features/Menu.cpp +++ b/DevourClient/Features/Menu.cpp @@ -326,7 +326,7 @@ void DrawMiscTab() { } if (ImGui::Button("Unlock Doors")) { - //Unlock Achievements + Misc::UnlockDoors(); } if (ImGui::Button("Revive Yourself")) { -- 2.52.0 From e893d88e2096d7bc56de359263681ee41bd83cc7 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:02:27 +0300 Subject: [PATCH 5/8] add: UnlockDoors function --- DevourClient/Features/Misc/Misc.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/DevourClient/Features/Misc/Misc.hpp b/DevourClient/Features/Misc/Misc.hpp index c90a524..f044efa 100644 --- a/DevourClient/Features/Misc/Misc.hpp +++ b/DevourClient/Features/Misc/Misc.hpp @@ -24,4 +24,5 @@ namespace Misc { void ShootEveryone(bool shootEveryone, bool hit); void Jumpscare(bool inHidingSpot); void FreezeAzazel(); + void UnlockDoors(); } -- 2.52.0 From 7448301ee38dfb768e5209ff1709afa1494d2da6 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:02:30 +0300 Subject: [PATCH 6/8] add: UnlockDoors function --- DevourClient/Features/Misc/Misc.cpp | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index 3a4fe16..a0f0a91 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -823,3 +823,34 @@ void Misc::FreezeAzazel() { } } } + + +void Misc::UnlockDoors() { + if (Helpers::GetActiveScene() == std::string("Menu")) { + return; + } + + Unity::il2cppArray* Interactable = Unity::GameObject::FindWithTag("Interactable"); + + for (int j = 0; j < Interactable->m_uMaxLength + 1; j++) + { + if (!Interactable->operator[](j)) { + return; + } + + Unity::CGameObject* InteractableObj = Interactable->operator[](j)->GetMemberValue("gameObject"); + + if (!InteractableObj) { + return; + } + + Unity::CComponent* DoorBehaviour = InteractableObj->GetComponent("Horror.DoorBehaviour"); + + if (DoorBehaviour != NULL) { + DoorBehaviour->CallMethodSafe("Unlock"); + } + else { + return; + } + } +} -- 2.52.0 From 62b5cfa5bc8c13217ed926441b8fe06a66999def Mon Sep 17 00:00:00 2001 From: ALittlePatate <48603993+ALittlePatate@users.noreply.github.com> Date: Sun, 8 Jan 2023 17:19:57 +0100 Subject: [PATCH 7/8] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 04a127a..7855865 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ # Unknowncheats thread [here](https://www.unknowncheats.me/forum/other-fps-games/475950-devour-multihack-update.html) # /!\ READ THIS -many people are comming here (thanks btw) and asking about the cheat. NO the MelonLoader version of the cheat DOES NOT WORK. We are working on this new version using C++. This takes time but you can follow along on the github page or in annoncements features-state update-logs channels in the discord. We do not have an ETA at the moment. - -This is the branch for the V2 of the cheat, this branch will be the one updated from now. +This is the branch for the V2 of the cheat, this branch will be the one updated if the MelonLoader version gets outdated (happened before). +For now, use the MelonLoader branch :) The v2 is still in development. # DevourClient -- 2.52.0 From 33e0147a4fe804580d1a29d4f2846cbea740d850 Mon Sep 17 00:00:00 2001 From: Jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:21:58 +0300 Subject: [PATCH 8/8] IL2CPP_Resolver updated. --- .../IL2CPP_Resolver/Functions/Callback.cpp | 19 ++++--- .../IL2CPP_Resolver/Functions/Class.cpp | 36 ++++++------ .../IL2CPP_Resolver/Functions/Class.hpp | 56 +++++++++---------- .../IL2CPP_Resolver/Unity/API/GameObject.hpp | 12 ++-- .../IL2CPP_Resolver/Unity/API/Object.hpp | 4 +- .../IL2CPP_Resolver/Unity/Defines.hpp | 10 +++- .../Unity/Structures/System_String.hpp | 4 +- .../Unity/Structures/il2cppDictionary.hpp | 49 +++++++++++++++- 8 files changed, 122 insertions(+), 68 deletions(-) diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Callback.cpp b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Callback.cpp index 2bbc1cf..d94996b 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Callback.cpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Callback.cpp @@ -61,10 +61,15 @@ namespace IL2CPP // Fetch { void** m_pMonoBehaviourVTable = *reinterpret_cast(IL2CPP::Helper::GetMonoBehaviour()->m_CachedPtr); - if (m_pMonoBehaviourVTable) // x86: darkness my old friend + if (m_pMonoBehaviourVTable) // x86: Hello my old friend :) { - OnUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0x33, 0xD2, 0xE9 }); // xor edx, edx | jmp - OnLateUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0xBA, 0x01, 0x00, 0x00, 0x00, 0xE9 }); // mov edx, 1 | jmp +#ifdef _WIN64 + OnUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0x33, 0xD2, 0xE9 }); // xor edx, edx | jmp + OnLateUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0xBA, 0x01, 0x00, 0x00, 0x00, 0xE9 }); // mov edx, 1 | jmp +#elif _WIN32 + OnUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0x6A, 0x00, 0xE8 }); // push 00 | call + OnLateUpdate::Data.m_pVTable = VFunc::Find_ASM(m_pMonoBehaviourVTable, 99, { 0x6A, 0x01, 0xE8 }); // push 01 | call +#endif } } @@ -72,15 +77,15 @@ namespace IL2CPP // Replace { - Replace_VFunc(OnUpdate::Data.m_pVTable, OnUpdate::Caller, &OnUpdate::Data.m_pOriginal); - Replace_VFunc(OnLateUpdate::Data.m_pVTable, OnLateUpdate::Caller, &OnLateUpdate::Data.m_pOriginal); + Replace_VFunc(OnUpdate::Data.m_pVTable, OnUpdate::Caller, &OnUpdate::Data.m_pOriginal); + Replace_VFunc(OnLateUpdate::Data.m_pVTable, OnLateUpdate::Caller, &OnLateUpdate::Data.m_pOriginal); } } void Uninitialize() { - Replace_VFunc(OnUpdate::Data.m_pVTable, OnUpdate::Data.m_pOriginal, nullptr); - Replace_VFunc(OnLateUpdate::Data.m_pVTable, OnLateUpdate::Data.m_pOriginal, nullptr); + Replace_VFunc(OnUpdate::Data.m_pVTable, OnUpdate::Data.m_pOriginal, nullptr); + Replace_VFunc(OnLateUpdate::Data.m_pVTable, OnLateUpdate::Data.m_pOriginal, nullptr); } } } \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.cpp b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.cpp index dc13d6f..64dad2e 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.cpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.cpp @@ -2,11 +2,11 @@ namespace IL2CPP { - namespace Class - { + namespace Class + { Unity::il2cppFieldInfo* GetFields(Unity::il2cppClass* m_pClass, void** m_pIterator) { - return reinterpret_cast(Data.Functions.m_pClassGetFields)(m_pClass, m_pIterator); + return reinterpret_cast(Data.Functions.m_pClassGetFields)(m_pClass, m_pIterator); } void FetchFields(Unity::il2cppClass* m_pClass, std::vector* m_pVector, void* m_pFieldIterator) @@ -25,7 +25,7 @@ namespace IL2CPP Unity::il2cppMethodInfo* GetMethods(Unity::il2cppClass* m_pClass, void** m_pIterator) { - return reinterpret_cast(Data.Functions.m_pClassGetMethods)(m_pClass, m_pIterator); + return reinterpret_cast(Data.Functions.m_pClassGetMethods)(m_pClass, m_pIterator); } void FetchMethods(Unity::il2cppClass* m_pClass, std::vector* m_pVector, void* m_pMethodIterator) @@ -44,12 +44,12 @@ namespace IL2CPP Unity::il2cppType* GetType(Unity::il2cppClass* m_pClass) { - return reinterpret_cast(Data.Functions.m_pClassGetType)(m_pClass); + return reinterpret_cast(Data.Functions.m_pClassGetType)(m_pClass); } Unity::il2cppObject* GetSystemType(Unity::il2cppClass* m_pClass) { - return reinterpret_cast(Data.Functions.m_pTypeGetObject)(GetType(m_pClass)); + return reinterpret_cast(Data.Functions.m_pTypeGetObject)(GetType(m_pClass)); } Unity::il2cppObject* GetSystemType(const char* m_pClassName) @@ -63,11 +63,11 @@ namespace IL2CPP Unity::il2cppClass* GetFromName(Unity::il2cppImage* m_pImage, const char* m_pNamespace, const char* m_pName) { - return reinterpret_cast(Data.Functions.m_pClassFromName)(m_pImage, m_pNamespace, m_pName); + return reinterpret_cast(Data.Functions.m_pClassFromName)(m_pImage, m_pNamespace, m_pName); } - Unity::il2cppClass* Find(const char* m_pName) - { + Unity::il2cppClass* Find(const char* m_pName) + { size_t m_sAssembliesCount = 0U; Unity::il2cppAssembly** m_pAssemblies = Domain::GetAssemblies(&m_sAssembliesCount); if (!m_pAssemblies || 0U >= m_sAssembliesCount) return nullptr; @@ -101,7 +101,7 @@ namespace IL2CPP delete[] m_pNameSpace; return m_pClassReturn; - } + } void FetchClasses(std::vector* m_pVector, const char* m_pModuleName, const char* m_pNamespace) { @@ -127,7 +127,7 @@ namespace IL2CPP size_t m_sClassesCount = reinterpret_cast(Data.Functions.m_pImageGetClassCount)(m_pImage); for (size_t i = 0U; m_sClassesCount > i; ++i) { - Unity::il2cppClass* m_pClass = reinterpret_cast(Data.Functions.m_pImageGetClass)(m_pImage, i); + Unity::il2cppClass* m_pClass = reinterpret_cast(Data.Functions.m_pImageGetClass)(m_pImage, i); if (m_pNamespace) { if (m_pNamespace[0] == '\0') @@ -173,7 +173,7 @@ namespace IL2CPP void* GetMethodPointer(Unity::il2cppClass* m_pClass, const char* m_pMethodName, int m_iArgs) { - Unity::il2cppMethodInfo* pMethod = reinterpret_cast(Data.Functions.m_pClassGetMethodFromName)(m_pClass, m_pMethodName, m_iArgs); + Unity::il2cppMethodInfo* pMethod = reinterpret_cast(Data.Functions.m_pClassGetMethodFromName)(m_pClass, m_pMethodName, m_iArgs); if (!pMethod) return nullptr; return pMethod->m_pMethodPointer; @@ -188,14 +188,14 @@ namespace IL2CPP return nullptr; } - void* GetMethodPointer(const char* m_pClassName, const char* m_pMethodName, std::initializer_list m_vNames) + void* GetMethodPointer(const char* m_pClassName, const char* m_pMethodName, std::initializer_list m_vNames) { Unity::il2cppClass* m_pClass = Find(m_pClassName); if (!m_pClass) return nullptr; - int m_iNamesCount = static_cast(m_vNames.size()); - const char** m_pNames = const_cast(m_vNames.begin()); + int m_iNamesCount = static_cast(m_vNames.size()); + const char** m_pNames = const_cast(m_vNames.begin()); void* m_pMethodIterator = nullptr; while (1) @@ -220,7 +220,7 @@ namespace IL2CPP } return nullptr; } - + Unity::il2cppClass* FilterClass(std::vector* m_pClasses, std::initializer_list m_vNames, int m_iFoundCount) { int m_iNamesCount = static_cast(m_vNames.size()); @@ -285,5 +285,5 @@ namespace IL2CPP return m_pMethodPointer; } } - } -} + } +} \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.hpp index 783b0dc..5dd6d0a 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Functions/Class.hpp @@ -37,14 +37,14 @@ namespace IL2CPP void* GetMethodPointer(Unity::il2cppClass* m_pClass, const char* m_pMethodName, int m_iArgs = -1); void* GetMethodPointer(const char* m_pClassName, const char* m_pMethodName, int m_iArgs = -1); - + /* * Usage: * m_vNames = { "arg1" , "arg2" , ... } */ void* GetMethodPointer(const char* m_pClassName, const char* m_pMethodName, std::initializer_list m_vNames); - + /* * Name Prefixes * (Field) ~ @@ -69,7 +69,7 @@ namespace IL2CPP public: Unity::il2cppObject m_Object = { 0 }; void* m_CachedPtr = nullptr; - + // Wrappers for namespace, ah... Unity::il2cppFieldInfo* GetFields(void** m_pIterator) { @@ -98,16 +98,16 @@ namespace IL2CPP m_eClassPropType GetPropType(const char* m_pPropType) { - Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pPropType); - if (pField) + Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pPropType); + if (pField) return m_eClassPropType::Field; - Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropType); - if (pProperty) + Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropType); + if (pProperty) return m_eClassPropType::Property; - Unity::il2cppMethodInfo* pMethod = reinterpret_cast(Data.Functions.m_pClassGetMethodFromName)(m_Object.m_pClass, m_pPropType, -1); - if (pMethod) + Unity::il2cppMethodInfo* pMethod = reinterpret_cast(Data.Functions.m_pClassGetMethodFromName)(m_Object.m_pClass, m_pPropType, -1); + if (pMethod) return m_eClassPropType::Method; return m_eClassPropType::Unknown; @@ -125,9 +125,9 @@ namespace IL2CPP { if (!m_pMethod) { - #ifdef _DEBUG - __debugbreak(); // remove it when you wanna step through your code and be like why the fuck it doesn't do anything. - #endif +#ifdef _DEBUG + __debugbreak(); // remove it when you wanna step through your code and be like why the fuck it doesn't do anything. +#endif TReturn m_tDefault = {}; // void goes like illegal use of type. (use void* and fuck them) return m_tDefault; @@ -144,8 +144,8 @@ namespace IL2CPP template T GetPropertyValue(const char* m_pPropertyName) { - Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropertyName); - if (pProperty && pProperty->m_pGet) + Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropertyName); + if (pProperty && pProperty->m_pGet) return reinterpret_cast(pProperty->m_pGet->m_pMethodPointer)(this); T tDefault = {}; @@ -155,8 +155,8 @@ namespace IL2CPP template void SetPropertyValue(const char* m_pPropertyName, T m_tValue) { - Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropertyName); - if (pProperty && pProperty->m_pSet) + Unity::il2cppPropertyInfo* pProperty = reinterpret_cast(Data.Functions.m_pClassGetPropertyFromName)(m_Object.m_pClass, m_pPropertyName); + if (pProperty && pProperty->m_pSet) return reinterpret_cast(pProperty->m_pSet->m_pMethodPointer)(this, m_tValue); } @@ -196,7 +196,7 @@ namespace IL2CPP template T GetMemberValue(const char* m_pMemberName) { - Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); + Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); if (pField) { if (pField->m_iOffset >= 0) return *reinterpret_cast(reinterpret_cast(this) + pField->m_iOffset); @@ -211,7 +211,7 @@ namespace IL2CPP template void SetMemberValue(const char* m_pMemberName, T m_tValue) { - Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); + Unity::il2cppFieldInfo* pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); if (pField) { if (pField->m_iOffset >= 0) *reinterpret_cast(reinterpret_cast(this) + pField->m_iOffset) = m_tValue; @@ -228,7 +228,7 @@ namespace IL2CPP { switch (sizeof(T)) { - case sizeof(double): + case sizeof(double) : { long long m_lKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); long long m_lValue = *reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_lKey)); @@ -237,7 +237,7 @@ namespace IL2CPP return *reinterpret_cast(&m_lValue); } break; - case sizeof(int): + case sizeof(int) : { int m_iKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); int m_iValue = *reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_iKey)); @@ -246,7 +246,7 @@ namespace IL2CPP return *reinterpret_cast(&m_iValue); } break; - case sizeof(bool): + case sizeof(bool) : { unsigned char m_uKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); int m_iValue = *reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_uKey)); @@ -265,7 +265,7 @@ namespace IL2CPP template T GetObscuredValue(const char* m_pMemberName) { - Unity::il2cppFieldInfo* m_pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); + Unity::il2cppFieldInfo* m_pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); return GetObscuredViaOffset(m_pField ? m_pField->m_iOffset : -1); } @@ -277,7 +277,7 @@ namespace IL2CPP switch (sizeof(T)) { - case sizeof(double): + case sizeof(double) : { long long m_lKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); long long* m_pValue = reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_lKey)); @@ -285,7 +285,7 @@ namespace IL2CPP *m_pValue = *reinterpret_cast(&m_tValue) ^ m_lKey; } break; - case sizeof(int): + case sizeof(int) : { int m_iKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); int* m_pValue = reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_iKey)); @@ -293,7 +293,7 @@ namespace IL2CPP *m_pValue = *reinterpret_cast(&m_tValue) ^ m_iKey; } break; - case sizeof(bool): + case sizeof(bool) : { unsigned char m_uKey = *reinterpret_cast(reinterpret_cast(this) + m_iOffset); int* m_pValue = reinterpret_cast(reinterpret_cast(this) + m_iOffset + sizeof(m_uKey)); @@ -307,11 +307,11 @@ namespace IL2CPP template void SetObscuredValue(const char* m_pMemberName, T m_tValue) { - Unity::il2cppFieldInfo* m_pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); + Unity::il2cppFieldInfo* m_pField = reinterpret_cast(Data.Functions.m_pClassGetFieldFromName)(m_Object.m_pClass, m_pMemberName); if (!m_pField) return; - + SetObscuredViaOffset(m_pField->m_iOffset, m_tValue); } }; -} +} \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/GameObject.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/GameObject.hpp index c52c463..22ec579 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/GameObject.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/GameObject.hpp @@ -28,12 +28,12 @@ namespace Unity CComponent* GetComponent(const char* m_pName) { - return reinterpret_cast(GameObjectFunctions.m_pGetComponent)(this, IL2CPP::String::New(m_pName)); + return reinterpret_cast(GameObjectFunctions.m_pGetComponent)(this, IL2CPP::String::New(m_pName)); } il2cppArray* GetComponents(il2cppObject* m_pSystemType) { - /* + /* 0 - Object 1 - Type 2 - Use search type as array return type @@ -71,7 +71,7 @@ namespace Unity CTransform* GetTransform() { - return reinterpret_cast(GameObjectFunctions.m_pGetTransform)(this); + return reinterpret_cast(GameObjectFunctions.m_pGetTransform)(this); } bool GetActive() @@ -112,11 +112,11 @@ namespace Unity }; void Initialize(); - + CGameObject* CreatePrimitive(m_ePrimitiveType m_eType); CGameObject* Find(const char* m_pName); - + il2cppArray* FindWithTag(const char* m_pTag); } -} +} \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/Object.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/Object.hpp index bd2a30c..f82ad25 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/Object.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/API/Object.hpp @@ -20,7 +20,7 @@ namespace Unity System_String* GetName() { - return reinterpret_cast(ObjectFunctions.m_pGetName)(this); + return reinterpret_cast(ObjectFunctions.m_pGetName)(this); } }; @@ -61,4 +61,4 @@ namespace Unity return FindObjectOfType(IL2CPP::Class::GetSystemType(m_pClass)); } } -} +} \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Defines.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Defines.hpp index b65e8bd..d6e081a 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Defines.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Defines.hpp @@ -1,6 +1,12 @@ #pragma once // Calling Convention +#ifdef _WIN64 #define UNITY_CALLING_CONVENTION __fastcall* +#elif _WIN32 +#define UNITY_CALLING_CONVENTION __cdecl* +#endif + + // Camera #define UNITY_CAMERA_CLASS "UnityEngine.Camera" @@ -83,7 +89,7 @@ namespace Unity Type_Variable = 19, Type_Array = 20, Type_Enum = 85, - }; + }; enum m_eFieldAttribute { @@ -107,4 +113,4 @@ namespace Unity FieldAttribute_Default = 32768, FieldAttribute_Reserved = 38144, }; -} +} \ No newline at end of file diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/System_String.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/System_String.hpp index 653e33a..6cc5e8c 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/System_String.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/System_String.hpp @@ -19,8 +19,8 @@ namespace Unity { if (!this) return ""; - std::string sRet(static_cast(m_iLength) + 1, '\0'); - WideCharToMultiByte(CP_UTF8, 0, m_wString, m_iLength, &sRet[0], m_iLength, 0, 0); + std::string sRet(static_cast(m_iLength) * 3 + 1, '\0'); + WideCharToMultiByte(CP_UTF8, 0, m_wString, m_iLength, &sRet[0], static_cast(sRet.size()), 0, 0); return sRet; } }; diff --git a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/il2cppDictionary.hpp b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/il2cppDictionary.hpp index b16cac2..2344b2b 100644 --- a/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/il2cppDictionary.hpp +++ b/DevourClient/Dependencies/IL2CPP_Resolver/Unity/Structures/il2cppDictionary.hpp @@ -2,12 +2,18 @@ namespace Unity { - // Don't use! Untested - template + template struct il2cppDictionary : il2cppObject { + struct Entry + { + int m_iHashCode; + int m_iNext; + TKey m_tKey; + TValue m_tValue; + }; il2cppArray* m_pBuckets; - il2cppArray* m_pEntries; + il2cppArray* m_pEntries; int m_iCount; int m_iVersion; int m_iFreeList; @@ -15,5 +21,42 @@ namespace Unity void* m_pComparer; void* m_pKeys; void* m_pValues; + + Entry* GetEntry() + { + return (Entry*)m_pEntries->GetData(); + } + + TKey GetKeyByIndex(int iIndex) + { + TKey tKey = { 0 }; + + Entry* pEntry = GetEntry(); + if (pEntry) + tKey = pEntry[iIndex].m_tKey; + + return tKey; + } + + TValue GetValueByIndex(int iIndex) + { + TValue tValue = { 0 }; + + Entry* pEntry = GetEntry(); + if (pEntry) + tValue = pEntry[iIndex].m_tValue; + + return tValue; + } + + TValue GetValueByKey(TKey tKey) + { + TValue tValue = { 0 }; + for (int i = 0; i < m_iCount; i++) { + if (GetEntry()[i].m_tKey == tKey) + tValue = GetEntry()[i].m_tValue; + } + return tValue; + } }; } \ No newline at end of file -- 2.52.0