破解Developer Express v2009 vol 3

破解Developer Express v2009 vol 3

 

使用工具:VS2005

 

破解思路:

1.       反编译DLL文件

2.       修改许可证类型

3.       再次编译

4.       发布到GACGlobal Assembly Cache 全局程序集缓存)中

 

下面是我的做法:

1.       先将安装目录下的DevExpress.Data.v9.3.dll(路径是/Components/Sources/DevExpress.DLL)放在一个单独的文件夹中,我选的是C:/aaa,打开SDK,把当前目录改到这个位置,输入命令:

ildasm DevExpress.Data.v9.3.dll /temp.il

2.       VS打开temp.il文件,找到GetLicense方法,将方法体里的汇编代码改为以下内容:

// 代码大小 133 (0x85) .maxstack 4 .locals init (valuetype DevExpress.Utils.About.DXLicenseType V_0, string V_1) IL_0000: ldc.i4.2 IL_0001: stloc.0 IL_0002: ldarg.0 IL_0003: ldarg.1 IL_0004: ldarg.2 IL_0005: call instance string DevExpress.Utils.About.DXLicenseProvider::GetSavedLicenseKey(class [System]System.ComponentModel.LicenseContext, class [mscorlib]System.Type) IL_000a: stloc.1 IL_000b: ldloc.1 IL_000c: brfalse.s IL_0023 IL_000e: ldloc.1 IL_000f: ldstr "" IL_0014: call bool [mscorlib]System.String::op_Inequality(string, string) IL_0019: brfalse.s IL_0023 IL_001b: ldarg.0 IL_001c: ldloc.1 IL_001d: callvirt instance valuetype DevExpress.Utils.About.DXLicenseType DevExpress.Utils.About.DXLicenseProvider::ParseKey(string) IL_0022: stloc.0 IL_0023: ldloc.0 IL_0024: ldc.i4.2 IL_0025: beq.s IL_0030 IL_0027: ldarg.1 IL_0028: callvirt instance valuetype [System]System.ComponentModel.LicenseUsageMode [System]System.ComponentModel.LicenseContext::get_UsageMode() IL_002d: ldc.i4.1 IL_002e: bne.un.s IL_0064 IL_0030: ldarg.1 IL_0031: callvirt instance valuetype [System]System.ComponentModel.LicenseUsageMode [System]System.ComponentModel.LicenseContext::get_UsageMode() IL_0036: ldc.i4.1 IL_0037: bne.un.s IL_0062 IL_0039: ldarg.0 IL_003a: callvirt instance valuetype DevExpress.Utils.About.ProductKind DevExpress.Utils.About.DXLicenseProvider::get_Kind() IL_003f: ldc.i4.0 IL_0040: conv.i8 IL_0041: beq.s IL_0062 IL_0043: ldarg.0 IL_0044: callvirt instance valuetype DevExpress.Utils.About.ProductKind DevExpress.Utils.About.DXLicenseProvider::get_Kind() IL_0049: ldc.i4.2 IL_004a: call string DevExpress.Utils.About.Utility::Get(valuetype DevExpress.Utils.About.ProductKind, valuetype DevExpress.Utils.About.ProductInfoStage) IL_004f: ldstr "" IL_0054: call bool [mscorlib]System.String::op_Equality(string, string) IL_0059: brtrue.s IL_005e IL_005b: ldc.i4.0 IL_005c: br.s IL_005f IL_005e: ldc.i4.0 IL_005f: stloc.0 IL_0060: br.s IL_0064 IL_0062: ldc.i4.0 IL_0063: stloc.0 IL_0064: ldarg.0 IL_0065: ldloc.0 IL_0066: callvirt instance string DevExpress.Utils.About.DXLicenseProvider::EncodeKey(valuetype DevExpress.Utils.About.DXLicenseType) IL_006b: stloc.1 IL_006c: ldloc.1 IL_006d: brfalse.s IL_0078 IL_006f: ldarg.0 IL_0070: ldarg.1 IL_0071: ldarg.2 IL_0072: ldloc.1 IL_0073: call instance void DevExpress.Utils.About.DXLicenseProvider::SetSavedLicenseKey(class [System]System.ComponentModel.LicenseContext, class [mscorlib]System.Type, string) IL_0078: ldloc.0 IL_0079: ldc.i4.2 IL_007a: beq.s IL_0083 IL_007c: ldloc.0 IL_007d: newobj instance void DevExpress.Utils.About.DXLicense::.ctor(valuetype DevExpress.Utils.About.DXLicenseType) IL_0082: ret IL_0083: ldnull IL_0084: ret

修改后对应的C#代码是:

public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions) { DXLicenseType none = DXLicenseType.None; string savedLicenseKey = this.GetSavedLicenseKey(context, type); if ((savedLicenseKey != null) && (savedLicenseKey != "")) { none = this.ParseKey(savedLicenseKey); } if ((none == DXLicenseType.None) || (context.get_UsageMode() == 1)) { if ((context.get_UsageMode() == 1) && (this.Kind != ProductKind.Default)) { //就修改了这个地方,原来这一句的代码是: //none = (Utility.Get(this.Kind, ProductInfoStage.Registered) == "") ? DXLicenseType.Trial : DXLicenseType.Full; none = (Utility.Get(this.Kind, ProductInfoStage.Registered) == "") ? DXLicenseType.Full : DXLicenseType.Full; } else { none = DXLicenseType.Full; } } savedLicenseKey = this.EncodeKey(none); if (savedLicenseKey != null) { this.SetSavedLicenseKey(context, type, savedLicenseKey); } if (none != DXLicenseType.None) { return new DXLicense(none); } return null; }   

3.       继续再SDK里:

ilasm temp.il /dll /Output: DevExpress.Data.v9.3.dll

 

4.  把这个DLL文件替换掉原始的那个,在SDK里切换到原来的DLL所在目录,使用Gacutil.exeSn.exe完成最后工作:

Gacutil /u DevExpress.Data.v9.3

 sn -Vr *
 Gacutil /i DevExpress.Data.v9.3.dll

 sn -Vu *

 

到此对DevExpress.Data.v9.3.dll的破解工作全部完成!本人QQ836930892

你可能感兴趣的:(破解Developer Express v2009 vol 3)