diff --git a/Il2CppDumper/Il2CppCSharpDumper.cs b/Il2CppDumper/Il2CppCSharpDumper.cs index b1cb6a8..3a2368c 100644 --- a/Il2CppDumper/Il2CppCSharpDumper.cs +++ b/Il2CppDumper/Il2CppCSharpDumper.cs @@ -51,7 +51,7 @@ namespace Il2CppInspector // Only print namespace if we're not nested if (!type.IsNested) - writer.Write($"{prefix}// Namespace: {type.Namespace}\n"); + writer.Write($"{prefix}// Namespace: {(!string.IsNullOrEmpty(type.Namespace)? type.Namespace : "")}\n"); // Type declaration if (type.IsImport) diff --git a/Il2CppDumper/Program.cs b/Il2CppDumper/Program.cs index 7b9ae43..6d24045 100644 --- a/Il2CppDumper/Program.cs +++ b/Il2CppDumper/Program.cs @@ -34,7 +34,8 @@ namespace Il2CppInspector "System", "UnityEngine", "Mono", - "Microsoft.Win32" + "Microsoft.Win32", + "" }; if (excludedNamespaces.Count == 1 && excludedNamespaces[0].ToLower() == "none") diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector/Reflection/TypeInfo.cs index 1aa9411..777b65a 100644 --- a/Il2CppInspector/Reflection/TypeInfo.cs +++ b/Il2CppInspector/Reflection/TypeInfo.cs @@ -125,7 +125,7 @@ namespace Il2CppInspector.Reflection { private string @namespace; public string Namespace { - get => !string.IsNullOrEmpty(@namespace) ? @namespace : DeclaringType?.Namespace ?? ""; + get => !string.IsNullOrEmpty(@namespace) ? @namespace : DeclaringType?.Namespace ?? ""; set => @namespace = value; } diff --git a/Il2CppTests/TestRunner.cs b/Il2CppTests/TestRunner.cs index 00a28c3..223981e 100644 --- a/Il2CppTests/TestRunner.cs +++ b/Il2CppTests/TestRunner.cs @@ -41,13 +41,15 @@ namespace Il2CppInspector throw new Exception("Could not find any images in the IL2CPP binary"); // Exclusions + var excludedNamespaces = new List { "System", "UnityEngine", "Mono", "Microsoft.Win32", + "" }; - + // Dump each image in the binary separately int i = 0; foreach (var il2cpp in inspectors) diff --git a/README.md b/README.md index 301c00b..cbf41bb 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Extract types, methods, properties and fields from Unity IL2CPP binaries. * 32-bit and 64-bit support for all file formats * Supports ARMv7, Thumb-2, ARMv8 (A64), x86 and x64 architectures regardless of file format * Supports metadata versions 16, 21, 22, 23, 24, 24.1 (Unity 2018.3+) and 24.2 (Unity 2019+) (other versions may or may not work) -* Support for classes, methods, constructors, fields, properties, enumerations, events, delegates, interfaces, structs and default field values +* Support for classes, methods, constructors, fields, properties, enumerations, events, delegates, interfaces, structs, nested types and default field values * Static symbol table scanning for ELF and Mach-O binaries if present * Dynamic symbol table scanning for ELF binaries if present * Symbol relocation handling for ELF binaries @@ -47,6 +47,7 @@ System Mono UnityEngine Microsoft.Win32 + ``` Providing an argument to `--exclude-namespaces` will override the default list. To output all namespaces, use `--exclude-namespaces=none`.