diff options
-rw-r--r-- | Disassembler.cs | 26 | ||||
-rw-r--r-- | Program.cs | 43 |
2 files changed, 41 insertions, 28 deletions
diff --git a/Disassembler.cs b/Disassembler.cs index b7e5c1a..646380c 100644 --- a/Disassembler.cs +++ b/Disassembler.cs @@ -1476,20 +1476,19 @@ namespace Ildasm ; } - void WritePInvokeImpl(LineWriter lw, MethodBase method) + void WritePInvokeImpl(LineWriter lw, MemberInfo member) { lw.Write("pinvokeimpl("); - MethodInfo mi = method as MethodInfo; ImplMapFlags flags; string importName; string importScope; - if (mi != null && mi.__TryGetImplMap(out flags, out importName, out importScope)) + if (member.Module.__TryGetImplMap(member.MetadataToken, out flags, out importName, out importScope)) { if (importScope != null) { lw.Write("\"{0}\"", EscapePInvoke(importScope)); } - if (importName != null && importName != method.Name) + if (importName != null && importName != member.Name) { lw.Write(" as \"{0}\"", EscapePInvoke(importName)); } @@ -1954,6 +1953,10 @@ namespace Ildasm { lw.Write("notserialized "); } + if ((field.Attributes & FieldAttributes.PinvokeImpl) != 0) + { + WritePInvokeImpl(lw, field); + } if ((field.Attributes & FieldAttributes.HasFieldMarshal) != 0) { FieldMarshal marshal; @@ -2021,7 +2024,14 @@ namespace Ildasm foreach (var mod in mods.Reverse()) { lw.Write(" {0}(", mod.IsRequired ? "modreq" : "modopt"); - WriteTypeDefOrRef(lw, mod.Type); + if (mod.Type.__IsBuiltIn) + { + WriteSignatureType(lw, mod.Type); + } + else + { + WriteTypeDefOrRef(lw, mod.Type); + } lw.Write(")"); } } @@ -2165,8 +2175,12 @@ namespace Ildasm && type.__Namespace == "System.Diagnostics"; } - void WriteDeclarativeSecurity(LineWriter lw, int level, IList<CustomAttributeData> list, int metadataToken) + void WriteDeclarativeSecurity(LineWriter lw, int level, IEnumerable<CustomAttributeData> list, int metadataToken) { + if (diffMode) + { + list = list.OrderBy(cad => cad.ConstructorArguments[0].Value); + } var action = (System.Security.Permissions.SecurityAction)(- 1); var curr = new List<CustomAttributeData>(); foreach (var sec in list) @@ -95,27 +95,27 @@ namespace Ildasm else if (IsIldasmOption(arg, "project")) { flags |= Flags.Project; - } - else - { - PrintUsage(); - return 1; - } - } - else - { - if (inputFile != null) - { - PrintUsage(); - return 1; - } - else - { - inputFile = arg; - } - } - } - } +<<<<<<< HEAD + } + else + { + PrintUsage(); + return; + } + } + else + { + if (inputFile != null) + { + PrintUsage(); + return; + } + else + { + inputFile = arg; + } + } + } if (inputFile == null) { @@ -178,7 +178,6 @@ namespace Ildasm Console.WriteLine("Usage: ikdasm [options] <file_name> [options]"); Console.WriteLine(); Console.WriteLine("Options:"); - if (typeof (int).Assembly.GetType ("Mono.Runtime") != null) { Console.WriteLine (" --out=<file name> Direct output to file rather than stdout."); Console.WriteLine (" --help Print this help."); |