无壳32位文件 32位ida打开查看main函数 _main();太乱了不想看 先看func()
int func()
{
int result;
int v1;
int v2;
int v3;
int v4;
unsigned __int8 v5;
unsigned __int8 v6;
unsigned __int8 v7;
unsigned __int8 v8;
unsigned __int8 v9;
int v10;
int v11;
int v12;
int v13;
unsigned __int8 v14;
char v15;
char v16;
char v17;
char v18;
char v19;
char v20;
char v21;
char v22;
char v23;
char v24;
char v25;
char v26;
char v27;
char v28;
char v29;
char v30;
char v31;
int i;
v15 = 81;
v16 = 115;
v17 = 119;
v18 = 51;
v19 = 115;
v20 = 106;
v21 = 95;
v22 = 108;
v23 = 122;
v24 = 52;
v25 = 95;
v26 = 85;
v27 = 106;
v28 = 119;
v29 = 64;
v30 = 108;
v31 = 0;
printf("Please input:");
scanf("%s", &v5);
result = v5;
if ( v5 == 'A' )
{
result = v6;
if ( v6 == 'C' )
{
result = v7;
if ( v7 == 'T' )
{
result = v8;
if ( v8 == 'F' )
{
result = v9;
if ( v9 == '{' )
{
result = v14;
if ( v14 == '}' )
{
v1 = v10;
v2 = v11;
v3 = v12;
v4 = v13;
for ( i = 0; i <= 15; ++i )
{
if ( *((_BYTE *)&v1 + i) > 64 && *((_BYTE *)&v1 + i) <= 90 )
*((_BYTE *)&v1 + i) = (*((char *)&v1 + i) - 51) % 26 + 65;
if ( *((_BYTE *)&v1 + i) > 96 && *((_BYTE *)&v1 + i) <= 122 )
*((_BYTE *)&v1 + i) = (*((char *)&v1 + i) - 79) % 26 + 97;
}
for ( i = 0; i <= 15; ++i )
{
result = (unsigned __int8)*(&v15 + i);
if ( *((_BYTE *)&v1 + i) != (_BYTE)result )
return result;
}
result = printf("You are correct!");
}
}
}
}
}
}
return result;
}
ACTF{}不用管,直接看for循环 第一个for循环 65-90,97-122,对大小写字母分别加密 第二个for就是单纯的比较
变化后的值等于v15的值就行 能正着跑绝不逆向)
v15 = [81,115,119,51,115,106,95,108,122,52,95,85,106,119,64,108]
flag = ''
for i in range(0,16):
for j in range(0,127):
f=j
if j > 64 and j <= 90:
j = (j-51)%26 + 65
if j > 96 and j <= 122:
j = (j-79)%26 + 97
if(j == v15[i]):
flag += chr(f)
print(flag)
flag{Cae3ar_th4_Gre@t}
|