一个VB注册函数方法分析
本帖最后由 moocher 于 2022-3-24 21:50 编辑注册码函数分析
机器号:279422942294共12位
对应ASCII 32,37,39,34,32,32,39,34,32,32,39,34
生成序列号:32FK156637FK
有兴趣的朋友一起分析分析算法
Private Sub Proc_2_42_83F890
loc_0083F8E7: var_8004 = Len(Me) // 取机器码长度,开始循环【1~C】
loc_0083F915: If 1 > var_8004 Then GoTo loc_0083FCC1//长度为0跳出,循环1完毕跳出
loc_0083F954: var_3C = CStr(Mid(var_74, 1, 1)) // 取第n位数转字符
loc_0083F983: movzx dx, Asc(var_3C) // 取第n个字符的ASCII码
loc_0083F99C: var_18 = (ecx - var_3C) //
loc_0083F9BC: If 1 > var_8004 Then GoTo loc_0083FAE2 // 长度为0跳转,循环2完毕跳出。
loc_0083FA0B: var_24 = Asc(CStr(Mid(var_74, 1, 1))) // 取第n个字符的ASCII码
loc_0083FA6D: var_3C = CStr(Mid(var_74, var_8004(1)(-1), 1)) // 取倒数第n个字符串
loc_0083FA7D: var_2C = Asc(var_3C) //字符对应的ASCII码
loc_0083FAC5: ((ecx - var_3C) And 255) = ((ecx - var_3C) And 255) + var_2C*var_24*var_20*1// ecx 应该是第n个数字,倒数第n个*正数第n个*n*1 ,双循环
loc_0083FADD: GoTo loc_0083F9B5
loc_0083FAE2: ' Referenced from: 0083F9BC // 循环2结束
loc_0083FAE9: If Sign((((ecx - var_3C) And 255)+var_2C*var_24*var_20*1 And &H800000FF) - 0) Then GoTo loc_0083FAF2
loc_0083FAF2 : ' Referenced from: 0083FAE9
loc_0083FAF5: If ((((ecx - var_3C) And 255)+var_2C*var_24*var_20*1 And &H800000FF) - 1 Or -256) + 1 <> 48 Then GoTo loc_0083FB02//排除字符0
loc_0083FB00: GoTo loc_0083FB20
loc_0083FB02: ' Referenced from: 0083FAF5
loc_0083FB05: If var_30 <> 79 Then GoTo loc_0083FB12// 排除大写的O
loc_0083FB10: GoTo loc_0083FB20
loc_0083FB12: ' Referenced from: 0083FB05
loc_0083FB15: If var_30 <> 111 Then GoTo loc_0083FB36// 排除小写的o
loc_0083FB20: ' Referenced from: 0083FB00
loc_0083FB20: ' Referenced from: 0083FB10
loc_0083FB2B: var_30 = var_30 & global_004725D8// 0赋值1,O赋值2,o赋值3
loc_0083FB31: GoTo loc_0083FCA7
loc_0083FB39: If var_30 < 49 Then GoTo loc_0083FB90// 小于1
loc_0083FB3E: If var_30 > 57 Then GoTo loc_0083FB90// 大于9,特殊字符
loc_0083FB76: var_30 = var_30 & Chr(var_30)// 1到9数字的运算法则
loc_0083FB8B: GoTo loc_0083FCA7
loc_0083FB90: ' Referenced from: 0083FB39
loc_0083FB93: If eax < 65 Then GoTo loc_0083FB9A// 小于A,特殊字符
loc_0083FB98: If eax <= 78 Then GoTo loc_0083FBA4// A~N
loc_0083FB9A: ' Referenced from: 0083FB93
loc_0083FB9D: If eax < 80 Then GoTo loc_0083FBF4// 79 P
loc_0083FBA2: If eax > 90 Then GoTo loc_0083FBF4// Z后的特殊字符
loc_0083FBDA: var_30 = var_30 & Chr(0) //大写字符P及以前的运算法则
loc_0083FBEF: GoTo loc_0083FCA7
loc_0083FBF4: ' Referenced from: 0083FB9D
loc_0083FBF7: If eax < 97 Then GoTo loc_0083FBFE// a前的特殊字符
loc_0083FBFC: If eax <= 110 Then GoTo loc_0083FC08// a~n
loc_0083FBFE: ' Referenced from: 0083FBF7
loc_0083FC01: If eax < 112 Then GoTo loc_0083FC67 //111 p
loc_0083FC06: If eax > 122 Then GoTo loc_0083FC67 //z以后的特殊字符
loc_0083FC4C: var_30 = var_30 & Ucase(Chr(0)) //小写字符p及以前的的运算法则
loc_0083FC65: GoTo loc_0083FCA7
loc_0083FC67: ' Referenced from: 0083FC01 //特殊字符处理
loc_0083FC73:Mod 00000009h =Mod 00000009h + 1
loc_0083FC9C: var_30 = var_30 & CStr( Mod 00000009h+1)
loc_0083FCA7: ' Referenced from: 0083FB31
loc_0083FCA7: ' Referenced from: 0083FB8B
loc_0083FCA7: ' Referenced from: 0083FBEF
loc_0083FCA7: ' Referenced from: 0083FC65
loc_0083FCB9: var_20 = 1+var_20 // 循环+1
loc_0083FCBC: GoTo loc_0083F90E// 返回循环1
loc_0083FCC1: ' Referenced from: 0083F915 //运算结束跳转到这里
loc_0083FCCE: If Len(var_30) >= 12 Then GoTo loc_0083FD1D// 判断字符长度是否大于等于12
loc_0083FD08: var_30 = Left(var_30 & "A1B2C3D4E5F6", 12) //超过后处理
loc_0083FD1D: ' Referenced from: 0083FCCE
loc_0083FD23: var_38 = var_30
loc_0083FD2E: GoTo loc_0083FD60
loc_0083FD34: If var_4 = 0 Then GoTo loc_0083FD3F
loc_0083FD3F: ' Referenced from: 0083FD34
loc_0083FD5F: Exit Sub
loc_0083FD60: ' Referenced from: 0083FD2E
End Sub
VB能追出源码不? 本帖最后由 moocher 于 2022-5-21 19:07 编辑
#include <stdio.h>
#define MAX_DATA_LEN 12
char OriginData= {'2','7','9','4','2','2','9','4','2','2','9','4'};//输入279422942294,输出32FK156637FK
char calcuData; //calculated data
int DataTransfer(char *dataIn, char *dataOut)
{
int i = 0;
char a1 = dataIn;
char b1 = dataIn;
char compleCode; //c1, complement code
intasciiCode;
for(i=0; i<MAX_DATA_LEN; i++)
{
compleCode = 0xff - dataIn;
asciiCode= b1 * a1 * (i+1) * 12 + compleCode;
asciiCode= asciiCode & 0xff;
//printf("%02x,compleCode;\n", compleCode);
// printf("%02x,asciiCode;\n", asciiCode);
if('0' == asciiCode)
{
dataOut = '1';
}
else if('O' == asciiCode)
{
dataOut = '2';
}
else if('o' == asciiCode)
{
dataOut = '3';
}
else if(('1' <= asciiCode) && (asciiCode <= '9'))
{
dataOut = asciiCode;
}
else if(('A' <= asciiCode) && (asciiCode <= 'Z'))
{
dataOut = asciiCode;
}
else if(('a' <= asciiCode) && (asciiCode <= 'z'))
{
dataOut = asciiCode + 'A' - 'a';
}
else
{
dataOut = (asciiCode % 9) + 1 + '0';
}
}
return 0;
}
int main(void)
{
DataTransfer(OriginData, calcuData);
printf(calcuData);
return 0;
}
页:
[1]