我没破解过.net程序,最近正在学习这方面也找了好多资料,但还是不太明白请高手多多指教!谢谢!!
注册部分:
private void button1_Click(object sender, EventArgs e)
{
if (this.regist_code.Text.ToString() == this.Encrypt(this.cpu_id.Text.ToString())) //不知道这个Encrypt 在干什么、而.ToString哪个是不是转换为十六进制?
{
if (this.RegCDRomSn(this.regist_code.Text.ToString()))
{
MessageBox.Show("注册成功");
}
else
{
MessageBox.Show("注册失败,请检查是否您的注册表被写保护,或者防病毒软件开启了注册表保护功能");
}
}
else
{
MessageBox.Show("注册码不正确,请查看是否输入正确");
}
}
=======================================================================
Encrypt部分:
protected string Encrypt(string pToEncrypt)
{
string str;
byte[] buffer = new byte[] { 0x19, 0x17, 0x18, 0x19, 0x17, 0x11, 0x15, 0x18 };
byte[] buffer2 = new byte[] { 0x17, 0x19, 0x18, 0x16, 0x17, 0x11, 0x15, 0x18 };
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
try
{
byte[] bytes = Encoding.Unicode.GetBytes(pToEncrypt);
provider.Key = buffer;
provider.IV = buffer2;
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream, provider.CreateEncryptor(), CryptoStreamMode.Write);
stream2.Write(bytes, 0, bytes.Length);
stream2.FlushFinalBlock();
StringBuilder builder = new StringBuilder();
foreach (byte num in stream.ToArray())
{
builder.AppendFormat("{0:X2}", num);
}
builder.ToString();
str = builder.ToString();
}
catch
{
str = pToEncrypt;
}
finally
{
provider = null;
}
return str;
}
==============================================================
RegCDRomSn部分:
public bool RegCDRomSn(string sn)
{
try
{
Registry.LocalMachine.OpenSubKey("Software", true).CreateSubKey("jokemaster").SetValue("jokemaster", sn);
return true;
}
catch
{
return false;
}
}
=================================================================
机器码:BFEBFBFF00000F29
请高手帮分析一下我把这三关键部分都帖上来了!!
谢谢!!!
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)