How To Decompile Dll In Visual Studio

0 views
Skip to first unread message

Margarita Lovvorn

unread,
Aug 4, 2024, 6:16:45 PM8/4/24
to quesacacin
WithF12 I can view decompiled code. However, when I start debugging (F5) and try to step in(F11) into the dll, Visual Studio seams to debug a different version of the code. For example, Visual studio moves the debugging cursor through comments (screenshot below)...

Because for C#, pdb records mainly information such as line numbers (if it is cpp, there will be source code information in pdb, which is different), and because the source file on your side is different from what it should be, it will "step into" a place that you "think" is completely wrong when you press f11, but actually it already go to the right place (I mean, it really should go to that line if you press f11 if the source file matches).


You can use a tool like dotpeek to decompile the C# dll file into a project(you can use this tool to export dll to be a totally new project/solution), and then you can build this new project. In this case, you can ensure that the source files, dll and pdb in this new project are consistent . Have your test project refer to the dll in this decompiled project so you won't run into problems.


It should be noted that the decompilation operation cannot guarantee that the decompilation code is 100% the same as the source code. It is inevitable that the code obtained in this way will be somewhat different from the source code.


I downloaded one of the projects using vc++ and using visual studio 2008. The problem is some of the files are in .lib format, to understand the project completely i want to know the contents of this lib files. Is it possible to extract this .lib files into C files (I am assuming they are written in C).


In the process of compiling C code, a lot of the information that we find useful in understanding the code, such as comments and often also variable names, gets thrown away because that information has no added value to the processor that has to execute the code.

3a8082e126
Reply all
Reply to author
Forward
0 new messages