吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 8107|回复: 30
收起左侧

[其他转载] NET反编译出来的C#关键代码

[复制链接]
molinchz 发表于 2014-1-27 23:25
破解 一个程序 反编译出来的关键代码 ,但看不懂代码 中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[Strings.Len(text) + 1];
                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[num3] = Strings.Mid(text, num3 + 1, 1);
                        num3++;
                }
                flag = (Operators.CompareString(this.arrLicenseCode[0], array2[8], false) == 0 & Operators.CompareString(this.arrLicenseCode[1], this.MACtoSecret(array2[0]), false) == 0 & Operators.CompareString(this.arrLicenseCode[2], this.MACtoSecret(array2[1]), false) == 0 & Operators.CompareString(this.arrLicenseCode[3], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[4], this.MACtoSecret(array2[2]), false) == 0 & Operators.CompareString(this.arrLicenseCode[5], array2[9], false) == 0 & Operators.CompareString(this.arrLicenseCode[6], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[7], this.MACtoSecret(array2[3]), false) == 0 & Operators.CompareString(this.arrLicenseCode[8], this.MACtoSecret(array2[4]), false) == 0 & Operators.CompareString(this.arrLicenseCode[9], array2[10], false) == 0 & Operators.CompareString(this.arrLicenseCode[10], this.MACtoSecret(array2[5]), false) == 0 & Operators.CompareString(this.arrLicenseCode[11], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[12], this.MACtoSecret(array2[6]), false) == 0 & Operators.CompareString(this.arrLicenseCode[13], array2[11], false) == 0 & Operators.CompareString(this.arrLicenseCode[14], this.MACtoSecret(array2[7]), 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");
                }
        }
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

我是用户 发表于 2014-1-27 23:28
敢换个背景色吗?
吾爱-路人甲 发表于 2014-1-27 23:30
yunming 发表于 2014-1-27 23:32
1354669803 发表于 2014-1-27 23:42
依然看不懂是什么
wqnmlgb 发表于 2014-1-27 23:45
程序哪来 我给你秒做一个注册机
zjs 发表于 2014-1-28 01:17
前两句摘取MSDN,其他注释自己分析哈。新手见谅!
[C#] 纯文本查看 复制代码
 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地址的。
 楼主| molinchz 发表于 2014-1-28 08:58
zjs 发表于 2014-1-28 01:17
前两句摘取MSDN,其他注释自己分析哈。新手见谅!
[mw_shl_code=csharp,true] NetworkInterface[] al ...

那这么说不是注册算法啊,麻烦 了!!!!
 楼主| molinchz 发表于 2014-1-28 08:59
wqnmlgb 发表于 2014-1-27 23:45
程序哪来 我给你秒做一个注册机

http://pan.baidu.com/s/1jG9LjlO   软件 在这里,谢谢了!!!!
 楼主| molinchz 发表于 2014-1-28 09:09
大家 看一下:
查找   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[i];
                        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[Strings.Len(text) + 1];
                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[num3] = Strings.Mid(text, num3 + 1, 1);
                        num3++;
                }
                flag = (Operators.CompareString(this.arrLicenseCode[0], array2[8], false) == 0 & Operators.CompareString(this.arrLicenseCode[1], this.MACtoSecret(array2[0]), false) == 0 & Operators.CompareString(this.arrLicenseCode[2], this.MACtoSecret(array2[1]), false) == 0 & Operators.CompareString(this.arrLicenseCode[3], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[4], this.MACtoSecret(array2[2]), false) == 0 & Operators.CompareString(this.arrLicenseCode[5], array2[9], false) == 0 & Operators.CompareString(this.arrLicenseCode[6], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[7], this.MACtoSecret(array2[3]), false) == 0 & Operators.CompareString(this.arrLicenseCode[8], this.MACtoSecret(array2[4]), false) == 0 & Operators.CompareString(this.arrLicenseCode[9], array2[10], false) == 0 & Operators.CompareString(this.arrLicenseCode[10], this.MACtoSecret(array2[5]), false) == 0 & Operators.CompareString(this.arrLicenseCode[11], "-", false) == 0 & Operators.CompareString(this.arrLicenseCode[12], this.MACtoSecret(array2[6]), false) == 0 & Operators.CompareString(this.arrLicenseCode[13], array2[11], false) == 0 & Operators.CompareString(this.arrLicenseCode[14], this.MACtoSecret(array2[7]), 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;
        }
}
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-16 02:51

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表