打开发现是一个游戏,挺简单的,直接输入12345678就能直接拿到flag
使用IDA静态分析
在函数中搜索main,进入main函数,按F5进行反汇编
int __cdecl main(int argc, const char **argv, const char **envp)
{
int result; // eax
main_0();
return result;
}
跳转到main_0函数
void __cdecl main_0()
{
signed int i; // [esp+DCh] [ebp-20h]
int v1; // [esp+F4h] [ebp-8h]
sub_13FA7BE(&unk_14AB110);
sub_13FA7BE(&unk_14AB158);
sub_13FA7BE(&unk_14AB1A0);
sub_13FA7BE(&unk_14AB1E8);
sub_13FA7BE(&unk_14AB230);
sub_13FA7BE(&unk_14AB278);
sub_13FA7BE(&unk_14AB2C0);
sub_13FA7BE(&unk_14AB308);
sub_13FA7BE(&unk_14AAFD0);
sub_13FA7BE("| by 0x61 |\n");
sub_13FA7BE("| |\n");
sub_13FA7BE("|------------------------------------------------------|\n");
sub_13FA7BE(
"Play a game\n"
"The n is the serial number of the lamp,and m is the state of the lamp\n"
"If m of the Nth lamp is 1,it's on ,if not it's off\n"
"At first all the lights were closed\n");
sub_13FA7BE("Now you can input n to change its state\n");
sub_13FA7BE(
"But you should pay attention to one thing,if you change the state of the Nth lamp,the state of (N-1)th and (N+1)th w"
"ill be changed too\n");
sub_13FA7BE("When all lamps are on,flag will appear\n");
sub_13FA7BE("Now,input n \n");
while ( 1 )
{
while ( 1 )
{
sub_13FA7BE("input n,n(1-8)\n");
sub_13F9418();
sub_13FA7BE("n=");
sub_13F96D4("%d", &v1);
sub_13FA7BE("\n");
if ( v1 >= 0 && v1 <= 8 )
break;
sub_13FA7BE("sorry,n error,try again\n");
}
if ( v1 )
{
sub_13F76D6(v1 - 1);
}
else
{
for ( i = 0; i < 8; ++i )
{
if ( (unsigned int)i >= 9 )
j____report_rangecheckfailure();
byte_14D2E28[i] = 0;
}
}
j__system("CLS");
sub_13F8054();
if ( byte_14D2E28[0] == 1
&& byte_14D2E28[1] == 1