diff --git a/IL2CppDLL.vcxproj b/IL2CppDLL.vcxproj
index fbdd7a3..2fff91c 100644
--- a/IL2CppDLL.vcxproj
+++ b/IL2CppDLL.vcxproj
@@ -56,6 +56,7 @@
+
@@ -91,6 +92,7 @@
+
diff --git a/IL2CppDLL.vcxproj.filters b/IL2CppDLL.vcxproj.filters
index 574541c..e3e2a6c 100644
--- a/IL2CppDLL.vcxproj.filters
+++ b/IL2CppDLL.vcxproj.filters
@@ -67,6 +67,9 @@
lib
+
+ user\utils
+
@@ -168,6 +171,9 @@
lib
+
+ user\utils
+
@@ -200,5 +206,8 @@
{64867ae6-a574-4a01-ac5f-22a732ca25e0}
+
+ {05b8437a-8e9b-425b-acbc-3dd8bca051c3}
+
\ No newline at end of file
diff --git a/user/hooks/hooks.cpp b/user/hooks/hooks.cpp
index d6c6164..298564f 100644
--- a/user/hooks/hooks.cpp
+++ b/user/hooks/hooks.cpp
@@ -2,6 +2,7 @@
#include "Hooks.hpp"
#include "../features/menu.hpp"
#include "../main.h"
+#include "../utils/utils.hpp"
#include
#include "helpers.h"
@@ -39,8 +40,7 @@ TDebug_2_Log oDebug_2_Log = NULL;
TDebug_2_Log oDebug_2_Warning = NULL;
TDebug_2_Log oDebug_2_Error = NULL;
void __stdcall hDebug_Log(app::Object* message, MethodInfo* method) {
- std::string log = il2cppi_to_string(app::Object_ToString(message, nullptr));
- std::cout << log << "\n";
+ std::cout << ToString(message) << std::endl;
}
void CreateHooks() {
diff --git a/user/utils/utils.cpp b/user/utils/utils.cpp
new file mode 100644
index 0000000..21b31d7
--- /dev/null
+++ b/user/utils/utils.cpp
@@ -0,0 +1,12 @@
+#include "pch-il2cpp.h"
+#include "utils.hpp"
+#include "helpers.h"
+
+std::string ToString(app::Object* object) {
+ std::string type = il2cppi_to_string(app::Object_ToString(object, NULL));
+ if (type == "System.String") {
+ return il2cppi_to_string((app::String*)object);
+ }
+ return type;
+}
+
diff --git a/user/utils/utils.hpp b/user/utils/utils.hpp
new file mode 100644
index 0000000..9ba964a
--- /dev/null
+++ b/user/utils/utils.hpp
@@ -0,0 +1,4 @@
+#pragma once
+#include
+
+std::string ToString(app::Object* object);