NET反编译出来的C#关键代码
破解 一个程序 反编译出来的关键代码 ,但看不懂代码 中flag这个是怎样判断 的,求解答下,先谢了。原贴是这里http://www.52pojie.cn/thread-234462-4-1.html
。
iLspy_Master_2.0.0反编译器
// Schematic_Symbol_Wizard.frmSplashScreen
public void funGetMacAddress()
{
NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
int num = 0;
string text = null;
NetworkInterface[] array = allNetworkInterfaces;
checked
{
bool flag;
for (int i = 0; i < array.Length; i++)
{
NetworkInterface networkInterface = array;
num++;
flag = (num == 1);
if (flag)
{
text = networkInterface.GetPhysicalAddress().ToString();
}
}
this.txtUser.Text = "SN# " + Strings.Replace(Strings.Format(DateAndTime.Now, "Ryy-MMEdd"), "0", "Z", 1, -1, CompareMethod.Binary) + " is licensed to:\r\n";
this.txtUser.Text = this.txtUser.Text + "Computer Name: " + MyProject.Computer.Name + "\r\n";
this.txtUser.Text = this.txtUser.Text + "User Name: " + this.GetUserName() + "\r\n";
this.txtUser.Text = this.txtUser.Text + "Host ID:" + text + "\r\n";
string[] array2 = new string;
int arg_128_0 = 0;
int num2 = Strings.Len(text);
int num3 = arg_128_0;
while (true)
{
int arg_145_0 = num3;
int num4 = num2;
if (arg_145_0 > num4)
{
break;
}
array2 = Strings.Mid(text, num3 + 1, 1);
num3++;
}
flag = (Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0);
if (flag)
{
this.lblStatus1.ForeColor = Color.DarkGreen;
this.lblStatus1.Text = "Status: Registered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Green;
}
else
{
this.lblStatus1.ForeColor = Color.DarkRed;
this.lblStatus1.Text = "Status: Unregistered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Red;
this.EvalPeriod();
Interaction.MsgBox("Product ID not found, running in demo mode.\r", MsgBoxStyle.Critical, "Software registration");
}
}
}
敢换个背景色吗? 绿色背景看的好辛苦啊 绿色背景挺好的啊 依然看不懂是什么
程序哪来 我给你秒做一个注册机 前两句摘取MSDN,其他注释自己分析哈。新手见谅!:$qqq
NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();//返回描述本地计算机上的网络接口的对象。//包含描述可用网络接口的对象的 NetworkInterface 数组,如果没有检测到接口,则为空数组。
int num = 0;
string text = null;
NetworkInterface[] array = allNetworkInterfaces;
checked//开始检测
{
bool flag;
for (int i = 0; i < array.Length; i++)
{
NetworkInterface networkInterface = array;//可能是多个对象或者一个也没有
num++;
flag = (num == 1);//如果num等于1真,反之为假
if (flag)
{
text = networkInterface.GetPhysicalAddress().ToString();//获取MAC物理地址。
}
}
}
简单说flag用来获取MAC地址的。 zjs 发表于 2014-1-28 01:17 static/image/common/back.gif
前两句摘取MSDN,其他注释自己分析哈。新手见谅!
NetworkInterface[] al ...
那这么说不是注册算法啊,麻烦 了!!!!
wqnmlgb 发表于 2014-1-27 23:45 static/image/common/back.gif
程序哪来 我给你秒做一个注册机
http://pan.baidu.com/s/1jG9LjlO 软件 在这里,谢谢了!!!!
大家 看一下:
查找 Status: Unregistered找到以下关键反编译代码
// Schematic_Symbol_Wizard.frmSplashScreen
private bool EvalPeriod()
{
DateTime now = DateAndTime.Now;
DateTime date = Conversions.ToDate("7/26/2012");
checked
{
int num = (int)DateAndTime.DateDiff(DateInterval.Day, date, now, FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1);
bool flag = num >= 0 & num <= 10;
bool result;
if (flag)
{
this.lblStatus1.ForeColor = Color.DarkBlue;
this.lblStatus1.Text = "Status: 21 Day Trial";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Blue;
Interaction.MsgBox("Evaluation Period: " + Conversions.ToString(21 - num) + " Days Remaining.\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Information, "Evaluation Period");
result = true;
}
else
{
flag = (num > 10 & num <= 21);
if (flag)
{
Interaction.Beep();
this.lblStatus1.ForeColor = Color.DarkBlue;
this.lblStatus1.Text = "Status: 21 Day Trial";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Blue;
Interaction.MsgBox("Reminder Period: " + Conversions.ToString(21 - num) + " Days Remaining,\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Question, "Reminder Period");
result = true;
}
else
{
Interaction.Beep();
this.lblStatus1.ForeColor = Color.DarkRed;
this.lblStatus1.Text = "Status: Unregistered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Red;
Interaction.MsgBox("Evaluation period has expired, output limited to 6 pins symbol\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Critical, "Limited Output.");
result = false;
}
}
return result;
}
}
iLspy_Master_2.0.0反编译器
// Schematic_Symbol_Wizard.frmSplashScreen
public void funGetMacAddress()
{
NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
int num = 0;
string text = null;
NetworkInterface[] array = allNetworkInterfaces;
checked
{
bool flag;
for (int i = 0; i < array.Length; i++)
{
NetworkInterface networkInterface = array;
num++;
flag = (num == 1);
if (flag)
{
text = networkInterface.GetPhysicalAddress().ToString();
}
}
this.txtUser.Text = "SN# " + Strings.Replace(Strings.Format(DateAndTime.Now, "Ryy-MMEdd"), "0", "Z", 1, -1, CompareMethod.Binary) + " is licensed to:\r\n";
this.txtUser.Text = this.txtUser.Text + "Computer Name: " + MyProject.Computer.Name + "\r\n";
this.txtUser.Text = this.txtUser.Text + "User Name: " + this.GetUserName() + "\r\n";
this.txtUser.Text = this.txtUser.Text + "Host ID:" + text + "\r\n";
string[] array2 = new string;
int arg_128_0 = 0;
int num2 = Strings.Len(text);
int num3 = arg_128_0;
while (true)
{
int arg_145_0 = num3;
int num4 = num2;
if (arg_145_0 > num4)
{
break;
}
array2 = Strings.Mid(text, num3 + 1, 1);
num3++;
}
flag = (Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, "-", false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0 & Operators.CompareString(this.arrLicenseCode, array2, false) == 0 & Operators.CompareString(this.arrLicenseCode, this.MACtoSecret(array2), false) == 0);
if (flag)
{
this.lblStatus1.ForeColor = Color.DarkGreen;
this.lblStatus1.Text = "Status: Registered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Green;
}
else
{
this.lblStatus1.ForeColor = Color.DarkRed;
this.lblStatus1.Text = "Status: Unregistered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Red;
this.EvalPeriod();
Interaction.MsgBox("Product ID not found, running in demo mode.\r", MsgBoxStyle.Critical, "Software registration");
}
}
}
注册提示代码
Public Sub funGetMacAddress()
Dim allNetworkInterfaces As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces
Dim num As Integer = 0
Dim expression As String = Nothing
Dim interface2 As NetworkInterface
For Each interface2 In allNetworkInterfaces
num += 1
If (num = 1) Then
expression = interface2.GetPhysicalAddress.ToString
End If
Next
Me.txtUser.Text = ("SN# " & Strings.Replace(Strings.Format(DateAndTime.Now, "Ryy-MMEdd"), "0", "Z", 1, -1, CompareMethod.Binary) & " is licensed to:" & ChrW(13) & ChrW(10))
Me.txtUser.Text = (Me.txtUser.Text & "Computer Name: " & MyProject.Computer.Name & ChrW(13) & ChrW(10))
Me.txtUser.Text = (Me.txtUser.Text & "User Name: " & Me.GetUserName & ChrW(13) & ChrW(10))
Me.txtUser.Text = (Me.txtUser.Text & "Host ID:" & expression & ChrW(13) & ChrW(10))
Dim strArray As String() = New String((Strings.Len(expression) + 1)- 1) {}
Dim num4 As Integer = Strings.Len(expression)
Dim i As Integer = 0
Do While (i <= num4)
strArray(i) = Strings.Mid(expression, (i + 1), 1)
i += 1
Loop
If (((((((((((((((Me.arrLicenseCode(0) = strArray(8)) And (Me.arrLicenseCode(1) = Me.MACtoSecret(strArray(0)))) And (Me.arrLicenseCode(2) = Me.MACtoSecret(strArray(1)))) And (Me.arrLicenseCode(3) = "-")) And (Me.arrLicenseCode(4) = Me.MACtoSecret(strArray(2)))) And (Me.arrLicenseCode(5) = strArray(9))) And (Me.arrLicenseCode(6) = "-")) And (Me.arrLicenseCode(7) = Me.MACtoSecret(strArray(3)))) And (Me.arrLicenseCode(8) = Me.MACtoSecret(strArray(4)))) And (Me.arrLicenseCode(9) = strArray(10))) And (Me.arrLicenseCode(10) = Me.MACtoSecret(strArray(5)))) And (Me.arrLicenseCode(11) = "-")) And (Me.arrLicenseCode(12) = Me.MACtoSecret(strArray(6)))) And (Me.arrLicenseCode(13) = strArray(11))) And (Me.arrLicenseCode(14) = Me.MACtoSecret(strArray(7)))) Then
Me.lblStatus1.ForeColor = Color.DarkGreen
Me.lblStatus1.Text = "Status: Registered"
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Green
Else
Me.lblStatus1.ForeColor = Color.DarkRed
Me.lblStatus1.Text = "Status: Unregistered"
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Red
Me.EvalPeriod
Interaction.MsgBox("Product ID not found, running in demo mode." & ChrW(13), MsgBoxStyle.Critical, "Software registration")
End If
End Sub
// Schematic_Symbol_Wizard.frmSplashScreen
private void SplashScreen_Load(object sender, EventArgs e)
{
bool flag = Operators.CompareString(MyProject.Application.Info.Title, null, false) != 0;
string arg;
if (flag)
{
arg = MyProject.Application.Info.Title;
}
else
{
arg = Path.GetFileNameWithoutExtension(MyProject.Application.Info.AssemblyName);
}
this.Text = string.Format("About {0}", arg);
this.LabelProductName.Text = MyProject.Application.Info.ProductName;
this.LabelVersion.Text = string.Format("Version {0}", MyProject.Application.Info.Version.ToString());
this.LabelCopyright.Text = MyProject.Application.Info.Copyright;
this.LabelCompanyName.Text = MyProject.Application.Info.CompanyName;
this.TextBoxDescription.Text = MyProject.Application.Info.Description;
string text = "http://protocadeng.com/Symbol_Wizard.htm";
this.LinkLabel1.Links.Add(0, text.Length, text);
this.LinkLabel1.Text = "http://www.protocadeng.com";
this.ReadLicense();
this.funGetMacAddress();
flag = (Operators.CompareString(this.lblStatus1.Text, "Status: Unregistered", false) == 0);
if (flag)
{
this.EvalPeriod();
}
}
// Schematic_Symbol_Wizard.frmSplashScreen
private void btnCancel_Click(object sender, EventArgs e)
{
bool flag = Operators.CompareString(this.lblStatus1.Text, "Status: Unregistered", false) == 0;
if (flag)
{
this.EvalPeriod();
}
this.DialogResult = DialogResult.Cancel;
this.Close();
}
// Schematic_Symbol_Wizard.frmSplashScreen
private void btnOK_Click(object sender, EventArgs e)
{
this.WriteLicense();
this.ReadLicense();
this.funGetMacAddress();
bool flag = Operators.CompareString(this.lblStatus1.Text, "Status: Unregistered", false) == 0;
if (flag)
{
this.EvalPeriod();
}
}
// Schematic_Symbol_Wizard.frmSplashScreen
private bool EvalPeriod()
{
DateTime now = DateAndTime.Now;
DateTime date = Conversions.ToDate("7/26/2012");
checked
{
int num = (int)DateAndTime.DateDiff(DateInterval.Day, date, now, FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1);
bool flag = num >= 0 & num <= 10;
bool result;
if (flag)
{
this.lblStatus1.ForeColor = Color.DarkBlue;
this.lblStatus1.Text = "Status: 21 Day Trial";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Blue;
Interaction.MsgBox("Evaluation Period: " + Conversions.ToString(21 - num) + " Days Remaining.\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Information, "Evaluation Period");
result = true;
}
else
{
flag = (num > 10 & num <= 21);
if (flag)
{
Interaction.Beep();
this.lblStatus1.ForeColor = Color.DarkBlue;
this.lblStatus1.Text = "Status: 21 Day Trial";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Blue;
Interaction.MsgBox("Reminder Period: " + Conversions.ToString(21 - num) + " Days Remaining,\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Question, "Reminder Period");
result = true;
}
else
{
Interaction.Beep();
this.lblStatus1.ForeColor = Color.DarkRed;
this.lblStatus1.Text = "Status: Unregistered";
MyProject.Forms.frmSchematicSymbolWizard.lblStatus.BackColor = Color.Red;
Interaction.MsgBox("Evaluation period has expired, output limited to 6 pins symbol\r \rPlease register at: www.protocadeng.com", MsgBoxStyle.Critical, "Limited Output.");
result = false;
}
}
return result;
}
}