How to patch a line of code in a DLL?

Kees C. Bakker picture Kees C. Bakker · Apr 20, 2011 · Viewed 11k times · Source

I've got a .Net dll that misses a line of code. I would like to patch that DLL, but I don't have the source code. How would I go about? Does anyone know a quick way of patching something like this?

Answer

quentin-starin picture quentin-starin · Apr 20, 2011

With the Reflexil plugin for Reflector, modifying a small part of a DLL is quick and easy. I've used this on a handful of occasions to change a line or two in a deployed dll, usually to disable some behavior that's the result of a condition (and no, not cracking an app, legitimate uses on our own code to avoid the weight of a full deploy).