吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1699|回复: 13
收起左侧

[新手问题] .net login代码求解

[复制链接]
sunqv 发表于 2021-1-10 10:32
小弟刚刚接触.NET 破解,求大神帮忙看下这段代码,dnspy没找到   判断登录注册的过程。。。  不胜感激

using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;
using Microsoft.Win32;

namespace 地下管线
{
        // Token: 0x02000002 RID: 2
        public class login : Form
        {
                // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
                public login()
                {
                        this.InitializeComponent();
                }

                // Token: 0x06000003 RID: 3 RVA: 0x00002278 File Offset: 0x00000478
                protected override void Dispose(bool disposing)
                {
                        if (disposing && this.components != null)
                        {
                                this.components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                // Token: 0x06000004 RID: 4 RVA: 0x000022B0 File Offset: 0x000004B0
                private void InitializeComponent()
                {
                        base.SuspendLayout();
                        base.AutoScaleDimensions = new SizeF(6f, 12f);
                        base.AutoScaleMode = AutoScaleMode.Font;
                        base.ClientSize = new Size(650, 262);
                        base.MaximizeBox = false;
                        base.MinimizeBox = false;
                        base.Name = "login";
                        base.ShowInTaskbar = false;
                        base.StartPosition = FormStartPosition.CenterScreen;
                        base.Load += new EventHandler(this.login_Load);
                        base.ResumeLayout(false);
                }

                // Token: 0x06000002 RID: 2 RVA: 0x0000206C File Offset: 0x0000026C
                private void login_Load(object sender, EventArgs e)
                {
                        string currentDirectory = Environment.CurrentDirectory;
                        RegistryKey currentUser = Registry.CurrentUser;
                        RegistryKey registryKey = currentUser.OpenSubKey("SOFTWARE", true);
                        RegistryKey registryKey2 = registryKey.OpenSubKey("Autodesk", true);
                        RegistryKey registryKey3 = registryKey2.OpenSubKey("AutoCAD", true);
                        RegistryKey registryKey4 = registryKey3.OpenSubKey("R17.1", true);
                        RegistryKey registryKey5 = registryKey4.OpenSubKey("ACAD-6001:409", true);
                        RegistryKey registryKey6 = registryKey5.OpenSubKey("Applications", true);
                        RegistryKey registryKey7 = registryKey5.OpenSubKey("Profiles", true);
                        RegistryKey registryKey8 = registryKey7.OpenSubKey("<<Unnamed Profile>>", true);
                        RegistryKey registryKey9 = registryKey8.OpenSubKey("General", true);
                        string text = registryKey9.GetValue("ACAD").ToString();
                        text = currentDirectory + ";" + text;
                        registryKey9.SetValue("ACAD", text);
                        RegistryKey registryKey10 = registryKey6.CreateSubKey("MXCAD");
                        registryKey10.SetValue("LOADCTRLS", 2);
                        registryKey10.SetValue("LOADER", currentDirectory + "\\dataprocess.dll");
                        registryKey10.SetValue("MANAGED", 1);
                        this.BackgroundImage = Image.FromFile(Application.StartupPath + "\\image\\WELCOME.JPEG");
                        base.FormBorderStyle = FormBorderStyle.None;
                        AcadApplication acadApplication = (AcadApplication)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("28B7AA99-C0F9-4C47-995E-8A8D729603A1")));
                        AcadApplication acadApplication2 = acadApplication;
                        int hWND = acadApplication2.HWND;
                        WinApi.SetWindowTextA(hWND, "系统");
                        hWND = acadApplication2.HWND;
                        string path = acadApplication2.Path;
                        string startupPath = Application.StartupPath;
                        string text2 = string.Format("{0}//image//WELCOME.ico", startupPath);
                        if (File.Exists(text2))
                        {
                                int num = WinApi.LoadImageA(0, text2, 1, 16, 16, 16);
                                if (num != 0)
                                {
                                        WinApi.SendMessage(hWND, 128, 0, num);
                                }
                        }
                        acadApplication.WindowState = AcWindowState.acMax;
                        AcadDocument activeDocument = acadApplication.ActiveDocument;
                        activeDocument.WindowState = AcWindowState.acMax;
                        AcadModelSpace modelSpace = activeDocument.ModelSpace;
                        acadApplication.Visible = true;
                        base.Close();
                }

                // Token: 0x04000001 RID: 1
                private IContainer components = null;
        }
}

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

 楼主| sunqv 发表于 2021-1-10 20:42
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.Win32;

namespace DataProcess
{
        // Token: 0x02000019 RID: 25
        public class FrmReg : Form
        {
                // Token: 0x0600009E RID: 158 RVA: 0x0001A7C7 File Offset: 0x000189C7
                public FrmReg()
                {
                        this.InitializeComponent();
                }

                // Token: 0x060000A1 RID: 161 RVA: 0x0001A8E0 File Offset: 0x00018AE0
                private void btnClose_Click(object sender, EventArgs e)
                {
                        Application.Exit();
                }

                // Token: 0x060000A0 RID: 160 RVA: 0x0001A808 File Offset: 0x00018A08
                private void btnReg_Click(object sender, EventArgs e)
                {
                        try
                        {
                                if (this.textRegNum.Text == this.softReg.GetRNum())
                                {
                                        RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software", true).CreateSubKey("wxf").CreateSubKey("wxf.INI").CreateSubKey(this.textRegNum.Text);
                                        registryKey.SetValue("UserName", "Rsoft");
                                        MessageBox.Show("注册成功!重启软件后生效!", "信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                        base.Close();
                                }
                                else
                                {
                                        MessageBox.Show("注册码错误!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                        this.textRegNum.SelectAll();
                                }
                        }
                        catch (Exception ex)
                        {
                                throw new Exception(ex.Message);
                        }
                }

                // Token: 0x0600009C RID: 156 RVA: 0x0001A3BC File Offset: 0x000185BC
                protected override void Dispose(bool disposing)
                {
                        if (disposing && this.components != null)
                        {
                                this.components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                // Token: 0x060000A2 RID: 162 RVA: 0x0001A8E9 File Offset: 0x00018AE9
                private void FrmReg_FormClosed(object sender, FormClosedEventArgs e)
                {
                        Application.Exit();
                }

                // Token: 0x0600009F RID: 159 RVA: 0x0001A7EB File Offset: 0x000189EB
                private void FrmReg_Load(object sender, EventArgs e)
                {
                        this.textSerialNum.Text = this.softReg.GetMNum();
                }

                // Token: 0x0600009D RID: 157 RVA: 0x0001A3F4 File Offset: 0x000185F4
                private void InitializeComponent()
                {
                        this.label1 = new Label();
                        this.label2 = new Label();
                        this.textSerialNum = new TextBox();
                        this.textRegNum = new TextBox();
                        this.btnReg = new Button();
                        this.btnClose = new Button();
                        base.SuspendLayout();
                        this.label1.AutoSize = true;
                        this.label1.Location = new Point(13, 27);
                        this.label1.Name = "label1";
                        this.label1.Size = new Size(53, 12);
                        this.label1.TabIndex = 0;
                        this.label1.Text = "序列号:";
                        this.label2.AutoSize = true;
                        this.label2.Location = new Point(13, 67);
                        this.label2.Name = "label2";
                        this.label2.Size = new Size(53, 12);
                        this.label2.TabIndex = 1;
                        this.label2.Text = "注册码:";
                        this.textSerialNum.Location = new Point(61, 27);
                        this.textSerialNum.Name = "textSerialNum";
                        this.textSerialNum.Size = new Size(283, 21);
                        this.textSerialNum.TabIndex = 2;
                        this.textRegNum.Location = new Point(61, 67);
                        this.textRegNum.Multiline = true;
                        this.textRegNum.Name = "textRegNum";
                        this.textRegNum.Size = new Size(283, 107);
                        this.textRegNum.TabIndex = 3;
                        this.btnReg.Location = new Point(178, 199);
                        this.btnReg.Name = "btnReg";
                        this.btnReg.Size = new Size(75, 23);
                        this.btnReg.TabIndex = 4;
                        this.btnReg.Text = "注册";
                        this.btnReg.UseVisualStyleBackColor = true;
                        this.btnReg.Click += new EventHandler(this.btnReg_Click);
                        this.btnClose.Location = new Point(269, 199);
                        this.btnClose.Name = "btnClose";
                        this.btnClose.Size = new Size(75, 23);
                        this.btnClose.TabIndex = 5;
                        this.btnClose.Text = "关闭";
                        this.btnClose.UseVisualStyleBackColor = true;
                        this.btnClose.Click += new EventHandler(this.btnClose_Click);
                        base.AutoScaleDimensions = new SizeF(6f, 12f);
                        base.AutoScaleMode = AutoScaleMode.Font;
                        base.ClientSize = new Size(356, 239);
                        base.Controls.Add(this.btnClose);
                        base.Controls.Add(this.btnReg);
                        base.Controls.Add(this.textRegNum);
                        base.Controls.Add(this.textSerialNum);
                        base.Controls.Add(this.label2);
                        base.Controls.Add(this.label1);
                        base.MaximizeBox = false;
                        base.MinimizeBox = false;
                        base.Name = "FrmReg";
                        base.StartPosition = FormStartPosition.CenterScreen;
                        this.Text = "注册";
                        base.FormClosed += new FormClosedEventHandler(this.FrmReg_FormClosed);
                        base.Load += new EventHandler(this.FrmReg_Load);
                        base.ResumeLayout(false);
                        base.PerformLayout();
                }

                // Token: 0x0400010B RID: 267
                private Button btnClose;

                // Token: 0x0400010A RID: 266
                private Button btnReg;

                // Token: 0x04000105 RID: 261
                private IContainer components = null;

                // Token: 0x04000106 RID: 262
                private Label label1;

                // Token: 0x04000107 RID: 263
                private Label label2;

                // Token: 0x0400010C RID: 268
                private SoftReg softReg = new SoftReg();

                // Token: 0x04000109 RID: 265
                private TextBox textRegNum;

                // Token: 0x04000108 RID: 264
                private TextBox textSerialNum;
        }
}
 楼主| sunqv 发表于 2021-1-10 20:48
using System;
using System.Management;

namespace DataProcess
{
        // Token: 0x0200000C RID: 12
        internal class SoftReg
        {
                // Token: 0x06000054 RID: 84 RVA: 0x0000D22C File Offset: 0x0000B42C
                private string GetCpu()
                {
                        string result = null;
                        ManagementClass managementClass = new ManagementClass("win32_Processor");
                        ManagementObjectCollection instances = managementClass.GetInstances();
                        using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
                        {
                                while (enumerator.MoveNext())
                                {
                                        ManagementObject managementObject = (ManagementObject)enumerator.Current;
                                        result = managementObject.Properties["Processorid"].Value.ToString();
                                }
                        }
                        return result;
                }

                // Token: 0x06000053 RID: 83 RVA: 0x0000D1EC File Offset: 0x0000B3EC
                private string GetDiskVolumeSerialNumber()
                {
                        ManagementClass managementClass = new ManagementClass("win32_NetworkAdapterConfiguration");
                        ManagementObject managementObject = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
                        managementObject.Get();
                        return managementObject.GetPropertyValue("VolumeSerialNumber").ToString();
                }

                // Token: 0x06000055 RID: 85 RVA: 0x0000D2C0 File Offset: 0x0000B4C0
                public string GetMNum()
                {
                        string text = this.GetCpu() + this.GetDiskVolumeSerialNumber();
                        return text.Substring(0, 24);
                }

                // Token: 0x06000057 RID: 87 RVA: 0x0000D324 File Offset: 0x0000B524
                public string GetRNum()
                {
                        this.SetIntCode();
                        string mNum = this.GetMNum();
                        for (int i = 1; i < this.charCode.Length; i++)
                        {
                                this.charCode[i] = Convert.ToChar(mNum.Substring(i - 1, 1));
                        }
                        for (int j = 1; j < this.intNumber.Length; j++)
                        {
                                this.intNumber[j] = Convert.ToInt32(this.charCode[j]) + this.intCode[Convert.ToInt32(this.charCode[j])];
                        }
                        string text = "";
                        for (int k = 1; k < this.intNumber.Length; k++)
                        {
                                if ((this.intNumber[k] >= 48 && this.intNumber[k] <= 57) || (this.intNumber[k] >= 65 && this.intNumber[k] <= 90) || (this.intNumber[k] >= 97 && this.intNumber[k] <= 122))
                                {
                                        text += Convert.ToChar(this.intNumber[k]).ToString();
                                }
                                else if (this.intNumber[k] > 122)
                                {
                                        text += Convert.ToChar(this.intNumber[k] - 10).ToString();
                                }
                                else
                                {
                                        text += Convert.ToChar(this.intNumber[k] - 9).ToString();
                                }
                        }
                        return text.Replace("1", "X").Replace("2", "Y").Replace("3", "Z");
                }

                // Token: 0x06000056 RID: 86 RVA: 0x0000D2F0 File Offset: 0x0000B4F0
                private void SetIntCode()
                {
                        for (int i = 1; i < this.intCode.Length; i++)
                        {
                                this.intCode[i] = i % 9;
                        }
                }

                // Token: 0x0400009A RID: 154
                public char[] charCode = new char[25];

                // Token: 0x04000099 RID: 153
                public int[] intCode = new int[127];

                // Token: 0x0400009B RID: 155
                public int[] intNumber = new int[25];
        }
}
 楼主| sunqv 发表于 2021-1-10 10:35
// C:\Users\Administrator\Desktop\DATAPROCESS\DataProcess.dll
// DataProcess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null


using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.Runtime;
using DataProcess;

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: CommandClass(typeof(DataProcess))]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCopyright("Copyright &#169;  2016")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyProduct("CADDataProcess")]
[assembly: AssemblyTitle("CADDataProcess")]
[assembly: AssemblyTrademark("")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: ComVisible(false)]
[assembly: Guid("95361a87-8112-41e8-a60f-067b89eac71a")]
ps122 发表于 2021-1-10 11:30
啥都没有,看不出来
zero呆 发表于 2021-1-10 11:41
窗体加载的时候 读了一堆注册表信息 然后 重新打开了一个窗口 估计这个就是真正的登录窗口吧
AcadApplication acadApplication = (AcadApplication)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("28B7AA99-C0F9-4C47-995E-8A8D729603A1")));
ps122 发表于 2021-1-10 11:49
zero呆 发表于 2021-1-10 11:41
窗体加载的时候 读了一堆注册表信息 然后 重新打开了一个窗口 估计这个就是真正的登录窗口吧
AcadApplicat ...

这个不是打开cad么
万神fake 发表于 2021-1-10 13:17
没有什么关键信息,不是在这里
 楼主| sunqv 发表于 2021-1-10 15:29
dnspy调试的一般步骤操作怎么操作?
 楼主| sunqv 发表于 2021-1-10 20:33
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.Win32;

namespace DataProcess
{
        // Token: 0x02000019 RID: 25
        public class FrmReg : Form
        {
                // Token: 0x0600009E RID: 158 RVA: 0x0001A7C7 File Offset: 0x000189C7
                public FrmReg()
                {
                        this.InitializeComponent();
                }

                // Token: 0x060000A1 RID: 161 RVA: 0x0001A8E0 File Offset: 0x00018AE0
                private void btnClose_Click(object sender, EventArgs e)
                {
                        Application.Exit();
                }

                // Token: 0x060000A0 RID: 160 RVA: 0x0001A808 File Offset: 0x00018A08
                private void btnReg_Click(object sender, EventArgs e)
                {
                        try
                        {
                                if (this.textRegNum.Text == this.softReg.GetRNum())
                                {
                                        RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software", true).CreateSubKey("wxf").CreateSubKey("wxf.INI").CreateSubKey(this.textRegNum.Text);
                                        registryKey.SetValue("UserName", "Rsoft");
                                        MessageBox.Show("注册成功!重启软件后生效!", "信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                        base.Close();
                                }
                                else
                                {
                                        MessageBox.Show("注册码错误!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                        this.textRegNum.SelectAll();
                                }
                        }
                        catch (Exception ex)
                        {
                                throw new Exception(ex.Message);
                        }
                }

                // Token: 0x0600009C RID: 156 RVA: 0x0001A3BC File Offset: 0x000185BC
                protected override void Dispose(bool disposing)
                {
                        if (disposing && this.components != null)
                        {
                                this.components.Dispose();
                        }
                        base.Dispose(disposing);
       
 楼主| sunqv 发表于 2021-1-10 20:34
找到这一步了   在进去哪里看他的算法啊?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

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

GMT+8, 2024-6-1 07:35

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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