diff --git a/IL2CppDLL.vcxproj b/IL2CppDLL.vcxproj
index 53cb17a..359e13e 100644
--- a/IL2CppDLL.vcxproj
+++ b/IL2CppDLL.vcxproj
@@ -51,7 +51,7 @@
-
+
@@ -94,7 +94,7 @@
-
+
diff --git a/IL2CppDLL.vcxproj.filters b/IL2CppDLL.vcxproj.filters
index b04e85c..218659f 100644
--- a/IL2CppDLL.vcxproj.filters
+++ b/IL2CppDLL.vcxproj.filters
@@ -73,7 +73,7 @@
user\features\misc
-
+
lib
@@ -195,7 +195,7 @@
include
-
+
lib
diff --git a/framework/helpers.cpp b/framework/helpers.cpp
index a4eaebf..bc9b258 100644
--- a/framework/helpers.cpp
+++ b/framework/helpers.cpp
@@ -52,4 +52,12 @@ std::string il2cppi_to_string(Il2CppString* str) {
std::string il2cppi_to_string(app::String* str) {
return il2cppi_to_string(reinterpret_cast(str));
}
+app::String* ConvertToSystemString(const char* str)
+{
+ Il2CppString* il2cpp_str = il2cpp_string_new(str);
+
+ app::String* system_string_str = reinterpret_cast(il2cpp_str);
+
+ return system_string_str;
+}
#endif
\ No newline at end of file
diff --git a/framework/helpers.h b/framework/helpers.h
index 4517439..5c973d7 100644
--- a/framework/helpers.h
+++ b/framework/helpers.h
@@ -26,6 +26,9 @@ std::string il2cppi_to_string(Il2CppString* str);
// Helper function to convert System.String to std::string
std::string il2cppi_to_string(app::String* str);
+
+// Helper function to convert const char* to System.String
+app::String* ConvertToSystemString(const char* str);
#endif
// Helper function to check if a metadata usage pointer is initialized
diff --git a/lib/ClientHelper.cpp b/lib/ClientHelper.cpp
index 7c69e7b..348a73b 100644
--- a/lib/ClientHelper.cpp
+++ b/lib/ClientHelper.cpp
@@ -4,7 +4,7 @@
#include "ClientHelper.h"
#include "players/players.h"
-#include "UnityCore.h"
+#include "UnityEngine.h"
bool IsSinglePlayer()
{
@@ -46,10 +46,8 @@ bool IsPlayerCrawling(app::GameObject* go)
if (go == NULL)
return false;
- app::String* str = reinterpret_cast(il2cpp_string_new("NolanBehaviour"));
-
if (app::GameObject_GetComponentByName != NULL) {
- app::Component* nbComponent = app::GameObject_GetComponentByName(go, str, nullptr);
+ app::Component* nbComponent = app::GameObject_GetComponentByName(go, ConvertToSystemString("NolanBehaviour"), nullptr);
if (nbComponent) {
app::NolanBehaviour* nb = reinterpret_cast(nbComponent);
@@ -65,7 +63,7 @@ bool IsPlayerCrawling(app::GameObject* go)
bool IsInGame()
{
- app::OptionsHelpers* optionsHelpers = UnityCore::Object::FindObjectOfType("OptionsHelpers");
+ app::OptionsHelpers* optionsHelpers = UnityEngine::Object::FindObjectOfType("OptionsHelpers");
if (optionsHelpers)
return optionsHelpers->fields._inGame_k__BackingField;
diff --git a/lib/UnityCore.cpp b/lib/UnityCore.cpp
deleted file mode 100644
index 05fb2eb..0000000
--- a/lib/UnityCore.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "pch-il2cpp.h"
-
-#include "UnityCore.h"
-#include
-
-app::Component* Unity::GameObject::GetComponentByName(app::GameObject* go, const char* type)
-{
- app::String* str = reinterpret_cast(il2cpp_string_new(type));
-
- if (str != nullptr) {
- app::Component* component = app::GameObject_GetComponentByName(go, str, nullptr);
-
- if (component != nullptr) {
- return component;
- }
- }
-
- return nullptr;
-}
-
-std::string Unity::Math::Vector3::ToString(app::Vector3* v)
-{
- app::String* str = app::Vector3_ToString(v, nullptr);
-
- if (str == NULL) {
- return std::string("NULL");
- }
-
- return il2cppi_to_string(str);
-}
-
-std::string Unity::Math::Vector3::ToString(app::Vector3 v)
-{
- return ("x: " + std::to_string(v.x) + " y: " + std::to_string(v.y) + " z: " + std::to_string(v.z));
-}
-
-
-app::Transform* Unity::Transform::Get(app::GameObject* go)
-{
- if (go != nullptr) {
- if (app::GameObject_get_transform != nullptr) {
-
- app::Transform* __transform = app::GameObject_get_transform(go, nullptr);
-
- if (__transform) {
- return __transform;
- }
- }
- }
-
- return nullptr;
-}
-
-app::Vector3 Unity::Transform::Position(app::Transform* transform)
-{
- if (transform != nullptr) {
- if (app::Transform_get_position != nullptr) {
- return app::Transform_get_position(transform, nullptr);
- }
- }
-
- return app::Vector3();
-}
diff --git a/lib/UnityCore.h b/lib/UnityCore.h
deleted file mode 100644
index aec0950..0000000
--- a/lib/UnityCore.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#pragma once
-
-#include "Wrapper.h"
-#include
-#include
-#include "ClientHelper.h"
-
-namespace Unity {
- namespace GameObject {
- // DO_APP_FUNC(0x02D34DA0, Component *, GameObject_GetComponentByName, (GameObject * __this, String * type, MethodInfo * method));
- app::Component* GetComponentByName(app::GameObject* go, const char* type);
- }
-
- namespace Math {
- namespace Vector3 {
- std::string ToString(app::Vector3* v);
- std::string ToString(app::Vector3 v);
- }
- }
-
- namespace Transform {
- app::Transform* Get(app::GameObject* go);
- app::Vector3 Position(app::Transform* transform);
- }
-}
-
-namespace UnityCore {
- template
- class Object {
- public:
- Object() = default;
-
- static T* FindObjectOfType(const char* className, const char* classNamespace = "");
- };
-
- template
- inline T* Object::FindObjectOfType(const char* className, const char* classNamespace)
- {
- Wrapper obj("Assembly-CSharp.dll");
-
- Il2CppObject* object = obj.find_class(classNamespace, className).get_class();
- if (object) {
-
- if (app::Object_1_FindObjectOfType == nullptr) return nullptr;
-
- app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast(object), nullptr);
-
- if (IsNull(obj_1) || obj_1 == nullptr) return nullptr;
-
- T* foundObject = reinterpret_cast(obj_1);
-
- if (foundObject) {
- return foundObject;
- }
- }
-
- return nullptr;
- }
-}
diff --git a/lib/UnityEngine.cpp b/lib/UnityEngine.cpp
new file mode 100644
index 0000000..dc0cca8
--- /dev/null
+++ b/lib/UnityEngine.cpp
@@ -0,0 +1,72 @@
+#include "pch-il2cpp.h"
+
+#include "UnityEngine.h"
+#include
+
+app::Component* UnityEngine::GameObject::GetComponentByName(app::GameObject* go, const char* type)
+{
+ app::Component* component = app::GameObject_GetComponentByName(go, ConvertToSystemString(type), nullptr);
+
+ return component ? component : nullptr;
+}
+
+app::Component__Array* UnityEngine::GameObject::LogComponents(app::GameObject* go)
+{
+ Wrapper obj("UnityEngine.CoreModule.dll");
+
+ Il2CppObject* object = obj.find_class("UnityEngine", "Component").get_class();
+
+ if (!object) return nullptr;
+
+ app::Type* type = reinterpret_cast(object);
+ if (!type) return nullptr;
+
+ app::Component__Array* __components = app::GameObject_GetComponents(go, type, nullptr);
+
+ return __components ? __components : nullptr;
+}
+
+const char* UnityEngine::Math::Vector3::ToString(app::Vector3* v)
+{
+ app::String* str = app::Vector3_ToString(v, nullptr);
+
+ return str ? il2cppi_to_string(str).c_str() : "Vector::ToString returned nullptr!\n";
+}
+
+const char* UnityEngine::Math::Vector3::ToString(app::Vector3 v)
+{
+ return ("x: " + std::to_string(v.x) + " y: " + std::to_string(v.y) + " z: " + std::to_string(v.z)).c_str();
+}
+
+app::Transform* UnityEngine::Transform::Get(app::GameObject* go)
+{
+ if (!go || !app::GameObject_get_transform) return nullptr;
+
+ app::Transform* __transform = app::GameObject_get_transform(go, nullptr);
+
+ return __transform ? __transform : nullptr;
+}
+
+app::Vector3 UnityEngine::Transform::Position(app::Transform* transform)
+{
+ if (!transform || !app::Transform_get_position) return app::Vector3();
+
+ return app::Transform_get_position(transform, nullptr);
+}
+
+const char* UnityEngine::Object::GetObjectName(app::Object_1* obj)
+{
+ static std::string name = il2cppi_to_string(app::Object_1_GetName(obj, nullptr));
+ return name.c_str();
+}
+
+app::GameObject__Array* UnityEngine::Object::FindGameObjectsWithTag(const char* tag)
+{
+ app::GameObject__Array* go_array_result = app::GameObject_FindGameObjectsWithTag(ConvertToSystemString(tag), nullptr);
+
+ return go_array_result ? go_array_result : nullptr;
+}
+
+void UnityEngine::Object::FindObjectFromInstanceID(int32_t instanceID)
+{
+}
diff --git a/lib/UnityEngine.h b/lib/UnityEngine.h
new file mode 100644
index 0000000..497dbd2
--- /dev/null
+++ b/lib/UnityEngine.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "Wrapper.h"
+#include "helpers.h"
+#include "ClientHelper.h"
+
+namespace UnityEngine {
+ namespace GameObject {
+ app::Component* GetComponentByName(app::GameObject* go, const char* type);
+ app::Component__Array* LogComponents(app::GameObject* go);
+ }
+
+ namespace Math {
+ namespace Vector3 {
+ const char* ToString(app::Vector3* v);
+ const char* ToString(app::Vector3 v);
+ }
+ }
+
+ namespace Transform {
+ app::Transform* Get(app::GameObject* go);
+ app::Vector3 Position(app::Transform* transform);
+ }
+
+ struct Object {
+
+ static const char* GetObjectName(app::Object_1* obj);
+
+ static app::GameObject__Array* FindGameObjectsWithTag(const char* tag);
+
+ // Object_1_FindObjectFromInstanceID
+ static void FindObjectFromInstanceID(int32_t instanceID);
+
+ template
+ static T* FindObjectOfType(const char* className, const char* classNamespace = "", const char* assemblyName = "Assembly-CSharp.dll") {
+
+ Wrapper obj(assemblyName);
+
+ Il2CppObject* object = obj.find_class(classNamespace, className).get_class();
+
+ if (!object || !app::Object_1_FindObjectOfType) return nullptr;
+
+ app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast(object), nullptr);
+
+ if (!obj_1 || IsNull(obj_1)) return nullptr;
+
+ return reinterpret_cast(obj_1);
+ }
+
+ };
+}
diff --git a/user/features/esp/esp.cpp b/user/features/esp/esp.cpp
index 609285a..c01232d 100644
--- a/user/features/esp/esp.cpp
+++ b/user/features/esp/esp.cpp
@@ -2,7 +2,7 @@
#include
#include "ClientHelper.h"
-#include "UnityCore.h"
+#include "UnityEngine.h"
#include "players/players.h"
#include "helpers.h"
#include "esp.hpp"
@@ -31,11 +31,11 @@ static void DrawBoxESP(app::GameObject *it, float footOffset, float headOffset,
if (!it || cam == nullptr)
return;
- app::Transform* _transform = Unity::Transform::Get(it);
+ app::Transform* _transform = UnityEngine::Transform::Get(it);
if (_transform == nullptr)
return;
- app::Vector3 pos = Unity::Transform::Position(_transform);
+ app::Vector3 pos = UnityEngine::Transform::Position(_transform);
app::Vector3 footpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + footOffset, pos.z}, NULL);
app::Vector3 headpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + headOffset, pos.z}, NULL);
diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp
index ccbc825..209d76a 100644
--- a/user/features/misc/misc.cpp
+++ b/user/features/misc/misc.cpp
@@ -5,17 +5,18 @@
#include "ClientHelper.h"
#include "players/players.h"
#include "helpers.h"
-#include "UnityCore.h"
+#include "UnityEngine.h"
#include
#include "Windows.h"
#include