钢牙妹 发表于 2021-6-6 22:40

.net追码分析求助

本帖最后由 钢牙妹 于 2021-6-6 22:43 编辑

一款.net的DLL.不能动态调式,只能静态分析,关键代码如下,按道理应该是读取注册码跟真码对比然后 怎么怎么样吗?这段这几个参数得出的码都试过了都不对,。哪位大侠给解答一下呀

private void LicenseVerify()
                {
                        int year = this.Function("Convert.ToInt32", "2000");
                        int month = this.Function("Convert.ToInt32", "1");
                        int day = this.Function("Convert.ToInt32", "1");
                        DateTime d = new DateTime(year, month, day);
                        x_Const.Today = (DateTime.Today - d).Days;
                        if (x_Const.Today < this.fld_pluginDate)
                        {
                                return;
                        }
                        List<string> list = new List<string>();
                        bool flag = false;
                        if (!File.Exists(x_Const.LicenseFile))
                        {
                                RegistryKey registryKey = Registry.CurrentUser.CreateSubKey(this.fld_regDir);
                                string text = Convert.ToString(registryKey.GetValue(this.fld_Key));
                                if (text == string.Empty)
                                {
                                        int arg = x_Const.Today + x_Const.FreeDays;
                                        text = string.Concat(new string[]
                                        {
                                                this.SubKey(x_Const.HDD_id),
                                                "#",
                                                this.Function("ToString", arg),
                                                "#",
                                                this.Function("ToString", x_Const.Today),
                                                "#1#",
                                                x_Const.FreeDays.ToString(),
                                                "#012#1#"
                                        });
                                        text = this.CheckSumm(text) + "#" + text;
                                        text = this.Crypt(text, x_Const.HDD_id, this.Function("Convert.ToInt32", "0"));
                                }
                                list.Add(text);
                        }
                        else
                        {
                                StreamReader streamReader = new StreamReader(x_Const.LicenseFile);
                                flag = true;
                                while (!streamReader.EndOfStream)
                                {
                                        list.Add(streamReader.ReadLine());
                                }
                                streamReader.Close();
                        }
                        int num = 0;
                        int num2 = 0;
                        int num3 = 0;
                        int num4 = 0;
                        string text2 = "";
                        int num5 = 0;
                        string value = "#";
                        string text3 = "";
                        for (int i = 0; i < list.Count; i++)
                        {
                                int num6 = list.IndexOf("+");
                                string text4 = list;
                                if (num6 > 0)
                                {
                                        text3 = text4.Substring(num6 + 1);
                                        text4 = text4.Substring(0, num6);
                                }
                                int num7 = this.Function("Convert.ToInt32", "1");
                                num7 = this.Function("minus", i, num7);
                                text4 = this.Crypt(text4, x_Const.HDD_id, num7);
                                int num8 = text4.IndexOf(value);
                                string a = text4.Substring(0, num8);
                                string text5 = text4.Substring(num8 + 1);
                                if (!(a != this.CheckSumm(text5)))
                                {
                                        num8 = text5.IndexOf(value);
                                        string a2 = text5.Substring(0, num8);
                                        if (!(a2 != this.SubKey(x_Const.HDD_id)))
                                        {
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                string arg2 = text5.Substring(0, num8);
                                                num2 = this.Function("Convert.ToInt32", arg2);
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                arg2 = text5.Substring(0, num8);
                                                num3 = this.Function("Convert.ToInt32", arg2);
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                arg2 = text5.Substring(0, num8);
                                                x_Const.WorkedDay = this.Function("Convert.ToInt32", arg2);
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                arg2 = text5.Substring(0, num8);
                                                num4 = this.Function("Convert.ToInt32", arg2);
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                text2 = text5.Substring(0, num8);
                                                text5 = text5.Substring(num8 + 1);
                                                num8 = text5.IndexOf(value);
                                                arg2 = text5.Substring(0, num8);
                                                num5 = this.Function("Convert.ToInt32", arg2);
                                                num = i;
                                                break;
                                        }
                                }
                        }
                        if (flag && text3 == "")
                        {
                                x_Debug.ShowMessage("Используется старая версия лицензии, необходимо установить новую.\nПо всем вопросам Вы всегда можите обратиться к разработчику office@xplugins.com");
                                return;
                        }
                        if (x_Const.Today != num3)
                        {
                                int num9 = this.Function("plus", x_Const.Today, num3);
                                num9 = this.Function("abs", num9, num4);
                                x_Const.WorkedDay = this.Function("minus", x_Const.WorkedDay, num9);
                        }
                        if (num5 == this.Function("Convert.ToInt32", "0"))
                        {
                                x_Const.WorkedDay = this.Function("shiftL", num4, num3);
                        }
                        if (num2 < x_Const.Today)
                        {
                                x_Const.WorkedDay = this.Function("shiftL", num4, x_Const.WorkedDay);
                        }
                        if (num2 < this.fld_pluginDate)
                        {
                                x_Const.WorkedDay = this.Function("shiftL", num4, x_Const.Today);
                        }
                        if (this.Function("Convert.ToInt32", "0") < x_Const.WorkedDay && x_Const.WorkedDay < num4)
                        {
                                x_Const.LicenseVerified = this.Function("Convert.ToInt32", "1");
                        }
                        else
                        {
                                x_Const.WorkedDay = this.Function("abs", num4, x_Const.Today);
                                num5 = this.Function("Convert.ToInt32", "0");
                        }
                        text3 = x_ConstByte.LicenseVerify(text3);
                        list = string.Concat(new string[]
                        {
                                this.SubKey(x_Const.HDD_id),
                                "#",
                                this.Function("ToString", num2),
                                "#",
                                this.Function("ToString", x_Const.Today),
                                "#",
                                this.Function("ToString", x_Const.WorkedDay),
                                "#",
                                this.Function("ToString", num4),
                                "#",
                                text2,
                                "#",
                                this.Function("ToString", num5),
                                "#"
                        });
                        list = this.CheckSumm(list) + "#" + list;
                        list = this.Crypt(list, x_Const.HDD_id, this.Function("Convert.ToInt32", "0"));
                        if (!File.Exists(x_Const.LicenseFile))
                        {
                                RegistryKey registryKey2 = Registry.CurrentUser.CreateSubKey(this.fld_regDir);
                                registryKey2.SetValue(this.fld_Key, list);
                        }
                        else
                        {
                                StreamWriter streamWriter = new StreamWriter(x_Const.LicenseFile);
                                List<string> list2;
                                int index;
                                (list2 = list) = list2 + "+" + text3;
                                foreach (string value2 in list)
                                {
                                        streamWriter.WriteLine(value2);
                                }
                                streamWriter.Close();
                        }
                        x_Const.DaysLeft = this.Function("plus", num4, x_Const.WorkedDay);
                        if (x_Const.DaysLeft < 0)
                        {
                                x_Const.DaysLeft = 0;
                        }
                }

链接: https://pan.baidu.com/s/1h2zVK4pjvfE9QcqhnFRwjA 提取码: e3bv

钢牙妹 发表于 2021-6-7 21:22

xia先生 发表于 2021-6-7 00:00
走RMB区吧。难度比你想的高

那就算了,不是不想花钱,发出来本就是想学习讨论,并不是为了逆向这个软件,{:5_116:}
页: [1]
查看完整版本: .net追码分析求助