3

I have used many decompilers but have too little experience to understand where it is that I can edit the c# code of specific objects within the DLL. Is it possible to simply edit the C# code and save the changes? If so how could I go about doing this?

TL:DR How do I edit C# code inside a DLL that I do not have the source code for?

Micheal Johnson
  • 45
  • 1
  • 1
  • 6
  • 1
    This is not something that can easily be done. – Scott Chamberlain Jan 26 '16 at 22:02
  • What about code injections or completely decompiling the DLL the way you can decompile and edit an apk – Micheal Johnson Jan 26 '16 at 22:03
  • There is no C# code in a DLL. An assembly contains Immediate Language, which can sometimes be decompiled to C#. Then you can edit the code and compile an assembly from that code again. Plenty of questions about this subject, try searching. – CodeCaster Jan 26 '16 at 22:12
  • @ScottChamberlain, but it is though. ILSpy and other tools can do it. – Ilian Jan 26 '16 at 22:27
  • @lonewolf ILSpy and others ***decompile*** code. But if even the cheapest code obfuscator has been run on the code it will not re-compile after decompiling due to non valid method names for C#. – Scott Chamberlain Jan 26 '16 at 22:29

1 Answers1

17

You can edit & patch .NET DLL/EXE with https://github.com/0xd4d/dnSpy

Worked perfectly well for me.

serhiyb
  • 4,753
  • 2
  • 15
  • 24