求助大佬关于这段IDA代码如何理解
int __cdecl main(int argc, const char **argv, const char **envp){
unsigned int v3; // edx
unsigned int v4; // ecx
__m128i v5; // xmm1
unsigned int v6; // esi
const __m128i *v7; // eax
__m128i v8; // xmm0
int v9; // eax
char v11; //
char v12; //
char v13; //
char v14; //
unsigned int v15; //
printf("please input your flag:");
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, "this_is_a_simple_reverse_for_you");
if ( v9 )
v9 = -(v9 < 0) | 1;
if ( v9 )
printf("wrong\n");
else
printf("correct\n");
system("pause");
return 0;
} 我直接输入this_is_a_simple_reverse_for_you是错误的,怀疑前面有什么算法加密解密一类的 ,但是看不太懂反编译出来的伪代码,求大神指导 你输入的字符串是V11经过下面算法得出来的,你把计算结果当成输入,肯定不对嘛 minibeetuaman 发表于 2019-7-28 15:41
你输入的字符串是V11经过下面算法得出来的,你把计算结果当成输入,肯定不对嘛
等下我把算法也发出来,我已经在尝试还原算法了,可是这伪代码一堆看不懂,还原成c对我而言很困难 这是算法函数
signed int __usercall sub_401000@<eax>(unsigned int *a1@<edx>, _BYTE *a2@<ecx>, unsigned __int8 *a3, unsigned int a4)
{
int v4; // ebx
unsigned int v5; // eax
int v6; // ecx
unsigned __int8 *v7; // edi
int v8; // edx
bool v9; // zf
unsigned __int8 v10; // cl
char v11; // cl
_BYTE *v12; // esi
unsigned int v13; // ecx
int v14; // ebx
unsigned __int8 v15; // cl
char v16; // dl
_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 != 32 )
break;
++v5;
++v8;
}
while ( v5 < a4 );
v9 = v5 == a4;
}
if ( v9 )
break;
if ( a4 - v5 >= 2 && a3 == 13 && a3 == 10 || (v10 = a3, 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;
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;
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;
} 发一下文件看看 脱壳之后的文件,改下后缀名就可以了 主要是IDA反编译出来的伪代码一堆莫名其妙的代码,有没有大佬讲解一下
页:
[1]