我自己看,感觉好像一句一句翻译的,写得很是生硬,不如书上写的灵活
0040137E 8B7424 04 MOV ESI,DWORD PTR SS:[ESP+4]
00401382 56 PUSH ESI
00401383 8A06 MOV AL,BYTE PTR DS:[ESI]
00401385 84C0 TEST AL,AL
00401387 74 13 JE SHORT serial.0040139C
00401389 3C 41 CMP AL,41
0040138B 72 1F JB SHORT serial.004013AC
0040138D 3C 5A CMP AL,5A
0040138F 73 03 JNB SHORT serial.00401394
00401391 46 INC ESI
00401392 ^ EB EF JMP SHORT serial.00401383
00401394 E8 39000000 CALL serial.004013D2
00401399 46 INC ESI
0040139A ^ EB E7 JMP SHORT serial.00401383
0040139C 5E POP ESI
0040139D E8 20000000 CALL serial.004013C2
004013A2 81F7 78560000 XOR EDI,5678
004013A8 8BC7 MOV EAX,EDI
004013AA EB 15 JMP SHORT serial.004013C1
004013AC 5E POP ESI
004013AD 6A 30 PUSH 30
004013AF 68 60214000 PUSH serial.00402160
004013B4 68 69214000 PUSH serial.00402169
004013B9 FF75 08 PUSH DWORD PTR SS:[EBP+8]
004013BC E8 79000000 CALL <JMP.&USER32.MessageBoxA>
004013C1 C3 RETN
004013C2 33FF XOR EDI,EDI
004013C4 33DB XOR EBX,EBX
004013C6 8A1E MOV BL,BYTE PTR DS:[ESI]
004013C8 84DB TEST BL,BL
004013CA 74 05 JE SHORT serial.004013D1
004013CC 03FB ADD EDI,EBX
004013CE 46 INC ESI
004013CF ^ EB F5 JMP SHORT serial.004013C6
004013D1 C3 RETN
004013D2 2C 20 SUB AL,20
004013D4 8806 MOV BYTE PTR DS:[ESI],AL
004013D6 C3 RETN
int fun(char *str)
{
char *temp = str;
int j = 0;
int i;
for( i = 0 ; ; i++ )
{
if( temp == '\0' )
{
break;
}
if( temp < 0x41 )
{
//return MessageBoxA(handle , "重试" , "出错" , 30);
}
if( temp > 0x5A )
{
temp -= 0x20;
}
}
for( i = 0 ; ; i++ )
{
if( temp == '\0' )
{
break;
}
j += (int)temp;
}
j = j ^ 0x5678;
return j;
}