ILASM没有设置FileVersion

编程入门 行业动态 更新时间:2024-10-22 08:21:32
本文介绍了ILASM没有设置FileVersion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个.il文件,可以毫无问题地进行编译.我可以强力命名,因此没有任何问题.但是我无法像我期望的那样通过属性设置文件版本.使用ilasm时如何设置程序集的FileVersion?

I have an .il file which I can compile without any problems. I can strong name it and so without any issues. But I am not able to set the file version via the attribute as I would expect it. How can I set the FileVersion for an assembly when using ilasm?

如果进行往返旅行,我将始终得到一个.res文件,该文件只包含不可读的二进制数据.此res文件里面有什么,我可以对其进行编辑吗?

If I do a round trip I get always a .res file which does contain only binary data which is not readable. What is inside this res file and can I edit it?

代码不起作用

.assembly myAssembly { .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = { string('1.2.3.4') }

推荐答案

可以使用.res文件解决此问题.与ildasm和ilasm进行往返旅行是不够的. IL文件未引用.res文件.我必须手动将其添加到ilasm调用中. res文件中的数据似乎包含写入PE标头中的信息,这对我来说是可以的.

The issue can be solved by using the .res file. It is not sufficient to do a round trip with ildasm and ilasm. The IL file does not reference the .res file. I had to add it to the ilasm call manually. The data in the res file seemed to contain the infos which are written into the PE header which is ok for me.

所需的最终命令行是

ilasm test.il /dll /res:test.res

我仍然不知道res文件中到底有什么,但是我可以将其与我手动创建的任何其他assemlby的元数据信息进行交换,然后根据需要对其进行反编译以替换原始程序集的元数据.

I still do not know what exactly is inside the res file but I can exhange it with the meta data information of any other assemlby that I create manually and then decompile it to replace the metadata of the original assembly as I need.

似乎没有多少人在做这样的事情.

It seems not many people are doing such stuff.

更多推荐

ILASM没有设置FileVersion

本文发布于:2023-11-17 04:52:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608901.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ILASM   FileVersion

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!