djkaty / Il2CppInspector

Powerful automated tool for reverse engineering Unity IL2CPP binaries
http://www.djkaty.com
GNU Affero General Public License v3.0
2.59k stars 420 forks source link

How to dump internal Unity structures like GameObject and Transform? #159

Open srvasn opened 3 years ago

srvasn commented 3 years ago

Il2CppInspector is currently unable to dump field information for internal Unity classes (from namespace UnityEngine) like GameObject and Transform.

API reference for Transform class : https://docs.unity3d.com/ScriptReference/Transform.html

Extract from header dump output (il2cpp-types.h) for Transform

struct Transform {
    struct Transform__Class *klass;
    MonitorData *monitor;
    void *m_CachedPtr;
};

struct Transform__VTable {
    VirtualInvokeData Equals;
    VirtualInvokeData Finalize;
    VirtualInvokeData GetHashCode;
    VirtualInvokeData ToString;
    VirtualInvokeData GetEnumerator;
};

struct Transform__StaticFields {
};

struct Transform__Class {
    Il2CppClass_0 _0;
    Il2CppRuntimeInterfaceOffsetPair *interfaceOffsets;
    struct Transform__StaticFields *static_fields;
    const Il2CppRGCTXData *rgctx_data;
    Il2CppClass_1 _1;
    struct Transform__VTable vtable;
};

The class is not present at all in types.cs. How do I get the fields for objects like above?

OsOmE1 commented 3 years ago

image Make sure to check the appropriate boxes in the Namespaces section