DLL: Allow suppression of metadata attributes

This commit is contained in:
Katy Coe
2021-01-12 02:17:23 +01:00
parent 59c095f794
commit fca91ff556
4 changed files with 27 additions and 6 deletions

View File

@@ -85,6 +85,9 @@ namespace Il2CppInspector.CLI
[Option('n', "suppress-metadata", Required = false, HelpText = "Diff tidying: suppress method pointers, field offsets and type indices from C# output. Useful for comparing two versions of a binary for changes with a diff tool")]
public bool SuppressMetadata { get; set; }
[Option("suppress-dll-metadata", Required = false, HelpText = "Diff tidying: suppress method pointers, field offsets and type indices attributes from DLL output. Useful for comparing two versions of a binary for changes")]
public bool SuppressDllMetadata { get; set; }
[Option('k', "must-compile", Required = false, HelpText = "Compilation tidying: try really hard to make code that compiles. Suppress generation of code for items with CompilerGenerated attribute. Comment out attributes without parameterless constructors or all-optional constructor arguments. Don't emit add/remove/raise on events. Specify AttributeTargets.All on classes with AttributeUsage attribute. Force auto-properties to have get accessors. Force regular properties to have bodies. Suppress global::Locale classes. Generate dummy parameterless base constructors and ref return fields.")]
public bool MustCompile { get; set; }
@@ -427,7 +430,10 @@ namespace Il2CppInspector.CLI
// DLL output
using (new Benchmark("Generate .NET assembly shim DLLs"))
new AssemblyShims(model).Write(getOutputPath(options.DllOutPath, "", imageIndex));
new AssemblyShims(model) {
SuppressMetadata = options.SuppressDllMetadata
}
.Write(getOutputPath(options.DllOutPath, "", imageIndex));
imageIndex++;
}