.NET's Ildasm.exe Tool Seems To Not Be Dumping All Source Lines Out To Output File
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
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.
精彩评论