上次弄了web版本的,今天弄winform版本的,注意这次是enterprise版本的。
初步估计这次问题不大,应该和web版本的区别不大,感觉都是绘图的,winform的可能是直接在dc上绘图并显示给我们看得的,web版本的是绘图后产生图片的。基本上绘图的方法,算法什么的应该变化不大。
还是像以前那样做好准备工作,新建一个专门用于破解的工作目录,写好bat文件么,用于减少我们的打字工作量。
Dasm.bat (反编译的文件)
文件内容为:
ildasm DundasWinChart.dll /out=DundasWinChart.il
Asm.bat(编译刚才反编译出来的il代码的文件,用于重新生成dll文件)
文件内容为:
ilasm /dll /res: DundasWinChart.res /key: DundasWinChart.snk DundasWinChart.il /out: DundasWinChart.dll /quiet
/key: DundasWinChart.snk这个选项可以去掉。不要什么强名了。
好了,开始工作
运行vs2005的命令行,进入工作目录,执行dasm
生成了一大堆文件,使用编辑器(我使用了editplus)打开生成的DundasWinChart.il文件,同时用reflector打开dll文件,对照着弄,比较方便。
这次是找到
Dundas.Charting.WinControl.ChartPicture 的 Paint方法
public void Paint(Graphics graph, bool paintTopLevelElementOnly)
{ this.Paint(graph, paintTopLevelElementOnly, RenderingType.Gdi, null, null, string.Empty, false, false);
}
调用了另一个,来到这个方法
public void Paint(Graphics graph, bool paintTopLevelElementOnly, RenderingType renderingType, XmlTextWriter svgTextWriter, Stream flashStream, string documentTitle, bool resizable, bool preserveAspectRatio)
{ this.backgroundRestored = false;
-----------中间省略,一直来到-----------
finally { this.OnAfterPaint(new ChartPaintEventArgs(this.chartGraph, this.common, new ElementPosition(0f , 0f , 100f , 100f ))); foreach (ChartArea area7 in this.chartAreas) { if (area7.Visible) { area7.Restore3DAnglesAndReverseMode(); area7.GetTempValues(); } } this.showWaterMark = true; !!!!!!!多么明显阿
if (this.showWaterMark) { StringFormat format1 = new StringFormat(); format1.Alignment = StringAlignment.Center; format1.LineAlignment = StringAlignment.Center; SolidBrush brush1 = new SolidBrush(Color.FromArgb(40, 0, 0, 0xaf)); SolidBrush brush2 = new SolidBrush(Color.FromArgb(40, 200, 200, 200)); Font font1 = new Font(ChartPicture.GetDefaultFontFamilyName(), 8f ); SizeF ef1 = this.chartGraph.GetRelativeSize(new SizeF(2f , 2f )); string text1 = "Dundas Chart - Windows Forms Enterprise Edition\r\nEvaluation Mode Enabled, for testing purposes only\r\n(C) 2006 Dundas Software, www.dundas.com"; this.chartGraph.DrawStringRel(text1, font1, brush2, new RectangleF(0f , 0f , 100f , 100f ), format1); this.chartGraph.DrawStringRel(text1, font1, brush1, new RectangleF(0f , 0f , 100f - ef1.Width, 100f - ef1.Height), format1); } if (renderingType == RenderingType.Svg) { this.chartGraph.Close(); this.chartGraph.ActiveRenderingType = RenderingType.Gdi; } } }} 看到this.showWaterMark = true; 还是那么的明显阿,哈哈
好了到il文件中查找 showWaterMark ,来到
IL_096d: ldarg.0 IL_096e: ldc.i4.1 IL_096f : stfld bool Dundas.Charting.WinControl.ChartPicture::showWaterMark IL_0974: ldarg.0 IL_0975: ldfld bool Dundas.Charting.WinControl.ChartPicture::showWaterMark IL_097a : brfalse IL_0a 64 IL_097f : newobj instance void [System.Drawing]System.Drawing.StringFormat::.ctor() IL_096e: ldc.i4.1 !!!!!!!!!!!!!设置showWaterMark成了true
修改的话就简单了,IL_096e: ldc.i4.1 修改成 IL_096e: ldc.i4.0 就是改成了false,
这样下面就不显示水印了。 按照上篇文章的内容(请参考以前的文章),好像还有一个地方 就是Dundas.Charting.WebControl.ChartLicenseProvider中方法 iskeyvalid,好的,在IL中查找iskeyvalid,找不到,看来方法名字换了。但是应该考虑到跟License有关系,在IL中查找License字符串,有
在ChartImage:: CheckLicense中,用 reflector看看吧
internal static bool CheckLicense()
{ bool flag1 = false; try { string text1 = @"SOFTWARE\Dundas Software\Charting\WinControlVS2005"; string text2 = "Dundas.Charting.WinControl.Chart.lic"; flag1 = ChartImage.CheckLicense(text1, text2); if (!flag1) { text1 = @"SOFTWARE\Dundas Software\OlapServices\WinControlVS2005"; flag1 = ChartImage.CheckLicense(text1, text2); } } catch { } return flag1;}在这个方法上点右键,点Analyzer,分析此方法,这个功能很强,可以看出此方法被谁调用过,呵呵,一看就明白了

就一个地方调用。
过去看看
protected override void OnPaint(PaintEventArgs e)
{ if (this.invalidLicense) { if (!base.DesignMode) { this.invalidLicense = false; } else if (ChartImage.CheckLicense()) { this.invalidLicense = false; } } if (this.invalidLicense) { throw new LicenseException(base.GetType()); }-------------------------------省略一--------------------------
} 看看是不是invalidLicense(无效License)的,着手修改吧。
看来只要保证ChartImage.CheckLicense()返回true即可
看看上面的ChartImage.CheckLicense()方法,
flag1 = ChartImage.CheckLicense(text1, text2);这句话很关键,叫他返回true就行了,
来到ChartImage.CheckLicense(text1, text2);方法
private static bool CheckLicense(string keyName, string fileName)
{ bool flag1 = false; RegistryKey key1 = Registry.LocalMachine.OpenSubKey(keyName); if (key1 != null) { string text1 = (string) key1.GetValue("InstallDir"); if (!text1.EndsWith(@"\")) { text1 = text1 + @"\"; } text1 = text1 + @"Bin\"; if (File.Exists(text1 + fileName)) { flag1 = true; } } return flag1;} bool flag1 = false;只要是让bool flag1 = true;就没有问题了。
好了,来到il中的ChartImage.CheckLicense(string keyName, string fileName)方法
.method private hidebysig static bool CheckLicense(string keyName, string fileName) cil managed {// 代码大小 89 (0x59)
.maxstack 2 .locals init (bool V_0, class [mscorlib]Microsoft.Win32.RegistryKey V_1, string V_2)IL_0000: ldc.i4.0 !!!false 修改为true
IL_0001: stloc.0 IL_0002: ldsfld class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.Registry::LocalMachine IL_0007: ldarg.0 IL_0000: ldc.i4.0 这句修改为 IL_0000: ldc.i4.1
执行asm.bat.
OK,替换原来的文件,再去看看,水印都不见了,搞定。
Dundas的Chart组件没有经过混淆,修改起来还是比较简单的,它还有几个组件,如
Gauge(仪表)空间,map(地图)控件,代码经过混淆了,在reflector中看到都是没有意义或者大多数相同的函数名,修改起来可就麻烦了。以后再讲他们的破解。
需要以上组件的请在Blog上留言。或者联系我 qq 709971426
老长时间没有来打理博客了,看好很多同学要组件的。
最近在淘宝上开店的,放了软件为了增加信誉
具体请访问http://item.taobao.com/item.htm?id=8427290160
联系我,价格随意。
: 科技
- 我 顶
-
- !觉得精彩就顶一下,顶的多了,文章将出现在更重要的位置上。
|
发表评论
|









