飘云阁

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 6563|回复: 16

[原创] Universal Viewer V6.5.6.2 注册机源代码

[复制链接]
  • TA的每日心情
    开心
    2019-3-25 14:18
  • 签到天数: 881 天

    [LV.10]以坛为家III

    发表于 2015-8-29 13:47:39 | 显示全部楼层 |阅读模式
    本帖最后由 GeekCat 于 2015-8-29 14:04 编辑

    【文章标题】: Universal Viewer  V6.5.6.2  注册机源代码
    【文章作者】: geekcat
    【作者邮箱】:
    【作者主页】:
    【软件名称】: Universal Viewer  V6.5.6.2
    【软件大小】:
    【加壳方式】: 无
    【保护方式】: 注册码
    【编写语言】: Borland Delphi
    【使用工具】: OD、PEID
    【操作平台】: XP SP3
    【下载地址】:百度找
    【软件介绍】:
    破解声明】:技术交流、学习,请不要用于商业用途!
    --------------------------------------------------------------------------------------------------------------------------------

    KeyFile注册类型的软件
    找不到软件输入注册信息的地方折腾了很久,经GG大神提示是KeyFile注册类型的软件
    伪造KeyFile文件接着又折腾了很久还是跟不出信息
    猜是KeyFile里内容是有格式的,只有格式正确才能读取出来,就跟GG要了一个KeyFile格式来伪造注册信息
    接下来就是春天来了~~~~~

    切入方式:
    1、API断点;
    2、字符串查找;


    算法总结:
    1、注册名要大于等于2位并且以下字符不计算在内:
    “_”, ".", ",", ";", "-", "/", "\", """, "'", "(", ")", “[”, "]"
    2、取注册名:,一共计算出4位:如果所的位是小写字母就转成大写字母
    第1位、长度除2后整数对位、长度除2后整数+1对应位、注册名的最后一位
    3、注册码分四段,中间用”-“分开每段注册码为4位,第2步中取得的这四位来对应:
    注册码第一段第2位、注册码第二段第1位、注册码第三段第1位、注册码第四段第1位
    4、注册码的第一位是字符中“BUS”中某1位,分别控制三个版本:
    个人版:"U"---Personal license (max. 2 computers)
    商业版:"B"---Business license (max. 7 computers)
    无限制版:"S"---Site license (unlimited num. of computers)
    5、注册码第一段4位AS值累加和跟0x14取余数要等于0xE
    6、注册码第二段4位AS值累加和跟0x28取余数要等于0xF
    7、注册码第三段4位AS值累加和跟0x28取余数要等于0x11
    8、注册码第四段4位AS值累加和跟0x28取余数要等于0x14

    注册机代码:

    [C#] 纯文本查看 复制代码
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    
    namespace Universal_Viewer_Pro_V6._5._6._2
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void btnKeygen_Click(object sender, EventArgs e)
            {
                string regNam = "";
                if (txtName.Text.Length >= 2)
                {
                    regNam = FilterChars(txtName.Text).ToUpper();
                }
                
                string key = "";
    
                if (regNam.Length >= 2) //用户名长度大于等于2
                {
    
                    //软件版本的选择:1、个人版;2、商业版;3、无限版
                    string VersionChar = "";
                    if (rbPersonal.Checked)
                    {
                        VersionChar = "U";
                    }
                    else if (rbBusiness.Checked)
                    {
                        VersionChar = "B";
                    }
                    else
                    {
                        VersionChar = "S";
                    }
    
    
                    string firstCheck = regNam.Substring(0, 1);
                    string secondCheck = regNam.Substring(regNam.Length / 2 - 1, 1);
                    string threeCheck = regNam.Substring(regNam.Length / 2, 1);
                    string fourthCheck = regNam.Substring(regNam.Length - 1, 1);
    
    
                    //第一段注册码
                    Random randomKey = new Random();
                    int oneKey_fourBaseNum = randomKey.Next(2, 6);//注册码第一段最后一位基数
                    string oneKey_ThreeChar = System.Guid.NewGuid().ToString().Substring(0, 1);   //注册码第一段第3位,随机生成1位即包含字符又包含数字的字符串
                    string oneKey_Three = VersionChar + firstCheck + oneKey_ThreeChar;
                    char oneKey_fourChar = GetKey(oneKey_Three, 20, oneKey_fourBaseNum, 14);
    
                    string oneKey = oneKey_Three + oneKey_fourChar;
    
    
                    //第二段注册码
                    int twoKey_fourBaseNum = randomKey.Next(1, 3);
                    string twoKey_TwoChar = System.Guid.NewGuid().ToString().Substring(0, 2);//第二段注册的2,3位两位 
                    string twoKey_Three = secondCheck + twoKey_TwoChar;
                    char twoKey_fourChar = GetKey(twoKey_Three, 40, twoKey_fourBaseNum, 15);
    
    
                    string twoKey = twoKey_Three + twoKey_fourChar;
    
    
                    //第三段注册码
                    int threeKey_fourBaseNum = randomKey.Next(1, 3);
                    string threeKey_TwoChar = System.Guid.NewGuid().ToString().Substring(0, 2);//第三段注册的2,3位两位 
                    string threeKey_Three = threeCheck + threeKey_TwoChar;
                    char threeKey_fourChar = GetKey(threeKey_Three, 40, threeKey_fourBaseNum, 17);
    
                    string threeKey = threeKey_Three + threeKey_fourChar;
    
    
                    //第四段注册码
                    int fourKey_fourBaseNum = randomKey.Next(1, 3);
                    string fourKey_TwoChar = System.Guid.NewGuid().ToString().Substring(0, 2);//第二段注册的2,3位两位 
                    string fourKey_Three = fourthCheck + fourKey_TwoChar;
                    char fourKey_fourChar = GetKey(fourKey_Three, 40, fourKey_fourBaseNum, 20);
    
                    string fourKey = fourKey_Three + fourKey_fourChar;
    
    
                    key = oneKey + "-" + twoKey + "-" + threeKey + "-" + fourKey;
    
    
    
                    txtKey.Text = key;
    
    
                    //生成Key文件
    
                    //System.IO.File.WriteAllText("key.txt", key);//成生指定文件名的文件并把内容写入(只一行)
    
                    string Path = System.Windows.Forms.Application.StartupPath;
                    string filePath = Path + "\\Key.txt";
    
                    if (File.Exists(filePath))
                    {
                        if (MessageBox.Show("Key文件已存在,是否覆盖", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            //生成指定文件名的文件并写入多行内容
                            //using (StreamWriter sw = File.AppendText("Key.txt")) //如果文件不存在就创建,如果存在就把新的内容追加到之前的后面
                            using (StreamWriter sw = File.CreateText("Key.txt"))   //如果文件不存在就创建,如果存在直接覆盖文件且不提示
                            {
                                sw.WriteLine("[key]");
                                sw.WriteLine("name=" + txtName.Text);
                                sw.WriteLine("key=" + txtKey.Text);
                                sw.Close();
                                labCopy.Visible = true;
                                labCopy.Text = "文件已覆盖";
                            }
                        }
    
                    }
                    else
                    {
                        using (StreamWriter sw = File.CreateText("Key.txt"))   //如果文件不存在就创建,如果存在直接覆盖文件且不提示
                        {
                            sw.WriteLine("[key]");
                            sw.WriteLine("name=" + txtName.Text);
                            sw.WriteLine("key=" + txtKey.Text);
                            sw.Close();
                            labCopy.Visible = true;
                            labCopy.Text = "文件已生成请复制到安装目录下";
                        }
                    }
    
    
    
                    if (txtKey.Text != "")
                    {
                        labCopy.Visible = true;
                        labCopy.Text = "Key文件已生成请复制到安装目录下";
                    }
                    else
                    {
                        MessageBox.Show("注册名长度小于两位,请输入注册名", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
    
                }
        
            }
    
    
            /// <summary>
            /// 计算每段注册码最后一位
            /// </summary>
            /// <param name="pwdchars"></param>
            /// <param name="pwdlen"></param>
            /// <returns></returns>
            public static char GetKey(string keyChars, int mod, int randomNum, int result)//前三位字符,跟谁取余数,随机数做倍数,四位字符串取余数后的结果
            {
                int total = 0;
                int fourMod = 0;
                int Key_fourNum = 0;
                char Key_fourChar;
                for (int i = 0; i < keyChars.Length; i++)
                {
                    total += keyChars[i];
                }
                fourMod = total % mod;
    
    
                if (fourMod == result)
                {
                    Key_fourNum = mod * randomNum;
                    Key_fourChar = (char)Key_fourNum;//十进制数值直接转对应字符
                }
                else if (fourMod < result)
                {
                    Key_fourNum = result - fourMod + mod * randomNum;
                    Key_fourChar = (char)Key_fourNum;
                }
                else
                {
                    Key_fourNum = mod - fourMod + result + mod * randomNum;
                    Key_fourChar = (char)Key_fourNum;
                }
                return Key_fourChar;
            }
    
            /// <summary>
            /// 去掉字符串指定的字符
            /// </summary>
            /// <param name="strHtml"></param>
            /// <returns></returns>
            public string FilterChars(string newStr)
            {
                if (string.Empty == newStr)
                {
                    return newStr;
                }
                string[] aryReg = {" ","\"", ".", ",", ";", "-", "/", "\\", "\"", "'", "(", ")", "[", "]"};//指定要去掉的字符
                for (int i = 0; i < aryReg.Length; i++)
                {
                    newStr = newStr.Replace(aryReg[i], string.Empty);
                }
                return newStr;
            }
    
    
            private void Form1_Load(object sender, EventArgs e)
            {
                labCopy.Visible = false;
                labNameCopy.Visible = false;
            }
    
            private void txtName_TextChanged(object sender, EventArgs e)
            {
                txtKey.Text = "";
                labNameCopy.Visible = false;
    
            }
    
            private void btnKeygen_MouseLeave(object sender, EventArgs e)
            {
                labCopy.Visible = false;
            }
    
            private void txtName_MouseLeave(object sender, EventArgs e)
            {
                labNameCopy.Visible = false;
            }
    
            private void txtName_MouseEnter(object sender, EventArgs e)
            {
                if (txtKey.Text != "")
                {
                    Clipboard.SetText(txtName.Text);
                    labNameCopy.Visible = true;
                    labNameCopy.Text = "注册名复制成功";
                }
    
            }
    
            private void linkPYG_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                System.Diagnostics.Process.Start("https://www.chinapyg.com");
            }
    
        }
    }
    


    11.png
    22.png


    Universal Viewer Pro V6.5.6.2注册机源代码.rar (104.56 KB, 下载次数: 40)

    评分

    参与人数 2威望 +24 飘云币 +24 收起 理由
    NoNameX2016 + 4 + 4 赞一个!
    Dxer + 20 + 20 PYG有你更精彩!

    查看全部评分

    PYG19周年生日快乐!
  • TA的每日心情

    2015-8-14 19:24
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    发表于 2015-8-29 13:52:22 | 显示全部楼层
    请问这是什么语言写的

    点评

    C#写的新手刚入门写  详情 回复 发表于 2015-8-29 13:57
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2019-3-25 14:18
  • 签到天数: 881 天

    [LV.10]以坛为家III

     楼主| 发表于 2015-8-29 13:57:06 | 显示全部楼层
    腾龙细雨 发表于 2015-8-29 13:52
    请问这是什么语言写的

    C#写的新手刚入门写
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2016-2-8 11:06
  • 签到天数: 32 天

    [LV.5]常住居民I

    发表于 2015-8-29 14:13:37 | 显示全部楼层
    看看瞧,正需要这个
    PYG19周年生日快乐!
  • TA的每日心情
    难过
    2024-3-10 19:49
  • 签到天数: 473 天

    [LV.9]以坛为家II

    发表于 2015-8-29 14:34:52 | 显示全部楼层
    喜欢看到你的注册机源码
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    昨天 09:15
  • 签到天数: 1008 天

    [LV.10]以坛为家III

    发表于 2015-8-29 14:44:40 | 显示全部楼层
    谢谢版主辛苦了
    PYG19周年生日快乐!
  • TA的每日心情
    慵懒
    2023-4-24 08:03
  • 签到天数: 489 天

    [LV.9]以坛为家II

    发表于 2015-8-29 16:12:16 | 显示全部楼层
    我是来膜拜G师傅的

    点评

    大神又来欺负小菜了~~~ 有时间来指导一下我  详情 回复 发表于 2015-8-29 16:46
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2019-3-25 14:18
  • 签到天数: 881 天

    [LV.10]以坛为家III

     楼主| 发表于 2015-8-29 16:46:19 | 显示全部楼层
    vipcrack 发表于 2015-8-29 16:12
    我是来膜拜G师傅的

    大神又来欺负小菜了~~~
    有时间来指导一下我
    PYG19周年生日快乐!
  • TA的每日心情
    无聊
    2015-8-29 17:31
  • 签到天数: 1 天

    [LV.1]初来乍到

    发表于 2015-8-29 17:32:30 | 显示全部楼层
    PYG有你更精彩  支持一下
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2015-9-1 01:55
  • 签到天数: 3 天

    [LV.2]偶尔看看I

    发表于 2015-8-29 17:55:35 | 显示全部楼层
    被大牛给忽悠了,还以为是算法分析的破文。

    点评

    这软件的算**坛有了,我也就没发了直接发了算法总结和注册源代码,你根据我的提示找到软件的算法处,跟一遍很快~~~  详情 回复 发表于 2015-8-29 18:04
    PYG19周年生日快乐!
    您需要登录后才可以回帖 登录 | 加入我们

    本版积分规则

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