把文件加载入ida
一开始在右边找不到主函数。
于是去字符串里面找,F12+shift打开字符串面板
发现有蹊跷,点进去看看。
有一个s,有一个E其他都是o和_,估计就是迷宫题了,接着就差寻找代码段了。
复制一下上面的‘Ur not on the way!!’搜索所有出现该句的地方。
结果发现一个test段,点进去F5反编译就是代码段了。
int sub_401A10()
{
int v0; // ecx
int v1; // eax
int v2; // esi
char *v3; // ecx
unsigned int v4; // kr00_4
int v5; // eax
char v6; // cl
char v8[108]; // [esp+8h] [ebp-70h]
char v9[108]; // [esp+9h] [ebp-6Fh]
sub_402400(dword_431974);
sub_401CB0(v0, "give me your way:");
sub_406FD0(v8, 0, 100);
v1 = sub_409A97(0);
sub_409E54(v1);
sub_401100("%64s", (unsigned int)v8);
v2 = 0;
v3 = v9;
v4 = strlen(v8);
if ( v4 )
{
v5 = dword_431960;
while ( 1 )
{
v6 = v8[v2];
if ( v6 == 97 )
break;
switch ( v6 )
{
case 119:
v5 -= 31; //在这里可以看出迷宫每一排为31个字符
goto LABEL_11;
case 115:
v5 += 31;
goto LABEL_11;
case 100:
++v5;
goto LABEL_11;
}
LABEL_12:
LOBYTE(v3) = byte_42E820[v5];
if ( (_BYTE)v3 == 111 )
{
sub_401CB0(v3, "Ur not on the way!!");
sub_4099B9(0);
LABEL_17:
sub_401CB0(v3, "ttttttttttttttttttttql!!");
sub_4099B9(0);
JUMPOUT(*(_DWORD *)algn_401B14);
}
if ( (_BYTE)v3 == 69 )
goto LABEL_17;
if ( ++v2 >= v4 )
return 0;
}
--v5;
LABEL_11:
dword_431960 = v5;
goto LABEL_12;
}
return 0;
}
所以开始给字符串分段。分段的时候会发现最后一排为30个字符,少一个,于是回去看
将5Fh转换成字符,也是一个_,我觉得这也是个坑吧。这下就完美了,每排都是31个字符。
接着就根据迷宫解出答案
dddddddwwwwaaaaaaawwwddddddddddsdsdsddwdwdwddddsssssssdddddddddd
flag为SYC{dddddddwwwwaaaaaaawwwddddddddddsdsdsddwdwdwddddsssssssdddddddddd}.