diff --git a/Il2CppTests/Il2CppTests.csproj b/Il2CppTests/Il2CppTests.csproj index 2ca7903..5804a68 100644 --- a/Il2CppTests/Il2CppTests.csproj +++ b/Il2CppTests/Il2CppTests.csproj @@ -27,15 +27,29 @@ + + + + + + + + + + + + + + diff --git a/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs b/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs new file mode 100644 index 0000000..bccc3c8 --- /dev/null +++ b/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs @@ -0,0 +1,34 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: ArraysAndPointers.dll - 1810 + +// Namespace: Il2CppTests.TestSources +internal class Test // TypeDefIndex: 1811 +{ + // Fields + private int[] foo; // 0x08 + private int[] bar; // 0x0C + private float[][] arrayOfArrays; // 0x10 + private float[,] twoDimensionalArray; // 0x14 + private float[,,] threeDimensionalArray; // 0x18 + private int*[] arrayOfPointer; // 0x1C + private int** pointerToPointer; // 0x20 + private float*[][,,][] confusedElephant; // 0x24 + + // Nested types + private struct fixedSizeArrayStruct // TypeDefIndex: 1812 + { + // Fields + private fixed /* 0x000A6CAC */ int fixedSizeArray[0]; // 0x08 + + // Nested types + + } + + // Constructors + public Test(); // 0x00562BA0 + + // Methods + public int[] FooMethod(int[][] bar); // 0x00562AC8 + public int[,] BarMethod(int[,,] baz); // 0x00562B28 +} + diff --git a/Il2CppTests/TestExpectedResults/CustomAttributeData.cs b/Il2CppTests/TestExpectedResults/CustomAttributeData.cs new file mode 100644 index 0000000..274b60c --- /dev/null +++ b/Il2CppTests/TestExpectedResults/CustomAttributeData.cs @@ -0,0 +1,47 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: CustomAttributeData.dll - 1810 + +// Namespace: Il2CppTests.TestSources +public enum ExampleKind // TypeDefIndex: 1811 +{ + FirstKind = 0, + SecondKind = 1, + ThirdKind = 2, + FourthKind = 3 +} + +// Namespace: Il2CppTests.TestSources +[AttributeUsage] // 0x000A5070 +public class ExampleAttribute : Attribute // TypeDefIndex: 1812 +{ + // Fields + private ExampleKind kindValue; // 0x08 + private string noteValue; // 0x0C + private string[] arrayStrings; // 0x10 + private int[] arrayNumbers; // 0x14 + + // Properties + public ExampleKind Kind { get; } // 0x005612FC + public string[] Strings { get; } // 0x00561304 + public string Note { get; set; } // 0x0056130C 0x00561314 + public int[] Numbers { get; set; } // 0x0056131C 0x00561324 + + // Constructors + public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x00561288 + public ExampleAttribute(ExampleKind initKind); // 0x005612B0 + public ExampleAttribute(); // 0x005612D8 + +} + +// Namespace: Il2CppTests.TestSources +[Example] // 0x000A5084 +public class Test // TypeDefIndex: 1813 +{ + // Constructors + public Test(); // 0x00561330 + + // Methods + [Example] // 0x000A5208 + public void TestMethod([Example] /* 0x000A525C */ object arg); // 0x0056132C +} + diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs new file mode 100644 index 0000000..8e61a70 --- /dev/null +++ b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs @@ -0,0 +1,34 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: ArraysAndPointers.dll - 1810 + +// Namespace: Il2CppTests.TestSources +internal class Test // TypeDefIndex: 1811 +{ + // Fields + private int[] foo; // 0x10 + private int[] bar; // 0x20 + private float[][] arrayOfArrays; // 0x30 + private float[,] twoDimensionalArray; // 0x40 + private float[,,] threeDimensionalArray; // 0x10 + private int*[] arrayOfPointer; // 0x29 + private int** pointerToPointer; // 0x8047EC30 + private float*[][,,][] confusedElephant; // 0x00 + + // Nested types + private struct fixedSizeArrayStruct // TypeDefIndex: 1812 + { + // Fields + private fixed /* 0x000000018000CC70 */ int fixedSizeArray[0]; // 0x10 + + // Nested types + + } + + // Constructors + public Test(); // 0x00000001803E0EE0 + + // Methods + public int[] FooMethod(int[][] bar); // 0x00000001803E0EA0 + public int[,] BarMethod(int[,,] baz); // 0x00000001803E0E50 +} + diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs new file mode 100644 index 0000000..b83bf86 --- /dev/null +++ b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs @@ -0,0 +1,34 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: ArraysAndPointers.dll - 1810 + +// Namespace: Il2CppTests.TestSources +internal class Test // TypeDefIndex: 1811 +{ + // Fields + private int[] foo; // 0x08 + private int[] bar; // 0x0C + private float[][] arrayOfArrays; // 0x10 + private float[,] twoDimensionalArray; // 0x14 + private float[,,] threeDimensionalArray; // 0x18 + private int*[] arrayOfPointer; // 0x1C + private int** pointerToPointer; // 0x20 + private float*[][,,][] confusedElephant; // 0x24 + + // Nested types + private struct fixedSizeArrayStruct // TypeDefIndex: 1812 + { + // Fields + private fixed /* 0x1000DE40 */ int fixedSizeArray[0]; // 0x08 + + // Nested types + + } + + // Constructors + public Test(); // 0x1034DAE0 + + // Methods + public int[] FooMethod(int[][] bar); // 0x1034DAB0 + public int[,] BarMethod(int[,,] baz); // 0x1034DA60 +} + diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs new file mode 100644 index 0000000..d20fafc --- /dev/null +++ b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs @@ -0,0 +1,47 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: CustomAttributeData.dll - 1810 + +// Namespace: Il2CppTests.TestSources +public enum ExampleKind // TypeDefIndex: 1811 +{ + FirstKind = 0, + SecondKind = 1, + ThirdKind = 2, + FourthKind = 3 +} + +// Namespace: Il2CppTests.TestSources +[AttributeUsage] // 0x000000018000C5B0 +public class ExampleAttribute : Attribute // TypeDefIndex: 1812 +{ + // Fields + private ExampleKind kindValue; // 0x10 + private string noteValue; // 0x20 + private string[] arrayStrings; // 0x29 + private int[] arrayNumbers; // 0x8047D628 + + // Properties + public ExampleKind Kind { get; } // 0x00000001800ECD10 + public string[] Strings { get; } // 0x00000001800EAEB0 + public string Note { get; set; } // 0x00000001803E0EE0 0x00000001800EAEE0 + public int[] Numbers { get; set; } // 0x00000001803E0EF0 0x000000018015B760 + + // Constructors + public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x00000001803E0E70 + public ExampleAttribute(ExampleKind initKind); // 0x00000001803E0EB0 + public ExampleAttribute(); // 0x00000001803E0E50 + +} + +// Namespace: Il2CppTests.TestSources +[Example] // 0x000000018000C5D0 +public class Test // TypeDefIndex: 1813 +{ + // Constructors + public Test(); // 0x00000001800E2000 + + // Methods + [Example] // 0x000000018000C710 + public void TestMethod([Example] /* 0x000000018000C750 */ object arg); // 0x00000001800EA7B0 +} + diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs new file mode 100644 index 0000000..c28d11f --- /dev/null +++ b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs @@ -0,0 +1,47 @@ +// Image 0: mscorlib.dll - 0 +// Image 1: CustomAttributeData.dll - 1810 + +// Namespace: Il2CppTests.TestSources +public enum ExampleKind // TypeDefIndex: 1811 +{ + FirstKind = 0, + SecondKind = 1, + ThirdKind = 2, + FourthKind = 3 +} + +// Namespace: Il2CppTests.TestSources +[AttributeUsage] // 0x1000D430 +public class ExampleAttribute : Attribute // TypeDefIndex: 1812 +{ + // Fields + private ExampleKind kindValue; // 0x08 + private string noteValue; // 0x0C + private string[] arrayStrings; // 0x10 + private int[] arrayNumbers; // 0x14 + + // Properties + public ExampleKind Kind { get; } // 0x100BF0C0 + public string[] Strings { get; } // 0x100BFC20 + public string Note { get; set; } // 0x100C5B30 0x100C5B50 + public int[] Numbers { get; set; } // 0x100EF0C0 0x10127B00 + + // Constructors + public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x1034DA90 + public ExampleAttribute(ExampleKind initKind); // 0x1034DAC0 + public ExampleAttribute(); // 0x1034DA60 + +} + +// Namespace: Il2CppTests.TestSources +[Example] // 0x1000D450 +public class Test // TypeDefIndex: 1813 +{ + // Constructors + public Test(); // 0x100BF000 + + // Methods + [Example] // 0x1000D550 + public void TestMethod([Example] /* 0x1000D590 */ object arg); // 0x100C5530 +} + diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs index 4b0aa3f..6fe2298 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs @@ -16,7 +16,7 @@ public class Derived : Base // TypeDefIndex: 1812 public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1813 { // Constructors public Nested(); diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs index 1a2dc4f..e849f5f 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs @@ -16,7 +16,7 @@ public class Derived : Base // TypeDefIndex: 1812 public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1813 { // Constructors public Nested(); diff --git a/Il2CppTests/TestExpectedResults/GenericTypes.cs b/Il2CppTests/TestExpectedResults/GenericTypes.cs index edf11df..ea4c8b3 100644 --- a/Il2CppTests/TestExpectedResults/GenericTypes.cs +++ b/Il2CppTests/TestExpectedResults/GenericTypes.cs @@ -16,7 +16,7 @@ public class Derived : Base // TypeDefIndex: 1812 public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1813 { // Constructors public Nested(); diff --git a/Il2CppTests/TestGenericTypes.cs b/Il2CppTests/TestGenericTypes.cs index 7de63de..4512fe6 100644 --- a/Il2CppTests/TestGenericTypes.cs +++ b/Il2CppTests/TestGenericTypes.cs @@ -53,7 +53,7 @@ namespace Il2CppInspector //(tDerivedArray, "Derived`1[System.Int32][]", false, false, false, false), (tT, "T", false, false, true, true), (tF, "G`1[Derived`1[V]]", true, false, true, false), - (tNested, "Derived`1+Nested[V]", true, true, true, false) + (tNested, "Derived`1[V]+Nested[V]", true, true, true, false) }; foreach (var check in checks) { diff --git a/Il2CppTests/TestSources/ArraysAndPointers.cs b/Il2CppTests/TestSources/ArraysAndPointers.cs new file mode 100644 index 0000000..a421fe5 --- /dev/null +++ b/Il2CppTests/TestSources/ArraysAndPointers.cs @@ -0,0 +1,34 @@ +/* + Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com + + All rights reserved. +*/ + +namespace Il2CppTests.TestSources +{ +#pragma warning disable CS0169 + internal unsafe class Test + { + private int[] foo; + private int[] bar = new int[10]; + + private struct fixedSizeArrayStruct + { + private fixed int fixedSizeArray[25]; + } + + private float[][] arrayOfArrays; + private float[,] twoDimensionalArray; + private float[,,] threeDimensionalArray; + + public int[] FooMethod(int[][] bar) => new int[20]; + + public int[,] BarMethod(int[,,] baz) => new int[5, 6]; + + private int*[] arrayOfPointer; + private int** pointerToPointer; + + private float*[][,,][] confusedElephant; + } +#pragma warning restore CS0169 +} \ No newline at end of file