Output: Exclude root namespace by default

This commit is contained in:
Katy Coe
2019-10-31 23:35:58 +01:00
parent dbc3ef40b0
commit ac47c811be
5 changed files with 9 additions and 5 deletions

View File

@@ -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 : "<default namespace>")}\n");
// Type declaration
if (type.IsImport)

View File

@@ -34,7 +34,8 @@ namespace Il2CppInspector
"System",
"UnityEngine",
"Mono",
"Microsoft.Win32"
"Microsoft.Win32",
""
};
if (excludedNamespaces.Count == 1 && excludedNamespaces[0].ToLower() == "none")

View File

@@ -125,7 +125,7 @@ namespace Il2CppInspector.Reflection {
private string @namespace;
public string Namespace {
get => !string.IsNullOrEmpty(@namespace) ? @namespace : DeclaringType?.Namespace ?? "<default namespace>";
get => !string.IsNullOrEmpty(@namespace) ? @namespace : DeclaringType?.Namespace ?? "";
set => @namespace = value;
}

View File

@@ -41,11 +41,13 @@ namespace Il2CppInspector
throw new Exception("Could not find any images in the IL2CPP binary");
// Exclusions
var excludedNamespaces = new List<string> {
"System",
"UnityEngine",
"Mono",
"Microsoft.Win32",
""
};
// Dump each image in the binary separately

View File

@@ -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
<the root (empty string) namespace>
```
Providing an argument to `--exclude-namespaces` will override the default list. To output all namespaces, use `--exclude-namespaces=none`.