本文为看雪论坛优秀文章
看雪论坛作者ID:bluefish蓝鱼
最近遇到一个wibu加密的程序,使用wibu证书进行授权,类似于sentianl的软锁SL,没有加密狗。
一
前期准备
$cmu -v
cmu - CodeMeter Universal Support Tool.
Version 6.60 of 2017-Dec-18 (Build 2869) for Linux
Copyright (C) 2007-2017 by WIBU-SYSTEMS AG. All rights reserved.
Operating System:
Name: Ubuntu 18.04.6 LTS (Kernel 5.4.0-124-generic)
Architecture: x86_64
cmboxpgm.exe -f6000010 -lif:"MyFirstUfcLif.WibuCmLIF" - lfs:smart:3 -lpn:"Universal Firm Code - 2000" -lpid:2000 -lopt:vm,reimport -v
二
初步接触
$cmu -i -f xxx.WibuCmLIF
cmu - CodeMeter Universal Support Tool.
Version 6.60 of 2017-Dec-18 (Build 2869) for Linux
Copyright (C) 2007-2017 by WIBU-SYSTEMS AG. All rights reserved.
List remote updates failed: It is not permitted to use this license on a virtual machine, Error 273.
sudo netstat -tlp | grep 22350
tcp 0 0 0.0.0.0:22350 0.0.0.0:* LISTEN 12483/CodeMeterLin
tcp6 0 0 [::]:22350 [::]:* LISTEN 12483/CodeMeterLin
cmu -i -f xxx.WibuCmLIF
cmu - CodeMeter Universal Support Tool.
Version 6.60 of 2017-Dec-18 (Build 2869) for Linux
Copyright (C) 2007-2017 by WIBU-SYSTEMS AG. All rights reserved.
List remote updates failed: A network error occurred, Error 100.
三
分析CodeMeterLin
char __fastcall license_dec(__int64 a1, __int64 a2)
{
int v2; // edx
char result; // al
_DWORD *v4; // rcx
unsigned __int64 v5; // r8
unsigned __int64 v6; // r8
unsigned int v7; // edx
__int64 v8; // rax
v2 = *(_DWORD *)(a1 + 260);
result = 0;
if ( (v2 & 1) == 0 )
{
result = 1;
if ( (v2 & 2) != 0 )
{
v4 = *(_DWORD **)(a1 + 264);
if ( v4 )
{
v5 = *(_QWORD *)(a1 + 280);
if ( v5 )
{
result = 0;
if ( !a2 )
return result;
v6 = v5 >> 2;
if ( v6 )
{
v7 = 0;
v8 = 0LL;
do
{
v4[v8] ^= a2;
v8 = ++v7;
a2 = 0x5917 * a2 + 0x4A6B;
}
while ( v7 < v6 );
v2 = *(_DWORD *)(a1 + 260);
}
}
}
result = 1;
*(_DWORD *)(a1 + 260) = v2 & 0xFFFFFFFD;
}
}
return result;
}
看雪ID:bluefish蓝鱼
https://bbs.pediy.com/user-home-674195.htm
# 往期推荐
球分享
球点赞
球在看
点击“阅读原文”,了解更多!