*** Intro ***
This tutorial explains how to remove the "timebomb" from Red Gate's community version of Reflector from Reflector version 6.6.0.30 (2/2/2011). Red Gate has announced that the community edition will expire on May 30, 2011 (http://www.red-gate.com/products/dotnet-development/reflector/announcement-faq). Users of the community edition will then be forced to pay $35 for a commercial version of this product. It is my opinion that Red Gate is not acting in good faith by allowing the community edition to expire thus forcing users to pay for their commercial version. This is compounded by the fact that Red Gate initially emphasized its commitment to a free community edition.
Make a backup of the Reflector bits in case you run into trouble with one of the steps. These basic steps should apply to older versions as well although the exact line numbers may differ. Requires the Windows SDK.
*** Prep ***
1. This tutorial assumes the following directory structure:
d:\temp\Reflector\bin <-- Contains the Reflector bits
d:\temp\Reflector\source\Reflector.exe <-- Destination for ildasm output
d:\temp\Reflector\source\RedGate.Reflector.Addin.dll <-- Destination for ildasm output
2. Creating a key. This is only required for Visual Studio Integration:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\sn" -k D:\Temp\Reflector\source\reflector.snk
*** Part 1 - Reflector.exe ***
1. Disassemble Reflector.exe:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\ildasm" D:\temp\Reflector\bin\Reflector.exe /out=D:\temp\Reflector\source\Reflector.exe\Reflector.exe.il /UTF8
2. Open Reflector.exe in Reflector and right-click|Save As the 4 resources listed below that contain the question marks. The question marks represent unicode characters that will probably be displayed in Reflector as empty boxes:
- Reflector
+ Reflector.exe
- Resources
{8a6f1618-b4d6-4e28-9941-873270d46e1f}
.???.resources --> D:\temp\Reflector\source\Reflector.exe\a.resources
.???.resources --> D:\temp\Reflector\source\Reflector.exe\b.resources
.??.resources --> D:\temp\Reflector\source\Reflector.exe\c.resources
???.???.resources --> D:\temp\Reflector\source\Reflector.exe\d.resources
RedGate.Reflector.Tools.Frank.txt
...
3. Open the Reflector.exe.il file in a text editor to add an alias the resources saved in the last step (Again the question marks represent unicode characters):
Line 115: .mresource public '???.???.resources' as 'd.resources'
Line 134: .mresource public '?.???.resources' as 'a.resources'
Line 153: .mresource public '?.??.resources' as 'c.resources'
Line 172: .mresource public '?.???.resources' as 'b.resources'
4. Modify line 269134 to fix the date. Change this:
IL_00bb: call valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::get_Now()
To this:
IL_00bb: ldsfld valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::MinValue
N.B. If the line number is different in another version look for get_Now() followed by a call to display a dialog box about 20 lines down.
5. Remove the following assembly signing, lines 87 to 97:
.publickey = (49 6E 20 6F 72 64 65 72 20 74 6F 20 65 78 70 6C // .$..............
61 69 6E 20 74 68 65 20 72 65 73 75 6C 74 73 20 // .$..RSA1........
6F 66 20 65 78 70 65 72 69 6D 65 6E 74 73 20 6F // .......(.'.)ms.i
6E 20 73 63 61 74 74 65 72 69 6E 67 20 6F 66 20 // ..#"!._...f.3...
61 20 72 61 79 73 20 62 79 20 6D 61 74 74 65 72 // c...t..$.....m..
20 50 72 6F 66 2E 20 52 75 74 68 65 72 66 6F 72 // ...sn.6.F......L
64 20 68 61 73 20 67 69 76 65 6E 20 61 20 74 68 // ..J..........rC.
65 6F 72 79 20 6F 66 20 74 68 65 20 73 74 72 75 // .A+.......K.6..g
63 74 75 72 65 20 0D 0A 6F 66 20 61 74 6F 6D 73 // -.V.g..E,..=.~..
2E 20 41 63 63 6F 72 64 69 6E 67 20 74 6F 20 74 ) // ....6'rz.o....$.
.hash algorithm 0x00008004
6. Assemble Reflector.exe:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe D:\temp\Reflector\source\Reflector.exe\Reflector.exe.il /EXE /OUTPUT=D:\temp\Reflector\bin\Reflector.exe /RESOURCE=D:\Temp\Reflector\source\Reflector.exe\Reflector.exe.res /KEY=D:\Temp\Reflector\source\reflector.snk
*** Part 2 - RedGate.Reflector.Addin.dll (Experimental) ***
N.B. Visual Studio Addin support may have issues.
1. Remove the SuppressIldasmAttribute from RedGate.Reflector.Addin.dll. Open RedGate.Reflector.Addin.dll in a hex editor and search for "SuppressIldasmAttribute" (No quotes). Replace this attribute with hex zeros (Not ascii zeros) and save the assembly.
2. Disassemble RedGate.Reflector.Addin.dll:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\ildasm" D:\temp\Reflector\bin\RedGate.Reflector.Addin.dll /out=D:\temp\Reflector\source\RedGate.Reflector.Addin.dll\RedGate.Reflector.Addin.dll.il /UTF8
3. Remove the following assembly signing in RedGate.Reflector.Addin.dll.il, lines 169 to 179:
.publickey = (49 6E 20 6F 72 64 65 72 20 74 6F 20 65 78 70 6C // .$..............
61 69 6E 20 74 68 65 20 72 65 73 75 6C 74 73 20 // .$..RSA1........
6F 66 20 65 78 70 65 72 69 6D 65 6E 74 73 20 6F // .......(.'.)ms.i
6E 20 73 63 61 74 74 65 72 69 6E 67 20 6F 66 20 // ..#"!._...f.3...
61 20 72 61 79 73 20 62 79 20 6D 61 74 74 65 72 // c...t..$.....m..
20 50 72 6F 66 2E 20 52 75 74 68 65 72 66 6F 72 // ...sn.6.F......L
64 20 68 61 73 20 67 69 76 65 6E 20 61 20 74 68 // ..J..........rC.
65 6F 72 79 20 6F 66 20 74 68 65 20 73 74 72 75 // .A+.......K.6..g
63 74 75 72 65 20 0D 0A 6F 66 20 61 74 6F 6D 73 // -.V.g..E,..=.~..
2E 20 41 63 63 6F 72 64 69 6E 67 20 74 6F 20 74 ) // ....6'rz.o....$.
.hash algorithm 0x00008004
4. Change the public key token for the Reflector assembly reference in RedGate.Reflector.Addin.dll.il on line 60 to be that of the key you created earlier:
.assembly extern Reflector
{
.publickeytoken = (18 CA 6B B8 DD 6A 03 C3 ) // <---
.ver 5:0:0:0
}
5. Remove the following, line 163:
.custom instance void [mscorlib]System.Runtime.CompilerServices.$TR$1DF::.ctor() = ( 01 00 00 00 )
6. Assemble RedGate.Reflector.Addin.dll:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe D:\temp\Reflector\source\RedGate.Reflector.Addin.dll\RedGate.Reflector.Addin.dll.il /DLL /OUTPUT=D:\temp\Reflector\bin\RedGate.Reflector.Addin.dll /RESOURCE=D:\Temp\Reflector\source\RedGate.Reflector.Addin.dll\RedGate.Reflector.Addin.dll.res /KEY=D:\Temp\Reflector\source\reflector.snk
*** Part 3 - Addins ***
Addins need to be modified to refer to the new version of Reflector that is not strongly named. You can either obtain the source code and recompile the addin referencing the updated Reflector assembly or follow the steps below to modify the reference:
1. Disassemble the addin (Using FileGenerator.dll as an example):
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\ildasm" D:\temp\Reflector\bin\FileGenerator.dll /out=D:\temp\Reflector\source\FileGenerator.dll\FileGenerator.dll.il /UTF8
3. Change the public key token for the Reflector assembly reference in the addin il file to be that of the key you created earlier:
.assembly extern Reflector
{
.publickeytoken = (18 CA 6B B8 DD 6A 03 C3 ) // <--
.ver 4:2:0:0
}
4. Assemble the addin:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe D:\temp\Reflector\source\FileGenerator.dll\FileGenerator.dll.il /DLL /OUTPUT=D:\temp\Reflector\bin\FileGenerator.dll /RESOURCE=D:\Temp\Reflector\source\FileGenerator.dll\FileGenerator.dll.res
Remove Reflector Timebomb