Background:
We had a problem with an hardware manufactures SDK, whereby one of their assemblies (for which we had the source code for) was throwing an unmanaged exception, killing our software.
I got in contact with their support, who provided us with some modified source code. After getting it compiling under C++ VS2010 / .NET 3.5 (another Headache in itself) I ran into problems with some of their other DLLs which are strongly signed refusing to load the assembly that we’ve recompiled. Guess what… we don’t have the strong key in order to resign the assemblies, and don’t have source code to all the other assemblies to recompile them without strong names!
That’s where Reflexil comes in!
Awesome little tool I found today, which allows you to hack around with compiled .NET assemblies.
1. Download and extract Reflexil anywhere you want.
2. Open Reflector, goto ‘View’ –> ‘Add-Ins’ –> ‘Add’ and select ‘Reflexil.Reflector.dll’
You now have it installed! Click on the ‘Reflexil’ item in the ‘Tools’ menu to load the right hand bar.
Using Reflexil you are able to remove the strong names from the DLLs that don’t belong to you, so that they will then load the ‘rogue’ DLL that I’ve just recompiled without the original strong name key file.
Click on the assemblies and remove the ‘HasPublicKey’ checkbox on each one. Clear the ‘PublicKey’ and ‘PublicKeyToken’
Note that if you have assemblies that reference each other, you will also have to go through each of the references for each assembly, and remove the public key information from each reference as well.
No comments:
Post a Comment