V5Shop彻底激怒了我。。发个免费版的程序非要到处加自己的版权。。这样商城建好后太影响效果了。。
你流氓我也流氓。。我要全部给你破掉。。
第一步,分析
Reflector反编译分析看出
顶部标题版权“Powered by V5Shop”在V5Shop.Web.UI.dll中的TplPage类的构造器TplPage()中被加上的:
this.shoptitle = this.shoptitle + " - Powered by V5Shop";
底部版权“Designed By:V5Shop”是在V5Shop.Template.dll中的Xtemplate类的getBottom()方法中加上的。
private string getBottom(bool showpower)
{string str = string.Empty;
if (showpower){
if (this.ViewMode == "HTML"){
str = "\r\ntemplateBuilder.Append(\"<center style='font-size:12px;'>Designed By:<strong><a href='http://www.v5shop.com.cn/' target='_blank'>V5Shop</a></strong></center>\");\r\n\tResponse.Write(utils.ChangeUrl(templateBuilder.ToString(),\"\"));\r\n";
}else if (this.ViewMode == "Rewrite"){
str = "\r\ntemplateBuilder.Append(\"<center style='font-size:12px;'>Designed By:<strong><a href='http://www.v5shop.com.cn/' target='_blank'>V5Shop</a></strong></center>\");\r\n\tResponse.Write(utils.ChangeRewriteUrl(templateBuilder.ToString(),\"\"));\r\n";
}else{
str = "\r\ntemplateBuilder.Append(\"<center style='font-size:12px;'>Designed By:<strong><a href='http://www.v5shop.com.cn/' target='_blank'>V5Shop</a></strong></center>\");\r\n\tResponse.Write(templateBuilder.ToString());\r\n";
}
}
只要把base.shoptitle = base.shoptitle + " - Powered by V5Shop";改成base.shoptitle = base.shoptitle标题部分版权就能去掉。
把getBottom方法中的<center></center>部分字串删除底部版权也就去掉了。
呵呵,V5太蠢了吧!这种方法保护版权也太容易破了吧!!!
第二步,修改分解出的il文件
用ildasm分解DLL文件。用UltraEdit打开分解出来的.il文件。
在V5Shop.Web.UI.il文件中搜索所有字串“Powered by V5Shop”,将其替换为""(空串)就OK了。
在V5Shop.Template.il中搜索getBottom发现要改的字串是bytearray(字节数组)类型的。还好,我要做的只是把版权移除,只需要将这行代码改成
IL_0053: ldstr "\r\n\tResponse.Write(templateBuilder.ToString());\r\n"
附:bytearray类型的16进制字串是特殊处理过的,如果此处你想修改成自己的版权的话(例如我们要将<center></center>段改成<center>冰封的迷失小屋</center>),教你一个最简单的方法,用VS新建一个C#控制台项目,在程序里只定义一个string型变量并赋值为要修改成的字符串,如下。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string str = "<center>冰封的迷失小屋</center>";
}
}
}
然后将此C#控制台项目编译。再找到编译成的exe文件,用ildasm将其反编译,复制其中的bytearray型字串替换掉源il文件中对应的bytearray字串就OK了。
第三步,将修改过的il文件重新编译回dll文件
将修改过的两个il文件用ilasm重新编译回.dll文件。大功告成!