.NET 的 Ildasm.exe 工具似乎不会将所有源代码行转储到输出文件
我正在创建一个实用程序,用于读取我公司编写的 VB .NET 可执行文件的源代码行。它按以下方式使用 ildasm.exe 实用程序:
ildasm.exe /NOBAR /UNICODE /SOURCE "AssemblyToRead.exe" /OUT="App_Dir\CodeOutput\CodeOutput.txt"
这会导致某些源代码行被转储到 CodeOutput 中.txt 文件。然而,似乎每个源文件的开头都缺少源行。源文件丢失前 10 - 20 行代码的情况并不罕见。大多数其他线路似乎都是忠实制作的。 有谁知道我做错了什么? 谢谢
I am creating a utility that reads the source lines of VB .NET executables my company has written. It is using the ildasm.exe utility in the following way:
ildasm.exe /NOBAR /UNICODE /SOURCE "AssemblyToRead.exe" /OUT="App_Dir\CodeOutput\CodeOutput.txt"
This results in some source line being dumped into the CodeOutput.txt file. However, it seems like their are source line missing at the beginning of every source files. It is not uncommon for a source file to be missing the first 10 - 20 lines of code. Most of the other lines seem to be faithfully produced.
Does anyone have any idea what I am doing wrong?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可执行文件中没有源代码行,因此反汇编程序无法从中读取源代码行。它的作用是创建可编译成相同可执行文件的代码。
任何不生成可执行代码的源代码行都不会被重新创建。另外,一些代码被优化掉了,所以如果一行代码没有做任何有用的事情,它可能已在编译中被删除。
There is no source lines in an executable, so the disassembler can not read source lines from it. What it does is to create code that would compile into the same executable.
Any source lines that does not produce executable code won't be recreated. Also, some code is optimised away, so if a line doesn't do anything useful, it might have been removed in the compilation.