dotnet dll decompile and change the code

前端 未结 2 1021
青春惊慌失措
青春惊慌失措 2020-12-23 21:50

I need to change the code of the .NET DLL. I am able to see the code by compilable the DLL with .NET reflector, but I am not able to change the code of the DLL. With .NET Re

相关标签:
2条回答
  • 2020-12-23 22:28

    The following code is working:

    "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ildasm.exe" original.dll /out=code.asm
    echo Here changes to code.asm should be done.
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe /dll code.asm
    

    So if the change in code is to be small, it's doable by making the changes in assembly code directly. One can compile and disassemble simple methods to see how the assembly code should look like. Putting additional methods inside the assembly file should not be too hard too.

    Of course code analyzis should be done using ilspy-like tools, displaying the source code rather than assembly code.

    Tools employed here come from Windows SDK (ildasm) and from .net framework (ilasm).

    0 讨论(0)
  • 2020-12-23 22:29

    I've had limited success in recompiling DLLs. A better way of going about it is to using Reflector and the Reflexil plugin. You need to have a bit better knowledge of the IL code that makes up .NET assemblies but Reflexil does a great job of describing the OP codes. I have a little walk through on my blog about how I used to modify the PowerShell Cmdlet Help Editor: http://csharpening.net/?p=348

    0 讨论(0)
提交回复
热议问题