// dnlib: See LICENSE.txt for more info
using dnlib.IO;
using dnlib.DotNet.Pdb;
namespace dnlib.DotNet {
///
/// creation options
///
public sealed class ModuleCreationOptions {
internal static readonly ModuleCreationOptions Default = new ModuleCreationOptions();
///
/// Module context
///
public ModuleContext Context { get; set; }
internal const PdbReaderOptions DefaultPdbReaderOptions = PdbReaderOptions.None;
///
/// PDB reader options
///
public PdbReaderOptions PdbOptions { get; set; } = DefaultPdbReaderOptions;
///
/// Set it to A) the path (string) of the PDB file, B) the data (byte[]) of the PDB file or
/// C) to an of the PDB data. The will
/// be owned by the module. You don't need to initialize
///
public object PdbFileOrData { get; set; }
///
/// If true, will load the PDB file from disk if present, or an embedded portable PDB file
/// stored in the PE file. The default value is true.
/// You don't need to initialize .
///
public bool TryToLoadPdbFromDisk { get; set; } = true;
///
/// corlib assembly reference to use or null if the default one from the opened
/// module should be used.
///
public AssemblyRef CorLibAssemblyRef { get; set; }
///
/// Runtime reader kind, default is . It should be
/// set to if it's an obfuscated Mono/Unity assembly.
///
public CLRRuntimeReaderKind Runtime { get; set; } = CLRRuntimeReaderKind.CLR;
///
/// Default constructor
///
public ModuleCreationOptions() { }
///
/// Constructor
///
/// Module context
public ModuleCreationOptions(ModuleContext context) => Context = context;
///
/// Constructor
///
/// Runtime reader kind, default is . It should be
/// set to if it's an obfuscated Mono/Unity assembly.
public ModuleCreationOptions(CLRRuntimeReaderKind runtime) => Runtime = runtime;
///
/// Constructor
///
/// Module context
/// Runtime reader kind, default is . It should be
/// set to if it's an obfuscated Mono/Unity assembly.
public ModuleCreationOptions(ModuleContext context, CLRRuntimeReaderKind runtime) {
Context = context;
Runtime = runtime;
}
}
///
/// Runtime reader kind
///
public enum CLRRuntimeReaderKind {
///
/// Microsoft's CLRs (.NET Framework, .NET Core)
///
CLR,
///
/// Mono's CLR (Mono, Unity)
///
Mono,
}
}