首页
社区
课程
招聘
[求助]这个应该是插件的注册机制,请问怎么更改掉注册机制呢?大神给个教程吧!!!!
发表于: 2017-11-6 16:18 3078

[求助]这个应该是插件的注册机制,请问怎么更改掉注册机制呢?大神给个教程吧!!!!

2017-11-6 16:18
3078
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace RuralHosesInvestigation.Authorization
{
    public class RegisterForm : Form
    {
        private IContainer icontainer_0;

        private Label label1;

        private TextBox txtCpuId;

        private Label label2;

        private TextBox txtRegisterNum;

        private Button btnRegister;

        protected override void Dispose(bool disposing)
        {
            if (disposing && this.icontainer_0 != null)
            {
                this.icontainer_0.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.label1 = new Label();
            this.txtCpuId = new TextBox();
            this.label2 = new Label();
            this.txtRegisterNum = new TextBox();
            this.btnRegister = new Button();
            base.SuspendLayout();
            this.label1.AutoSize = true;
            this.label1.Location = new Point(13, 16);
            this.label1.Name = "label1";
            this.label1.Size = new Size(53, 12);
            this.label1.TabIndex = 0;
            this.label1.Text = "机器码:";
            this.txtCpuId.Location = new Point(72, 13);
            this.txtCpuId.Name = "txtCpuId";
            this.txtCpuId.ReadOnly = true;
            this.txtCpuId.Size = new Size(232, 21);
            this.txtCpuId.TabIndex = 1;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(13, 43);
            this.label2.Name = "label2";
            this.label2.Size = new Size(53, 12);
            this.label2.TabIndex = 0;
            this.label2.Text = "注册码:";
            this.txtRegisterNum.Location = new Point(72, 40);
            this.txtRegisterNum.Name = "txtRegisterNum";
            this.txtRegisterNum.Size = new Size(232, 21);
            this.txtRegisterNum.TabIndex = 1;
            this.btnRegister.Location = new Point(72, 68);
            this.btnRegister.Name = "btnRegister";
            this.btnRegister.Size = new Size(67, 23);
            this.btnRegister.TabIndex = 2;
            this.btnRegister.Text = "注册";
            this.btnRegister.UseVisualStyleBackColor = true;
            this.btnRegister.Click += new EventHandler(this.btnRegister_Click);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(316, 100);
            base.Controls.Add(this.btnRegister);
            base.Controls.Add(this.txtRegisterNum);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.txtCpuId);
            base.Controls.Add(this.label1);
            base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            base.Name = "RegisterForm";
            this.Text = "农房调查软件注册";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public RegisterForm()
        {
            this.InitializeComponent();
            this.txtCpuId.Text = Class16.smethod_2() + Class16.smethod_3();
            if (!Class16.Boolean_0)
            {
                if (Class16.Boolean_1)
                {
                    this.txtRegisterNum.Text = Class16.String_0;
                    this.btnRegister.Text = "升级授权";
                }
                return;
            }
            this.txtRegisterNum.Text = Class16.String_0;
            this.btnRegister.Text = "已注册";
            this.btnRegister.Enabled = false;
        }

        private void btnRegister_Click(object sender, EventArgs e)
        {
            string text = this.txtRegisterNum.Text.Trim();
            if (string.IsNullOrEmpty(text))
            {
                MessageBox.Show("请输入注册码!");
                return;
            }
            if (text == RegisterForm.smethod_0(this.txtCpuId.Text))
            {
                Class16.smethod_6(text);
                MessageBox.Show("注册成功!");
                this.btnRegister.Text = "已注册";
                this.btnRegister.Enabled = false;
                return;
            }
            if (!(text == RegisterForm.smethod_1(this.txtCpuId.Text)))
            {
                MessageBox.Show("注册码不正确,注册失败!");
                return;
            }
            Class16.smethod_7(text);
            MessageBox.Show("注册成功,您现在已是高级用户!");
            this.btnRegister.Text = "升级授权";
        }

        private static string smethod_0(string string_0)
        {
            byte[] byte_ = RegisterForm.smethod_2(string_0);
            byte[] byte_2 = RegisterForm.smethod_3(byte_, "Sj170319");
            byte[] value = RegisterForm.smethod_5(byte_2);
            return BitConverter.ToString(value).Replace("-", "");
        }

        private static string smethod_1(string string_0)
        {
            byte[] byte_ = RegisterForm.smethod_2(string_0);
            byte[] byte_2 = RegisterForm.smethod_3(byte_, "Aza17052");
            byte[] value = RegisterForm.smethod_5(byte_2);
            return BitConverter.ToString(value).Replace("-", "");
        }

        private static byte[] smethod_2(string string_0)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(string_0);
            for (int i = 0; i < bytes.Length; i++)
            {
                byte b = bytes[i];
                byte b2 = b / 16;
                byte b3 = b % 16;
                switch (i % 4)
                {
                case 1:
                    b3 = 15 - b3;
                    break;
                case 2:
                    b2 = 15 - b2;
                    break;
                case 3:
                    b2 = 15 - b2;
                    b3 = 15 - b3;
                    break;
                }
                if (i % 2 != 0)
                {
                    bytes[i] = b3 * 16 + b2;
                }
                else
                {
                    bytes[i] = b2 * 16 + b3;
                }
            }
            if (bytes.Length > 1)
            {
                byte b4 = bytes[0] / 16;
                byte b5 = bytes[bytes.Length - 1] % 16;
                bytes[0] = b5 * 16 + b4;
                for (int j = 1; j < bytes.Length; j++)
                {
                    byte b6 = bytes[j - 1] % 16;
                    byte b7 = bytes[j] / 16;
                    bytes[j] = b6 * 16 + b7;
                }
                return bytes;
            }
            return bytes;
        }

        private static byte[] smethod_3(byte[] byte_0, string string_0)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(string_0);
            byte[] rgbIV = bytes;
            DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider();
            MemoryStream memoryStream = new MemoryStream();
            CryptoStream cryptoStream = new CryptoStream(memoryStream, dESCryptoServiceProvider.CreateEncryptor(bytes, rgbIV), CryptoStreamMode.Write);
            cryptoStream.Write(byte_0, 0, byte_0.Length);
            cryptoStream.FlushFinalBlock();
            return memoryStream.ToArray();
        }

        private static string smethod_4(string string_0, string string_1)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(string_1);
            byte[] rgbIV = bytes;
            byte[] array = Convert.FromBase64String(string_0);
            DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider();
            MemoryStream memoryStream = new MemoryStream();
            CryptoStream cryptoStream = new CryptoStream(memoryStream, dESCryptoServiceProvider.CreateDecryptor(bytes, rgbIV), CryptoStreamMode.Write);
            cryptoStream.Write(array, 0, array.Length);
            cryptoStream.FlushFinalBlock();
            return Encoding.UTF8.GetString(memoryStream.ToArray());
        }

        private static byte[] smethod_5(byte[] byte_0)
        {
            MD5 mD = new MD5CryptoServiceProvider();
            return mD.ComputeHash(byte_0);
        }
    }
}



跪求更改的机制,或者怎么做和注册机啊,谢谢
跪谢!!!!!

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (15)
雪    币: 1787
活跃值: (913)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
smethod_0恒返回true应该ok
而且这里好像不是悬赏区吧XD
2017-11-6 20:39
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
Tatsuy smethod_0恒返回true应该ok 而且这里好像不是悬赏区吧XD
我才学习,所以不是很懂,大哥可以说的详细点吗?感谢
2017-11-6 23:51
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
Tatsuy smethod_0恒返回true应该ok 而且这里好像不是悬赏区吧XD
大哥,我才学没多久,发错了不好意思,另外可以说的详细点嘛?感谢
2017-11-6 23:54
0
雪    币: 1787
活跃值: (913)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
axlolo 大哥,我才学没多久,发错了不好意思,另外可以说的详细点嘛?感谢
我好像弄错了什么……不是smethod_0恒true……应该是这个text  ==  RegisterForm.smethod_0(this.txtCpuId.Text)改为true
把程序扔上来大概好讲点XD
2017-11-7 00:39
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Tatsuy 我好像弄错了什么……不是smethod_0恒true……应该是这个text == RegisterForm.smethod_0(this.txtCpuId.Text)改为true 把程序扔上来大概好 ...
大哥有QQ吗?那样我可以好好的和你学习下,我把整个程序发给你,我已经脱壳了都,这里附件发不上来!!!
2017-11-7 11:17
0
雪    币: 1787
活跃值: (913)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
axlolo 大哥有QQ吗?那样我可以好好的和你学习下,我把整个程序发给你,我已经脱壳了都,这里附件发不上来!!!
QQ前阵子开车被ban掉了,里番是个好东西可惜腾讯不懂人心
2017-11-7 13:11
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
Tatsuy QQ前阵子开车被ban掉了,里番是个好东西可惜腾讯不懂人心
大哥,你说的啥、、、、、、、一头问好。。。。。
2017-11-7 15:07
0
雪    币: 6723
活跃值: (4178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9

    public partial class RegisterForm : Form

    {
        public RegisterForm()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)

        {

            textBox2.Text = RegisterForm.smethod_0(textBox1.Text); //textBox2.Text = 注册码, textBox1.Text = 输入机器码

        }


        private static string smethod_0(string string_0)
        {
            byte[] byte_ = RegisterForm.smethod_2(string_0);
            byte[] byte_2 = RegisterForm.smethod_3(byte_, "Sj170319");
            byte[] value = RegisterForm.smethod_5(byte_2);
            return BitConverter.ToString(value).Replace("-", "");
        }

        private static byte[] smethod_2(string string_0)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(string_0);
            for (int i = 0; i < bytes.Length; i++)
            {
                byte b = (byte)(bytes[i]);
                byte b2 = (byte)(b / 16);
                byte b3 = (byte)(b % 16);
                switch (i % 4)
                {
                    case 1:
                        b3 = (byte)(15 - b3);
                        break;
                    case 2:
                        b2 = (byte)(15 - b2);
                        break;
                    case 3:
                        b2 = (byte)(15 - b2);
                        b3 = (byte)(15 - b3);
                        break;
                }
                if (i % 2 != 0)
                {
                    bytes[i] = (byte)(b3 * 16 + b2);
                }
                else
                {
                    bytes[i] = (byte)(b2 * 16 + b3);
                }
            }
            if (bytes.Length > 1)
            {
                byte b4 = (byte)(bytes[0] / 16);
                byte b5 = (byte)(bytes[bytes.Length - 1] % 16);
                bytes[0] = (byte)(b5 * 16 + b4);
                for (int j = 1; j < bytes.Length; j++)
                {
                    byte b6 = (byte)(bytes[j - 1] % 16);
                    byte b7 = (byte)(bytes[j] / 16);
                    bytes[j] = (byte)(b6 * 16 + b7);
                }
                return bytes;
            }
            return bytes;
        }

        private static byte[] smethod_3(byte[] byte_0, string string_0)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(string_0);
            byte[] rgbIV = bytes;
            DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider();
            MemoryStream memoryStream = new MemoryStream();
            CryptoStream cryptoStream = new CryptoStream(memoryStream, dESCryptoServiceProvider.CreateEncryptor(bytes, rgbIV), CryptoStreamMode.Write);
            cryptoStream.Write(byte_0, 0, byte_0.Length);
            cryptoStream.FlushFinalBlock();
            return memoryStream.ToArray();
        }

        private static byte[] smethod_5(byte[] byte_0)
        {
            MD5 mD = new MD5CryptoServiceProvider();
            return mD.ComputeHash(byte_0);
        }
    }
2017-11-7 16:41
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
厉害了我的谁 &nbsp; &nbsp; public partial class RegisterForm : Form&nbsp; &nbsp; {&nbsp; & ...
大哥,你改了之后是什么意思呢?

2017-11-7 17:16
0
雪    币: 6723
活跃值: (4178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
照你贴出来的代码乱改的. :)


2017-11-7 18:36
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
厉害了我的谁 照你贴出来的代码乱改的. :)
大哥,你牛逼了哈!我搞了半天还没找到那段代码。。。。用ilasm转了不知道怎么改了。。。。
2017-11-7 19:36
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
厉害了我的谁 照你贴出来的代码乱改的. :)
大哥你知道怎么改了可以用成注册的吗?跪求。。。。
2017-11-7 19:37
0
雪    币: 6723
活跃值: (4178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
之前的代码就是了.  只加了下面这行,  其余的都是照抄的.

textBox2.Text  =  RegisterForm.smethod_0(textBox1.Text);  //textBox2.Text  =  注册码,  textBox1.Text  =  输入机器码
2017-11-7 19:45
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
厉害了我的谁 之前的代码就是了. 只加了下面这行, 其余的都是照抄的. textBox2.Text = RegisterForm.smethod_0(textBox1.Text); //textBox2.Te ...
加这个还是要注册吧?我转成IL文件找不到要改的那段代码了。。。。。压力大!!!
2017-11-7 20:20
0
雪    币: 9
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
Csharp不难
2017-11-19 08:41
0
游客
登录 | 注册 方可回帖
返回
//