pub struct TypeDefinition {Show 26 fields
pub name_index: u32,
pub namespace_index: u32,
pub byval_type_index: TypeIndex,
pub declaring_type_index: TypeIndex,
pub parent_index: TypeIndex,
pub element_type_index: TypeIndex,
pub generic_container_index: i32,
pub flags: u32,
pub field_start: i32,
pub method_start: i32,
pub event_start: i32,
pub property_start: i32,
pub nested_types_start: i32,
pub interfaces_start: i32,
pub vtable_start: i32,
pub interface_offsets_start: i32,
pub method_count: u16,
pub property_count: u16,
pub field_count: u16,
pub event_count: u16,
pub nested_type_count: u16,
pub vtable_count: u16,
pub interfaces_count: u16,
pub interface_offsets_count: u16,
pub bitfield: u32,
pub token: u32,
}Expand description
Il2CppTypeDefinition: one type’s name, flags, base type and the ranges
of its members in the other tables.
Each *_start indexes the matching Metadata table and pairs with its
*_count; Metadata::type_methods and Metadata::type_fields slice
them for you.
Fields§
§name_index: u32The type’s name, with the `N arity suffix for generics. Index into the string pool; read it with Metadata::string.
namespace_index: u32The type’s namespace, empty for nested types and the global namespace. Index into the string pool; read it with Metadata::string.
byval_type_index: TypeIndexThis type itself in the binary’s Il2CppType table (see Binary::type_at).
declaring_type_index: TypeIndexThe enclosing type, as a TypeIndex, or -1 for a top-level type.
parent_index: TypeIndexThe base type, as a TypeIndex, or -1 (System.Object, interfaces).
element_type_index: TypeIndexFor an enum, its underlying type as a TypeIndex; otherwise -1.
v39 doesn’t store it, so it’s always -1 there.
generic_container_index: i32Index into Metadata::generic_containers if the type is generic, or -1.
flags: u32TypeAttributes: visibility, layout, class semantics (class or interface), etc.
field_start: i32Index into Metadata::fields of the first field.
method_start: i32Index into Metadata::methods of the first method.
event_start: i32Index into Metadata::events of the first event.
property_start: i32Index into Metadata::properties of the first property.
nested_types_start: i32Index into Metadata::nested_types of the first nested type.
interfaces_start: i32Index into Metadata::interfaces of the first implemented interface.
vtable_start: i32Index into the vtable_methods section of the first vtable slot.
interface_offsets_start: i32Index into the interface_offsets section of the first interface’s vtable offset.
method_count: u16How many methods the type declares.
property_count: u16How many properties the type declares.
field_count: u16How many fields the type declares.
event_count: u16How many events the type declares.
nested_type_count: u16How many types are nested directly in this one.
vtable_count: u16How many vtable slots the type has.
interfaces_count: u16How many interfaces the type implements directly.
interface_offsets_count: u16How many interface vtable offsets the type has.
bitfield: u32Packed flags (IL2CPP’s bitfield): value type, enum, has finalizer, has cctor, blittable, and the packing size.
token: u32The type’s TypeDef metadata token in its image.