This repository was archived by the owner on Apr 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
4. Class.hpp
Batchhh edited this page Oct 19, 2024
·
2 revisions
This file defines various utilities and methods for interacting with IL2CPP classes, such as retrieving fields, methods, and types, fetching system types, and working with static fields and methods. It is organized into the IL2CPP::Class and IL2CPP::Class::Utils namespaces.
This namespace provides functions to retrieve and manipulate IL2CPP class information, including fields, methods, types, and system types.
-
GetFields
- Retrieves fields of a specified IL2CPP class.
-
Signature:
Unity::il2cppFieldInfo* GetFields(Unity::il2cppClass* m_pClass, void** m_pIterator);
-
FetchFields
- Fetches all fields from a specified class and stores them in a vector.
-
Signature:
void FetchFields(Unity::il2cppClass* m_pClass, std::vector<Unity::il2cppFieldInfo*>* m_pVector, void* m_pFieldIterator = nullptr);
-
GetMethods
- Retrieves methods of a specified IL2CPP class.
-
Signature:
Unity::il2cppMethodInfo* GetMethods(Unity::il2cppClass* m_pClass, void** m_pIterator);
-
FetchMethods
- Fetches all methods from a specified class and stores them in a vector.
-
Signature:
void FetchMethods(Unity::il2cppClass* m_pClass, std::vector<Unity::il2cppMethodInfo*>* m_pVector, void* m_pMethodIterator = nullptr);
-
GetType
- Retrieves the type of a specified IL2CPP class.
-
Signature:
Unity::il2cppType* GetType(Unity::il2cppClass* m_pClass);
-
GetSystemType
- Returns the system type object of a given IL2CPP class.
-
Signature:
Unity::il2cppObject* GetSystemType(Unity::il2cppClass* m_pClass);
-
GetFromName
- Retrieves a class by its name and namespace from an IL2CPP image.
-
Signature:
Unity::il2cppClass* GetFromName(Unity::il2cppImage* m_pImage, const char* m_pNamespace, const char* m_pName);
-
Find
- Finds a class by its fully qualified name.
-
Signature:
Unity::il2cppClass* Find(const char* m_pName);
-
FetchClasses
- Fetches all classes in a module or namespace and stores them in a vector.
-
Signature:
void FetchClasses(std::vector<Unity::il2cppClass*>* m_pVector, const char* m_pModuleName, const char* m_pNamespace);
This namespace contains utility functions to interact with IL2CPP classes and their fields, methods, and types.
-
GetFieldOffset
- Retrieves the offset of a specified field in a class.
-
Signature:
int GetFieldOffset(Unity::il2cppClass* m_pClass, const char* m_pName);
-
SetStaticField
- Sets a value for a static field in a class.
-
Signature:
void SetStaticField(Unity::il2cppClass* m_pClass, const char* m_pMemberName, void* m_pValue);
-
GetStaticField
- Retrieves the value of a static field from a class.
-
Signature:
void* GetStaticField(Unity::il2cppClass* m_pClass, const char* m_pMemberName);
-
GetMethodPointer
- Retrieves the pointer to a method in a class.
-
Signature:
void* GetMethodPointer(Unity::il2cppClass* m_pClass, const char* m_pMethodName, int m_iArgs = -1);
-
GetMethodPointerRVA
- Retrieves the relative virtual address (RVA) of a method pointer.
-
Signature:
uint64_t GetMethodPointerRVA(Unity::il2cppClass* m_pClass, const char* m_pMethodName, int m_iArgs = -1);
-
MethodGetParamName
- Retrieves the name of a parameter for a method at a specific index.
-
Signature:
const char* MethodGetParamName(Unity::il2cppMethodInfo* m_pMethodInfo, uint32_t index);
-
GetMethodParamType
- Retrieves the parameter type for a method at a specific index.
-
Signature:
Unity::il2cppType* GetMethodParamType(Unity::il2cppMethodInfo* m_pMethodInfo, uint32_t index);
-
ClassFromType
- Retrieves the class from a specified type.
-
Signature:
Unity::il2cppClass* ClassFromType(Unity::il2cppType * type);