Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:IL2CPP global-metadata.dat/struct/Il2CppTypeDefinition v27 to v31

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:IL2CPP global-metadata.dat"
claim"In metadata version 27 and later (no byref index, no rgctx or custom attribute index) an Il2CppTypeDefinition record is 88 bytes; the name is stringOffset + nameIndex, field and method ranges are indexes into the fields and methods tables."
scope
level"format"
applies_to"Format:IL2CPP global-metadata.dat"
observed_in
Empty array
data
name"Il2CppTypeDefinition"
variant"metadata version greater than 24.5 (computed for 27, 29, 31)"
size"0x58"
endianness"little"
fields
offset"0x0"
size4
type"uint32_t"
name"nameIndex"
offset"0x4"
size4
type"uint32_t"
name"namespaceIndex"
offset"0x8"
size4
type"int32_t"
name"byvalTypeIndex"
offset"0xc"
size4
type"int32_t"
name"declaringTypeIndex"
offset"0x10"
size4
type"int32_t"
name"parentIndex"
offset"0x14"
size4
type"int32_t"
name"elementTypeIndex"
notes"only used for enums per the source comment"
offset"0x18"
size4
type"int32_t"
name"genericContainerIndex"
offset"0x1c"
size4
type"uint32_t"
name"flags"
offset"0x20"
size4
type"int32_t"
name"fieldStart"
offset"0x24"
size4
type"int32_t"
name"methodStart"
offset"0x28"
size4
type"int32_t"
name"eventStart"
offset"0x2c"
size4
type"int32_t"
name"propertyStart"
offset"0x30"
size4
type"int32_t"
name"nestedTypesStart"
offset"0x34"
size4
type"int32_t"
name"interfacesStart"
offset"0x38"
size4
type"int32_t"
name"vtableStart"
offset"0x3c"
size4
type"int32_t"
name"interfaceOffsetsStart"
offset"0x40"
size2
type"uint16_t"
name"method_count"
offset"0x42"
size2
type"uint16_t"
name"property_count"
offset"0x44"
size2
type"uint16_t"
name"field_count"
offset"0x46"
size2
type"uint16_t"
name"event_count"
offset"0x48"
size2
type"uint16_t"
name"nested_type_count"
offset"0x4a"
size2
type"uint16_t"
name"vtable_count"
offset"0x4c"
size2
type"uint16_t"
name"interfaces_count"
offset"0x4e"
size2
type"uint16_t"
name"interface_offsets_count"
offset"0x50"
size4
type"uint32_t"
name"bitfield"
bits
bit"0"
name"valuetype"
notes"IsValueType: bitfield & 1"
bit"1"
name"enumtype"
notes"IsEnum: (bitfield >> 1) & 1"
offset"0x54"
size4
type"uint32_t"
name"token"
notes"metadata token (from version 19)"
version_note"Earlier versions add fields (Il2CppDumper [Version] gates): customAttributeIndex after namespaceIndex up to 24; byrefTypeIndex after byvalTypeIndex up to 24.5; rgctxStartIndex and rgctxCount after elementTypeIndex up to 24.1; delegateWrapperFromManagedToNativeIndex and marshalingFunctionsIndex after genericContainerIndex up to 22, plus ccwFunctionIndex and guidIndex for 21 to 22; token only from 19. Computed sizes: 16: 108, 19 and 20: 112, 21 and 22: 120, 23 and 24.0: 104, 24.1: 100, 24.2 to 24.5: 92, 27 and later: 88. The source comment lists more bitfield bits (has_finalize, has_cctor, is_blittable, is_import_or_windows_runtime, packing size, size defaults) numbered from 1; only bits 0 and 1 are used by code read."
evidence
type"source"
detail"member order, [Version] gates, bitfield comment and IsValueType/IsEnum accessors; offsets computed by summing"
repo"https://github.com/Perfare/Il2CppDumper"
commit"4741d46ba9cd6159c5d853eb9d6fc48b4bfa2b1a"
path"Il2CppDumper/Il2Cpp/MetadataClass.cs"
lines"166-233"
confidence"high"
related
Empty array
key"Il2CppTypeDefinition v27 to v31"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T17:27:35.746Z"
verifications
operator"PatientStepper99"
date"2026-10-19T17:41:16.504Z"
result"confirmed"
method"Read MetadataClass.cs 166-233 at 4741d46: 7 fields to genericContainerIndex + flags = 0x20, 8 int starts to 0x40, 8 ushorts to 0x50, bitfield, token = 0x58; summed sizes for 16 (108), 19 (112), 21/22 (120), 23/24.0 (104), 24.1 (100), 24.2-24.5 (92) also match the version gates."