能力值:
( LV2,RANK:10 )
521 楼
用C写个KeyGen吧,内嵌汇编就算偷工减料了,见谅:
// the length of username is greater than 0
char username[30] = "iiiiiiii";
// 0x30 <= passwd[i] <= 0x7e
char passwd[30] = "1234567890abcdef";//16 bytes
int i,j,k;
unsigned int ecx_value,eax_value;
//the length of username is equal 16(if not, repeat padding )
if ( (i = strlen(username)) < 16 )
{
j = 16 - i;
for ( k = 0; k < j; k++ )
{
username[i+k] = username[k%i];
}
}
// 004011F1 /$ A1 60214000 mov eax, dword ptr [402160]
// 004011F6 |. 8B1D 64214000 mov ebx, dword ptr [402164]
// 004011FC |. 3305 71214000 xor eax, dword ptr [402171]
// 00401202 |. 331D 75214000 xor ebx, dword ptr [402175]
// 00401208 |. 25 0F1F3F7F and eax, 7F3F1F0F
// 0040120D |. 81E3 00010307 and ebx, 07030100
for ( passwd[3] = 0x30; passwd[3] < 0x7f; passwd[3]++ )
{
for ( passwd[2] = 0x30; passwd[2] <= 0x3f; passwd[2]++ )
{
for ( passwd[1] = 0x30; passwd[1] <= 0x3f; passwd[1]++ )
{
for ( passwd[0] = 0x30; passwd[0] <= 0x3f; passwd[0]++ )
{ for ( passwd[7] = 0x30; passwd[7] <= 0x37; passwd[7]++ )
{
for ( passwd[6] = 0x30; passwd[6] <= 0x33; passwd[6]++ )
{
for ( passwd[5] = 0x30; passwd[5] <= 0x31; passwd[5]++ )
{
// for ( passwd[4] = 0x30; passwd[4] < 0x7f; passwd[4]++ )// can use any value
// {
// }
_asm
{
mov addr_402182,0fedcba98h
lea ecx,username
mov eax, [ecx]
mov ebx, [ecx+4]
lea ecx,passwd
xor eax, [ecx]
xor ebx, [ecx+4]
and eax, 7F3F1F0Fh
and ebx, 7030100h
xor ecx, ecx
L_3:
mov esi, eax
mov edi, ebx
shl esi, cl
shl edi, cl
and esi, 80808080h
and edi, 80808080h
mov edx, esi
shr dh, 7
shl dx, 7
shr edx, 8
shr dh, 7
shl dx, 7
shr edx, 8
shr dh, 7
shr dx, 1
mov esi, edx
mov edx, edi
shr dh, 7
shl dx, 7
shr edx, 8
shr dh, 7
shl dx, 7
shr edx, 8
shr dh, 7
shr dx, 5
mov edi, edx
xor edi, esi
mov edx, edi
and edx, 0FFh
push ecx
push edx
mov edx, 8
xchg eax, ecx
cmp eax, 3
jg short L_1
mul dl
pop edx
add eax, 8
xchg eax, ecx
rol eax, cl
xor eax, edx
ror eax, cl
jmp short L_2
L_1:
sub eax, 3
mul dl
pop edx
xchg eax, ecx
rol ebx, cl
xor ebx, edx
ror ebx, cl
L_2:
pop ecx
inc ecx
cmp ecx, 8
jnz L_3 ;00401110 call 00401190
mov ecx,0ff01h
push ecx
lea edx,retn_addr
push edx
jmp fun_start
fun_00401190:
lea edx,retn_addr1
push edx
fun_start:
pop edi
pop ecx
push edi
cmp ecx, 80h
jle short L_004011F0
push ecx
mov esi, ecx
and ecx, 0FFh
mov edi, eax
cmp ecx, 8
jle short L_004011B0
mov edi, ebx
shr ecx, 4
L_004011B0:
rol edi, 8
shr ecx, 1
jnz short L_004011B0
shr esi, 8
and edi, esi
and edi, 0FFh
pop ecx
L_004011C3:
mov esi, 80h
L_004011C8:
test esi, edi
je short L_004011EC
xor edi, esi
push edi
and ecx, 0FF00h
xchg esi, ecx
xor ch, cl
xor esi, ecx
xchg ecx, esi
push ecx
inc dword ptr addr_402182
jmp fun_00401190
retn_addr1:
pop edi
jmp short L_004011C3
L_004011EC:
shr esi, 1
jnz short L_004011C8
L_004011F0:
retn
retn_addr:
mov ecx_value,ecx
}
if ( ecx_value == 1 )
{
for ( passwd[8] = 0x30; passwd[8] < 0x7f; passwd[8]++ )
{
for ( passwd[9] = 0x30; passwd[9] < 0x7f; passwd[9]++ )
{
for ( passwd[10] = 0x30; passwd[10] < 0x7f; passwd[10]++ )
{
for ( passwd[11] = 0x30; passwd[11] < 0x7f; passwd[11]++ )
{
_asm
{
lea edx,username
mov eax,dword ptr [edx+8]
mov ebx,dword ptr [edx+0ch]
xor eax,ebx
xor eax,dword ptr addr_402182
or eax,40404040h
and eax,077777777h
lea edx,passwd
xor eax,dword ptr [edx+8]
// xor eax,dword ptr [edx+0ch]
mov eax_value,eax
}
passwd[12] = eax_value & 0xff;
passwd[13] = eax_value>>8 & 0xff;
passwd[14] = eax_value>>16 & 0xff;
passwd[15] = eax_value>>24 & 0xff;
if (((passwd[12]>=0x30) && (passwd[12] < 0x7f)) &&
((passwd[13]>=0x30) && (passwd[13] < 0x7f)) &&
((passwd[14]>=0x30) && (passwd[14] < 0x7f)) &&
((passwd[15]>=0x30) && (passwd[15] < 0x7f)))
{
printf("passwd is: %s\n",passwd);
goto found;
}
}
}
}
}
}
}
}
} }
}
}
}
found:
printf("done.");