上面几篇文章,基本上把注册激活的流程弄清楚了。但这种调试方式仅适用于研究,因为修改内存变量只能单次生效。
要想永久生效,那就得修改dll的二进制内容了。
一劳永逸的方法,就是修改LicenseCheck函数。
// ModbusSlaveEmulator.Services.LicenseService
// Token: 0x06000D85 RID: 3461 RVA: 0x00054E34 File Offset: 0x00053034
public static bool LicenseCheck(string msg = null, bool showPopup = true)
{
bool flag = false;
try
{
User user = ActivateUtil.GetUser(StaticValue.AppSettings.User);
if (user != null)
{
bool flag2 = false;
string deviceId = Device.GetDeviceId();
List<AssociatedApp> apps = user.Apps;
if (apps != null)
{
foreach (AssociatedApp associatedApp in apps)
{
if (associatedApp.App == Class47.smethod_17(6456))
{
flag2 = associatedApp.ActivatedDevices != null && associatedApp.ActivatedDevices.Contains(deviceId);
break;
}
}
}
if (flag2 && TimeService.Now > user.LicenseStartDateTime && TimeService.Now < user.LicenseStopDateTime)
{
flag = true;
}
if (!flag)
{
TimeService.RemoveUser();
}
}
}
catch (VerificationFailedException)
{
TimeService.RemoveUser();
}
catch (Exception ex)
{
StaticValue.Logger.Error(ex);
}
if (!flag && showPopup)
{
PopupWindow.FreeTrialTip(msg ?? Resources.FreeTrialTip);
}
return flag;
}
一个简单的办法,就是将flag的初始值由false改为true。
右键,编辑IL指令,

将操作码改一下。

还有一个简单的办法,将其改为:
public static bool LicenseCheck(string msg = null, bool showPopup = true)
{
return true;
}
哈哈哈哈,再也不会出来下面这个烦人的窗口了。

怎么改?

72

被折叠的 条评论
为什么被折叠?



