天天看点

Easy ELF

elf文件用ida打开

main函数F5,判断条件为

if ( sub_8048451() ==  )
  {
    sub_80484F7(); //输出correct!
    result = ;
  }
  else
  {
    write(, "Wrong\n", );
    result = ;
  }
           

故只要sub_8048451()==1即可,查看这个函数

int sub_8048451()
{
  int result; // [email protected]
  if ( byte_804A021 ==  )
  {
    byte_804A020 ^= u;
    byte_804A022 ^= u;
    byte_804A023 ^= u;
    if ( byte_804A024 ==  )
    {
      if ( byte_804A025 )
      {
        result = ;
      }
      else if ( byte_804A022 ==  )
      {
        if ( byte_804A020 ==  )
          result = byte_804A023 == -;
        else
          result = ;
      }
      else
      {
        result = ;
      }
    }
    else
    {
      result = ;
    }
  }
  else
  {
    result = ;
  }
  return result;
}
           

然后找到byte_804A020看看这是什么东西

.bss:0804A020 byte_804A020    db ?                    ; DATA XREF: sub_8048434+Bo
.bss:0804A020                                         ; sub_8048451:loc_8048469r ...
.bss:0804A021 byte_804A021    db ?                    ; DATA XREF: sub_8048451+r
.bss:0804A022 byte_804A022    db ?                    ; DATA XREF: sub_8048451+r
.bss:0804A022                                         ; sub_8048451+w ...
.bss:0804A023 byte_804A023    db ?                    ; DATA XREF: sub_8048451+r
.bss:0804A023                                         ; sub_8048451+w ...
.bss:0804A024 byte_804A024    db ?                    ; DATA XREF: sub_8048451+r
.bss:0804A025 byte_804A025    db ?                    ; DATA XREF: sub_8048451:loc_80484A8r
           

看sub_8048434()函数

int sub_8048434()
{
  return __isoc99_scanf();
}
           

即是输入的字符串

写个c

#include <stdio.h>
int main ()
{
    char s[]={,'1',,,'X'};
    s[]=^;
    s[]=^;
    s[]=^-;
    s[]=;
    printf("%s",s);

}
           

答案为L1NUX,提交,正确