Skip to content

Commit

Permalink
add a different path for il2cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed May 7, 2023
1 parent 2caef8e commit f654aeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void CPipeServer::InitMono()

mono_type_get_name = (MONO_TYPE_GET_NAME)GetProcAddress(hMono, "il2cpp_type_get_name");
mono_type_get_type = (MONO_TYPE_GET_TYPE)GetProcAddress(hMono, "il2cpp_type_get_type");
mono_type_get_object = (MONO_TYPE_GET_OBJECT)GetProcAddress(hMono, "il2cpp_type_get_object");
il2cpp_type_get_object = (IL2CPP_TYPE_GET_OBJECT)GetProcAddress(hMono, "il2cpp_type_get_object");
mono_type_get_name_full = (MONO_TYPE_GET_NAME_FULL)GetProcAddress(hMono, "il2cpp_type_get_name_full");

mono_method_get_name = (MONO_METHOD_GET_NAME)GetProcAddress(hMono, "il2cpp_method_get_name");
Expand Down Expand Up @@ -1837,7 +1837,10 @@ void CPipeServer::GetReflectionTypeOfClassType()

try
{
WriteQword((UINT64)mono_type_get_object(domain, type)); //ReflectionType*
if (il2cpp)
WriteQword((UINT64)il2cpp_type_get_object(type)); //ReflectionType*
else
WriteQword((UINT64)mono_type_get_object(domain, type)); //ReflectionType*
}
catch (...)
{
Expand Down
4 changes: 4 additions & 0 deletions Cheat Engine/MonoDataCollector/MonoDataCollector/PipeServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ typedef char* (__cdecl *MONO_TYPE_GET_NAME)(void *type);
typedef void* (__cdecl* MONO_TYPE_GET_CLASS)(void* type);
typedef int (__cdecl *MONO_TYPE_GET_TYPE)(void *type);
typedef void* (__cdecl *MONO_TYPE_GET_OBJECT)(void *domain, void *type);
typedef void* (__cdecl *IL2CPP_TYPE_GET_OBJECT)(void *type);


typedef char* (__cdecl *MONO_TYPE_GET_NAME_FULL)(void *type, int format);
typedef bool(__cdecl* MONO_TYPE_IS_STRUCT)(void* type);

Expand Down Expand Up @@ -317,6 +320,7 @@ class CPipeServer : Pipe
MONO_TYPE_GET_NAME mono_type_get_name;
MONO_TYPE_GET_TYPE mono_type_get_type;
MONO_TYPE_GET_OBJECT mono_type_get_object; //return a ReflectionType* object
IL2CPP_TYPE_GET_OBJECT il2cpp_type_get_object;
MONO_TYPE_IS_STRUCT mono_type_is_struct;
MONO_TYPE_GET_CLASS mono_type_get_class;
MONO_TYPE_GET_NAME_FULL mono_type_get_name_full;
Expand Down

0 comments on commit f654aeb

Please sign in to comment.