32位下由C++编译的EXE文件,无壳。
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v3;
unsigned int v4;
__m128i v5;
unsigned int v6;
const __m128i *v7;
__m128i v8;
int v9;
char v11;
char v12;
char v13;
char v14;
unsigned int v15;
printf("please input your flah:");
v11 = 0;
memset(&v12, 0, 0x63u);
scanf("%s", &v11);
v13 = 0;
memset(&v14, 0, 0x63u);
sub_401000(&v15, &v13, (unsigned __int8 *)&v11, strlen(&v11));
v3 = v15;
v4 = 0;
if ( v15 )
{
if ( v15 >= 0x10 )
{
v5 = _mm_load_si128((const __m128i *)&xmmword_414F20);
v6 = v15 - (v15 & 0xF);
v7 = (const __m128i *)&v13;
do
{
v8 = _mm_loadu_si128(v7);
v4 += 16;
++v7;
_mm_storeu_si128((__m128i *)&v7[-1], _mm_xor_si128(v8, v5));
}
while ( v4 < v6 );
}
for ( ; v4 < v3; ++v4 )
*(&v13 + v4) ^= 0x25u;
}
v9 = strcmp(&v13, "you_know_how_to_remove_junk_code");
if ( v9 )
v9 = -(v9 < 0) | 1;
if ( v9 )
printf("wrong\n");
else
printf("correct\n");
system("pause");
return 0;
}
signed int __usercall sub_401000@<eax>(unsigned int *a1@<edx>, _BYTE *a2@<ecx>, unsigned __int8 *a3, unsigned int a4)
{
int v4;
unsigned int v5;
int v6;
unsigned __int8 *v7;
int v8;
bool v9;
unsigned __int8 v10;
char v11;
_BYTE *v12;
unsigned int v13;
int v14;
unsigned __int8 v15;
char v16;
_BYTE *v18;
unsigned int *v19;
int v20;
unsigned int v21;
int i;
v4 = 0;
v18 = a2;
v5 = 0;
v6 = 0;
v19 = a1;
v20 = 0;
if ( !a4 )
return 0;
v7 = a3;
do
{
v8 = 0;
v9 = v5 == a4;
if ( v5 < a4 )
{
do
{
if ( a3[v5] != 32 )
break;
++v5;
++v8;
}
while ( v5 < a4 );
v9 = v5 == a4;
}
if ( v9 )
break;
if ( a4 - v5 >= 2 && a3[v5] == 13 && a3[v5 + 1] == 10 || (v10 = a3[v5], v10 == 10) )
{
v6 = v20;
}
else
{
if ( v8 )
return -44;
if ( v10 == 61 && (unsigned int)++v4 > 2 )
return -44;
if ( v10 > 0x7Fu )
return -44;
v11 = byte_414E40[v10];
if ( v11 == 127 || (unsigned __int8)v11 < 0x40u && v4 )
return -44;
v6 = v20++ + 1;
}
++v5;
}
while ( v5 < a4 );
if ( !v6 )
return 0;
v12 = v18;
v13 = ((unsigned int)(6 * v6 + 7) >> 3) - v4;
if ( v18 && *v19 >= v13 )
{
v21 = 3;
v14 = 0;
for ( i = 0; v5; --v5 )
{
v15 = *v7;
if ( *v7 != 13 && v15 != 10 && v15 != 32 )
{
v16 = byte_414E40[v15];
v21 -= v16 == 64;
v14 = v16 & 0x3F | (v14 << 6);
if ( ++i == 4 )
{
i = 0;
if ( v21 )
*v12++ = BYTE2(v14);
if ( v21 > 1 )
*v12++ = BYTE1(v14);
if ( v21 > 2 )
*v12++ = v14;
}
}
++v7;
}
*v19 = v12 - v18;
return 0;
}
*v19 = v13;
return -42;
}
看不懂啊…看wp说sub_401000()是base64解密算法。也就是说这个程序是将字符串拿去base64解密后再与0x25异或。
char n[33]="you_know_how_to_remove_junk_code";
int flag[33];
int i;
for(i=0; i<32; i++)
{
flag[i] = n[i] ^ 0x25;
printf("%c",(char)flag[i]);
}
拿去base64加密得
XEpQek5LSlJ6TUpSelFKeldASEpTQHpPUEtOekZKQUA=
|