攻防世界 reverse新手题 Hello, CTF

Hello, CTF

运行一下,请输入序列
在这里插入图片描述
查看一下,无壳,32bit
在这里插入图片描述
用32位ida打开,找到main函数,F5查看伪代码

int __cdecl main(int argc, const char **argv, const char **envp)
{
  signed int v3; // ebx
  char v4; // al
  int result; // eax
  int v6; // [esp+0h] [ebp-70h]
  int v7; // [esp+0h] [ebp-70h]
  char v8; // [esp+12h] [ebp-5Eh]
  char v9[20]; // [esp+14h] [ebp-5Ch]
  char v10; // [esp+28h] [ebp-48h]
  __int16 v11; // [esp+48h] [ebp-28h]
  char v12; // [esp+4Ah] [ebp-26h]
  char v13; // [esp+4Ch] [ebp-24h]

  strcpy(&v13, "437261636b4d654a757374466f7246756e");
  while ( 1 )
  {
    memset(&v10, 0, 0x20u);
    v11 = 0;
    v12 = 0;
    sub_40134B(aPleaseInputYou, v6);
    scanf(aS, v9);
    if ( strlen(v9) > 0x11 )
      break;
    v3 = 0;
    do
    {
      v4 = v9[v3];
      if ( !v4 )
        break;
      sprintf(&v8, asc_408044, v4);
      strcat(&v10, &v8);
      ++v3;
    }
    while ( v3 < 17 );
    if ( !strcmp(&v10, &v13) )
      sub_40134B(aSuccess, v7);
    else
      sub_40134B(aWrong, v7);
  }
  sub_40134B(aWrong, v7);
  result = stru_408090._cnt-- - 1;
  if ( stru_408090._cnt < 0 )
    return _filbuf(&stru_408090);
  ++stru_408090._ptr;
  return result;
}

发现输入字符串大于17,程序结束0x11 = 17
小于17,则v10与v13比较,相同则输出:aSuccess
而v13一定大于17 ,v13=437261636b4d654a757374466f7246756e
进制转换,发现每位都在1-9 a-f之内,猜测为16位,转换如图
在这里插入图片描述
而题目描述为菜鸡发现Flag似乎并不一定是明文比较的
{CrackMeJustForFun}
直接提交,正确

猜你喜欢

转载自blog.csdn.net/weixin_45759668/article/details/107724413