I've detected some defects on legacy third party assemblies that we're using on our code decompilind them. I would like to fix them but as I don't have the source code I need to directly modify the bytecode. The changes are really simple (changing an AND for an OR and NOPing some lines).
Is there an editor to do this kind of things? Doing the work with an hex editor would be the last option, I would preffer to have a hint of what instructions I have around the cursor ...
dnSpy
, allows you to modify IL and C# code. See their screenshots.
I think what you are looking for is .NET Reflector with the Reflexil add-on. Take a look at the screenshots, it's pretty powerful and it can modify IL code at runtime. Reflector used to be free of charge, you might be able to get some older version somewhere.
I am assuming the assemblies are not strongly named because otherwise there's nothing you can do without the signing key.
If not, it sounds like Ildasm
would work for you. You can decompile the assemblies, perform modifications and assemble them again with Ilasm
.
Another free option might be Telerik's JustDecompile, which "can create a Visual Studio project from a decompiled assembly." -- I haven't used it, but this sounds like it decompiles to source and creates a ready-to-build project. That would be super convenient since you won't even have to work with IL.
Try Simple Assembly Explorer, it allows you to edit bytecode and works by default more life Reflexil
https://sites.google.com/site/simpledotnet/simple-assembly-explorer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With