吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 14807|回复: 24
收起左侧

[.NET逆向] 【注册机制作】 某二手车发票管理系统

  [复制链接]
云在天 发表于 2018-1-29 16:48
本帖最后由 云在天 于 2019-6-7 13:10 编辑

前言:最近一直忙着弄MacOS上的一些东西,没怎么写Win程序,这次就先写一篇注册机的制作,Net程序,如果不加强壳,混淆,做一个注册机很容易,复制粘贴到IDE就搞定。
软件去看我原创区的帖子
【0x1】查壳
QQ截图20180129162431.jpg
这种不知道什么壳,De4又支持的就直接放到De4里脱一脱,是骡子是马拉出来溜达溜达。
PS:其实这个不脱也是可以看到的。
【0x2】反编译
De4搞完后,直接拖进Dnspy里
QQ截图20180129162750.jpg
结构很清楚,不过这个作者一会中文拼音,一会英文的,不纠结吗


我们先从类名入手,找有关注册【register/zhuce】的字段,如果这里能找到就恭喜你了,如果找不到就用搜索搜关键字吧。还好还好,找到了。看一下代码,找到关键部分,这里不截图了,直接放代码
1.注册窗体的加载
[C#] 纯文本查看 复制代码
private void Register_Load(object sender, EventArgs e)
                {
                        CUntily cuntily = new CUntily();
                        string[] departmentAndYXQ = cuntily.GetDepartmentAndYXQ();
                        if (cuntily.IsCorrentSearial())//这里判断是不是已经注册,如果注册就显示下面的已授权,如果没有就显示默认文本
                        {
                                this.RegisterInformation.Text = "本产品已授权给" + departmentAndYXQ[0] + ",授权截止日期为" + departmentAndYXQ[1];
                        }
                        ToolTip toolTip = new ToolTip();
                        toolTip.SetToolTip(this.ck_IDCard, "若没有购买此功能,请不要勾选。");
                }

2.点击注册按钮时的动作
[C#] 纯文本查看 复制代码
private void OK_Click(object sender, EventArgs e)
                {
                        string text = this.DepartName.Text.Trim();//企业名称
                        string text2 = this.XQDate.Text;//授权时间
                        string text3 = this.ck_IDCard.Checked ? "是" : "否";//身份证检测
                        DateTime dateTime;//系统时间

                        if (text == "")
                        {
                                MessageBox.Show("单位名称不能为空!");
                        }
//判断输入是否正确,检查了很多,这里省略,直接看检验注册码的过程
                        else
                        {
                                CUntily cuntily = new CUntily();//新建了一个类
                                if (cuntily.MakeSearial(new string[]
                                {
                                        text,
                                        text2,
                                        text3
                                }) == this.ZhuCeMa.Text)//通过MakeSearial与输入的注册码对比,一致就注册成功,不一致失败。
                                {
                                        this.IsCorrect = true;
                                        MessageBox.Show("注册成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                        base.Close();
                                }
                                else
                                {
                                        this.IsCorrect = false;
                                        MessageBox.Show("注册失败!\n\n1、请检查单位名称、授权截止日期、注册码是否正确;\n2、输入法改成半角,再重新输入。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                }
                        }
                }

通过上面的分析,我们知道获取正确注册码的关键是在MakeSearial这个函数里面,那我们就跳到这里分析注册码构成。PS:Serial才对,作者可能多打了一个a。
3.MakeSearial代码
[C#] 纯文本查看 复制代码
public string MakeSearial(string[] deanddate)
                {
                        string text;
                        if (deanddate[2] == "是")//这里是选择身份证那个选择框的值
                        {
                                text = deanddate[0] + deanddate[1] + "&8$dZ|3%G#@";
                        }
                        else
                        {
                                text = deanddate[0] + deanddate[1] + "Ze34@!-+d93";
                        }
                        text = this.GetMd5(text);//获取输入内容的MD5
                        string text2 = text.Substring(0, 5);
                        string text3 = text.Substring(5, 5);
                        string text4 = text.Substring(10, 5);
                        string text5 = text.Substring(15, 5);
                        string text6 = text.Substring(20, 5);
//上面就是一次取5个字符,取5次。
                        return string.Concat(new string[]
                        {
                                text2,
                                "-",
                                text3,
                                "-",
                                text4,
                                "-",
                                text5,
                                "-",
                                text6
                        });//通过-连接,然后返回
                }

4.编写注册机
通过上面的分析,就是获取输入的内容然后构造一个String然后MD5,然后在取文本,组合成注册码


只要把上面的代码都复制到IDE里面,在画几个控件就完成了


附上我写的代码
[C#] 纯文本查看 复制代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void InitializeComponent()
        {
            this.label5 = new System.Windows.Forms.Label();
            this.OK = new System.Windows.Forms.Button();
            this.ZhuCeMa = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
            this.label3 = new System.Windows.Forms.Label();
            this.DepartName = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
            this.XQDate = new System.Windows.Forms.TextBox();
            this.ck_IDCard = new System.Windows.Forms.CheckBox();
            this.label7 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label5.ForeColor = System.Drawing.Color.Black;
            this.label5.Location = new System.Drawing.Point(3, 276);
            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(357, 75);
            this.label5.TabIndex = 25;
            this.label5.Text = " 注册机制作: 云在天(Harry)  吾爱破解论坛  \n\r\n\r 邮箱:[url=mailto:harry@521harry.site]harry@521harry.site[/url]\r\n\n\r 微博:";
            // 
            // OK
            // 
            this.OK.Location = new System.Drawing.Point(242, 231);
            this.OK.Margin = new System.Windows.Forms.Padding(4);
            this.OK.Name = "OK";
            this.OK.Size = new System.Drawing.Size(100, 29);
            this.OK.TabIndex = 22;
            this.OK.Text = "生成注册码";
            this.OK.UseVisualStyleBackColor = true;
            this.OK.Click += new System.EventHandler(this.OK_Click);
            // 
            // ZhuCeMa
            // 
            this.ZhuCeMa.Location = new System.Drawing.Point(206, 193);
            this.ZhuCeMa.Margin = new System.Windows.Forms.Padding(4);
            this.ZhuCeMa.Name = "ZhuCeMa";
            this.ZhuCeMa.Size = new System.Drawing.Size(301, 25);
            this.ZhuCeMa.TabIndex = 3;
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.ForeColor = System.Drawing.Color.Black;
            this.label4.Location = new System.Drawing.Point(98, 198);
            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(97, 15);
            this.label4.TabIndex = 20;
            this.label4.Text = "产品注册码:";
            // 
            // linkLabel1
            // 
            this.linkLabel1.AutoSize = true;
            this.linkLabel1.Location = new System.Drawing.Point(59, 335);
            this.linkLabel1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new System.Drawing.Size(223, 15);
            this.linkLabel1.TabIndex = 28;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "https://weibo.com/279977366";
            this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.ForeColor = System.Drawing.Color.Black;
            this.label3.Location = new System.Drawing.Point(114, 108);
            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(82, 15);
            this.label3.TabIndex = 30;
            this.label3.Text = "单位名称:";
            // 
            // DepartName
            // 
            this.DepartName.Location = new System.Drawing.Point(206, 103);
            this.DepartName.Margin = new System.Windows.Forms.Padding(4);
            this.DepartName.Name = "DepartName";
            this.DepartName.Size = new System.Drawing.Size(301, 25);
            this.DepartName.TabIndex = 1;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.ForeColor = System.Drawing.Color.Black;
            this.label6.Location = new System.Drawing.Point(82, 138);
            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(112, 15);
            this.label6.TabIndex = 32;
            this.label6.Text = "授权截止日期:";
            // 
            // richTextBox1
            // 
            this.richTextBox1.BackColor = System.Drawing.SystemColors.Control;
            this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.richTextBox1.Enabled = false;
            this.richTextBox1.ForeColor = System.Drawing.Color.Red;
            this.richTextBox1.Location = new System.Drawing.Point(6, 5);
            this.richTextBox1.Margin = new System.Windows.Forms.Padding(4);
            this.richTextBox1.Name = "richTextBox1";
            this.richTextBox1.ReadOnly = true;
            this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
            this.richTextBox1.Size = new System.Drawing.Size(589, 90);
            this.richTextBox1.TabIndex = 36;
            this.richTextBox1.Text = "Crack By 云在天 (Harry) [url=http://www.52Pojie.cn]www.52Pojie.cn[/url] \n此补丁仅限用于学习和研究目的,不得将上述内容用于商业或者非法用途,否则,一切后果请用户自" +
    "负。\n您必须在下载后的24小时之内,从您的电脑中彻底删除上述内容。\n\n如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。\n\n如有侵权请联系harr" +
    "y@521harry.site。";
            // 
            // XQDate
            // 
            this.XQDate.Location = new System.Drawing.Point(206, 133);
            this.XQDate.Margin = new System.Windows.Forms.Padding(4);
            this.XQDate.Name = "XQDate";
            this.XQDate.Size = new System.Drawing.Size(301, 25);
            this.XQDate.TabIndex = 2;
            // 
            // ck_IDCard
            // 
            this.ck_IDCard.AutoSize = true;
            this.ck_IDCard.Location = new System.Drawing.Point(206, 166);
            this.ck_IDCard.Margin = new System.Windows.Forms.Padding(4);
            this.ck_IDCard.Name = "ck_IDCard";
            this.ck_IDCard.Size = new System.Drawing.Size(119, 19);
            this.ck_IDCard.TabIndex = 4;
            this.ck_IDCard.Text = "身份证阅读器";
            this.ck_IDCard.UseVisualStyleBackColor = true;
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.ForeColor = System.Drawing.Color.Black;
            this.label7.Location = new System.Drawing.Point(114, 167);
            this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(82, 15);
            this.label7.TabIndex = 39;
            this.label7.Text = "附加功能:";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(592, 372);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.ck_IDCard);
            this.Controls.Add(this.XQDate);
            this.Controls.Add(this.richTextBox1);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.DepartName);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.linkLabel1);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.OK);
            this.Controls.Add(this.ZhuCeMa);
            this.Controls.Add(this.label4);
            this.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Margin = new System.Windows.Forms.Padding(4);
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "二手车注册机";
            this.Load += new System.EventHandler(this.Form1_Load_1);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        // Token: 0x04000352 RID: 850
        public bool IsCorrect = false;

        // Token: 0x04000353 RID: 851
        private IContainer components = null;

        // Token: 0x04000354 RID: 852
        private Label label5;

        // Token: 0x04000357 RID: 855
        private Button OK;

        // Token: 0x04000358 RID: 856
        private TextBox ZhuCeMa;

        // Token: 0x04000359 RID: 857
        private Label label4;

        // Token: 0x0400035B RID: 859
        private LinkLabel linkLabel1;

        // Token: 0x0400035D RID: 861
        private Label label3;

        // Token: 0x0400035E RID: 862
        private TextBox DepartName;

        // Token: 0x0400035F RID: 863
        private Label label6;

        // Token: 0x04000360 RID: 864
        private RichTextBox richTextBox1;

        // Token: 0x04000362 RID: 866
        private TextBox XQDate;

        // Token: 0x04000363 RID: 867
        private CheckBox ck_IDCard;

        // Token: 0x04000364 RID: 868
        private Label label7;

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("https://weibo.com/279977366");
        }
        public string MakeSearial(string[] deanddate)
        {
            string text;
            if (deanddate[2] == "是")
            {
                text = deanddate[0] + deanddate[1] + "&8$dZ|3%G#@";
            }
            else
            {
                text = deanddate[0] + deanddate[1] + "Ze34@!-+d93";
            }
            text = this.GetMd5(text);
            string text2 = text.Substring(0, 5);
            string text3 = text.Substring(5, 5);
            string text4 = text.Substring(10, 5);
            string text5 = text.Substring(15, 5);
            string text6 = text.Substring(20, 5);
            return string.Concat(new string[]
            {
                text2,
                "-",
                text3,
                "-",
                text4,
                "-",
                text5,
                "-",
                text6
            });
        }
        public string GetMd5(string ss)
        {
            MD5 md = MD5.Create();
            string text = "";
            byte[] array = md.ComputeHash(Encoding.UTF8.GetBytes(ss));
            for (int i = 0; i < array.Length; i++)
            {
                text += array[i].ToString("X");
            }
            return text;
        }

        private void OK_Click(object sender, EventArgs e)
        {
            string text = this.DepartName.Text.Trim();
            string text2 = this.XQDate.Text;
            string text3 = this.ck_IDCard.Checked ? "是" : "否";
            if (text == "")
            {
                MessageBox.Show("单位名称不能为空!");
                return;
            }
            if (text2.IndexOf("-") > -1)
            {
                MessageBox.Show("请将输入法转换为半角方式,再重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            DateTime dateTime;
            if (!DateTime.TryParse(text2, out dateTime))
            {
                MessageBox.Show("日期格式输入错误!格式:2017-02-01", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            if (this.ZhuCeMa.Text.IndexOf("-") > -1)
            {
                MessageBox.Show("请将输入法转换为半角方式,再重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            this.ZhuCeMa.Text = MakeSearial(new string[]
            {
                text,
                text2,
                text3
            });

        }

        private void Form1_Load_1(object sender, EventArgs e)
        {

        }

        
    }
}


效果图:
QQ截图20180129161132.jpg

免费评分

参与人数 13威望 +1 吾爱币 +21 热心值 +13 收起 理由
XXTK + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
yzy93 + 1 + 1 用心讨论,共获提升!
烟不离手 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
Hmily + 1 + 10 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
梦呓呦 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
少尉_lib + 1 + 1 学习了
whdfog + 1 + 1 热心回复!
Anewbie + 1 + 1 我很赞同!
f393349145 + 1 + 1 用心讨论,共获提升!
550729 + 1 + 1 没有下载地址啊
yolwas + 1 + 1 谢谢@Thanks!
610100 + 1 膜拜!
lovemier + 1 + 1 谢谢@Thanks!

查看全部评分

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

奇卡无比 发表于 2018-1-30 09:45
的确是这样的  不过就是去壳有难度  有的dll不会去壳  导致没法看到算法  
236381673 发表于 2018-1-29 18:10
zyw_zjk 发表于 2018-1-29 18:59
XXTK 发表于 2018-1-29 19:39
软件放出来更好
caige2008 发表于 2018-1-29 19:54
分析的不错啊!
170077000 发表于 2018-1-29 20:51
对NET不了解   求源码和软件做练习
metty 发表于 2018-1-29 22:31
表示叹服
whdfog 发表于 2018-1-29 23:16
支持作者!
萌萌哒的小白 发表于 2018-1-29 23:41
6666!支持!!!
badboytcq 发表于 2018-1-30 02:08
发出来吧  需要
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

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

GMT+8, 2024-11-16 10:33

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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