Browse Source

Display a reference to a module's global type.

Global types are used as assembly initializers; they contain global methods (e.g. in VB), and may be used by obfuscators. They can also be renamed so they are hard to find.
pull/550/head
LordJZ 10 years ago
parent
commit
14bfdecb8a
  1. 5
      ILSpy/Languages/CSharpLanguage.cs
  2. 5
      ILSpy/VB/VBLanguage.cs

5
ILSpy/Languages/CSharpLanguage.cs

@ -291,6 +291,11 @@ namespace ICSharpCode.ILSpy @@ -291,6 +291,11 @@ namespace ICSharpCode.ILSpy
base.DecompileAssembly(assembly, output, options);
output.WriteLine();
ModuleDefinition mainModule = assembly.ModuleDefinition;
if (mainModule.Types.Count > 0) {
output.Write("// Global type: ");
output.WriteReference(mainModule.Types[0].FullName, mainModule.Types[0]);
output.WriteLine();
}
if (mainModule.EntryPoint != null) {
output.Write("// Entry point: ");
output.WriteReference(mainModule.EntryPoint.DeclaringType.FullName + "." + mainModule.EntryPoint.Name, mainModule.EntryPoint);

5
ILSpy/VB/VBLanguage.cs

@ -80,6 +80,11 @@ namespace ICSharpCode.ILSpy.VB @@ -80,6 +80,11 @@ namespace ICSharpCode.ILSpy.VB
base.DecompileAssembly(assembly, output, options);
output.WriteLine();
ModuleDefinition mainModule = assembly.ModuleDefinition;
if (mainModule.Types.Count > 0) {
output.Write("// Global type: ");
output.WriteReference(mainModule.Types[0].FullName, mainModule.Types[0]);
output.WriteLine();
}
if (mainModule.EntryPoint != null) {
output.Write("' Entry point: ");
output.WriteReference(mainModule.EntryPoint.DeclaringType.FullName + "." + mainModule.EntryPoint.Name, mainModule.EntryPoint);

Loading…
Cancel
Save