Fix bugs in .NET program without access to source

前端 未结 6 1136
南方客
南方客 2021-02-14 03:03

I have a program i frequently use that is made with .NET. This program has a small bug that is very annoying and the developer to the app is nowhere to be found.

I have

相关标签:
6条回答
  • 2021-02-14 03:21

    I suggest you use the Reflexil plugin for Reflector. It allows you to easily modify assemblies, and even replace the body of a method by your own C# code.

    0 讨论(0)
  • 2021-02-14 03:24

    I don't think there is an easier way to do this than what you already mentioned. I actually decompiled a program with ILDASM for something similar and it took quite a lot of tinkering.

    If there is an easier method I'd like to know it too.

    0 讨论(0)
  • 2021-02-14 03:29

    If the program is simple, in theory you could use reflector to reverse the entire program back to C#, make the change and recompile it.

    Alternatively you could try a tool like ILDasm, which should allow you to extract the IL, make your change (in MSIL), and re assemble (using ILAsm). Obviously to do this you'll have to figure out how to write your change in IL, so you'll probably have to do some experimenting to see how if statements compile.

    I suspect both will take quite a bit of messing around to get the recompile to work.

    Good luck.

    If you get it to work, post back and let me know, I'd be quite interested in how you did this.

    0 讨论(0)
  • 2021-02-14 03:35

    You can use ILDASM and ILASM to make a roundtrip. While this is impractical for large changes, I think that it should do the trick in your case.

    0 讨论(0)
  • 2021-02-14 03:35

    Try this .NET Reflector addin.

    This has worked for me. It sometimes creates "Complier Generated" tags which cannot be complied. But you can easily fix this manually.

    0 讨论(0)
  • 2021-02-14 03:37

    telerik Just Decompile (free) Then the reflexil plug in

    2 min job with the above (I've tried all the other methods!!)

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