diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/asmref.cs | 38 | ||||
-rw-r--r-- | tools/tools.build | 10 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tools/asmref.cs b/tools/asmref.cs new file mode 100644 index 00000000..909e6f4d --- /dev/null +++ b/tools/asmref.cs @@ -0,0 +1,38 @@ +using System; +using System.IO; +using System.Reflection; +using System.Text; + +class asmref +{ + static void Main(string[] args) + { + foreach(string s in args) + { + AssemblyName asm; + if(File.Exists(s)) + { + asm = Assembly.LoadFile(new FileInfo(s).FullName).GetName(); + } + else + { + asm = Assembly.LoadWithPartialName(s).GetName(); + } + + Console.WriteLine(".assembly extern {0}", asm.Name); + Console.WriteLine("{"); + if(asm.GetPublicKeyToken() != null) + { + StringBuilder sb = new StringBuilder(); + foreach(byte b in asm.GetPublicKeyToken()) + { + sb.AppendFormat("{0:X2} ", b); + } + Console.WriteLine(" .publickeytoken = ({0})", sb.ToString()); + } + Version v = asm.Version; + Console.WriteLine(" .ver {0}:{1}:{2}:{3}", v.Major, v.Minor, v.Build, v.Revision); + Console.WriteLine("}"); + } + } +} diff --git a/tools/tools.build b/tools/tools.build new file mode 100644 index 00000000..145617b7 --- /dev/null +++ b/tools/tools.build @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<project name="tools" default="tools"> + <target name="tools"> + <csc target="exe" output="asmref.exe" optimize="true"> + <sources> + <includes name="asmref.cs" /> + </sources> + </csc> + </target> +</project> |