From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:IL2CPP global-metadata.dat" |
|---|
| claim | "Il2CppType in the native types array (pointers from Il2CppMetadataRegistration.types) is a pointer-sized data union followed by a 32-bit bits word: attrs = bits & 0xFFFF, type (Il2CppTypeEnum) = (bits >> 16) & 0xFF; above bit 24 the layout depends on the version: before 27.2, num_mods = bits[24..29], byref = bit 30, pinned = bit 31; from 27.2, num_mods = bits[24..28], byref = bit 29, pinned = bit 30, valuetype = bit 31. The data union holds a type definition index for VALUETYPE and CLASS (a handle at runtime or in dumps), a type pointer for PTR and SZARRAY, an Il2CppArrayType pointer for ARRAY, a generic parameter index for VAR and MVAR, an Il2CppGenericClass pointer for GENERICINST." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:IL2CPP global-metadata.dat" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "Il2CppType" |
|---|
| variant | "as read by Il2CppDumper (padding after bits, if any, is not read)" |
|---|
| size_min | "0xc" |
|---|
| endianness | "native" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "datapoint" |
|---|
| notes | "pointer-sized (4 bytes on 32-bit targets, then bits is at 0x4)" |
|---|
|
| offset | "0x8" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "bits" |
|---|
| bits | |
| bit | "16-23" |
|---|
| name | "type" |
|---|
| notes | "Il2CppTypeEnum" |
|---|
|
| bit | "24-28" |
|---|
| name | "num_mods" |
|---|
| notes | "version >= 27.2; bits 24-29 before" |
|---|
|
| bit | "29" |
|---|
| name | "byref" |
|---|
| notes | "version >= 27.2; bit 30 before" |
|---|
|
| bit | "30" |
|---|
| name | "pinned" |
|---|
| notes | "version >= 27.2; bit 31 before" |
|---|
|
| bit | "31" |
|---|
| name | "valuetype" |
|---|
| notes | "version >= 27.2 only" |
|---|
|
|
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "Il2CppType.Init(version) bit extraction and the Union accessors" |
|---|
| repo | "https://github.com/Perfare/Il2CppDumper" |
|---|
| commit | "4741d46ba9cd6159c5d853eb9d6fc48b4bfa2b1a" |
|---|
| path | "Il2CppDumper/Il2Cpp/Il2CppClass.cs" |
|---|
| lines | "139-203" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Il2CppType bit layout" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T17:29:15.190Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T17:41:16.882Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read Il2CppClass.cs Il2CppType.Init at 4741d46: attrs bits&0xffff, type (bits>>16)&0xff, version>=27.2: mods 5 bits at 24, byref 29, pinned 30, valuetype 31; else mods 6 bits at 24, byref 30, pinned 31. datapoint is ulong (pointer-sized read)." |
|---|
|
|
|---|