dmd-50

因为之前没有看到过md5加密,所以做这个题目有一丝丝的困难,因此在看了wp后,发现还是满简单的,

在这里插入代码片int __cdecl main(int argc, const char **argv, const char **envp)
{
  __int64 v3; // rax
  __int64 v4; // rax
  __int64 v5; // rax
  __int64 v6; // rax
  __int64 v7; // rax
  __int64 v8; // rax
  __int64 v9; // rax
  __int64 v10; // rax
  __int64 v11; // rax
  __int64 v12; // rax
  __int64 v13; // rax
  __int64 v14; // rax
  __int64 v15; // rax
  __int64 v16; // rax
  __int64 v17; // rax
  __int64 v18; // rax
  __int64 v19; // rax
  __int64 v20; // rax
  __int64 v21; // rax
  int result; // eax
  __int64 v23; // rax
  __int64 v24; // rax
  __int64 v25; // rax
  __int64 v26; // rax
  __int64 v27; // rax
  __int64 v28; // rax
  __int64 v29; // rax
  __int64 v30; // rax
  __int64 v31; // rax
  __int64 v32; // rax
  __int64 v33; // rax
  __int64 v34; // rax
  __int64 v35; // rax
  __int64 v36; // rax
  __int64 v37; // rax
  char v38; // [rsp+Fh] [rbp-71h]
  char v39; // [rsp+10h] [rbp-70h]
  char v40; // [rsp+20h] [rbp-60h]
  _BYTE *v41; // [rsp+28h] [rbp-58h]
  char v42; // [rsp+30h] [rbp-50h]
  unsigned __int64 v43; // [rsp+68h] [rbp-18h]

  v43 = __readfsqword(0x28u);
  std::operator<<<std::char_traits<char>>(&std::cout, "Enter the valid key!\n", envp);
  std::operator>><char,std::char_traits<char>>(&edata, &v42);
  std::allocator<char>::allocator(&v38);
  std::string::string(&v39, &v42, &v38);
  md5((MD5 *)&v40, (const std::string *)&v39);
  v41 = (_BYTE *)std::string::c_str((std::string *)&v40);
  std::string::~string((std::string *)&v40);
  std::string::~string((std::string *)&v39);
  std::allocator<char>::~allocator(&v38);
  if ( *v41 != '7'
    || v41[1] != '8'
    || v41[2] != '0'
    || v41[3] != '4'
    || v41[4] != '3'
    || v41[5] != '8'
    || v41[6] != 'd'
    || v41[7] != '5'
    || v41[8] != 'b'
    || v41[9] != '6'
    || v41[10] != 'e'
    || v41[11] != '2'
    || v41[12] != '9'
    || v41[13] != 'd'
    || v41[14] != 'b'
    || v41[15] != '0'
    || v41[16] != '8'
    || v41[17] != '9'
    || v41[18] != '8'
    || v41[19] != 'b'
    || v41[20] != 'c'
    || v41[21] != '4'
    || v41[22] != 'f'
    || v41[23] != '0'
    || v41[24] != '2'
    || v41[25] != '2'
    || v41[26] != '5'
    || v41[27] != '9'
    || v41[28] != '3'
    || v41[29] != '5'
    || v41[30] != 'c'
    || v41[31] != '0' )
  {
    v23 = std::operator<<<std::char_traits<char>>(&std::cout, 'I');
    v24 = std::operator<<<std::char_traits<char>>(v23, 'n');
    v25 = std::operator<<<std::char_traits<char>>(v24, 'v');
    v26 = std::operator<<<std::char_traits<char>>(v25, 'a');
    v27 = std::operator<<<std::char_traits<char>>(v26, 'l');
    v28 = std::operator<<<std::char_traits<char>>(v27, 'i');
    v29 = std::operator<<<std::char_traits<char>>(v28, 'd');
    v30 = std::operator<<<std::char_traits<char>>(v29, ' ');
    v31 = std::operator<<<std::char_traits<char>>(v30, 'K');
    v32 = std::operator<<<std::char_traits<char>>(v31, 'e');
    v33 = std::operator<<<std::char_traits<char>>(v32, 'y');
    v34 = std::operator<<<std::char_traits<char>>(v33, '!');
    v35 = std::operator<<<std::char_traits<char>>(v34, ' ');
    v36 = std::operator<<<std::char_traits<char>>(v35, ':');
    v37 = std::operator<<<std::char_traits<char>>(v36, '(');
    std::ostream::operator<<(v37, &std::endl<char,std::char_traits<char>>);
    result = 0;
  }
  else
  {
    v3 = std::operator<<<std::char_traits<char>>(&std::cout, 'T');
    v4 = std::operator<<<std::char_traits<char>>(v3, 'h');
    v5 = std::operator<<<std::char_traits<char>>(v4, 'e');
    v6 = std::operator<<<std::char_traits<char>>(v5, ' ');
    v7 = std::operator<<<std::char_traits<char>>(v6, 'k');
    v8 = std::operator<<<std::char_traits<char>>(v7, 'e');
    v9 = std::operator<<<std::char_traits<char>>(v8, 'y');
    v10 = std::operator<<<std::char_traits<char>>(v9, ' ');
    v11 = std::operator<<<std::char_traits<char>>(v10, 'i');
    v12 = std::operator<<<std::char_traits<char>>(v11, 's');
    v13 = std::operator<<<std::char_traits<char>>(v12, ' ');
    v14 = std::operator<<<std::char_traits<char>>(v13, 'v');
    v15 = std::operator<<<std::char_traits<char>>(v14, 'a');
    v16 = std::operator<<<std::char_traits<char>>(v15, 'l');
    v17 = std::operator<<<std::char_traits<char>>(v16, 'i');
    v18 = std::operator<<<std::char_traits<char>>(v17, 'd');
    v19 = std::operator<<<std::char_traits<char>>(v18, ' ');
    v20 = std::operator<<<std::char_traits<char>>(v19, ':');
    v21 = std::operator<<<std::char_traits<char>>(v20, ')');
    std::ostream::operator<<(v21, &std::endl<char,std::char_traits<char>>);
    result = 0;
  }
  return result;
}

我们在网上加密可以看出,是进行了两次md5加密,所以我们需要在解码后,找到grape,再进行一次加密。

你可能感兴趣的:(ctf)