您的位置:首页 > 其它

SiteServer cms 授权破解教程

2012-05-03 23:01 330 查看
声明:本文只供研究使用,若产生纠纷,与本文作者无关!请大家积极遵守互联网产权!

如果是懒人的话,直接移步下载我写好的:http://download.csdn.net/detail/fengruochen966/4274681

SiteServer cms采用的是des加密授权,本人已破解授权DLL和授权文件。本文教程主要教大家使用des加密来实现自主授权

首先新建DESEncrypt.cs des加密文件。

using System;
using System.Text;
using System.Security;
using System.Security.Cryptography;
using System.IO;

/**/
/// <summary>
/// 此处定义的是DES加密,为了便于今后的管理和维护
/// 请不要随便改动密码,或者改变了密码后请一定要
/// 牢记先前的密码,否则将会照成不可预料的损失
/// </summary>
public class DESEncrypt
{
#region "member fields"
private  byte[] ivb = new byte[] { 0x12, 0x34, 0x56, 120, 0x90, 0xab, 0xcd, 0xef };
private string key = "kesgf4zb";
private Encoding encoding = new UnicodeEncoding();
private DES des;
#endregion
/**/
/// <summary>
/// 构造函数
/// </summary>
public DESEncrypt()
{
des = new DESCryptoServiceProvider();
}
#region "propertys"
/**/
/// <summary>
/// 设置加密密钥
/// </summary>
public string EncryptKey
{
get { return "kesgf4zb"; }
set
{
this.key = value;
}
}
/**/
/// <summary>
/// 要加密字符的编码模式
/// </summary>
public Encoding EncodingMode
{
get { return this.encoding; }
set { this.encoding = value; }
}
#endregion
/**/
/// <summary>
/// 加密指定的文件,如果成功返回True,否则false
/// </summary>
/// <param name="filePath">要加密的文件路径</param>
/// <param name="outPath">加密后的文件输出路径</param>
public void EncryptFile2(string filePath, string outPath)
{
byte[] rgbKey = null;
byte[] rgbIV = new byte[] { 0x12, 0x44, 0x16, 0xee, 0x88, 0x15, 0xdd, 0x41 };
try
{
FileStream stream;

DES des = new DESCryptoServiceProvider(); ;

rgbKey = Encoding.UTF8.GetBytes((this.key.Length > 8) ? this.key.Substring(0, 8) : this.key);
stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(stream, this.EncodingMode);
// string dataStr = reader.ReadToEnd();
// byte[] toEncrypt = this.EncodingMode.GetBytes(dataStr);
byte[] buffer3 = new byte[600];
int num3 = stream.Read(buffer3, 0, buffer3.Length);
stream.Close();

FileStream stream2 = new FileStream(outPath, FileMode.OpenOrCreate, FileAccess.Write);

CryptoStream stream3 = new CryptoStream(stream2, des.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);

//stream3.Write(toEncrypt, 0, toEncrypt.Length);
stream3.Write(buffer3, 0, num3);
stream3.FlushFinalBlock();
stream3.Close();
stream2.Close();

}
catch (Exception exception)
{
throw new FileNotFoundException("没有找到指定的文件");
}
}
}


新建并且配置license.xml文件位于根目录,内容如下:

<!--test-->
<registration productID="CMS">
<computer>
<domain>www.baidu.com</domain>
<macAddress></macAddress>
<processorID></processorID>
<columnSerialNumber></columnSerialNumber>
</computer>
<company>
<isOEM>false</isOEM>
<companyName></companyName>
<companyUrl></companyUrl>
<productName></productName>
<productUrl></productUrl>
</company>
<product>
<owner></owner>
<productUser>All</productUser>
<modules></modules>
<maxSiteNumber>0</maxSiteNumber>
<expirationDate>2009-3-10</expirationDate>
</product>
</registration>


说明:

domain 授权域名或IP

macAddress 网卡地址

然后执行生成:

protected void Button1_Click(object sender, EventArgs e)
{
string path = HttpContext.Current.Server.MapPath("~/") + "license.xml";
string outpath = HttpContext.Current.Server.MapPath("~/") + "license.lic";
DESEncrypt dese = new DESEncrypt();
dese.EncryptFile2(path, outpath);
Response.Write("<a href='license.lic'>证书生成成功!</a>");

}


会生成license.lic证书文件,覆盖原有证书文件即可。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: