【练习】reserving.kr之easy ELF

时间:2022-12-22 18:24:44

打开主函数:

int __cdecl main()
{
int result; // eax@2 write(, "Reversing.Kr Easy ELF\n\n", 0x17u);
sub_8048434();
if ( main_0() == ) // 算法函数
{
sub_80484F7(); // correct!
result = ;
}
else
{
write(, "Wrong\n", 6u);
result = ;
}
return result;
}

进入算法函数:

int sub_8048451()
{
int result; // eax@2 if ( byte_804A021 == 0x31 )
{
byte_804A020 ^= 0x34u;
byte_804A022 ^= 0x32u;
byte_804A023 ^= 0x88u;
if ( byte_804A024 == 0x58 )
{
if ( byte_804A025 )
{
result = ;
}
else if ( byte_804A022 == 0x7C )
{
if ( byte_804A020 == 0x78 )
result = byte_804A023 == 0xDDu;
else

分析flag的泄露地址,写出exp如下:

flag=''
flag+=chr(0x78^0x34)
flag+=''
flag+=chr(0x7c^0x32)
flag+=chr(0xdd^0x88)
flag+='X'
print flag

flag为L1NUX