看题目说一共有8个围成一圈的灯,需要输入1-8个数,输入的数会让相应的数字的灯改变状态(亮或灭),且该灯的前一个灯和后一个灯也会改变状态。输入0会让所有的灯都灭掉,当8个灯都亮起时flag就会出现。
另一个方法就比较麻烦一点了,用IDA32位打开程序
先找下main函数
找到后按下f5进行反汇编
跟进main0 继续跳转
看到一个if语句,以及判断的条件推测这就是得到flag的条件(用1和0来判断8个灯的亮灭)
当8个灯都亮的时候就输出flag,这里跟进sub_457AB4()
#include
#include
int main(void)
{
int a[] = {18,64,98,5,2,4,6,3,6,48,49,65,32,12,48,65,31,78,62,32,49,32,
1,57,96,3,21,9,4,62,3,5,4,1,2,3,44,65,78,32,16,97,54,16,44,
52,32,64,89,45,32,65,15,34,18,16,0};
int b[] = {123,32,18,98,119,108,65,41,124,80,125,38,124,111,74,49,
83,108,94,108,84,6,96,83,44,121,104,110,32,95,117,101,99,
123,127,119,96,48,107,71,92,29,81,107,90,85,64,12,43,76,86,
13,114,1,117,126,0};
for (int i = 0; i < 56; ++i)
{
b[i] ^= a[i];
b[i] ^= 0x13;
printf("%c",b[i]);
}
return 0;
}