// Serial Port Utility破解.cpp: 定义控制台应用程序的入口点。
//
#include "stdafx.h"
char *ss = (char *)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char sn[29];
int GetSSN(char ch)
{
char p[2];
p[1] = 0;
p[0] = ch;
return strstr(ss,p) - ss;
}
int sndiv(int x,int p)
{
return x % p;
}
int main()
{
char *str = (char *)"SA56W-UR34V-7KY76-XB31F-HZPAU";
//06 - License Version [ebp - 0xB0] = 3 /9
//07 - Product Name [ebp - 0xB4] = 1 /2
//08 - Product Version [ebp - 0xB8] != 2 /5
//09 - Active Mode /3
//0A - Language /5
//0C - Software Type /5
//0D - Valid Period /6
//char *str = (char *)"11111-UR311-81111-11111-1112F";
int i;
int sum = 0;
for(i = 0;i < 29;i++)
{
if(str[i] != '-')
{
sn[i] = GetSSN(str[i]);
}
else
{
sn[i] = 0;
}
}
for(i = 0;i < 27;i++)
{
sum += sn[i];
}
printf("Calculate Sum:%d\n",sum);
printf("License Version:%d\nProduct Name:%d\nProduct Version:%d\nActive Mode:%d\nLanguage:%d\nSoftware Type:%d\nValid Period:%d\n",sndiv(sn[0x06],9),sndiv(sn[0x07],2),sndiv(sn[0x08],5),sndiv(sn[0x09],3),sndiv(sn[0x0A],5),sndiv(sn[0x0C],5),sndiv(sn[0x0D],6));
return 0;
}