Add header files for every known Unity version.
We want to get types into the IDA output, and to do that we need accurate types for the Il2Cpp structures. Unfortunately, some crucial types like Il2CppClass change between versions without any corresponding metadata changes, meaning that we have to manually identify the version outside of the Inspector somehow (e.g. by looking at the version number embedded in Unity asset files). This patch adds header files for *every* known Unity version from 5.3.0 to 2019.3.8, merging them into version ranges where header files don't change. It also adds front-end support for supplying the version number in both the CLI and GUI. The GUI is given the ability to guess the version number approximately to reduce the number of choices presented to the user.
This commit is contained in:
@@ -6,10 +6,10 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using CommandLine;
|
using CommandLine;
|
||||||
using Il2CppInspector.Reflection;
|
using Il2CppInspector.Reflection;
|
||||||
using Il2CppInspector.Outputs;
|
using Il2CppInspector.Outputs;
|
||||||
|
using Il2CppInspector.Outputs.UnityHeaders;
|
||||||
|
|
||||||
namespace Il2CppInspector.CLI
|
namespace Il2CppInspector.CLI
|
||||||
{
|
{
|
||||||
@@ -71,6 +71,9 @@ namespace Il2CppInspector.CLI
|
|||||||
|
|
||||||
[Option("unity-assemblies", Required = false, HelpText = "Path to Unity script assemblies (when using --project). Wildcards select last matching folder in alphanumeric order", Default = @"C:\Program Files\Unity\Hub\Editor\*\Editor\Data\Resources\PackageManager\ProjectTemplates\libcache\com.unity.template.3d-*\ScriptAssemblies")]
|
[Option("unity-assemblies", Required = false, HelpText = "Path to Unity script assemblies (when using --project). Wildcards select last matching folder in alphanumeric order", Default = @"C:\Program Files\Unity\Hub\Editor\*\Editor\Data\Resources\PackageManager\ProjectTemplates\libcache\com.unity.template.3d-*\ScriptAssemblies")]
|
||||||
public string UnityAssembliesPath { get; set; }
|
public string UnityAssembliesPath { get; set; }
|
||||||
|
|
||||||
|
[Option("unity-version", Required = false, HelpText = "Version of Unity used to create the input files, if known. Used to enhance IDA Python script output. If not specified, a close match will be inferred automatically.", Default = null)]
|
||||||
|
public UnityVersion UnityVersion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adapted from: https://stackoverflow.com/questions/16376191/measuring-code-execution-time
|
// Adapted from: https://stackoverflow.com/questions/16376191/measuring-code-execution-time
|
||||||
@@ -233,7 +236,9 @@ namespace Il2CppInspector.CLI
|
|||||||
|
|
||||||
// IDA Python script output
|
// IDA Python script output
|
||||||
using (var scriptDumperTimer = new Benchmark("IDA Python Script Dumper")) {
|
using (var scriptDumperTimer = new Benchmark("IDA Python Script Dumper")) {
|
||||||
var idaWriter = new IDAPythonScript(model);
|
var idaWriter = new IDAPythonScript(model) {
|
||||||
|
UnityVersion = options.UnityVersion,
|
||||||
|
};
|
||||||
idaWriter.WriteScriptToFile(options.PythonOutFile);
|
idaWriter.WriteScriptToFile(options.PythonOutFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,14 @@
|
|||||||
<Product>Il2CppInspector Shared Library</Product>
|
<Product>Il2CppInspector Shared Library</Product>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Outputs\UnityHeaders\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Outputs\UnityHeaders\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Linq;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Il2CppInspector.Reflection;
|
using Il2CppInspector.Reflection;
|
||||||
|
using Il2CppInspector.Outputs.UnityHeaders;
|
||||||
|
|
||||||
namespace Il2CppInspector.Outputs
|
namespace Il2CppInspector.Outputs
|
||||||
{
|
{
|
||||||
@@ -15,16 +16,29 @@ namespace Il2CppInspector.Outputs
|
|||||||
{
|
{
|
||||||
private readonly Il2CppModel model;
|
private readonly Il2CppModel model;
|
||||||
private StreamWriter writer;
|
private StreamWriter writer;
|
||||||
|
public UnityVersion UnityVersion;
|
||||||
|
private UnityHeader header;
|
||||||
|
|
||||||
public IDAPythonScript(Il2CppModel model) => this.model = model;
|
public IDAPythonScript(Il2CppModel model) => this.model = model;
|
||||||
|
|
||||||
public void WriteScriptToFile(string outputFile) {
|
public void WriteScriptToFile(string outputFile) {
|
||||||
|
if (UnityVersion == null) {
|
||||||
|
header = UnityHeader.GuessHeadersForModel(model)[0];
|
||||||
|
UnityVersion = header.MinVersion;
|
||||||
|
} else {
|
||||||
|
header = UnityHeader.GetHeaderForVersion(UnityVersion);
|
||||||
|
if (header.MetadataVersion != model.Package.BinaryImage.Version) {
|
||||||
|
/* this can only happen in the CLI frontend with a manually-supplied version number */
|
||||||
|
Console.WriteLine($"Warning: selected version {UnityVersion} (metadata version {header.MetadataVersion}) does not match metadata version {model.Package.BinaryImage.Version}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using var fs = new FileStream(outputFile, FileMode.Create);
|
using var fs = new FileStream(outputFile, FileMode.Create);
|
||||||
writer = new StreamWriter(fs, Encoding.UTF8);
|
writer = new StreamWriter(fs, Encoding.UTF8);
|
||||||
|
|
||||||
writeLine("# Generated script file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty");
|
writeLine("# Generated script file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty");
|
||||||
|
writeLine("# Target Unity version: " + header);
|
||||||
writeLine("print('Generated script file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty')");
|
writeLine("print('Generated script file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty')");
|
||||||
|
|
||||||
writeSectionHeader("Preamble");
|
writeSectionHeader("Preamble");
|
||||||
writePreamble();
|
writePreamble();
|
||||||
|
|
||||||
@@ -67,6 +81,21 @@ def MakeFunction(start, end):
|
|||||||
ida_funcs.del_func(start)
|
ida_funcs.del_func(start)
|
||||||
ida_funcs.add_func(start, end)"
|
ida_funcs.add_func(start, end)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Compatibility (in a separate decl block in case these are already defined)
|
||||||
|
writeDecls(@"
|
||||||
|
typedef unsigned __int8 uint8_t;
|
||||||
|
typedef unsigned __int16 uint16_t;
|
||||||
|
typedef unsigned __int32 uint32_t;
|
||||||
|
typedef unsigned __int64 uint64_t;
|
||||||
|
typedef __int8 int8_t;
|
||||||
|
typedef __int16 int16_t;
|
||||||
|
typedef __int32 int32_t;
|
||||||
|
typedef __int64 int64_t;
|
||||||
|
");
|
||||||
|
|
||||||
|
var prefix = (model.Package.BinaryImage.Bits == 32) ? "#define IS_32BIT\n" : "";
|
||||||
|
writeDecls(prefix + header.GetHeaderText());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeMethods() {
|
private void writeMethods() {
|
||||||
@@ -164,6 +193,14 @@ def MakeFunction(start, end):
|
|||||||
writeLine("");
|
writeLine("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void writeDecls(string decls) {
|
||||||
|
var lines = decls.Replace("\r", "").Split('\n');
|
||||||
|
var cleanLines = lines.Select((s) => s.ToEscapedString());
|
||||||
|
var declString = string.Join('\n', cleanLines);
|
||||||
|
if (declString != "")
|
||||||
|
writeLine("idc.parse_decls('''" + declString + "''')");
|
||||||
|
}
|
||||||
|
|
||||||
private void writeName(ulong address, string name) {
|
private void writeName(ulong address, string name) {
|
||||||
writeLine($"SetName({address.ToAddressString()}, r'{name.ToEscapedString()}')");
|
writeLine($"SetName({address.ToAddressString()}, r'{name.ToEscapedString()}')");
|
||||||
}
|
}
|
||||||
|
|||||||
818
Il2CppInspector.Common/Outputs/UnityHeaders/16-5.3.0-5.3.1.h
Normal file
818
Il2CppInspector.Common/Outputs/UnityHeaders/16-5.3.0-5.3.1.h
Normal file
@@ -0,0 +1,818 @@
|
|||||||
|
typedef void (*methodPointerType)();
|
||||||
|
typedef int32_t il2cpp_array_size_t;
|
||||||
|
typedef uint32_t Il2CppMethodSlot;
|
||||||
|
const int ipv6AddressSize = 16;
|
||||||
|
typedef enum Il2CppTypeEnum
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_END = 0x00,
|
||||||
|
IL2CPP_TYPE_VOID = 0x01,
|
||||||
|
IL2CPP_TYPE_BOOLEAN = 0x02,
|
||||||
|
IL2CPP_TYPE_CHAR = 0x03,
|
||||||
|
IL2CPP_TYPE_I1 = 0x04,
|
||||||
|
IL2CPP_TYPE_U1 = 0x05,
|
||||||
|
IL2CPP_TYPE_I2 = 0x06,
|
||||||
|
IL2CPP_TYPE_U2 = 0x07,
|
||||||
|
IL2CPP_TYPE_I4 = 0x08,
|
||||||
|
IL2CPP_TYPE_U4 = 0x09,
|
||||||
|
IL2CPP_TYPE_I8 = 0x0a,
|
||||||
|
IL2CPP_TYPE_U8 = 0x0b,
|
||||||
|
IL2CPP_TYPE_R4 = 0x0c,
|
||||||
|
IL2CPP_TYPE_R8 = 0x0d,
|
||||||
|
IL2CPP_TYPE_STRING = 0x0e,
|
||||||
|
IL2CPP_TYPE_PTR = 0x0f,
|
||||||
|
IL2CPP_TYPE_BYREF = 0x10,
|
||||||
|
IL2CPP_TYPE_VALUETYPE = 0x11,
|
||||||
|
IL2CPP_TYPE_CLASS = 0x12,
|
||||||
|
IL2CPP_TYPE_VAR = 0x13,
|
||||||
|
IL2CPP_TYPE_ARRAY = 0x14,
|
||||||
|
IL2CPP_TYPE_GENERICINST= 0x15,
|
||||||
|
IL2CPP_TYPE_TYPEDBYREF = 0x16,
|
||||||
|
IL2CPP_TYPE_I = 0x18,
|
||||||
|
IL2CPP_TYPE_U = 0x19,
|
||||||
|
IL2CPP_TYPE_FNPTR = 0x1b,
|
||||||
|
IL2CPP_TYPE_OBJECT = 0x1c,
|
||||||
|
IL2CPP_TYPE_SZARRAY = 0x1d,
|
||||||
|
IL2CPP_TYPE_MVAR = 0x1e,
|
||||||
|
IL2CPP_TYPE_CMOD_REQD = 0x1f,
|
||||||
|
IL2CPP_TYPE_CMOD_OPT = 0x20,
|
||||||
|
IL2CPP_TYPE_INTERNAL = 0x21,
|
||||||
|
IL2CPP_TYPE_MODIFIER = 0x40,
|
||||||
|
IL2CPP_TYPE_SENTINEL = 0x41,
|
||||||
|
IL2CPP_TYPE_PINNED = 0x45,
|
||||||
|
IL2CPP_TYPE_ENUM = 0x55
|
||||||
|
} Il2CppTypeEnum;
|
||||||
|
typedef int32_t TypeIndex;
|
||||||
|
typedef int32_t TypeDefinitionIndex;
|
||||||
|
typedef int32_t FieldIndex;
|
||||||
|
typedef int32_t DefaultValueIndex;
|
||||||
|
typedef int32_t DefaultValueDataIndex;
|
||||||
|
typedef int32_t CustomAttributeIndex;
|
||||||
|
typedef int32_t ParameterIndex;
|
||||||
|
typedef int32_t MethodIndex;
|
||||||
|
typedef int32_t GenericMethodIndex;
|
||||||
|
typedef int32_t PropertyIndex;
|
||||||
|
typedef int32_t EventIndex;
|
||||||
|
typedef int32_t GenericContainerIndex;
|
||||||
|
typedef int32_t GenericParameterIndex;
|
||||||
|
typedef int16_t GenericParameterConstraintIndex;
|
||||||
|
typedef int32_t NestedTypeIndex;
|
||||||
|
typedef int32_t InterfacesIndex;
|
||||||
|
typedef int32_t VTableIndex;
|
||||||
|
typedef int32_t InterfaceOffsetIndex;
|
||||||
|
typedef int32_t RGCTXIndex;
|
||||||
|
typedef int32_t StringIndex;
|
||||||
|
typedef int32_t StringLiteralIndex;
|
||||||
|
typedef int32_t GenericInstIndex;
|
||||||
|
typedef int32_t ImageIndex;
|
||||||
|
typedef int32_t AssemblyIndex;
|
||||||
|
const TypeIndex kTypeIndexInvalid = -1;
|
||||||
|
const TypeDefinitionIndex kTypeDefinitionIndexInvalid = -1;
|
||||||
|
const DefaultValueDataIndex kDefaultValueIndexNull = -1;
|
||||||
|
const EventIndex kEventIndexInvalid = -1;
|
||||||
|
const FieldIndex kFieldIndexInvalid = -1;
|
||||||
|
const MethodIndex kMethodIndexInvalid = -1;
|
||||||
|
const PropertyIndex kPropertyIndexInvalid = -1;
|
||||||
|
const GenericContainerIndex kGenericContainerIndexInvalid = -1;
|
||||||
|
const GenericParameterIndex kGenericParameterIndexInvalid = -1;
|
||||||
|
const RGCTXIndex kRGCTXIndexInvalid = -1;
|
||||||
|
const StringLiteralIndex kStringLiteralIndexInvalid = -1;
|
||||||
|
typedef uint32_t EncodedMethodIndex;
|
||||||
|
static inline bool IsGenericMethodIndex (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return (index & 0x80000000U) != 0;
|
||||||
|
}
|
||||||
|
static inline uint32_t GetDecodedMethodIndex (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return index & 0x7FFFFFFFU;
|
||||||
|
}
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppTypeDefinitionMetadata Il2CppTypeDefinitionMetadata;
|
||||||
|
typedef union Il2CppRGCTXDefinitionData
|
||||||
|
{
|
||||||
|
int32_t rgctxDataDummy;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppRGCTXDefinitionData;
|
||||||
|
typedef enum Il2CppRGCTXDataType
|
||||||
|
{
|
||||||
|
IL2CPP_RGCTX_DATA_INVALID,
|
||||||
|
IL2CPP_RGCTX_DATA_TYPE,
|
||||||
|
IL2CPP_RGCTX_DATA_CLASS,
|
||||||
|
IL2CPP_RGCTX_DATA_METHOD
|
||||||
|
} Il2CppRGCTXDataType;
|
||||||
|
typedef struct Il2CppRGCTXDefinition
|
||||||
|
{
|
||||||
|
Il2CppRGCTXDataType type;
|
||||||
|
Il2CppRGCTXDefinitionData data;
|
||||||
|
} Il2CppRGCTXDefinition;
|
||||||
|
typedef struct Il2CppInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
TypeIndex interfaceTypeIndex;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppTypeDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex namespaceIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex byvalTypeIndex;
|
||||||
|
TypeIndex byrefTypeIndex;
|
||||||
|
TypeIndex declaringTypeIndex;
|
||||||
|
TypeIndex parentIndex;
|
||||||
|
TypeIndex elementTypeIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex delegateWrapperFromManagedToNativeIndex;
|
||||||
|
int32_t marshalingFunctionsIndex;
|
||||||
|
uint32_t flags;
|
||||||
|
FieldIndex fieldStart;
|
||||||
|
MethodIndex methodStart;
|
||||||
|
EventIndex eventStart;
|
||||||
|
PropertyIndex propertyStart;
|
||||||
|
NestedTypeIndex nestedTypesStart;
|
||||||
|
InterfacesIndex interfacesStart;
|
||||||
|
VTableIndex vtableStart;
|
||||||
|
InterfacesIndex interfaceOffsetsStart;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint32_t bitfield;
|
||||||
|
} Il2CppTypeDefinition;
|
||||||
|
typedef struct Il2CppFieldDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} Il2CppFieldDefinition;
|
||||||
|
typedef struct Il2CppFieldDefaultValue
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppFieldDefaultValue;
|
||||||
|
typedef struct Il2CppFieldMarshaledSize
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
int32_t size;
|
||||||
|
} Il2CppFieldMarshaledSize;
|
||||||
|
typedef struct Il2CppParameterDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppParameterDefinition;
|
||||||
|
typedef struct Il2CppParameterDefaultValue
|
||||||
|
{
|
||||||
|
ParameterIndex parameterIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppParameterDefaultValue;
|
||||||
|
typedef struct Il2CppMethodDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeDefinitionIndex declaringType;
|
||||||
|
TypeIndex returnType;
|
||||||
|
ParameterIndex parameterStart;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
MethodIndex delegateWrapperIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint16_t parameterCount;
|
||||||
|
} Il2CppMethodDefinition;
|
||||||
|
typedef struct Il2CppEventDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
MethodIndex add;
|
||||||
|
MethodIndex remove;
|
||||||
|
MethodIndex raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} Il2CppEventDefinition;
|
||||||
|
typedef struct Il2CppPropertyDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
MethodIndex get;
|
||||||
|
MethodIndex set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} Il2CppPropertyDefinition;
|
||||||
|
typedef struct Il2CppMethodSpec
|
||||||
|
{
|
||||||
|
MethodIndex methodDefinitionIndex;
|
||||||
|
GenericInstIndex classIndexIndex;
|
||||||
|
GenericInstIndex methodIndexIndex;
|
||||||
|
} Il2CppMethodSpec;
|
||||||
|
typedef struct Il2CppStringLiteral
|
||||||
|
{
|
||||||
|
uint32_t length;
|
||||||
|
StringLiteralIndex dataIndex;
|
||||||
|
} Il2CppStringLiteral;
|
||||||
|
typedef struct Il2CppGenericMethodIndices
|
||||||
|
{
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
} Il2CppGenericMethodIndices;
|
||||||
|
typedef struct Il2CppGenericMethodFunctionsDefinitions
|
||||||
|
{
|
||||||
|
GenericMethodIndex genericMethodIndex;
|
||||||
|
Il2CppGenericMethodIndices indices;
|
||||||
|
} Il2CppGenericMethodFunctionsDefinitions;
|
||||||
|
const int kPublicKeyByteLength = 8;
|
||||||
|
typedef struct Il2CppAssemblyName
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex cultureIndex;
|
||||||
|
StringIndex hashValueIndex;
|
||||||
|
StringIndex publicKeyIndex;
|
||||||
|
uint32_t hash_alg;
|
||||||
|
int32_t hash_len;
|
||||||
|
uint32_t flags;
|
||||||
|
int32_t major;
|
||||||
|
int32_t minor;
|
||||||
|
int32_t build;
|
||||||
|
int32_t revision;
|
||||||
|
uint8_t publicKeyToken[8];
|
||||||
|
} Il2CppAssemblyName;
|
||||||
|
typedef struct Il2CppImageDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
} Il2CppImageDefinition;
|
||||||
|
typedef struct Il2CppAssembly
|
||||||
|
{
|
||||||
|
ImageIndex imageIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
Il2CppAssemblyName aname;
|
||||||
|
} Il2CppAssembly;
|
||||||
|
#pragma pack(push, p1,4)
|
||||||
|
typedef struct Il2CppGlobalMetadataHeader
|
||||||
|
{
|
||||||
|
int32_t sanity;
|
||||||
|
int32_t version;
|
||||||
|
int32_t stringLiteralOffset;
|
||||||
|
int32_t stringLiteralCount;
|
||||||
|
int32_t stringLiteralDataOffset;
|
||||||
|
int32_t stringLiteralDataCount;
|
||||||
|
int32_t stringOffset;
|
||||||
|
int32_t stringCount;
|
||||||
|
int32_t eventsOffset;
|
||||||
|
int32_t eventsCount;
|
||||||
|
int32_t propertiesOffset;
|
||||||
|
int32_t propertiesCount;
|
||||||
|
int32_t methodsOffset;
|
||||||
|
int32_t methodsCount;
|
||||||
|
int32_t parameterDefaultValuesOffset;
|
||||||
|
int32_t parameterDefaultValuesCount;
|
||||||
|
int32_t fieldDefaultValuesOffset;
|
||||||
|
int32_t fieldDefaultValuesCount;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataOffset;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataCount;
|
||||||
|
int32_t fieldMarshaledSizesOffset;
|
||||||
|
int32_t fieldMarshaledSizesCount;
|
||||||
|
int32_t parametersOffset;
|
||||||
|
int32_t parametersCount;
|
||||||
|
int32_t fieldsOffset;
|
||||||
|
int32_t fieldsCount;
|
||||||
|
int32_t genericParametersOffset;
|
||||||
|
int32_t genericParametersCount;
|
||||||
|
int32_t genericParameterConstraintsOffset;
|
||||||
|
int32_t genericParameterConstraintsCount;
|
||||||
|
int32_t genericContainersOffset;
|
||||||
|
int32_t genericContainersCount;
|
||||||
|
int32_t nestedTypesOffset;
|
||||||
|
int32_t nestedTypesCount;
|
||||||
|
int32_t interfacesOffset;
|
||||||
|
int32_t interfacesCount;
|
||||||
|
int32_t vtableMethodsOffset;
|
||||||
|
int32_t vtableMethodsCount;
|
||||||
|
int32_t interfaceOffsetsOffset;
|
||||||
|
int32_t interfaceOffsetsCount;
|
||||||
|
int32_t typeDefinitionsOffset;
|
||||||
|
int32_t typeDefinitionsCount;
|
||||||
|
int32_t rgctxEntriesOffset;
|
||||||
|
int32_t rgctxEntriesCount;
|
||||||
|
int32_t imagesOffset;
|
||||||
|
int32_t imagesCount;
|
||||||
|
int32_t assembliesOffset;
|
||||||
|
int32_t assembliesCount;
|
||||||
|
} Il2CppGlobalMetadataHeader;
|
||||||
|
#pragma pack(pop, p1)
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppArrayType
|
||||||
|
{
|
||||||
|
const Il2CppType* etype;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t numsizes;
|
||||||
|
uint8_t numlobounds;
|
||||||
|
int *sizes;
|
||||||
|
int *lobounds;
|
||||||
|
} Il2CppArrayType;
|
||||||
|
typedef struct Il2CppGenericInst
|
||||||
|
{
|
||||||
|
uint32_t type_argc;
|
||||||
|
const Il2CppType **type_argv;
|
||||||
|
} Il2CppGenericInst;
|
||||||
|
typedef struct Il2CppGenericContext
|
||||||
|
{
|
||||||
|
const Il2CppGenericInst *class_inst;
|
||||||
|
const Il2CppGenericInst *method_inst;
|
||||||
|
} Il2CppGenericContext;
|
||||||
|
typedef struct Il2CppGenericParameter
|
||||||
|
{
|
||||||
|
GenericContainerIndex ownerIndex;
|
||||||
|
StringIndex nameIndex;
|
||||||
|
GenericParameterConstraintIndex constraintsStart;
|
||||||
|
int16_t constraintsCount;
|
||||||
|
uint16_t num;
|
||||||
|
uint16_t flags;
|
||||||
|
} Il2CppGenericParameter;
|
||||||
|
typedef struct Il2CppGenericContainer
|
||||||
|
{
|
||||||
|
int32_t ownerIndex;
|
||||||
|
int32_t type_argc;
|
||||||
|
int32_t is_method;
|
||||||
|
GenericParameterIndex genericParameterStart;
|
||||||
|
} Il2CppGenericContainer;
|
||||||
|
typedef struct Il2CppGenericClass
|
||||||
|
{
|
||||||
|
TypeDefinitionIndex typeDefinitionIndex;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
Il2CppClass *cached_class;
|
||||||
|
} Il2CppGenericClass;
|
||||||
|
typedef struct Il2CppGenericMethod
|
||||||
|
{
|
||||||
|
const MethodInfo* methodDefinition;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
} Il2CppGenericMethod;
|
||||||
|
typedef struct Il2CppType
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
void* dummy;
|
||||||
|
TypeDefinitionIndex klassIndex;
|
||||||
|
const Il2CppType *type;
|
||||||
|
Il2CppArrayType *array;
|
||||||
|
GenericParameterIndex genericParameterIndex;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
} data;
|
||||||
|
unsigned int attrs : 16;
|
||||||
|
Il2CppTypeEnum type : 8;
|
||||||
|
unsigned int num_mods : 6;
|
||||||
|
unsigned int byref : 1;
|
||||||
|
unsigned int pinned : 1;
|
||||||
|
} Il2CppType;
|
||||||
|
typedef enum {
|
||||||
|
IL2CPP_CALL_DEFAULT,
|
||||||
|
IL2CPP_CALL_C,
|
||||||
|
IL2CPP_CALL_STDCALL,
|
||||||
|
IL2CPP_CALL_THISCALL,
|
||||||
|
IL2CPP_CALL_FASTCALL,
|
||||||
|
IL2CPP_CALL_VARARG
|
||||||
|
} Il2CppCallConvention;
|
||||||
|
typedef enum Il2CppCharSet
|
||||||
|
{
|
||||||
|
CHARSET_ANSI,
|
||||||
|
CHARSET_UNICODE
|
||||||
|
} Il2CppCharSet;
|
||||||
|
typedef struct PInvokeArguments
|
||||||
|
{
|
||||||
|
const char* moduleName;
|
||||||
|
const char* entryPoint;
|
||||||
|
Il2CppCallConvention callingConvention;
|
||||||
|
Il2CppCharSet charSet;
|
||||||
|
int parameterSize;
|
||||||
|
bool isNoMangle;
|
||||||
|
} PInvokeArguments;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppAssembly Il2CppAssembly;
|
||||||
|
typedef struct Il2CppAppDomain Il2CppAppDomain;
|
||||||
|
typedef struct Il2CppDelegate Il2CppDelegate;
|
||||||
|
typedef struct Il2CppAppContext Il2CppAppContext;
|
||||||
|
typedef struct Il2CppNameToTypeDefinitionIndexHashTable Il2CppNameToTypeDefinitionIndexHashTable;
|
||||||
|
typedef enum Il2CppTypeNameFormat
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_IL,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_REFLECTION,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_FULL_NAME,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
|
||||||
|
} Il2CppTypeNameFormat;
|
||||||
|
extern bool g_il2cpp_is_fully_initialized;
|
||||||
|
typedef struct {
|
||||||
|
Il2CppImage *corlib;
|
||||||
|
Il2CppClass *object_class;
|
||||||
|
Il2CppClass *byte_class;
|
||||||
|
Il2CppClass *void_class;
|
||||||
|
Il2CppClass *boolean_class;
|
||||||
|
Il2CppClass *sbyte_class;
|
||||||
|
Il2CppClass *int16_class;
|
||||||
|
Il2CppClass *uint16_class;
|
||||||
|
Il2CppClass *int32_class;
|
||||||
|
Il2CppClass *uint32_class;
|
||||||
|
Il2CppClass *int_class;
|
||||||
|
Il2CppClass *uint_class;
|
||||||
|
Il2CppClass *int64_class;
|
||||||
|
Il2CppClass *uint64_class;
|
||||||
|
Il2CppClass *single_class;
|
||||||
|
Il2CppClass *double_class;
|
||||||
|
Il2CppClass *char_class;
|
||||||
|
Il2CppClass *string_class;
|
||||||
|
Il2CppClass *enum_class;
|
||||||
|
Il2CppClass *array_class;
|
||||||
|
Il2CppClass *delegate_class;
|
||||||
|
Il2CppClass *multicastdelegate_class;
|
||||||
|
Il2CppClass *asyncresult_class;
|
||||||
|
Il2CppClass *manualresetevent_class;
|
||||||
|
Il2CppClass *typehandle_class;
|
||||||
|
Il2CppClass *fieldhandle_class;
|
||||||
|
Il2CppClass *methodhandle_class;
|
||||||
|
Il2CppClass *systemtype_class;
|
||||||
|
Il2CppClass *monotype_class;
|
||||||
|
Il2CppClass *exception_class;
|
||||||
|
Il2CppClass *threadabortexception_class;
|
||||||
|
Il2CppClass *thread_class;
|
||||||
|
Il2CppClass *appdomain_class;
|
||||||
|
Il2CppClass *appdomain_setup_class;
|
||||||
|
Il2CppClass *field_info_class;
|
||||||
|
Il2CppClass *method_info_class;
|
||||||
|
Il2CppClass *property_info_class;
|
||||||
|
Il2CppClass *event_info_class;
|
||||||
|
Il2CppClass *mono_event_info_class;
|
||||||
|
Il2CppClass *stringbuilder_class;
|
||||||
|
Il2CppClass *stack_frame_class;
|
||||||
|
Il2CppClass *stack_trace_class;
|
||||||
|
Il2CppClass *marshal_class;
|
||||||
|
Il2CppClass *typed_reference_class;
|
||||||
|
Il2CppClass *marshalbyrefobject_class;
|
||||||
|
Il2CppClass *generic_ilist_class;
|
||||||
|
Il2CppClass *generic_icollection_class;
|
||||||
|
Il2CppClass *generic_ienumerable_class;
|
||||||
|
Il2CppClass *generic_nullable_class;
|
||||||
|
Il2CppClass *customattribute_data_class;
|
||||||
|
Il2CppClass *version;
|
||||||
|
Il2CppClass *culture_info;
|
||||||
|
Il2CppClass *async_call_class;
|
||||||
|
Il2CppClass *assembly_class;
|
||||||
|
Il2CppClass *assembly_name_class;
|
||||||
|
Il2CppClass *enum_info_class;
|
||||||
|
Il2CppClass *mono_field_class;
|
||||||
|
Il2CppClass *mono_method_class;
|
||||||
|
Il2CppClass *mono_method_info_class;
|
||||||
|
Il2CppClass *mono_property_info_class;
|
||||||
|
Il2CppClass *parameter_info_class;
|
||||||
|
Il2CppClass *module_class;
|
||||||
|
Il2CppClass *pointer_class;
|
||||||
|
Il2CppClass *system_exception_class;
|
||||||
|
Il2CppClass *argument_exception_class;
|
||||||
|
Il2CppClass *wait_handle_class;
|
||||||
|
Il2CppClass *safe_handle_class;
|
||||||
|
Il2CppClass *sort_key_class;
|
||||||
|
} Il2CppDefaults;
|
||||||
|
extern Il2CppDefaults il2cpp_defaults;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct FieldInfo FieldInfo;
|
||||||
|
typedef struct Il2CppObject Il2CppObject;
|
||||||
|
typedef struct CustomAttributesCache
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
Il2CppObject** attributes;
|
||||||
|
} CustomAttributesCache;
|
||||||
|
typedef void (*CustomAttributesCacheGenerator)(CustomAttributesCache*);
|
||||||
|
const int THREAD_STATIC_FIELD_OFFSET = -1;
|
||||||
|
typedef struct FieldInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass *parent;
|
||||||
|
int32_t offset;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} FieldInfo;
|
||||||
|
typedef struct PropertyInfo
|
||||||
|
{
|
||||||
|
Il2CppClass *parent;
|
||||||
|
const char *name;
|
||||||
|
const MethodInfo *get;
|
||||||
|
const MethodInfo *set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} PropertyInfo;
|
||||||
|
typedef struct EventInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* eventType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
const MethodInfo* add;
|
||||||
|
const MethodInfo* remove;
|
||||||
|
const MethodInfo* raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
} EventInfo;
|
||||||
|
typedef struct ParameterInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
int32_t position;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
const Il2CppType* parameter_type;
|
||||||
|
} ParameterInfo;
|
||||||
|
typedef void* (*InvokerMethod)(const MethodInfo*, void*, void**);
|
||||||
|
typedef union Il2CppRGCTXData
|
||||||
|
{
|
||||||
|
void* rgctxDataDummy;
|
||||||
|
const MethodInfo* method;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass* klass;
|
||||||
|
} Il2CppRGCTXData;
|
||||||
|
typedef struct MethodInfo
|
||||||
|
{
|
||||||
|
methodPointerType method;
|
||||||
|
InvokerMethod invoker_method;
|
||||||
|
const char* name;
|
||||||
|
Il2CppClass *declaring_type;
|
||||||
|
const Il2CppType *return_type;
|
||||||
|
const ParameterInfo* parameters;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
const Il2CppMethodDefinition* methodDefinition;
|
||||||
|
};
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppGenericMethod* genericMethod;
|
||||||
|
const Il2CppGenericContainer* genericContainer;
|
||||||
|
};
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint8_t parameters_count;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t is_inflated : 1;
|
||||||
|
} MethodInfo;
|
||||||
|
typedef struct Il2CppRuntimeInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
Il2CppClass* interfaceType;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppRuntimeInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppClass
|
||||||
|
{
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
} Il2CppClass;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_0 {
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass * generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
} Il2CppClass_0;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_1 {
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
#ifdef IS_32BIT
|
||||||
|
uint32_t cctor_thread__padding;
|
||||||
|
uint32_t cctor_thread;
|
||||||
|
uint32_t cctor_thread__hi;
|
||||||
|
#else
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
#endif
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
} Il2CppClass_1;
|
||||||
|
|
||||||
|
typedef struct __attribute__((aligned(8))) Il2CppClass_Merged {
|
||||||
|
struct Il2CppClass_0 _0;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
struct Il2CppClass_1 _1;
|
||||||
|
} Il2CppClass_Merged;
|
||||||
|
|
||||||
|
typedef struct Il2CppTypeDefinitionSizes
|
||||||
|
{
|
||||||
|
uint32_t instance_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
} Il2CppTypeDefinitionSizes;
|
||||||
|
typedef struct Il2CppDomain
|
||||||
|
{
|
||||||
|
Il2CppAppDomain* domain;
|
||||||
|
Il2CppObject* setup;
|
||||||
|
Il2CppAppContext* default_context;
|
||||||
|
const char* friendly_name;
|
||||||
|
uint32_t domain_id;
|
||||||
|
} Il2CppDomain;
|
||||||
|
typedef struct Il2CppImage
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
Il2CppNameToTypeDefinitionIndexHashTable* nameToClassHashTable;
|
||||||
|
} Il2CppImage;
|
||||||
|
typedef struct Il2CppMarshalingFunctions
|
||||||
|
{
|
||||||
|
methodPointerType marshal_to_native_func;
|
||||||
|
methodPointerType marshal_from_native_func;
|
||||||
|
methodPointerType marshal_cleanup_func;
|
||||||
|
} Il2CppMarshalingFunctions;
|
||||||
|
typedef struct Il2CppCodeRegistration
|
||||||
|
{
|
||||||
|
uint32_t methodPointersCount;
|
||||||
|
const methodPointerType* methodPointers;
|
||||||
|
uint32_t delegateWrappersFromNativeToManagedCount;
|
||||||
|
const methodPointerType** delegateWrappersFromNativeToManaged;
|
||||||
|
uint32_t delegateWrappersFromManagedToNativeCount;
|
||||||
|
const methodPointerType* delegateWrappersFromManagedToNative;
|
||||||
|
uint32_t marshalingFunctionsCount;
|
||||||
|
const Il2CppMarshalingFunctions* marshalingFunctions;
|
||||||
|
uint32_t genericMethodPointersCount;
|
||||||
|
const methodPointerType* genericMethodPointers;
|
||||||
|
uint32_t invokerPointersCount;
|
||||||
|
const InvokerMethod* invokerPointers;
|
||||||
|
CustomAttributeIndex customAttributeCount;
|
||||||
|
const CustomAttributesCacheGenerator* customAttributeGenerators;
|
||||||
|
} Il2CppCodeRegistration;
|
||||||
|
typedef struct Il2CppMetadataRegistration
|
||||||
|
{
|
||||||
|
int32_t genericClassesCount;
|
||||||
|
Il2CppGenericClass* const * genericClasses;
|
||||||
|
int32_t genericInstsCount;
|
||||||
|
const Il2CppGenericInst* const * genericInsts;
|
||||||
|
int32_t genericMethodTableCount;
|
||||||
|
const Il2CppGenericMethodFunctionsDefinitions* genericMethodTable;
|
||||||
|
int32_t typesCount;
|
||||||
|
const Il2CppType* const * types;
|
||||||
|
int32_t methodSpecsCount;
|
||||||
|
const Il2CppMethodSpec* methodSpecs;
|
||||||
|
int32_t methodReferencesCount;
|
||||||
|
const EncodedMethodIndex* methodReferences;
|
||||||
|
FieldIndex fieldOffsetsCount;
|
||||||
|
const int32_t* fieldOffsets;
|
||||||
|
TypeDefinitionIndex typeDefinitionsSizesCount;
|
||||||
|
const Il2CppTypeDefinitionSizes* typeDefinitionsSizes;
|
||||||
|
} Il2CppMetadataRegistration;
|
||||||
|
typedef struct Il2CppRuntimeStats
|
||||||
|
{
|
||||||
|
uint64_t new_object_count;
|
||||||
|
uint64_t initialized_class_count;
|
||||||
|
uint64_t method_count;
|
||||||
|
uint64_t class_static_data_size;
|
||||||
|
uint64_t generic_instance_count;
|
||||||
|
uint64_t generic_class_count;
|
||||||
|
uint64_t inflated_method_count;
|
||||||
|
uint64_t inflated_type_count;
|
||||||
|
bool enabled;
|
||||||
|
} Il2CppRuntimeStats;
|
||||||
|
extern Il2CppRuntimeStats il2cpp_runtime_stats;
|
||||||
|
|
||||||
|
struct MonitorData;
|
||||||
|
struct Il2CppObject {
|
||||||
|
struct Il2CppClass *klass;
|
||||||
|
struct MonitorData *monitor;
|
||||||
|
};
|
||||||
|
typedef int32_t il2cpp_array_lower_bound_t;
|
||||||
|
struct Il2CppArrayBounds {
|
||||||
|
il2cpp_array_size_t length;
|
||||||
|
il2cpp_array_lower_bound_t lower_bound;
|
||||||
|
};
|
||||||
|
struct Il2CppArray {
|
||||||
|
struct Il2CppObject obj;
|
||||||
|
struct Il2CppArrayBounds *bounds;
|
||||||
|
il2cpp_array_size_t max_length;
|
||||||
|
/* vector must be 8-byte aligned.
|
||||||
|
On 64-bit platforms, this happens naturally.
|
||||||
|
On 32-bit platforms, sizeof(obj)=8, sizeof(bounds)=4 and sizeof(max_length)=4 so it's also already aligned. */
|
||||||
|
void *vector[32];
|
||||||
|
};
|
||||||
|
struct Il2CppString {
|
||||||
|
struct Il2CppObject object;
|
||||||
|
int32_t length;
|
||||||
|
uint16_t chars[32];
|
||||||
|
};
|
||||||
866
Il2CppInspector.Common/Outputs/UnityHeaders/19-5.3.2.h
Normal file
866
Il2CppInspector.Common/Outputs/UnityHeaders/19-5.3.2.h
Normal file
@@ -0,0 +1,866 @@
|
|||||||
|
typedef void (*methodPointerType)();
|
||||||
|
typedef int32_t il2cpp_array_size_t;
|
||||||
|
typedef uint32_t Il2CppMethodSlot;
|
||||||
|
const int ipv6AddressSize = 16;
|
||||||
|
typedef enum Il2CppTypeEnum
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_END = 0x00,
|
||||||
|
IL2CPP_TYPE_VOID = 0x01,
|
||||||
|
IL2CPP_TYPE_BOOLEAN = 0x02,
|
||||||
|
IL2CPP_TYPE_CHAR = 0x03,
|
||||||
|
IL2CPP_TYPE_I1 = 0x04,
|
||||||
|
IL2CPP_TYPE_U1 = 0x05,
|
||||||
|
IL2CPP_TYPE_I2 = 0x06,
|
||||||
|
IL2CPP_TYPE_U2 = 0x07,
|
||||||
|
IL2CPP_TYPE_I4 = 0x08,
|
||||||
|
IL2CPP_TYPE_U4 = 0x09,
|
||||||
|
IL2CPP_TYPE_I8 = 0x0a,
|
||||||
|
IL2CPP_TYPE_U8 = 0x0b,
|
||||||
|
IL2CPP_TYPE_R4 = 0x0c,
|
||||||
|
IL2CPP_TYPE_R8 = 0x0d,
|
||||||
|
IL2CPP_TYPE_STRING = 0x0e,
|
||||||
|
IL2CPP_TYPE_PTR = 0x0f,
|
||||||
|
IL2CPP_TYPE_BYREF = 0x10,
|
||||||
|
IL2CPP_TYPE_VALUETYPE = 0x11,
|
||||||
|
IL2CPP_TYPE_CLASS = 0x12,
|
||||||
|
IL2CPP_TYPE_VAR = 0x13,
|
||||||
|
IL2CPP_TYPE_ARRAY = 0x14,
|
||||||
|
IL2CPP_TYPE_GENERICINST= 0x15,
|
||||||
|
IL2CPP_TYPE_TYPEDBYREF = 0x16,
|
||||||
|
IL2CPP_TYPE_I = 0x18,
|
||||||
|
IL2CPP_TYPE_U = 0x19,
|
||||||
|
IL2CPP_TYPE_FNPTR = 0x1b,
|
||||||
|
IL2CPP_TYPE_OBJECT = 0x1c,
|
||||||
|
IL2CPP_TYPE_SZARRAY = 0x1d,
|
||||||
|
IL2CPP_TYPE_MVAR = 0x1e,
|
||||||
|
IL2CPP_TYPE_CMOD_REQD = 0x1f,
|
||||||
|
IL2CPP_TYPE_CMOD_OPT = 0x20,
|
||||||
|
IL2CPP_TYPE_INTERNAL = 0x21,
|
||||||
|
IL2CPP_TYPE_MODIFIER = 0x40,
|
||||||
|
IL2CPP_TYPE_SENTINEL = 0x41,
|
||||||
|
IL2CPP_TYPE_PINNED = 0x45,
|
||||||
|
IL2CPP_TYPE_ENUM = 0x55
|
||||||
|
} Il2CppTypeEnum;
|
||||||
|
typedef int32_t TypeIndex;
|
||||||
|
typedef int32_t TypeDefinitionIndex;
|
||||||
|
typedef int32_t FieldIndex;
|
||||||
|
typedef int32_t DefaultValueIndex;
|
||||||
|
typedef int32_t DefaultValueDataIndex;
|
||||||
|
typedef int32_t CustomAttributeIndex;
|
||||||
|
typedef int32_t ParameterIndex;
|
||||||
|
typedef int32_t MethodIndex;
|
||||||
|
typedef int32_t GenericMethodIndex;
|
||||||
|
typedef int32_t PropertyIndex;
|
||||||
|
typedef int32_t EventIndex;
|
||||||
|
typedef int32_t GenericContainerIndex;
|
||||||
|
typedef int32_t GenericParameterIndex;
|
||||||
|
typedef int16_t GenericParameterConstraintIndex;
|
||||||
|
typedef int32_t NestedTypeIndex;
|
||||||
|
typedef int32_t InterfacesIndex;
|
||||||
|
typedef int32_t VTableIndex;
|
||||||
|
typedef int32_t InterfaceOffsetIndex;
|
||||||
|
typedef int32_t RGCTXIndex;
|
||||||
|
typedef int32_t StringIndex;
|
||||||
|
typedef int32_t StringLiteralIndex;
|
||||||
|
typedef int32_t GenericInstIndex;
|
||||||
|
typedef int32_t ImageIndex;
|
||||||
|
typedef int32_t AssemblyIndex;
|
||||||
|
const TypeIndex kTypeIndexInvalid = -1;
|
||||||
|
const TypeDefinitionIndex kTypeDefinitionIndexInvalid = -1;
|
||||||
|
const DefaultValueDataIndex kDefaultValueIndexNull = -1;
|
||||||
|
const EventIndex kEventIndexInvalid = -1;
|
||||||
|
const FieldIndex kFieldIndexInvalid = -1;
|
||||||
|
const MethodIndex kMethodIndexInvalid = -1;
|
||||||
|
const PropertyIndex kPropertyIndexInvalid = -1;
|
||||||
|
const GenericContainerIndex kGenericContainerIndexInvalid = -1;
|
||||||
|
const GenericParameterIndex kGenericParameterIndexInvalid = -1;
|
||||||
|
const RGCTXIndex kRGCTXIndexInvalid = -1;
|
||||||
|
const StringLiteralIndex kStringLiteralIndexInvalid = -1;
|
||||||
|
typedef uint32_t EncodedMethodIndex;
|
||||||
|
typedef enum Il2CppMetadataUsage
|
||||||
|
{
|
||||||
|
kIl2CppMetadataUsageInvalid,
|
||||||
|
kIl2CppMetadataUsageTypeInfo,
|
||||||
|
kIl2CppMetadataUsageIl2CppType,
|
||||||
|
kIl2CppMetadataUsageMethodDef,
|
||||||
|
kIl2CppMetadataUsageFieldInfo,
|
||||||
|
kIl2CppMetadataUsageStringLiteral,
|
||||||
|
kIl2CppMetadataUsageMethodRef,
|
||||||
|
} Il2CppMetadataUsage;
|
||||||
|
static inline Il2CppMetadataUsage GetEncodedIndexType (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return (Il2CppMetadataUsage)((index & 0xE0000000) >> 29);
|
||||||
|
}
|
||||||
|
static inline uint32_t GetDecodedMethodIndex (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return index & 0x1FFFFFFFU;
|
||||||
|
}
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppTypeDefinitionMetadata Il2CppTypeDefinitionMetadata;
|
||||||
|
typedef union Il2CppRGCTXDefinitionData
|
||||||
|
{
|
||||||
|
int32_t rgctxDataDummy;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppRGCTXDefinitionData;
|
||||||
|
typedef enum Il2CppRGCTXDataType
|
||||||
|
{
|
||||||
|
IL2CPP_RGCTX_DATA_INVALID,
|
||||||
|
IL2CPP_RGCTX_DATA_TYPE,
|
||||||
|
IL2CPP_RGCTX_DATA_CLASS,
|
||||||
|
IL2CPP_RGCTX_DATA_METHOD
|
||||||
|
} Il2CppRGCTXDataType;
|
||||||
|
typedef struct Il2CppRGCTXDefinition
|
||||||
|
{
|
||||||
|
Il2CppRGCTXDataType type;
|
||||||
|
Il2CppRGCTXDefinitionData data;
|
||||||
|
} Il2CppRGCTXDefinition;
|
||||||
|
typedef struct Il2CppInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
TypeIndex interfaceTypeIndex;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppTypeDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex namespaceIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex byvalTypeIndex;
|
||||||
|
TypeIndex byrefTypeIndex;
|
||||||
|
TypeIndex declaringTypeIndex;
|
||||||
|
TypeIndex parentIndex;
|
||||||
|
TypeIndex elementTypeIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex delegateWrapperFromManagedToNativeIndex;
|
||||||
|
int32_t marshalingFunctionsIndex;
|
||||||
|
uint32_t flags;
|
||||||
|
FieldIndex fieldStart;
|
||||||
|
MethodIndex methodStart;
|
||||||
|
EventIndex eventStart;
|
||||||
|
PropertyIndex propertyStart;
|
||||||
|
NestedTypeIndex nestedTypesStart;
|
||||||
|
InterfacesIndex interfacesStart;
|
||||||
|
VTableIndex vtableStart;
|
||||||
|
InterfacesIndex interfaceOffsetsStart;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint32_t bitfield;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppTypeDefinition;
|
||||||
|
typedef struct Il2CppFieldDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppFieldDefinition;
|
||||||
|
typedef struct Il2CppFieldDefaultValue
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppFieldDefaultValue;
|
||||||
|
typedef struct Il2CppFieldMarshaledSize
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
int32_t size;
|
||||||
|
} Il2CppFieldMarshaledSize;
|
||||||
|
typedef struct Il2CppFieldRef
|
||||||
|
{
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
} Il2CppFieldRef;
|
||||||
|
typedef struct Il2CppParameterDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppParameterDefinition;
|
||||||
|
typedef struct Il2CppParameterDefaultValue
|
||||||
|
{
|
||||||
|
ParameterIndex parameterIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppParameterDefaultValue;
|
||||||
|
typedef struct Il2CppMethodDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeDefinitionIndex declaringType;
|
||||||
|
TypeIndex returnType;
|
||||||
|
ParameterIndex parameterStart;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
MethodIndex delegateWrapperIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint16_t parameterCount;
|
||||||
|
} Il2CppMethodDefinition;
|
||||||
|
typedef struct Il2CppEventDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
MethodIndex add;
|
||||||
|
MethodIndex remove;
|
||||||
|
MethodIndex raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppEventDefinition;
|
||||||
|
typedef struct Il2CppPropertyDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
MethodIndex get;
|
||||||
|
MethodIndex set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppPropertyDefinition;
|
||||||
|
typedef struct Il2CppMethodSpec
|
||||||
|
{
|
||||||
|
MethodIndex methodDefinitionIndex;
|
||||||
|
GenericInstIndex classIndexIndex;
|
||||||
|
GenericInstIndex methodIndexIndex;
|
||||||
|
} Il2CppMethodSpec;
|
||||||
|
typedef struct Il2CppStringLiteral
|
||||||
|
{
|
||||||
|
uint32_t length;
|
||||||
|
StringLiteralIndex dataIndex;
|
||||||
|
} Il2CppStringLiteral;
|
||||||
|
typedef struct Il2CppGenericMethodIndices
|
||||||
|
{
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
} Il2CppGenericMethodIndices;
|
||||||
|
typedef struct Il2CppGenericMethodFunctionsDefinitions
|
||||||
|
{
|
||||||
|
GenericMethodIndex genericMethodIndex;
|
||||||
|
Il2CppGenericMethodIndices indices;
|
||||||
|
} Il2CppGenericMethodFunctionsDefinitions;
|
||||||
|
const int kPublicKeyByteLength = 8;
|
||||||
|
typedef struct Il2CppAssemblyName
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex cultureIndex;
|
||||||
|
StringIndex hashValueIndex;
|
||||||
|
StringIndex publicKeyIndex;
|
||||||
|
uint32_t hash_alg;
|
||||||
|
int32_t hash_len;
|
||||||
|
uint32_t flags;
|
||||||
|
int32_t major;
|
||||||
|
int32_t minor;
|
||||||
|
int32_t build;
|
||||||
|
int32_t revision;
|
||||||
|
uint8_t publicKeyToken[8];
|
||||||
|
} Il2CppAssemblyName;
|
||||||
|
typedef struct Il2CppImageDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppImageDefinition;
|
||||||
|
typedef struct Il2CppAssembly
|
||||||
|
{
|
||||||
|
ImageIndex imageIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
Il2CppAssemblyName aname;
|
||||||
|
} Il2CppAssembly;
|
||||||
|
typedef struct Il2CppMetadataUsageList
|
||||||
|
{
|
||||||
|
uint32_t start;
|
||||||
|
uint32_t count;
|
||||||
|
} Il2CppMetadataUsageList;
|
||||||
|
typedef struct Il2CppMetadataUsagePair
|
||||||
|
{
|
||||||
|
uint32_t destinationIndex;
|
||||||
|
uint32_t encodedSourceIndex;
|
||||||
|
} Il2CppMetadataUsagePair;
|
||||||
|
#pragma pack(push, p1,4)
|
||||||
|
typedef struct Il2CppGlobalMetadataHeader
|
||||||
|
{
|
||||||
|
int32_t sanity;
|
||||||
|
int32_t version;
|
||||||
|
int32_t stringLiteralOffset;
|
||||||
|
int32_t stringLiteralCount;
|
||||||
|
int32_t stringLiteralDataOffset;
|
||||||
|
int32_t stringLiteralDataCount;
|
||||||
|
int32_t stringOffset;
|
||||||
|
int32_t stringCount;
|
||||||
|
int32_t eventsOffset;
|
||||||
|
int32_t eventsCount;
|
||||||
|
int32_t propertiesOffset;
|
||||||
|
int32_t propertiesCount;
|
||||||
|
int32_t methodsOffset;
|
||||||
|
int32_t methodsCount;
|
||||||
|
int32_t parameterDefaultValuesOffset;
|
||||||
|
int32_t parameterDefaultValuesCount;
|
||||||
|
int32_t fieldDefaultValuesOffset;
|
||||||
|
int32_t fieldDefaultValuesCount;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataOffset;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataCount;
|
||||||
|
int32_t fieldMarshaledSizesOffset;
|
||||||
|
int32_t fieldMarshaledSizesCount;
|
||||||
|
int32_t parametersOffset;
|
||||||
|
int32_t parametersCount;
|
||||||
|
int32_t fieldsOffset;
|
||||||
|
int32_t fieldsCount;
|
||||||
|
int32_t genericParametersOffset;
|
||||||
|
int32_t genericParametersCount;
|
||||||
|
int32_t genericParameterConstraintsOffset;
|
||||||
|
int32_t genericParameterConstraintsCount;
|
||||||
|
int32_t genericContainersOffset;
|
||||||
|
int32_t genericContainersCount;
|
||||||
|
int32_t nestedTypesOffset;
|
||||||
|
int32_t nestedTypesCount;
|
||||||
|
int32_t interfacesOffset;
|
||||||
|
int32_t interfacesCount;
|
||||||
|
int32_t vtableMethodsOffset;
|
||||||
|
int32_t vtableMethodsCount;
|
||||||
|
int32_t interfaceOffsetsOffset;
|
||||||
|
int32_t interfaceOffsetsCount;
|
||||||
|
int32_t typeDefinitionsOffset;
|
||||||
|
int32_t typeDefinitionsCount;
|
||||||
|
int32_t rgctxEntriesOffset;
|
||||||
|
int32_t rgctxEntriesCount;
|
||||||
|
int32_t imagesOffset;
|
||||||
|
int32_t imagesCount;
|
||||||
|
int32_t assembliesOffset;
|
||||||
|
int32_t assembliesCount;
|
||||||
|
int32_t metadataUsageListsOffset;
|
||||||
|
int32_t metadataUsageListsCount;
|
||||||
|
int32_t metadataUsagePairsOffset;
|
||||||
|
int32_t metadataUsagePairsCount;
|
||||||
|
int32_t fieldRefsOffset;
|
||||||
|
int32_t fieldRefsCount;
|
||||||
|
} Il2CppGlobalMetadataHeader;
|
||||||
|
#pragma pack(pop, p1)
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppArrayType
|
||||||
|
{
|
||||||
|
const Il2CppType* etype;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t numsizes;
|
||||||
|
uint8_t numlobounds;
|
||||||
|
int *sizes;
|
||||||
|
int *lobounds;
|
||||||
|
} Il2CppArrayType;
|
||||||
|
typedef struct Il2CppGenericInst
|
||||||
|
{
|
||||||
|
uint32_t type_argc;
|
||||||
|
const Il2CppType **type_argv;
|
||||||
|
} Il2CppGenericInst;
|
||||||
|
typedef struct Il2CppGenericContext
|
||||||
|
{
|
||||||
|
const Il2CppGenericInst *class_inst;
|
||||||
|
const Il2CppGenericInst *method_inst;
|
||||||
|
} Il2CppGenericContext;
|
||||||
|
typedef struct Il2CppGenericParameter
|
||||||
|
{
|
||||||
|
GenericContainerIndex ownerIndex;
|
||||||
|
StringIndex nameIndex;
|
||||||
|
GenericParameterConstraintIndex constraintsStart;
|
||||||
|
int16_t constraintsCount;
|
||||||
|
uint16_t num;
|
||||||
|
uint16_t flags;
|
||||||
|
} Il2CppGenericParameter;
|
||||||
|
typedef struct Il2CppGenericContainer
|
||||||
|
{
|
||||||
|
int32_t ownerIndex;
|
||||||
|
int32_t type_argc;
|
||||||
|
int32_t is_method;
|
||||||
|
GenericParameterIndex genericParameterStart;
|
||||||
|
} Il2CppGenericContainer;
|
||||||
|
typedef struct Il2CppGenericClass
|
||||||
|
{
|
||||||
|
TypeDefinitionIndex typeDefinitionIndex;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
Il2CppClass *cached_class;
|
||||||
|
} Il2CppGenericClass;
|
||||||
|
typedef struct Il2CppGenericMethod
|
||||||
|
{
|
||||||
|
const MethodInfo* methodDefinition;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
} Il2CppGenericMethod;
|
||||||
|
typedef struct Il2CppType
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
void* dummy;
|
||||||
|
TypeDefinitionIndex klassIndex;
|
||||||
|
const Il2CppType *type;
|
||||||
|
Il2CppArrayType *array;
|
||||||
|
GenericParameterIndex genericParameterIndex;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
} data;
|
||||||
|
unsigned int attrs : 16;
|
||||||
|
Il2CppTypeEnum type : 8;
|
||||||
|
unsigned int num_mods : 6;
|
||||||
|
unsigned int byref : 1;
|
||||||
|
unsigned int pinned : 1;
|
||||||
|
} Il2CppType;
|
||||||
|
typedef enum {
|
||||||
|
IL2CPP_CALL_DEFAULT,
|
||||||
|
IL2CPP_CALL_C,
|
||||||
|
IL2CPP_CALL_STDCALL,
|
||||||
|
IL2CPP_CALL_THISCALL,
|
||||||
|
IL2CPP_CALL_FASTCALL,
|
||||||
|
IL2CPP_CALL_VARARG
|
||||||
|
} Il2CppCallConvention;
|
||||||
|
typedef enum Il2CppCharSet
|
||||||
|
{
|
||||||
|
CHARSET_ANSI,
|
||||||
|
CHARSET_UNICODE
|
||||||
|
} Il2CppCharSet;
|
||||||
|
typedef struct PInvokeArguments
|
||||||
|
{
|
||||||
|
const char* moduleName;
|
||||||
|
const char* entryPoint;
|
||||||
|
Il2CppCallConvention callingConvention;
|
||||||
|
Il2CppCharSet charSet;
|
||||||
|
int parameterSize;
|
||||||
|
bool isNoMangle;
|
||||||
|
} PInvokeArguments;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppAssembly Il2CppAssembly;
|
||||||
|
typedef struct Il2CppAppDomain Il2CppAppDomain;
|
||||||
|
typedef struct Il2CppDelegate Il2CppDelegate;
|
||||||
|
typedef struct Il2CppAppContext Il2CppAppContext;
|
||||||
|
typedef struct Il2CppNameToTypeDefinitionIndexHashTable Il2CppNameToTypeDefinitionIndexHashTable;
|
||||||
|
typedef enum Il2CppTypeNameFormat
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_IL,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_REFLECTION,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_FULL_NAME,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
|
||||||
|
} Il2CppTypeNameFormat;
|
||||||
|
extern bool g_il2cpp_is_fully_initialized;
|
||||||
|
typedef struct {
|
||||||
|
Il2CppImage *corlib;
|
||||||
|
Il2CppClass *object_class;
|
||||||
|
Il2CppClass *byte_class;
|
||||||
|
Il2CppClass *void_class;
|
||||||
|
Il2CppClass *boolean_class;
|
||||||
|
Il2CppClass *sbyte_class;
|
||||||
|
Il2CppClass *int16_class;
|
||||||
|
Il2CppClass *uint16_class;
|
||||||
|
Il2CppClass *int32_class;
|
||||||
|
Il2CppClass *uint32_class;
|
||||||
|
Il2CppClass *int_class;
|
||||||
|
Il2CppClass *uint_class;
|
||||||
|
Il2CppClass *int64_class;
|
||||||
|
Il2CppClass *uint64_class;
|
||||||
|
Il2CppClass *single_class;
|
||||||
|
Il2CppClass *double_class;
|
||||||
|
Il2CppClass *char_class;
|
||||||
|
Il2CppClass *string_class;
|
||||||
|
Il2CppClass *enum_class;
|
||||||
|
Il2CppClass *array_class;
|
||||||
|
Il2CppClass *delegate_class;
|
||||||
|
Il2CppClass *multicastdelegate_class;
|
||||||
|
Il2CppClass *asyncresult_class;
|
||||||
|
Il2CppClass *manualresetevent_class;
|
||||||
|
Il2CppClass *typehandle_class;
|
||||||
|
Il2CppClass *fieldhandle_class;
|
||||||
|
Il2CppClass *methodhandle_class;
|
||||||
|
Il2CppClass *systemtype_class;
|
||||||
|
Il2CppClass *monotype_class;
|
||||||
|
Il2CppClass *exception_class;
|
||||||
|
Il2CppClass *threadabortexception_class;
|
||||||
|
Il2CppClass *thread_class;
|
||||||
|
Il2CppClass *appdomain_class;
|
||||||
|
Il2CppClass *appdomain_setup_class;
|
||||||
|
Il2CppClass *field_info_class;
|
||||||
|
Il2CppClass *method_info_class;
|
||||||
|
Il2CppClass *property_info_class;
|
||||||
|
Il2CppClass *event_info_class;
|
||||||
|
Il2CppClass *mono_event_info_class;
|
||||||
|
Il2CppClass *stringbuilder_class;
|
||||||
|
Il2CppClass *stack_frame_class;
|
||||||
|
Il2CppClass *stack_trace_class;
|
||||||
|
Il2CppClass *marshal_class;
|
||||||
|
Il2CppClass *typed_reference_class;
|
||||||
|
Il2CppClass *marshalbyrefobject_class;
|
||||||
|
Il2CppClass *generic_ilist_class;
|
||||||
|
Il2CppClass *generic_icollection_class;
|
||||||
|
Il2CppClass *generic_ienumerable_class;
|
||||||
|
Il2CppClass *generic_nullable_class;
|
||||||
|
Il2CppClass *customattribute_data_class;
|
||||||
|
Il2CppClass *version;
|
||||||
|
Il2CppClass *culture_info;
|
||||||
|
Il2CppClass *async_call_class;
|
||||||
|
Il2CppClass *assembly_class;
|
||||||
|
Il2CppClass *assembly_name_class;
|
||||||
|
Il2CppClass *enum_info_class;
|
||||||
|
Il2CppClass *mono_field_class;
|
||||||
|
Il2CppClass *mono_method_class;
|
||||||
|
Il2CppClass *mono_method_info_class;
|
||||||
|
Il2CppClass *mono_property_info_class;
|
||||||
|
Il2CppClass *parameter_info_class;
|
||||||
|
Il2CppClass *module_class;
|
||||||
|
Il2CppClass *pointer_class;
|
||||||
|
Il2CppClass *system_exception_class;
|
||||||
|
Il2CppClass *argument_exception_class;
|
||||||
|
Il2CppClass *wait_handle_class;
|
||||||
|
Il2CppClass *safe_handle_class;
|
||||||
|
Il2CppClass *sort_key_class;
|
||||||
|
} Il2CppDefaults;
|
||||||
|
extern Il2CppDefaults il2cpp_defaults;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct FieldInfo FieldInfo;
|
||||||
|
typedef struct Il2CppObject Il2CppObject;
|
||||||
|
typedef struct MemberInfo MemberInfo;
|
||||||
|
typedef struct CustomAttributesCache
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
Il2CppObject** attributes;
|
||||||
|
} CustomAttributesCache;
|
||||||
|
typedef struct CustomAttributeTypeCache
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
Il2CppClass** attributeTypes;
|
||||||
|
} CustomAttributeTypeCache;
|
||||||
|
typedef void (*CustomAttributesCacheGenerator)(CustomAttributesCache*, CustomAttributeTypeCache*);
|
||||||
|
const int THREAD_STATIC_FIELD_OFFSET = -1;
|
||||||
|
typedef struct FieldInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass *parent;
|
||||||
|
int32_t offset;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} FieldInfo;
|
||||||
|
typedef struct PropertyInfo
|
||||||
|
{
|
||||||
|
Il2CppClass *parent;
|
||||||
|
const char *name;
|
||||||
|
const MethodInfo *get;
|
||||||
|
const MethodInfo *set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} PropertyInfo;
|
||||||
|
typedef struct EventInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* eventType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
const MethodInfo* add;
|
||||||
|
const MethodInfo* remove;
|
||||||
|
const MethodInfo* raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} EventInfo;
|
||||||
|
typedef struct ParameterInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
int32_t position;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
const Il2CppType* parameter_type;
|
||||||
|
} ParameterInfo;
|
||||||
|
typedef void* (*InvokerMethod)(const MethodInfo*, void*, void**);
|
||||||
|
typedef union Il2CppRGCTXData
|
||||||
|
{
|
||||||
|
void* rgctxDataDummy;
|
||||||
|
const MethodInfo* method;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass* klass;
|
||||||
|
} Il2CppRGCTXData;
|
||||||
|
typedef struct MethodInfo
|
||||||
|
{
|
||||||
|
methodPointerType method;
|
||||||
|
InvokerMethod invoker_method;
|
||||||
|
const char* name;
|
||||||
|
Il2CppClass *declaring_type;
|
||||||
|
const Il2CppType *return_type;
|
||||||
|
const ParameterInfo* parameters;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
const Il2CppMethodDefinition* methodDefinition;
|
||||||
|
};
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppGenericMethod* genericMethod;
|
||||||
|
const Il2CppGenericContainer* genericContainer;
|
||||||
|
};
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint8_t parameters_count;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t is_inflated : 1;
|
||||||
|
} MethodInfo;
|
||||||
|
typedef struct Il2CppRuntimeInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
Il2CppClass* interfaceType;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppRuntimeInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppClass
|
||||||
|
{
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
} Il2CppClass;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_0 {
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass * generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
} Il2CppClass_0;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_1 {
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
#ifdef IS_32BIT
|
||||||
|
uint32_t cctor_thread__padding;
|
||||||
|
uint32_t cctor_thread;
|
||||||
|
uint32_t cctor_thread__hi;
|
||||||
|
#else
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
#endif
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
} Il2CppClass_1;
|
||||||
|
|
||||||
|
typedef struct __attribute__((aligned(8))) Il2CppClass_Merged {
|
||||||
|
struct Il2CppClass_0 _0;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
struct Il2CppClass_1 _1;
|
||||||
|
} Il2CppClass_Merged;
|
||||||
|
|
||||||
|
typedef struct Il2CppTypeDefinitionSizes
|
||||||
|
{
|
||||||
|
uint32_t instance_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
} Il2CppTypeDefinitionSizes;
|
||||||
|
typedef struct Il2CppDomain
|
||||||
|
{
|
||||||
|
Il2CppAppDomain* domain;
|
||||||
|
Il2CppObject* setup;
|
||||||
|
Il2CppAppContext* default_context;
|
||||||
|
const char* friendly_name;
|
||||||
|
uint32_t domain_id;
|
||||||
|
} Il2CppDomain;
|
||||||
|
typedef struct Il2CppImage
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
Il2CppNameToTypeDefinitionIndexHashTable* nameToClassHashTable;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppImage;
|
||||||
|
typedef struct Il2CppMarshalingFunctions
|
||||||
|
{
|
||||||
|
methodPointerType marshal_to_native_func;
|
||||||
|
methodPointerType marshal_from_native_func;
|
||||||
|
methodPointerType marshal_cleanup_func;
|
||||||
|
} Il2CppMarshalingFunctions;
|
||||||
|
typedef struct Il2CppCodeRegistration
|
||||||
|
{
|
||||||
|
uint32_t methodPointersCount;
|
||||||
|
const methodPointerType* methodPointers;
|
||||||
|
uint32_t delegateWrappersFromNativeToManagedCount;
|
||||||
|
const methodPointerType** delegateWrappersFromNativeToManaged;
|
||||||
|
uint32_t delegateWrappersFromManagedToNativeCount;
|
||||||
|
const methodPointerType* delegateWrappersFromManagedToNative;
|
||||||
|
uint32_t marshalingFunctionsCount;
|
||||||
|
const Il2CppMarshalingFunctions* marshalingFunctions;
|
||||||
|
uint32_t genericMethodPointersCount;
|
||||||
|
const methodPointerType* genericMethodPointers;
|
||||||
|
uint32_t invokerPointersCount;
|
||||||
|
const InvokerMethod* invokerPointers;
|
||||||
|
CustomAttributeIndex customAttributeCount;
|
||||||
|
const CustomAttributesCacheGenerator* customAttributeGenerators;
|
||||||
|
} Il2CppCodeRegistration;
|
||||||
|
typedef struct Il2CppMetadataRegistration
|
||||||
|
{
|
||||||
|
int32_t genericClassesCount;
|
||||||
|
Il2CppGenericClass* const * genericClasses;
|
||||||
|
int32_t genericInstsCount;
|
||||||
|
const Il2CppGenericInst* const * genericInsts;
|
||||||
|
int32_t genericMethodTableCount;
|
||||||
|
const Il2CppGenericMethodFunctionsDefinitions* genericMethodTable;
|
||||||
|
int32_t typesCount;
|
||||||
|
const Il2CppType* const * types;
|
||||||
|
int32_t methodSpecsCount;
|
||||||
|
const Il2CppMethodSpec* methodSpecs;
|
||||||
|
FieldIndex fieldOffsetsCount;
|
||||||
|
const int32_t* fieldOffsets;
|
||||||
|
TypeDefinitionIndex typeDefinitionsSizesCount;
|
||||||
|
const Il2CppTypeDefinitionSizes* typeDefinitionsSizes;
|
||||||
|
const size_t metadataUsagesCount;
|
||||||
|
void** const* metadataUsages;
|
||||||
|
} Il2CppMetadataRegistration;
|
||||||
|
typedef struct Il2CppRuntimeStats
|
||||||
|
{
|
||||||
|
uint64_t new_object_count;
|
||||||
|
uint64_t initialized_class_count;
|
||||||
|
uint64_t method_count;
|
||||||
|
uint64_t class_static_data_size;
|
||||||
|
uint64_t generic_instance_count;
|
||||||
|
uint64_t generic_class_count;
|
||||||
|
uint64_t inflated_method_count;
|
||||||
|
uint64_t inflated_type_count;
|
||||||
|
bool enabled;
|
||||||
|
} Il2CppRuntimeStats;
|
||||||
|
extern Il2CppRuntimeStats il2cpp_runtime_stats;
|
||||||
|
|
||||||
|
struct MonitorData;
|
||||||
|
struct Il2CppObject {
|
||||||
|
struct Il2CppClass *klass;
|
||||||
|
struct MonitorData *monitor;
|
||||||
|
};
|
||||||
|
typedef int32_t il2cpp_array_lower_bound_t;
|
||||||
|
struct Il2CppArrayBounds {
|
||||||
|
il2cpp_array_size_t length;
|
||||||
|
il2cpp_array_lower_bound_t lower_bound;
|
||||||
|
};
|
||||||
|
struct Il2CppArray {
|
||||||
|
struct Il2CppObject obj;
|
||||||
|
struct Il2CppArrayBounds *bounds;
|
||||||
|
il2cpp_array_size_t max_length;
|
||||||
|
/* vector must be 8-byte aligned.
|
||||||
|
On 64-bit platforms, this happens naturally.
|
||||||
|
On 32-bit platforms, sizeof(obj)=8, sizeof(bounds)=4 and sizeof(max_length)=4 so it's also already aligned. */
|
||||||
|
void *vector[32];
|
||||||
|
};
|
||||||
|
struct Il2CppString {
|
||||||
|
struct Il2CppObject object;
|
||||||
|
int32_t length;
|
||||||
|
uint16_t chars[32];
|
||||||
|
};
|
||||||
873
Il2CppInspector.Common/Outputs/UnityHeaders/20-5.3.3-5.3.4.h
Normal file
873
Il2CppInspector.Common/Outputs/UnityHeaders/20-5.3.3-5.3.4.h
Normal file
@@ -0,0 +1,873 @@
|
|||||||
|
typedef void (*methodPointerType)();
|
||||||
|
typedef int32_t il2cpp_array_size_t;
|
||||||
|
typedef uint32_t Il2CppMethodSlot;
|
||||||
|
const int ipv6AddressSize = 16;
|
||||||
|
typedef int32_t il2cpp_hresult_t;
|
||||||
|
typedef enum Il2CppTypeEnum
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_END = 0x00,
|
||||||
|
IL2CPP_TYPE_VOID = 0x01,
|
||||||
|
IL2CPP_TYPE_BOOLEAN = 0x02,
|
||||||
|
IL2CPP_TYPE_CHAR = 0x03,
|
||||||
|
IL2CPP_TYPE_I1 = 0x04,
|
||||||
|
IL2CPP_TYPE_U1 = 0x05,
|
||||||
|
IL2CPP_TYPE_I2 = 0x06,
|
||||||
|
IL2CPP_TYPE_U2 = 0x07,
|
||||||
|
IL2CPP_TYPE_I4 = 0x08,
|
||||||
|
IL2CPP_TYPE_U4 = 0x09,
|
||||||
|
IL2CPP_TYPE_I8 = 0x0a,
|
||||||
|
IL2CPP_TYPE_U8 = 0x0b,
|
||||||
|
IL2CPP_TYPE_R4 = 0x0c,
|
||||||
|
IL2CPP_TYPE_R8 = 0x0d,
|
||||||
|
IL2CPP_TYPE_STRING = 0x0e,
|
||||||
|
IL2CPP_TYPE_PTR = 0x0f,
|
||||||
|
IL2CPP_TYPE_BYREF = 0x10,
|
||||||
|
IL2CPP_TYPE_VALUETYPE = 0x11,
|
||||||
|
IL2CPP_TYPE_CLASS = 0x12,
|
||||||
|
IL2CPP_TYPE_VAR = 0x13,
|
||||||
|
IL2CPP_TYPE_ARRAY = 0x14,
|
||||||
|
IL2CPP_TYPE_GENERICINST= 0x15,
|
||||||
|
IL2CPP_TYPE_TYPEDBYREF = 0x16,
|
||||||
|
IL2CPP_TYPE_I = 0x18,
|
||||||
|
IL2CPP_TYPE_U = 0x19,
|
||||||
|
IL2CPP_TYPE_FNPTR = 0x1b,
|
||||||
|
IL2CPP_TYPE_OBJECT = 0x1c,
|
||||||
|
IL2CPP_TYPE_SZARRAY = 0x1d,
|
||||||
|
IL2CPP_TYPE_MVAR = 0x1e,
|
||||||
|
IL2CPP_TYPE_CMOD_REQD = 0x1f,
|
||||||
|
IL2CPP_TYPE_CMOD_OPT = 0x20,
|
||||||
|
IL2CPP_TYPE_INTERNAL = 0x21,
|
||||||
|
IL2CPP_TYPE_MODIFIER = 0x40,
|
||||||
|
IL2CPP_TYPE_SENTINEL = 0x41,
|
||||||
|
IL2CPP_TYPE_PINNED = 0x45,
|
||||||
|
IL2CPP_TYPE_ENUM = 0x55
|
||||||
|
} Il2CppTypeEnum;
|
||||||
|
typedef int32_t TypeIndex;
|
||||||
|
typedef int32_t TypeDefinitionIndex;
|
||||||
|
typedef int32_t FieldIndex;
|
||||||
|
typedef int32_t DefaultValueIndex;
|
||||||
|
typedef int32_t DefaultValueDataIndex;
|
||||||
|
typedef int32_t CustomAttributeIndex;
|
||||||
|
typedef int32_t ParameterIndex;
|
||||||
|
typedef int32_t MethodIndex;
|
||||||
|
typedef int32_t GenericMethodIndex;
|
||||||
|
typedef int32_t PropertyIndex;
|
||||||
|
typedef int32_t EventIndex;
|
||||||
|
typedef int32_t GenericContainerIndex;
|
||||||
|
typedef int32_t GenericParameterIndex;
|
||||||
|
typedef int16_t GenericParameterConstraintIndex;
|
||||||
|
typedef int32_t NestedTypeIndex;
|
||||||
|
typedef int32_t InterfacesIndex;
|
||||||
|
typedef int32_t VTableIndex;
|
||||||
|
typedef int32_t InterfaceOffsetIndex;
|
||||||
|
typedef int32_t RGCTXIndex;
|
||||||
|
typedef int32_t StringIndex;
|
||||||
|
typedef int32_t StringLiteralIndex;
|
||||||
|
typedef int32_t GenericInstIndex;
|
||||||
|
typedef int32_t ImageIndex;
|
||||||
|
typedef int32_t AssemblyIndex;
|
||||||
|
const TypeIndex kTypeIndexInvalid = -1;
|
||||||
|
const TypeDefinitionIndex kTypeDefinitionIndexInvalid = -1;
|
||||||
|
const DefaultValueDataIndex kDefaultValueIndexNull = -1;
|
||||||
|
const EventIndex kEventIndexInvalid = -1;
|
||||||
|
const FieldIndex kFieldIndexInvalid = -1;
|
||||||
|
const MethodIndex kMethodIndexInvalid = -1;
|
||||||
|
const PropertyIndex kPropertyIndexInvalid = -1;
|
||||||
|
const GenericContainerIndex kGenericContainerIndexInvalid = -1;
|
||||||
|
const GenericParameterIndex kGenericParameterIndexInvalid = -1;
|
||||||
|
const RGCTXIndex kRGCTXIndexInvalid = -1;
|
||||||
|
const StringLiteralIndex kStringLiteralIndexInvalid = -1;
|
||||||
|
typedef uint32_t EncodedMethodIndex;
|
||||||
|
typedef enum Il2CppMetadataUsage
|
||||||
|
{
|
||||||
|
kIl2CppMetadataUsageInvalid,
|
||||||
|
kIl2CppMetadataUsageTypeInfo,
|
||||||
|
kIl2CppMetadataUsageIl2CppType,
|
||||||
|
kIl2CppMetadataUsageMethodDef,
|
||||||
|
kIl2CppMetadataUsageFieldInfo,
|
||||||
|
kIl2CppMetadataUsageStringLiteral,
|
||||||
|
kIl2CppMetadataUsageMethodRef,
|
||||||
|
} Il2CppMetadataUsage;
|
||||||
|
static inline Il2CppMetadataUsage GetEncodedIndexType (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return (Il2CppMetadataUsage)((index & 0xE0000000) >> 29);
|
||||||
|
}
|
||||||
|
static inline uint32_t GetDecodedMethodIndex (EncodedMethodIndex index)
|
||||||
|
{
|
||||||
|
return index & 0x1FFFFFFFU;
|
||||||
|
}
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppTypeDefinitionMetadata Il2CppTypeDefinitionMetadata;
|
||||||
|
typedef union Il2CppRGCTXDefinitionData
|
||||||
|
{
|
||||||
|
int32_t rgctxDataDummy;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppRGCTXDefinitionData;
|
||||||
|
typedef enum Il2CppRGCTXDataType
|
||||||
|
{
|
||||||
|
IL2CPP_RGCTX_DATA_INVALID,
|
||||||
|
IL2CPP_RGCTX_DATA_TYPE,
|
||||||
|
IL2CPP_RGCTX_DATA_CLASS,
|
||||||
|
IL2CPP_RGCTX_DATA_METHOD
|
||||||
|
} Il2CppRGCTXDataType;
|
||||||
|
typedef struct Il2CppRGCTXDefinition
|
||||||
|
{
|
||||||
|
Il2CppRGCTXDataType type;
|
||||||
|
Il2CppRGCTXDefinitionData data;
|
||||||
|
} Il2CppRGCTXDefinition;
|
||||||
|
typedef struct Il2CppInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
TypeIndex interfaceTypeIndex;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppTypeDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex namespaceIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex byvalTypeIndex;
|
||||||
|
TypeIndex byrefTypeIndex;
|
||||||
|
TypeIndex declaringTypeIndex;
|
||||||
|
TypeIndex parentIndex;
|
||||||
|
TypeIndex elementTypeIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex delegateWrapperFromManagedToNativeIndex;
|
||||||
|
int32_t marshalingFunctionsIndex;
|
||||||
|
uint32_t flags;
|
||||||
|
FieldIndex fieldStart;
|
||||||
|
MethodIndex methodStart;
|
||||||
|
EventIndex eventStart;
|
||||||
|
PropertyIndex propertyStart;
|
||||||
|
NestedTypeIndex nestedTypesStart;
|
||||||
|
InterfacesIndex interfacesStart;
|
||||||
|
VTableIndex vtableStart;
|
||||||
|
InterfacesIndex interfaceOffsetsStart;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint32_t bitfield;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppTypeDefinition;
|
||||||
|
typedef struct Il2CppFieldDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppFieldDefinition;
|
||||||
|
typedef struct Il2CppFieldDefaultValue
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppFieldDefaultValue;
|
||||||
|
typedef struct Il2CppFieldMarshaledSize
|
||||||
|
{
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
int32_t size;
|
||||||
|
} Il2CppFieldMarshaledSize;
|
||||||
|
typedef struct Il2CppFieldRef
|
||||||
|
{
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
FieldIndex fieldIndex;
|
||||||
|
} Il2CppFieldRef;
|
||||||
|
typedef struct Il2CppParameterDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
} Il2CppParameterDefinition;
|
||||||
|
typedef struct Il2CppParameterDefaultValue
|
||||||
|
{
|
||||||
|
ParameterIndex parameterIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
DefaultValueDataIndex dataIndex;
|
||||||
|
} Il2CppParameterDefaultValue;
|
||||||
|
typedef struct Il2CppMethodDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeDefinitionIndex declaringType;
|
||||||
|
TypeIndex returnType;
|
||||||
|
ParameterIndex parameterStart;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
MethodIndex delegateWrapperIndex;
|
||||||
|
RGCTXIndex rgctxStartIndex;
|
||||||
|
int32_t rgctxCount;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint16_t parameterCount;
|
||||||
|
} Il2CppMethodDefinition;
|
||||||
|
typedef struct Il2CppEventDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
TypeIndex typeIndex;
|
||||||
|
MethodIndex add;
|
||||||
|
MethodIndex remove;
|
||||||
|
MethodIndex raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppEventDefinition;
|
||||||
|
typedef struct Il2CppPropertyDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
MethodIndex get;
|
||||||
|
MethodIndex set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppPropertyDefinition;
|
||||||
|
typedef struct Il2CppMethodSpec
|
||||||
|
{
|
||||||
|
MethodIndex methodDefinitionIndex;
|
||||||
|
GenericInstIndex classIndexIndex;
|
||||||
|
GenericInstIndex methodIndexIndex;
|
||||||
|
} Il2CppMethodSpec;
|
||||||
|
typedef struct Il2CppStringLiteral
|
||||||
|
{
|
||||||
|
uint32_t length;
|
||||||
|
StringLiteralIndex dataIndex;
|
||||||
|
} Il2CppStringLiteral;
|
||||||
|
typedef struct Il2CppGenericMethodIndices
|
||||||
|
{
|
||||||
|
MethodIndex methodIndex;
|
||||||
|
MethodIndex invokerIndex;
|
||||||
|
} Il2CppGenericMethodIndices;
|
||||||
|
typedef struct Il2CppGenericMethodFunctionsDefinitions
|
||||||
|
{
|
||||||
|
GenericMethodIndex genericMethodIndex;
|
||||||
|
Il2CppGenericMethodIndices indices;
|
||||||
|
} Il2CppGenericMethodFunctionsDefinitions;
|
||||||
|
const int kPublicKeyByteLength = 8;
|
||||||
|
typedef struct Il2CppAssemblyName
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
StringIndex cultureIndex;
|
||||||
|
StringIndex hashValueIndex;
|
||||||
|
StringIndex publicKeyIndex;
|
||||||
|
uint32_t hash_alg;
|
||||||
|
int32_t hash_len;
|
||||||
|
uint32_t flags;
|
||||||
|
int32_t major;
|
||||||
|
int32_t minor;
|
||||||
|
int32_t build;
|
||||||
|
int32_t revision;
|
||||||
|
uint8_t publicKeyToken[8];
|
||||||
|
} Il2CppAssemblyName;
|
||||||
|
typedef struct Il2CppImageDefinition
|
||||||
|
{
|
||||||
|
StringIndex nameIndex;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppImageDefinition;
|
||||||
|
typedef struct Il2CppAssembly
|
||||||
|
{
|
||||||
|
ImageIndex imageIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
int32_t referencedAssemblyStart;
|
||||||
|
int32_t referencedAssemblyCount;
|
||||||
|
Il2CppAssemblyName aname;
|
||||||
|
} Il2CppAssembly;
|
||||||
|
typedef struct Il2CppMetadataUsageList
|
||||||
|
{
|
||||||
|
uint32_t start;
|
||||||
|
uint32_t count;
|
||||||
|
} Il2CppMetadataUsageList;
|
||||||
|
typedef struct Il2CppMetadataUsagePair
|
||||||
|
{
|
||||||
|
uint32_t destinationIndex;
|
||||||
|
uint32_t encodedSourceIndex;
|
||||||
|
} Il2CppMetadataUsagePair;
|
||||||
|
#pragma pack(push, p1,4)
|
||||||
|
typedef struct Il2CppGlobalMetadataHeader
|
||||||
|
{
|
||||||
|
int32_t sanity;
|
||||||
|
int32_t version;
|
||||||
|
int32_t stringLiteralOffset;
|
||||||
|
int32_t stringLiteralCount;
|
||||||
|
int32_t stringLiteralDataOffset;
|
||||||
|
int32_t stringLiteralDataCount;
|
||||||
|
int32_t stringOffset;
|
||||||
|
int32_t stringCount;
|
||||||
|
int32_t eventsOffset;
|
||||||
|
int32_t eventsCount;
|
||||||
|
int32_t propertiesOffset;
|
||||||
|
int32_t propertiesCount;
|
||||||
|
int32_t methodsOffset;
|
||||||
|
int32_t methodsCount;
|
||||||
|
int32_t parameterDefaultValuesOffset;
|
||||||
|
int32_t parameterDefaultValuesCount;
|
||||||
|
int32_t fieldDefaultValuesOffset;
|
||||||
|
int32_t fieldDefaultValuesCount;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataOffset;
|
||||||
|
int32_t fieldAndParameterDefaultValueDataCount;
|
||||||
|
int32_t fieldMarshaledSizesOffset;
|
||||||
|
int32_t fieldMarshaledSizesCount;
|
||||||
|
int32_t parametersOffset;
|
||||||
|
int32_t parametersCount;
|
||||||
|
int32_t fieldsOffset;
|
||||||
|
int32_t fieldsCount;
|
||||||
|
int32_t genericParametersOffset;
|
||||||
|
int32_t genericParametersCount;
|
||||||
|
int32_t genericParameterConstraintsOffset;
|
||||||
|
int32_t genericParameterConstraintsCount;
|
||||||
|
int32_t genericContainersOffset;
|
||||||
|
int32_t genericContainersCount;
|
||||||
|
int32_t nestedTypesOffset;
|
||||||
|
int32_t nestedTypesCount;
|
||||||
|
int32_t interfacesOffset;
|
||||||
|
int32_t interfacesCount;
|
||||||
|
int32_t vtableMethodsOffset;
|
||||||
|
int32_t vtableMethodsCount;
|
||||||
|
int32_t interfaceOffsetsOffset;
|
||||||
|
int32_t interfaceOffsetsCount;
|
||||||
|
int32_t typeDefinitionsOffset;
|
||||||
|
int32_t typeDefinitionsCount;
|
||||||
|
int32_t rgctxEntriesOffset;
|
||||||
|
int32_t rgctxEntriesCount;
|
||||||
|
int32_t imagesOffset;
|
||||||
|
int32_t imagesCount;
|
||||||
|
int32_t assembliesOffset;
|
||||||
|
int32_t assembliesCount;
|
||||||
|
int32_t metadataUsageListsOffset;
|
||||||
|
int32_t metadataUsageListsCount;
|
||||||
|
int32_t metadataUsagePairsOffset;
|
||||||
|
int32_t metadataUsagePairsCount;
|
||||||
|
int32_t fieldRefsOffset;
|
||||||
|
int32_t fieldRefsCount;
|
||||||
|
int32_t referencedAssembliesOffset;
|
||||||
|
int32_t referencedAssembliesCount;
|
||||||
|
} Il2CppGlobalMetadataHeader;
|
||||||
|
#pragma pack(pop, p1)
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct Il2CppType Il2CppType;
|
||||||
|
typedef struct Il2CppArrayType
|
||||||
|
{
|
||||||
|
const Il2CppType* etype;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t numsizes;
|
||||||
|
uint8_t numlobounds;
|
||||||
|
int *sizes;
|
||||||
|
int *lobounds;
|
||||||
|
} Il2CppArrayType;
|
||||||
|
typedef struct Il2CppGenericInst
|
||||||
|
{
|
||||||
|
uint32_t type_argc;
|
||||||
|
const Il2CppType **type_argv;
|
||||||
|
} Il2CppGenericInst;
|
||||||
|
typedef struct Il2CppGenericContext
|
||||||
|
{
|
||||||
|
const Il2CppGenericInst *class_inst;
|
||||||
|
const Il2CppGenericInst *method_inst;
|
||||||
|
} Il2CppGenericContext;
|
||||||
|
typedef struct Il2CppGenericParameter
|
||||||
|
{
|
||||||
|
GenericContainerIndex ownerIndex;
|
||||||
|
StringIndex nameIndex;
|
||||||
|
GenericParameterConstraintIndex constraintsStart;
|
||||||
|
int16_t constraintsCount;
|
||||||
|
uint16_t num;
|
||||||
|
uint16_t flags;
|
||||||
|
} Il2CppGenericParameter;
|
||||||
|
typedef struct Il2CppGenericContainer
|
||||||
|
{
|
||||||
|
int32_t ownerIndex;
|
||||||
|
int32_t type_argc;
|
||||||
|
int32_t is_method;
|
||||||
|
GenericParameterIndex genericParameterStart;
|
||||||
|
} Il2CppGenericContainer;
|
||||||
|
typedef struct Il2CppGenericClass
|
||||||
|
{
|
||||||
|
TypeDefinitionIndex typeDefinitionIndex;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
Il2CppClass *cached_class;
|
||||||
|
} Il2CppGenericClass;
|
||||||
|
typedef struct Il2CppGenericMethod
|
||||||
|
{
|
||||||
|
const MethodInfo* methodDefinition;
|
||||||
|
Il2CppGenericContext context;
|
||||||
|
} Il2CppGenericMethod;
|
||||||
|
typedef struct Il2CppType
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
void* dummy;
|
||||||
|
TypeDefinitionIndex klassIndex;
|
||||||
|
const Il2CppType *type;
|
||||||
|
Il2CppArrayType *array;
|
||||||
|
GenericParameterIndex genericParameterIndex;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
} data;
|
||||||
|
unsigned int attrs : 16;
|
||||||
|
Il2CppTypeEnum type : 8;
|
||||||
|
unsigned int num_mods : 6;
|
||||||
|
unsigned int byref : 1;
|
||||||
|
unsigned int pinned : 1;
|
||||||
|
} Il2CppType;
|
||||||
|
typedef enum {
|
||||||
|
IL2CPP_CALL_DEFAULT,
|
||||||
|
IL2CPP_CALL_C,
|
||||||
|
IL2CPP_CALL_STDCALL,
|
||||||
|
IL2CPP_CALL_THISCALL,
|
||||||
|
IL2CPP_CALL_FASTCALL,
|
||||||
|
IL2CPP_CALL_VARARG
|
||||||
|
} Il2CppCallConvention;
|
||||||
|
typedef enum Il2CppCharSet
|
||||||
|
{
|
||||||
|
CHARSET_ANSI,
|
||||||
|
CHARSET_UNICODE
|
||||||
|
} Il2CppCharSet;
|
||||||
|
typedef struct PInvokeArguments
|
||||||
|
{
|
||||||
|
const char* moduleName;
|
||||||
|
const char* entryPoint;
|
||||||
|
Il2CppCallConvention callingConvention;
|
||||||
|
Il2CppCharSet charSet;
|
||||||
|
int parameterSize;
|
||||||
|
bool isNoMangle;
|
||||||
|
} PInvokeArguments;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct Il2CppImage Il2CppImage;
|
||||||
|
typedef struct Il2CppAssembly Il2CppAssembly;
|
||||||
|
typedef struct Il2CppAppDomain Il2CppAppDomain;
|
||||||
|
typedef struct Il2CppDelegate Il2CppDelegate;
|
||||||
|
typedef struct Il2CppAppContext Il2CppAppContext;
|
||||||
|
typedef struct Il2CppNameToTypeDefinitionIndexHashTable Il2CppNameToTypeDefinitionIndexHashTable;
|
||||||
|
typedef enum Il2CppTypeNameFormat
|
||||||
|
{
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_IL,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_REFLECTION,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_FULL_NAME,
|
||||||
|
IL2CPP_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
|
||||||
|
} Il2CppTypeNameFormat;
|
||||||
|
extern bool g_il2cpp_is_fully_initialized;
|
||||||
|
typedef struct {
|
||||||
|
Il2CppImage *corlib;
|
||||||
|
Il2CppClass *object_class;
|
||||||
|
Il2CppClass *byte_class;
|
||||||
|
Il2CppClass *void_class;
|
||||||
|
Il2CppClass *boolean_class;
|
||||||
|
Il2CppClass *sbyte_class;
|
||||||
|
Il2CppClass *int16_class;
|
||||||
|
Il2CppClass *uint16_class;
|
||||||
|
Il2CppClass *int32_class;
|
||||||
|
Il2CppClass *uint32_class;
|
||||||
|
Il2CppClass *int_class;
|
||||||
|
Il2CppClass *uint_class;
|
||||||
|
Il2CppClass *int64_class;
|
||||||
|
Il2CppClass *uint64_class;
|
||||||
|
Il2CppClass *single_class;
|
||||||
|
Il2CppClass *double_class;
|
||||||
|
Il2CppClass *char_class;
|
||||||
|
Il2CppClass *string_class;
|
||||||
|
Il2CppClass *enum_class;
|
||||||
|
Il2CppClass *array_class;
|
||||||
|
Il2CppClass *delegate_class;
|
||||||
|
Il2CppClass *multicastdelegate_class;
|
||||||
|
Il2CppClass *asyncresult_class;
|
||||||
|
Il2CppClass *manualresetevent_class;
|
||||||
|
Il2CppClass *typehandle_class;
|
||||||
|
Il2CppClass *fieldhandle_class;
|
||||||
|
Il2CppClass *methodhandle_class;
|
||||||
|
Il2CppClass *systemtype_class;
|
||||||
|
Il2CppClass *monotype_class;
|
||||||
|
Il2CppClass *exception_class;
|
||||||
|
Il2CppClass *threadabortexception_class;
|
||||||
|
Il2CppClass *thread_class;
|
||||||
|
Il2CppClass *appdomain_class;
|
||||||
|
Il2CppClass *appdomain_setup_class;
|
||||||
|
Il2CppClass *field_info_class;
|
||||||
|
Il2CppClass *method_info_class;
|
||||||
|
Il2CppClass *property_info_class;
|
||||||
|
Il2CppClass *event_info_class;
|
||||||
|
Il2CppClass *mono_event_info_class;
|
||||||
|
Il2CppClass *stringbuilder_class;
|
||||||
|
Il2CppClass *stack_frame_class;
|
||||||
|
Il2CppClass *stack_trace_class;
|
||||||
|
Il2CppClass *marshal_class;
|
||||||
|
Il2CppClass *typed_reference_class;
|
||||||
|
Il2CppClass *marshalbyrefobject_class;
|
||||||
|
Il2CppClass *generic_ilist_class;
|
||||||
|
Il2CppClass *generic_icollection_class;
|
||||||
|
Il2CppClass *generic_ienumerable_class;
|
||||||
|
Il2CppClass *generic_nullable_class;
|
||||||
|
Il2CppClass *customattribute_data_class;
|
||||||
|
Il2CppClass *version;
|
||||||
|
Il2CppClass *culture_info;
|
||||||
|
Il2CppClass *async_call_class;
|
||||||
|
Il2CppClass *assembly_class;
|
||||||
|
Il2CppClass *assembly_name_class;
|
||||||
|
Il2CppClass *enum_info_class;
|
||||||
|
Il2CppClass *mono_field_class;
|
||||||
|
Il2CppClass *mono_method_class;
|
||||||
|
Il2CppClass *mono_method_info_class;
|
||||||
|
Il2CppClass *mono_property_info_class;
|
||||||
|
Il2CppClass *parameter_info_class;
|
||||||
|
Il2CppClass *module_class;
|
||||||
|
Il2CppClass *pointer_class;
|
||||||
|
Il2CppClass *system_exception_class;
|
||||||
|
Il2CppClass *argument_exception_class;
|
||||||
|
Il2CppClass *wait_handle_class;
|
||||||
|
Il2CppClass *safe_handle_class;
|
||||||
|
Il2CppClass *sort_key_class;
|
||||||
|
} Il2CppDefaults;
|
||||||
|
extern Il2CppDefaults il2cpp_defaults;
|
||||||
|
typedef struct Il2CppClass Il2CppClass;
|
||||||
|
typedef struct MethodInfo MethodInfo;
|
||||||
|
typedef struct FieldInfo FieldInfo;
|
||||||
|
typedef struct Il2CppObject Il2CppObject;
|
||||||
|
typedef struct MemberInfo MemberInfo;
|
||||||
|
typedef struct CustomAttributesCache
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
Il2CppObject** attributes;
|
||||||
|
} CustomAttributesCache;
|
||||||
|
typedef struct CustomAttributeTypeCache
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
Il2CppClass** attributeTypes;
|
||||||
|
} CustomAttributeTypeCache;
|
||||||
|
typedef void (*CustomAttributesCacheGenerator)(CustomAttributesCache*, CustomAttributeTypeCache*);
|
||||||
|
const int THREAD_STATIC_FIELD_OFFSET = -1;
|
||||||
|
typedef struct FieldInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass *parent;
|
||||||
|
int32_t offset;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} FieldInfo;
|
||||||
|
typedef struct PropertyInfo
|
||||||
|
{
|
||||||
|
Il2CppClass *parent;
|
||||||
|
const char *name;
|
||||||
|
const MethodInfo *get;
|
||||||
|
const MethodInfo *set;
|
||||||
|
uint32_t attrs;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} PropertyInfo;
|
||||||
|
typedef struct EventInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
const Il2CppType* eventType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
const MethodInfo* add;
|
||||||
|
const MethodInfo* remove;
|
||||||
|
const MethodInfo* raise;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
} EventInfo;
|
||||||
|
typedef struct ParameterInfo
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
int32_t position;
|
||||||
|
uint32_t token;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
const Il2CppType* parameter_type;
|
||||||
|
} ParameterInfo;
|
||||||
|
typedef void* (*InvokerMethod)(const MethodInfo*, void*, void**);
|
||||||
|
typedef union Il2CppRGCTXData
|
||||||
|
{
|
||||||
|
void* rgctxDataDummy;
|
||||||
|
const MethodInfo* method;
|
||||||
|
const Il2CppType* type;
|
||||||
|
Il2CppClass* klass;
|
||||||
|
} Il2CppRGCTXData;
|
||||||
|
typedef struct MethodInfo
|
||||||
|
{
|
||||||
|
methodPointerType method;
|
||||||
|
InvokerMethod invoker_method;
|
||||||
|
const char* name;
|
||||||
|
Il2CppClass *declaring_type;
|
||||||
|
const Il2CppType *return_type;
|
||||||
|
const ParameterInfo* parameters;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
const Il2CppMethodDefinition* methodDefinition;
|
||||||
|
};
|
||||||
|
union
|
||||||
|
{
|
||||||
|
const Il2CppGenericMethod* genericMethod;
|
||||||
|
const Il2CppGenericContainer* genericContainer;
|
||||||
|
};
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t flags;
|
||||||
|
uint16_t iflags;
|
||||||
|
uint16_t slot;
|
||||||
|
uint8_t parameters_count;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t is_inflated : 1;
|
||||||
|
} MethodInfo;
|
||||||
|
typedef struct Il2CppRuntimeInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
Il2CppClass* interfaceType;
|
||||||
|
int32_t offset;
|
||||||
|
} Il2CppRuntimeInterfaceOffsetPair;
|
||||||
|
typedef struct Il2CppClass
|
||||||
|
{
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass *generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
uint8_t is_import : 1;
|
||||||
|
} Il2CppClass;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_0 {
|
||||||
|
const Il2CppImage* image;
|
||||||
|
void* gc_desc;
|
||||||
|
const char* name;
|
||||||
|
const char* namespaze;
|
||||||
|
const Il2CppType* byval_arg;
|
||||||
|
const Il2CppType* this_arg;
|
||||||
|
Il2CppClass* element_class;
|
||||||
|
Il2CppClass* castClass;
|
||||||
|
Il2CppClass* declaringType;
|
||||||
|
Il2CppClass* parent;
|
||||||
|
Il2CppGenericClass * generic_class;
|
||||||
|
const Il2CppTypeDefinition* typeDefinition;
|
||||||
|
FieldInfo* fields;
|
||||||
|
const EventInfo* events;
|
||||||
|
const PropertyInfo* properties;
|
||||||
|
const MethodInfo** methods;
|
||||||
|
Il2CppClass** nestedTypes;
|
||||||
|
Il2CppClass** implementedInterfaces;
|
||||||
|
} Il2CppClass_0;
|
||||||
|
|
||||||
|
typedef struct Il2CppClass_1 {
|
||||||
|
Il2CppClass** typeHierarchy;
|
||||||
|
uint32_t cctor_started;
|
||||||
|
uint32_t cctor_finished;
|
||||||
|
#ifdef IS_32BIT
|
||||||
|
uint32_t cctor_thread__padding;
|
||||||
|
uint32_t cctor_thread;
|
||||||
|
uint32_t cctor_thread__hi;
|
||||||
|
#else
|
||||||
|
__attribute__((aligned(8))) uint64_t cctor_thread;
|
||||||
|
#endif
|
||||||
|
GenericContainerIndex genericContainerIndex;
|
||||||
|
CustomAttributeIndex customAttributeIndex;
|
||||||
|
uint32_t instance_size;
|
||||||
|
uint32_t actualSize;
|
||||||
|
uint32_t element_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
int32_t thread_static_fields_offset;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t token;
|
||||||
|
uint16_t method_count;
|
||||||
|
uint16_t property_count;
|
||||||
|
uint16_t field_count;
|
||||||
|
uint16_t event_count;
|
||||||
|
uint16_t nested_type_count;
|
||||||
|
uint16_t vtable_count;
|
||||||
|
uint16_t interfaces_count;
|
||||||
|
uint16_t interface_offsets_count;
|
||||||
|
uint8_t typeHierarchyDepth;
|
||||||
|
uint8_t rank;
|
||||||
|
uint8_t minimumAlignment;
|
||||||
|
uint8_t packingSize;
|
||||||
|
uint8_t valuetype : 1;
|
||||||
|
uint8_t initialized : 1;
|
||||||
|
uint8_t enumtype : 1;
|
||||||
|
uint8_t is_generic : 1;
|
||||||
|
uint8_t has_references : 1;
|
||||||
|
uint8_t init_pending : 1;
|
||||||
|
uint8_t size_inited : 1;
|
||||||
|
uint8_t has_finalize : 1;
|
||||||
|
uint8_t has_cctor : 1;
|
||||||
|
uint8_t is_blittable : 1;
|
||||||
|
uint8_t is_import : 1;
|
||||||
|
} Il2CppClass_1;
|
||||||
|
|
||||||
|
typedef struct __attribute__((aligned(8))) Il2CppClass_Merged {
|
||||||
|
struct Il2CppClass_0 _0;
|
||||||
|
const MethodInfo** vtable;
|
||||||
|
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
|
||||||
|
void* static_fields;
|
||||||
|
const Il2CppRGCTXData* rgctx_data;
|
||||||
|
struct Il2CppClass_1 _1;
|
||||||
|
} Il2CppClass_Merged;
|
||||||
|
|
||||||
|
typedef struct Il2CppTypeDefinitionSizes
|
||||||
|
{
|
||||||
|
uint32_t instance_size;
|
||||||
|
int32_t native_size;
|
||||||
|
uint32_t static_fields_size;
|
||||||
|
uint32_t thread_static_fields_size;
|
||||||
|
} Il2CppTypeDefinitionSizes;
|
||||||
|
typedef struct Il2CppDomain
|
||||||
|
{
|
||||||
|
Il2CppAppDomain* domain;
|
||||||
|
Il2CppObject* setup;
|
||||||
|
Il2CppAppContext* default_context;
|
||||||
|
const char* friendly_name;
|
||||||
|
uint32_t domain_id;
|
||||||
|
} Il2CppDomain;
|
||||||
|
typedef struct Il2CppImage
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
AssemblyIndex assemblyIndex;
|
||||||
|
TypeDefinitionIndex typeStart;
|
||||||
|
uint32_t typeCount;
|
||||||
|
MethodIndex entryPointIndex;
|
||||||
|
Il2CppNameToTypeDefinitionIndexHashTable* nameToClassHashTable;
|
||||||
|
uint32_t token;
|
||||||
|
} Il2CppImage;
|
||||||
|
typedef struct Il2CppMarshalingFunctions
|
||||||
|
{
|
||||||
|
methodPointerType marshal_to_native_func;
|
||||||
|
methodPointerType marshal_from_native_func;
|
||||||
|
methodPointerType marshal_cleanup_func;
|
||||||
|
} Il2CppMarshalingFunctions;
|
||||||
|
typedef struct Il2CppCodeRegistration
|
||||||
|
{
|
||||||
|
uint32_t methodPointersCount;
|
||||||
|
const methodPointerType* methodPointers;
|
||||||
|
uint32_t delegateWrappersFromNativeToManagedCount;
|
||||||
|
const methodPointerType** delegateWrappersFromNativeToManaged;
|
||||||
|
uint32_t delegateWrappersFromManagedToNativeCount;
|
||||||
|
const methodPointerType* delegateWrappersFromManagedToNative;
|
||||||
|
uint32_t marshalingFunctionsCount;
|
||||||
|
const Il2CppMarshalingFunctions* marshalingFunctions;
|
||||||
|
uint32_t genericMethodPointersCount;
|
||||||
|
const methodPointerType* genericMethodPointers;
|
||||||
|
uint32_t invokerPointersCount;
|
||||||
|
const InvokerMethod* invokerPointers;
|
||||||
|
CustomAttributeIndex customAttributeCount;
|
||||||
|
const CustomAttributesCacheGenerator* customAttributeGenerators;
|
||||||
|
} Il2CppCodeRegistration;
|
||||||
|
typedef struct Il2CppMetadataRegistration
|
||||||
|
{
|
||||||
|
int32_t genericClassesCount;
|
||||||
|
Il2CppGenericClass* const * genericClasses;
|
||||||
|
int32_t genericInstsCount;
|
||||||
|
const Il2CppGenericInst* const * genericInsts;
|
||||||
|
int32_t genericMethodTableCount;
|
||||||
|
const Il2CppGenericMethodFunctionsDefinitions* genericMethodTable;
|
||||||
|
int32_t typesCount;
|
||||||
|
const Il2CppType* const * types;
|
||||||
|
int32_t methodSpecsCount;
|
||||||
|
const Il2CppMethodSpec* methodSpecs;
|
||||||
|
FieldIndex fieldOffsetsCount;
|
||||||
|
const int32_t* fieldOffsets;
|
||||||
|
TypeDefinitionIndex typeDefinitionsSizesCount;
|
||||||
|
const Il2CppTypeDefinitionSizes* typeDefinitionsSizes;
|
||||||
|
const size_t metadataUsagesCount;
|
||||||
|
void** const* metadataUsages;
|
||||||
|
} Il2CppMetadataRegistration;
|
||||||
|
typedef struct Il2CppRuntimeStats
|
||||||
|
{
|
||||||
|
uint64_t new_object_count;
|
||||||
|
uint64_t initialized_class_count;
|
||||||
|
uint64_t method_count;
|
||||||
|
uint64_t class_static_data_size;
|
||||||
|
uint64_t generic_instance_count;
|
||||||
|
uint64_t generic_class_count;
|
||||||
|
uint64_t inflated_method_count;
|
||||||
|
uint64_t inflated_type_count;
|
||||||
|
bool enabled;
|
||||||
|
} Il2CppRuntimeStats;
|
||||||
|
extern Il2CppRuntimeStats il2cpp_runtime_stats;
|
||||||
|
|
||||||
|
struct MonitorData;
|
||||||
|
struct Il2CppObject {
|
||||||
|
struct Il2CppClass *klass;
|
||||||
|
struct MonitorData *monitor;
|
||||||
|
};
|
||||||
|
typedef int32_t il2cpp_array_lower_bound_t;
|
||||||
|
struct Il2CppArrayBounds {
|
||||||
|
il2cpp_array_size_t length;
|
||||||
|
il2cpp_array_lower_bound_t lower_bound;
|
||||||
|
};
|
||||||
|
struct Il2CppArray {
|
||||||
|
struct Il2CppObject obj;
|
||||||
|
struct Il2CppArrayBounds *bounds;
|
||||||
|
il2cpp_array_size_t max_length;
|
||||||
|
/* vector must be 8-byte aligned.
|
||||||
|
On 64-bit platforms, this happens naturally.
|
||||||
|
On 32-bit platforms, sizeof(obj)=8, sizeof(bounds)=4 and sizeof(max_length)=4 so it's also already aligned. */
|
||||||
|
void *vector[32];
|
||||||
|
};
|
||||||
|
struct Il2CppString {
|
||||||
|
struct Il2CppObject object;
|
||||||
|
int32_t length;
|
||||||
|
uint16_t chars[32];
|
||||||
|
};
|
||||||
1002
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.5.h
Normal file
1002
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.5.h
Normal file
File diff suppressed because it is too large
Load Diff
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.6.h
Normal file
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.6.h
Normal file
File diff suppressed because it is too large
Load Diff
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.7-5.3.8.h
Normal file
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.3.7-5.3.8.h
Normal file
File diff suppressed because it is too large
Load Diff
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.0.h
Normal file
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.0.h
Normal file
File diff suppressed because it is too large
Load Diff
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.1-5.4.3.h
Normal file
1063
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.1-5.4.3.h
Normal file
File diff suppressed because it is too large
Load Diff
1065
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.4-5.4.6.h
Normal file
1065
Il2CppInspector.Common/Outputs/UnityHeaders/21-5.4.4-5.4.6.h
Normal file
File diff suppressed because it is too large
Load Diff
1080
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.0.h
Normal file
1080
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.0.h
Normal file
File diff suppressed because it is too large
Load Diff
1082
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.1-5.5.2.h
Normal file
1082
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.1-5.5.2.h
Normal file
File diff suppressed because it is too large
Load Diff
1086
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.3-5.5.6.h
Normal file
1086
Il2CppInspector.Common/Outputs/UnityHeaders/22-5.5.3-5.5.6.h
Normal file
File diff suppressed because it is too large
Load Diff
1094
Il2CppInspector.Common/Outputs/UnityHeaders/23-5.6.0-5.6.7.h
Normal file
1094
Il2CppInspector.Common/Outputs/UnityHeaders/23-5.6.0-5.6.7.h
Normal file
File diff suppressed because it is too large
Load Diff
1108
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.1.0-2017.1.2.h
Normal file
1108
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.1.0-2017.1.2.h
Normal file
File diff suppressed because it is too large
Load Diff
1109
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.1.3-2017.1.5.h
Normal file
1109
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.1.3-2017.1.5.h
Normal file
File diff suppressed because it is too large
Load Diff
1108
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.2.0.h
Normal file
1108
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.2.0.h
Normal file
File diff suppressed because it is too large
Load Diff
1109
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.2.1-2017.4.38.h
Normal file
1109
Il2CppInspector.Common/Outputs/UnityHeaders/24-2017.2.1-2017.4.38.h
Normal file
File diff suppressed because it is too large
Load Diff
1180
Il2CppInspector.Common/Outputs/UnityHeaders/24-2018.1.0-2018.1.9.h
Normal file
1180
Il2CppInspector.Common/Outputs/UnityHeaders/24-2018.1.0-2018.1.9.h
Normal file
File diff suppressed because it is too large
Load Diff
1215
Il2CppInspector.Common/Outputs/UnityHeaders/24-2018.2.0-2018.2.21.h
Normal file
1215
Il2CppInspector.Common/Outputs/UnityHeaders/24-2018.2.0-2018.2.21.h
Normal file
File diff suppressed because it is too large
Load Diff
1206
Il2CppInspector.Common/Outputs/UnityHeaders/24.1-2018.3.0-2018.3.7.h
Normal file
1206
Il2CppInspector.Common/Outputs/UnityHeaders/24.1-2018.3.0-2018.3.7.h
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1489
Il2CppInspector.Common/Outputs/UnityHeaders/24.2-2019.3.0-2019.3.6.h
Normal file
1489
Il2CppInspector.Common/Outputs/UnityHeaders/24.2-2019.3.0-2019.3.6.h
Normal file
File diff suppressed because it is too large
Load Diff
1496
Il2CppInspector.Common/Outputs/UnityHeaders/24.3-2019.3.7-.h
Normal file
1496
Il2CppInspector.Common/Outputs/UnityHeaders/24.3-2019.3.7-.h
Normal file
File diff suppressed because it is too large
Load Diff
81
Il2CppInspector.Common/Outputs/UnityHeaders/UnityHeader.cs
Normal file
81
Il2CppInspector.Common/Outputs/UnityHeaders/UnityHeader.cs
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Il2CppInspector.Outputs.UnityHeaders
|
||||||
|
{
|
||||||
|
public class UnityHeader
|
||||||
|
{
|
||||||
|
public double MetadataVersion { get; }
|
||||||
|
public UnityVersion MinVersion { get; }
|
||||||
|
public UnityVersion MaxVersion { get; }
|
||||||
|
public string HeaderFilename { get; }
|
||||||
|
private UnityHeader(string headerFilename) {
|
||||||
|
HeaderFilename = headerFilename;
|
||||||
|
var bits = headerFilename.Replace(".h", "").Split("-");
|
||||||
|
MetadataVersion = double.Parse(bits[0]);
|
||||||
|
MinVersion = new UnityVersion(bits[1]);
|
||||||
|
if (bits.Length == 2)
|
||||||
|
MaxVersion = MinVersion;
|
||||||
|
else if (bits[2] != "")
|
||||||
|
MaxVersion = new UnityVersion(bits[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString() {
|
||||||
|
var res = $"{MinVersion}";
|
||||||
|
if (MaxVersion == null)
|
||||||
|
res += "+";
|
||||||
|
else if (MaxVersion != MinVersion)
|
||||||
|
res += $" - {MaxVersion}";
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Contains(UnityVersion version) {
|
||||||
|
return version.CompareTo(MinVersion) >= 0 && (MaxVersion == null || version.CompareTo(MaxVersion) <= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetHeaderText() {
|
||||||
|
string resourceName = typeof(UnityHeader).Namespace + "." + HeaderFilename;
|
||||||
|
Assembly assembly = Assembly.GetCallingAssembly();
|
||||||
|
using Stream stream = assembly.GetManifestResourceStream(resourceName);
|
||||||
|
if (stream == null) {
|
||||||
|
throw new FileNotFoundException(resourceName);
|
||||||
|
}
|
||||||
|
using StreamReader reader = new StreamReader(stream);
|
||||||
|
string result = reader.ReadToEnd();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<UnityHeader> GetAllHeaders() {
|
||||||
|
string prefix = typeof(UnityHeader).Namespace + ".";
|
||||||
|
Assembly assembly = Assembly.GetCallingAssembly();
|
||||||
|
return assembly.GetManifestResourceNames()
|
||||||
|
.Where(s => s.StartsWith(prefix) && s.EndsWith(".h"))
|
||||||
|
.Select(s => new UnityHeader(s.Substring(prefix.Length)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnityHeader GetHeaderForVersion(string version) => GetHeaderForVersion(new UnityVersion(version));
|
||||||
|
public static UnityHeader GetHeaderForVersion(UnityVersion version) {
|
||||||
|
return GetAllHeaders().Where(v => v.Contains(version)).First();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<UnityHeader> GuessHeadersForModel(Reflection.Il2CppModel model) {
|
||||||
|
List<UnityHeader> result = new List<UnityHeader>();
|
||||||
|
foreach (var v in GetAllHeaders()) {
|
||||||
|
if (v.MetadataVersion != model.Package.BinaryImage.Version)
|
||||||
|
continue;
|
||||||
|
if (v.MetadataVersion == 21) {
|
||||||
|
/* Special version logic for metadata version 21 based on the Il2CppMetadataRegistration.fieldOffsets field */
|
||||||
|
var headerFieldOffsetsArePointers = (v.MinVersion.CompareTo("5.3.7") >= 0 && v.MinVersion.CompareTo("5.4.0") != 0);
|
||||||
|
var binaryFieldOffsetsArePointers = (model.Package.Binary.FieldOffsets == null);
|
||||||
|
if (headerFieldOffsetsArePointers != binaryFieldOffsetsArePointers)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result.Add(v);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
102
Il2CppInspector.Common/Outputs/UnityHeaders/UnityVersion.cs
Normal file
102
Il2CppInspector.Common/Outputs/UnityHeaders/UnityVersion.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace Il2CppInspector.Outputs.UnityHeaders
|
||||||
|
{
|
||||||
|
public class UnityVersion : IComparable<UnityVersion>, IEquatable<UnityVersion>
|
||||||
|
{
|
||||||
|
public enum BuildTypeEnum
|
||||||
|
{
|
||||||
|
Unspecified,
|
||||||
|
Alpha,
|
||||||
|
Beta,
|
||||||
|
ReleaseCandidate,
|
||||||
|
Final,
|
||||||
|
Patch,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string BuildTypeToString(BuildTypeEnum buildType) => buildType switch
|
||||||
|
{
|
||||||
|
BuildTypeEnum.Unspecified => "",
|
||||||
|
BuildTypeEnum.Alpha => "a",
|
||||||
|
BuildTypeEnum.Beta => "b",
|
||||||
|
BuildTypeEnum.ReleaseCandidate => "rc",
|
||||||
|
BuildTypeEnum.Final => "f",
|
||||||
|
BuildTypeEnum.Patch => "p",
|
||||||
|
_ => throw new ArgumentException(),
|
||||||
|
};
|
||||||
|
|
||||||
|
public static BuildTypeEnum StringToBuildType(string s) => s switch
|
||||||
|
{
|
||||||
|
"" => BuildTypeEnum.Unspecified,
|
||||||
|
"a" => BuildTypeEnum.Alpha,
|
||||||
|
"b" => BuildTypeEnum.Beta,
|
||||||
|
"rc" => BuildTypeEnum.ReleaseCandidate,
|
||||||
|
"f" => BuildTypeEnum.Final,
|
||||||
|
"p" => BuildTypeEnum.Patch,
|
||||||
|
_ => throw new ArgumentException("Unknown build type " + s),
|
||||||
|
};
|
||||||
|
|
||||||
|
public int Major { get; }
|
||||||
|
public int Minor { get; }
|
||||||
|
public int Update { get; }
|
||||||
|
public BuildTypeEnum BuildType { get; }
|
||||||
|
public int BuildNumber { get; }
|
||||||
|
|
||||||
|
public UnityVersion(string versionString) {
|
||||||
|
var match = Regex.Match(versionString, @"^(\d+)\.(\d+)(?:\.(\d+))?(?:([a-zA-Z]+)(\d+))?$");
|
||||||
|
if (!match.Success)
|
||||||
|
throw new ArgumentException($"'${versionString}' is not a valid Unity version number.");
|
||||||
|
Major = int.Parse(match.Groups[1].Value);
|
||||||
|
Minor = int.Parse(match.Groups[2].Value);
|
||||||
|
Update = match.Groups[3].Success ? int.Parse(match.Groups[3].Value) : 0;
|
||||||
|
BuildType = match.Groups[4].Success ? StringToBuildType(match.Groups[4].Value) : BuildTypeEnum.Unspecified;
|
||||||
|
BuildNumber = match.Groups[5].Success ? int.Parse(match.Groups[5].Value) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator UnityVersion(string versionString) => new UnityVersion(versionString);
|
||||||
|
|
||||||
|
public override string ToString() {
|
||||||
|
var res = $"{Major}.{Minor}.{Update}";
|
||||||
|
if (BuildType != BuildTypeEnum.Unspecified)
|
||||||
|
res += $"{BuildTypeToString(BuildType)}{BuildNumber}";
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CompareTo(UnityVersion other) {
|
||||||
|
int res;
|
||||||
|
if (0 != (res = Major.CompareTo(other.Major)))
|
||||||
|
return res;
|
||||||
|
if (0 != (res = Minor.CompareTo(other.Minor)))
|
||||||
|
return res;
|
||||||
|
if (0 != (res = Update.CompareTo(other.Update)))
|
||||||
|
return res;
|
||||||
|
// same major.minor.update - if one of these is suffix-less, they compare equal
|
||||||
|
// yes, this makes the compare function non-transitive; don't use it to sort things
|
||||||
|
if (BuildType == BuildTypeEnum.Unspecified || other.BuildType == BuildTypeEnum.Unspecified)
|
||||||
|
return 0;
|
||||||
|
if (0 != (res = BuildType.CompareTo(other.BuildType)))
|
||||||
|
return res;
|
||||||
|
if (0 != (res = BuildNumber.CompareTo(other.BuildNumber)))
|
||||||
|
return res;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj) {
|
||||||
|
return Equals(obj as UnityVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Equals(UnityVersion other) {
|
||||||
|
return other != null &&
|
||||||
|
Major == other.Major &&
|
||||||
|
Minor == other.Minor &&
|
||||||
|
Update == other.Update &&
|
||||||
|
BuildType == other.BuildType &&
|
||||||
|
BuildNumber == other.BuildNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode() {
|
||||||
|
return HashCode.Combine(Major, Minor, Update, BuildType, BuildNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -348,7 +348,10 @@
|
|||||||
|
|
||||||
<!-- IDAPython script -->
|
<!-- IDAPython script -->
|
||||||
<RadioButton GroupName="grpOutputType" Name="rdoOutputIDA" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">IDAPython script</RadioButton>
|
<RadioButton GroupName="grpOutputType" Name="rdoOutputIDA" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">IDAPython script</RadioButton>
|
||||||
<TextBlock TextWrapping="WrapWithOverflow">No configuration required for IDA script output</TextBlock>
|
<DockPanel>
|
||||||
|
<ComboBox Name="cboUnityVersion" DockPanel.Dock="Right" Margin="4"></ComboBox>
|
||||||
|
<Label DockPanel.Dock="Left" Width="170" VerticalAlignment="Center" HorizontalAlignment="Left">Unity version (if known):</Label>
|
||||||
|
</DockPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ using Il2CppInspector.Outputs;
|
|||||||
using Il2CppInspector.Reflection;
|
using Il2CppInspector.Reflection;
|
||||||
using Ookii.Dialogs.Wpf;
|
using Ookii.Dialogs.Wpf;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
using Il2CppInspector.Outputs.UnityHeaders;
|
||||||
|
|
||||||
namespace Il2CppInspectorGUI
|
namespace Il2CppInspectorGUI
|
||||||
{
|
{
|
||||||
@@ -196,6 +197,14 @@ namespace Il2CppInspectorGUI
|
|||||||
|
|
||||||
// Populate TreeView with namespace hierarchy
|
// Populate TreeView with namespace hierarchy
|
||||||
trvNamespaces.ItemsSource = namespaceTree;
|
trvNamespaces.ItemsSource = namespaceTree;
|
||||||
|
|
||||||
|
var prevSelection = cboUnityVersion.SelectedItem;
|
||||||
|
cboUnityVersion.Items.Clear();
|
||||||
|
foreach (var version in UnityHeader.GuessHeadersForModel(model))
|
||||||
|
cboUnityVersion.Items.Add(version);
|
||||||
|
cboUnityVersion.SelectedIndex = 0;
|
||||||
|
if (prevSelection != null)
|
||||||
|
cboUnityVersion.SelectedItem = prevSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<CheckboxNode> deconstructNamespaces(IEnumerable<string> input) {
|
private IEnumerable<CheckboxNode> deconstructNamespaces(IEnumerable<string> input) {
|
||||||
@@ -388,9 +397,11 @@ namespace Il2CppInspectorGUI
|
|||||||
|
|
||||||
txtBusyStatus.Text = "Generating IDAPython script...";
|
txtBusyStatus.Text = "Generating IDAPython script...";
|
||||||
areaBusyIndicator.Visibility = Visibility.Visible;
|
areaBusyIndicator.Visibility = Visibility.Visible;
|
||||||
|
var selectedVersion = ((UnityHeader)cboUnityVersion.SelectedItem)?.MinVersion;
|
||||||
await Task.Run(() => {
|
await Task.Run(() => {
|
||||||
var idaWriter = new IDAPythonScript(model);
|
var idaWriter = new IDAPythonScript(model) {
|
||||||
|
UnityVersion = selectedVersion,
|
||||||
|
};
|
||||||
idaWriter.WriteScriptToFile(outFile);
|
idaWriter.WriteScriptToFile(outFile);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
22
Il2CppTests/TestIDAOutput.cs
Normal file
22
Il2CppTests/TestIDAOutput.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System.IO;
|
||||||
|
using Il2CppInspector.Outputs.UnityHeaders;
|
||||||
|
using Il2CppInspector.Reflection;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Il2CppInspector
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public partial class FixedTests
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestVersions() {
|
||||||
|
Assert.That(UnityHeader.GetHeaderForVersion("5.3.1p4").ToString(), Is.EqualTo("5.3.0 - 5.3.1"));
|
||||||
|
Assert.That(UnityHeader.GetHeaderForVersion("5.6.4").ToString(), Is.EqualTo("5.6.0 - 5.6.7"));
|
||||||
|
Assert.That(new UnityVersion("2020.1.0b5").ToString(), Is.EqualTo("2020.1.0b5"));
|
||||||
|
Assert.That(new UnityVersion("2020.1").ToString(), Is.EqualTo("2020.1.0"));
|
||||||
|
Assert.That(new UnityVersion("5.3.1").CompareTo("5.3.1p4") == 0);
|
||||||
|
Assert.That(new UnityVersion("5.3.1rc0").CompareTo("5.3.1p2") < 0);
|
||||||
|
Assert.That(new UnityVersion("5.3.1f1").CompareTo("5.3.1p0") < 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user