Options

Updated tutorial on using Visual Studio .NET Reflector VSPro 11.1 Visual Studio add-in?

Overview:
--------------
.NET Reflector seems to be a great tool, as it quickly decompiled two test .NET applications into source code and Visual Studio projects.  I am trying to better understand how to use the Visual Studio debugging pieces.

Is there an updated tutorial for using .NET Reflector VSPro version 11.1 with Visual Studio 2019? Visual Studio 2019 seems to be the last version that supports .NET Reflector VSPro, from what I have seen in other forum entries.

The goal is to debug a .NET executable that does not have available source code using Visual Studio's ".NET Reflector" add-in "Generate PDB" and/or "Debug executable" options to debug into the auto-generated source code with PDB files that are created by this tool.  

Using the standalone .NET Reflector application, I have been able to create Visual Studio projects and source code that I can compile for the two test .NET applications (available online, without published source code) listed below, but I would like to understand how to debug the original application against the decompiled/updated/recompiled versions.

Prerequisites:
-------------------
. .NET Reflector VSPro 11.1 standalone and Visual Studio add-in capabilities installed.

  https://home.engineering.iastate.edu/~atamrawi/SYMake/SyMake-0.1.zip
as an example of a GUI .NET application without source code, for demonstration purposes.

I also tried http://benryves.com/bin/brass/ (a .NET-based Z80 assembler) for demonstration.
These are two .NET applications that I know are available online, that were not provided with public source code.

(If there is a dedicated GitHub repo with a .NET Visual Studio project in which the source code can be deleted and only the executable used as a tutorial, please let me know the URL.)

. Uncompress the .NET application into an appropriate folder

. In the uncompressed file folder (such as C:\Users\users\Downloads\SyMake-0.1\Release):
rename the Makefileparser.pdb file to a .pdb.bak file so that we can create a new PDB file for use by .NET Reflector.

Test steps:
--------------
. Launch VS 2015 (or another VS version that has the Redgate .NET Reflector add-in). 

NOTE: When I tried using Visual Studio 2019 .NET Reflector's add-in to "Generate PDBs..." or "Debug an Executable" for SyMake, I was able to duplicate the issues that others have experienced with the "Mono.Cecil.AssemblyFactory" exception being shown.

I seemed to make more progress when using Visual Studio 2015.

. Visual Studio: .NET Reflector > Generate PDBs...

. Select the [Browse] button

. Load C:\Users\User\Downloads\SyMake-0.1\Release\MakefileParser.exe, for example

. If the "Debug Store:" is not 0 bytes, click the [Clear Store] button to clear the cached copy

. Ensure that the "Debug" column for assembly MakefileParser is checkmarked.

. Click the [Continue] button

. Generating PDBs...-this enables debugging will process
A green checkmark for Assembly MakefileParser should report status "Debugging enabled for all methods"

. Click the [Done] button

. This creates a PDB file in C:\Users\User\AppData\Local\Red Gate\.NET Reflector\Cache\0 , for example.

How do I debug the original .NET executable so that this PDB is referenced? 
The .NET Reflector Object Browser is still empty and if I use the .NET Reflector > Debug an executable...
the PDB is not associated with the executable.

.  If I use .NET Reflector > Debug an executable... to load a .NET executable and then "Generate PDB...", the PDB is disassociated from the running .NET executable, so the source code was not usable for debugging.

Tagged:
Sign In or Register to comment.