一.题目链接:
https://adworld.xctf.org.cn/challenges/list
二.使用步骤
int __cdecl main(int argc, const char **argv, const char **envp)
{
int i; // ebx
char v4; // al
int result; // eax
int v6; // [esp+0h] [ebp-70h]
int v7; // [esp+0h] [ebp-70h]
char Buffer[2]; // [esp+12h] [ebp-5Eh] BYREF
char v9[20]; // [esp+14h] [ebp-5Ch] BYREF
char v10[32]; // [esp+28h] [ebp-48h] BYREF
__int16 v11; // [esp+48h] [ebp-28h]
char v12; // [esp+4Ah] [ebp-26h]
char v13[36]; // [esp+4Ch] [ebp-24h] BYREF
strcpy(v13, "437261636b4d654a757374466f7246756e");// v13=437261636b4d654a757374466f7246756e
while ( 1 )
{
memset(v10, 0, sizeof(v10));
v11 = 0;
v12 = 0;
sub_40134B((int)aPleaseInputYou, v6);
scanf("%s", v9);
if ( strlen(v9) > 17 ) // v9长度为17
break;
for ( i = 0; i < 17; ++i )
{
v4 = v9[i];
if ( !v4 )
break;
sprintf(Buffer, "%x", v4);
strcat(v10, Buffer);
}
if ( !strcmp(v10, v13) )
sub_40134B((int)aSuccess, v7);
else
sub_40134B((int)aWrong, v7);
}
sub_40134B((int)aWrong, v7);
result = --Stream._cnt;
if ( Stream._cnt < 0 )
return _filbuf(&Stream);
++Stream._ptr;
return result;
}
大致逻辑是将用户输入字符串单个与v13字符串单个进行对比,然后判断是否输入正确。v13对应的字符串是十六进制,直接用python转换过来即可。
CrackMeJustForFun