Carey Payette, one of our newest evangelists, asked me to show her how JustDecompile can help in a practical situation. She covers several products, including WinForms, and she wanted a taste of the secret sauce the WinForms development team used for an upcoming demo program. She could have asked the team for the source code, but it would have taken a day due to time zone differences. Besides, it was a great opportunity to see JustDecompile in action.

We connected on Skype, and she showed me her screen. I couldn’t believe my eyes! The program is still in development, and I cannot disclose screens from it yet. I’m including screenshots of the current QuickStart example, located in the Examples folder of the RadControls for WinForms Q1 2013 install directory, so you can follow along.

QuickStart example

With a simple drag and drop, Carey opened the executable in JustDecompile. There were dozens of namespaces contained within the assembly, so of course that means sloughing through hundreds of classes. Luckily, this was the main form of the application, and Bernhard Lang created a plugin we could use to locate where the analysis should begin.

I didn’t have mouse control since we were using Skype, so I guided Carey to the plugin manager located in the Plugins menu. I then had her install GoToEntryPoint.

 GoToEntryPoint

The installation process was quick and no restart was required.

Now, the context menu for assemblies and modules have a new item: GoTo Entry Point. Executing this option navigated JustDecompile directly to the location of static method the CLR runs after loading the assembly.

GoToEntryPoint

It’s been a while since I wrote a WinForms application. Nevertheless, I was not shocked to see a Main method in a Program class. You may wonder why I don’t recommend simply searching for that method name. You can, and you will find what you’re looking for most of the time. However, the only restriction in .NET is for the entry point to be static method returning void, int, or uint, and that it has a single, string array parameter or no parameters at all. If the application was written in a language other than C#, or the programmer used an obfuscator or applied a little creativity, searching for Main would yield invalid or misleading results.

With the entry method, it was easy to find the form the application launch on startup. JustDecompile has built in navigation, so it only required clicking on the class name to get to the juicy bits.

  entry method

entry method

Unlimited Possibilities

JustDecompile’s plugin system gives you unlimited possibilities in how you use this free (forever) tool. If you have an idea for a plugin, the API documentation is a great resource. I know reading documentation isn’t the most exciting activity; coding is far more fun. To spice things up, I forked Bernhard’s project to GitHub. His source is easy to follow, and since it’s licensed under MS-PL, you can use it to kick start your own plugin project.

Enjoy, and don’t forget to thank Bernhard for his contribution!


About the Author

Chris Eargle

is a Microsoft C# MVP with over a decade of experience designing and developing enterprise applications, and he runs the local .NET User Group: the Columbia Enterprise Developers Guild. He is a frequent guest of conferences and community events promoting best practices and new technologies. Chris is a native Carolinian; his family settled the Dutch Form region of South Carolina in 1752. He currently resides in Columbia with his wife, Binyue, his dog, Laika, and his three cats: Meeko, Tigger, and Sookie. Amazingly, they all get along... except for Meeko, who is by no means meek.

Related Posts

Comments

Comments are disabled in preview mode.