攻防世界-进阶-Reversing-x64Elf-100

关键代码

signed __int64 __fastcall sub_4006FD(__int64 a1)
{
  signed int i; // [rsp+14h] [rbp-24h]
  const char *v3; // [rsp+18h] [rbp-20h]
  const char *v4; // [rsp+20h] [rbp-18h]
  const char *v5; // [rsp+28h] [rbp-10h]

  v3 = "Dufhbmf";
  v4 = "pG`imos";
  v5 = "ewUglpt";
  for ( i = 0; i <= 11; ++i )
  {
    if ( (&v3)[i % 3][2 * (i / 3)] - *(char *)(i + a1) != 1 )//关键代码,a1为flag所以要逆着求a1
      return 1LL;
  }
  return 0LL;
}

解题脚本

str=["Dufhbmf","pG`imos","ewUglpt"]
flag = ''
for i in range(12):
    flag+=chr(ord(str[i % 3][2 * (i / 3)] )- 1)//字符串直接赋值
print flag

你可能感兴趣的:(攻防世界-进阶-Reversing-x64Elf-100)