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

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 11239|回复: 18
收起左侧

[.NET逆向] 一个专利查错的逆向(网络验证)

  [复制链接]
云在天 发表于 2017-12-12 15:49
看到悬赏区有人求类似软件,果断下载然后逆向。

【0X01】查壳
1.jpg

Unknown>>>>>Unknown Obfuscator,但是de4支持,所以果断拖进去脱壳

【0X02】逆向
拖到DnSpy里,从入口点下手发现关键代码
[C#] 纯文本查看 复制代码
if (configData.sn == null)//如果sn是空的就运行frmMain这个函数
			{
				configData.fileCreateTime = fileInfo.CreationTime.ToString();
				Cache.licenseData = configData;
				Application.Run(new frmMain());
			}

我们来看这个Main函数
[C#] 纯文本查看 复制代码
public void btnRegist_Click(object sender, EventArgs e)
		{
			LicenseService licenseService = new LicenseService();
			RegistIn registIn = new RegistIn();
			registIn.sn = string.Concat(new string[]
			{
				this.txtSn1.Text,
				"-",
				this.txtSn2.Text,
				"-",
				this.txtSn3.Text,
				"-",
				this.txtSn4.Text
			});
			registIn.userInfo = this.txtClient.Text;//四个编辑框组成的sn
			registIn.fileCreateTime = Cache.licenseData.fileCreateTime;//取创建时间
			registIn.productApiKey = "vimiLVloKqDbOdTkIrQdAhtZkJFClP14594231815470201";
			RegistOut registOut = licenseService.regist(registIn);//网络验证,下面是三种情况。
			if (registOut == null)
			{
				MessageBox.Show("认证失败\r\n可能的原因\r\n1.序列号填写有误\r\n2.未连接互联网");
			}
			else if ("Y".Equals(registOut.isRegisted))
			{
				MessageBox.Show("该序列号已被使用");
			}
			else
			{
				MessageBox.Show("产品认证成功\r\n请重启本软件");
				ConfigData licenseData = Cache.licenseData;
				licenseData.sn = registIn.sn;
				licenseData.userInfo = registIn.userInfo;
				licenseData.right = registOut.right;
				licenseData.lastAccessTime = DateTime.Now.ToString();
				File.WriteAllText(Directory.GetCurrentDirectory() + "\\license", DESUtil.Encrypt(JsonUtil.objectToString(licenseData)));//加密获取的数据然后重启验证
				Application.Exit();
			}
		}
	}
}

这个函数直接删除引用就好,继续往下走
[C#] 纯文本查看 复制代码
bool flag = true;
				if (!fileInfo.CreationTime.ToString().Equals(configData.fileCreateTime))//这里是校验License,直接删除掉
				{
					MessageBox.Show("认证文件已损坏!");
					flag = false;
					Application.Exit();
				}
				if (flag)
				{
					LicenseService licenseService = new LicenseService();
					if (licenseService.onlineCheck(configData.sn))
					{
						configData.lastAccessTime = DateTime.Now.ToString();
						File.WriteAllText(Directory.GetCurrentDirectory() + "\\license", DESUtil.Encrypt(JsonUtil.objectToString(configData)));
					}
					else
					{
						DateTime d = DateTime.Parse(configData.lastAccessTime);
						int days = (DateTime.Now - d).Days;
						if (days > 7)
						{
							flag = false;
							MessageBox.Show("已经超过7天没有认证软件\r\n请连接互联网后重启软件");
							Application.Exit();
						}
					}
				}
				if (flag)//这里是对比版本的所以没有必要删除掉
				{
					VersionService versionService = new VersionService();
					VersionInfo newVersionInfo = versionService.getNewVersionInfo("vimiLVloKqDbOdTkIrQdAhtZkJFClP14594231815470201");
					if (newVersionInfo != null)
					{
						string text2 = File.ReadAllText(Directory.GetCurrentDirectory() + "\\version");
						if (!text2.Equals(newVersionInfo.versionNum))
						{
							new frmVersion
							{
								oldVersion = text2,
								newVersion = newVersionInfo.versionNum,
								downloadUrl = newVersionInfo.fileUrl,
								updateInfo = newVersionInfo.updateInfo
							}.ShowDialog();
						}
					}
					string text3 = StringCommon.RandomString(50);
					File.WriteAllText(Directory.GetCurrentDirectory() + "\\hander", DESUtil.Encrypt(text3));//下面就是启动主程序Patstory了,这个程序只是个启动器性质的
					new Process
					{
						StartInfo = 
						{
							FileName = Directory.GetCurrentDirectory() + "\\PatStory\\PatStory.exe",
							Arguments = text3
						}
					}.Start();
				}
			}
		}
	}
}

【0x03】调试
保存调试,提示更新,更新完成后依然成功载入主程序


用到的工具:de4ot,Dnspy

免费评分

参与人数 10吾爱币 +12 热心值 +10 收起 理由
fillsky123 + 1 求楼主联系方式QQ 或者加我QQ42703829 有偿
kilkilo502 + 1 没看懂。。。这是PC软件?
宿墨 + 1 + 1 我很赞同!
sunnylds7 + 1 谢谢@Thanks!
Magic010824 + 1 + 1 请勿灌水,提高回帖质量是每位会员应尽的义务!
qaz003 + 1 用心讨论,共获提升!
Hmily + 7 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
libojun + 1 + 1 用心讨论,共获提升!
Snake.Eyes + 1 + 1 我很赞同!
comeluder + 1 + 1 我很赞同!

查看全部评分

本帖被以下淘专辑推荐:

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

ftn83 发表于 2020-4-17 16:24
本帖最后由 ftn83 于 2020-4-17 16:30 编辑
suidu 发表于 2020-4-17 14:57
软件名字叫什么啊?想尝试下

http://patstory.net/fullspec.html
这里可以下载到,非常期待能帮忙搞定,
对做这个行业的人来说,还是比较实用的。
搞定了肯定会给您币作为补偿。
Snake.Eyes 发表于 2017-12-12 17:02
studyC 发表于 2017-12-12 16:12
第一个图一直没加载成功,思路学习了,谢谢分享!
poulwalker 发表于 2017-12-12 16:36
谢谢楼主。学习了
寒尘丶Coldust 发表于 2017-12-12 23:38
感觉C#写的好容易被逆向啊...
龙木 发表于 2017-12-13 00:45
我就看看,好像很牛逼的样子!
shanhuyi 发表于 2017-12-13 10:58
好牛逼啊
toplove 发表于 2017-12-13 18:29
学习了,谢谢分享
heqiu000 发表于 2017-12-13 19:41
谢谢楼主分享
redking1989 发表于 2017-12-13 22:56
虽然看不明白,但还是要认真学习!!!
您需要登录后才可以回帖 登录 | 注册[Register]

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

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

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

GMT+8, 2024-4-25 16:17

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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