直接丢IDA
[C] 纯文本查看 复制代码 signed int wmain()
{
unsigned int v0; // kr00_4
signed int i; // ecx
unsigned int v3; // kr04_4
FILE *(__cdecl *v4)(const char *, const char *); // ebx
FILE *v5; // eax
FILE *v6; // esi
void (__cdecl *v7)(FILE *); // edi
signed int v8; // eax
FILE *v9; // esi
char Filename[4]; // [esp+0h] [ebp-40h]
int v11; // [esp+4h] [ebp-3Ch]
int v12; // [esp+8h] [ebp-38h]
int v13; // [esp+Ch] [ebp-34h]
int v14; // [esp+10h] [ebp-30h]
char Buf[4]; // [esp+14h] [ebp-2Ch]
int v16; // [esp+18h] [ebp-28h]
int v17; // [esp+1Ch] [ebp-24h]
__int64 v18; // [esp+20h] [ebp-20h]
int v19; // [esp+28h] [ebp-18h]
int v20; // [esp+2Ch] [ebp-14h]
int v21; // [esp+30h] [ebp-10h]
int v22; // [esp+34h] [ebp-Ch]
char v23; // [esp+38h] [ebp-8h]
__int16 v24; // [esp+39h] [ebp-7h]
char v25; // [esp+3Bh] [ebp-5h]
strcpy(Filename, "52pojie.txt");
v13 = 0;
v14 = 0;
v19 = '24XB';
v22 = '1J6D';
v20 = 'T3TE';
v21 = 'V23K';
v24 = 0;
v25 = 0;
v23 = 0;
strcpy(Buf, "reading GO!!!");
*(_DWORD *)((char *)&v18 + 2) = 0;
HIWORD(v18) = 0;
printf(
&Format,
*(_DWORD *)Filename,
v11,
v12,
0,
0,
*(_DWORD *)Buf,
v16,
v17,
(unsigned __int64)(unsigned __int16)v18,
'24XB',
'T3TE',
'V23K',
'1J6D',
0);
scanf("%s", &v19);
v0 = strlen((const char *)&v19);
if ( v0 > 0x10 )
return -1;
for ( i = 0; i < (signed int)v0; ++i )
*((_BYTE *)&v19 + i) ^= 0x52u;
v3 = strlen((const char *)&v19);
v4 = fopen;
v5 = fopen(Filename, "r");
v6 = v5;
if ( v5 )
{
if ( !feof(v5) )
{
do
fgets(Buf, v3 + 1, v6);
while ( !feof(v6) );
}
v7 = (void (__cdecl *)(FILE *))fclose;
fclose(v6);
v4 = fopen;
}
else
{
v7 = (void (__cdecl *)(FILE *))fclose;
}
if ( !strcmp((const char *)&v19, Buf) )
{
if ( strlen((const char *)&v19) != 16 || strlen(Buf) != 16 )
return 0;
v8 = 0;
do
*((_BYTE *)&v19 + v8++) ^= 0x52u;
while ( v8 < 16 );
v9 = v4(Filename, "w");
fputs((const char *)&v19, v9);
}
else
{
v9 = v4(Filename, "w");
fputs("o%%%|g`\"=8;7|1<o", v9);
}
v7(v9);
return 1;
}
直接看出key xor 0x52 = o%%%|g`\"=8;7|1<o
解出 key为
=www.52pojie.cn= |