-
-
[原创]第3题
-
2017-10-28 18:07 1266
-
定位窗口处理函数
.text:00434CC8 push 0 ; dwInitParam .text:00434CCA push offset DialogFunc ; lpDialogFunc .text:00434CCF push 0 ; hWndParent .text:00434CD1 push 65h ; lpTemplateName .text:00434CD3 mov eax, [ebp+hInstance] .text:00434CD6 push eax ; hInstance .text:00434CD7 call ds:DialogBoxParamA
buf_morse=b64_decode(b64_decode(sn))
buf_hash=hash(buf_morse, 3) 只算了前3字节的hash(32字节)
buf_steps=morse_decode(buf_morse)
.text:004350A6 lea eax, [ebp+var_C30] .text:004350AC push eax .text:004350AD push 400h .text:004350B2 lea ecx, [ebp+sn] .text:004350B8 push ecx .text:004350B9 call b64_decode .text:004350BE add esp, 0Ch .text:004350C1 mov [ebp+var_1440], 0 .text:004350C8 push 3FFh ; size_t .text:004350CD push 0 ; int .text:004350CF lea eax, [ebp+var_1440+1] .text:004350D5 push eax ; void * .text:004350D6 call j__memset .text:004350DB add esp, 0Ch .text:004350DE lea eax, [ebp+buf_morse] .text:004350E4 push eax .text:004350E5 push 400h .text:004350EA lea ecx, [ebp+var_C30] .text:004350F0 push ecx .text:004350F1 call b64_decode .text:004350F6 add esp, 0Ch .text:004350F9 push 400h ; int .text:004350FE lea eax, [ebp+var_1440] .text:00435104 push eax ; int .text:00435105 lea ecx, [ebp+buf_morse] .text:0043510B push ecx ; char * .text:0043510C call morse_decode .text:00435111 add esp, 0Ch .text:00435114 mov [ebp+var_144C], 3 .text:0043511E lea eax, [ebp+buf_hash] .text:00435124 push eax ; int .text:00435125 mov ecx, [ebp+var_144C] .text:0043512B push ecx ; size_t .text:0043512C lea edx, [ebp+buf_morse] .text:00435132 push edx ; void * .text:00435133 call hash .text:00435138 add esp, 0Ch
比较sn末尾的64个字符与buf_hash是否匹配
.text:0043518B lea eax, [ebp+var_187C] .text:00435191 push eax ; char * .text:00435192 call j__strlen .text:00435197 add esp, 4 .text:0043519A push eax ; size_t .text:0043519B lea ecx, [ebp+sn] .text:004351A1 push ecx ; char * .text:004351A2 call j__strlen .text:004351A7 add esp, 4 .text:004351AA lea esi, [ebp+eax+sn] .text:004351B1 lea edx, [ebp+var_187C] .text:004351B7 push edx ; char * .text:004351B8 call j__strlen .text:004351BD add esp, 4 .text:004351C0 sub esi, eax .text:004351C2 push esi ; void * .text:004351C3 lea eax, [ebp+var_187C] .text:004351C9 push eax ; void * .text:004351CA call j__memcmp .text:004351CF add esp, 0Ch
用buf_steps走10*10的迷宫, 遇到空格结束
.text:004351DB lea eax, [ebp+var_1440] .text:004351E1 push eax .text:004351E2 push offset g_maze .text:004351E7 call walk_maze .text:004351EC add esp, 8 .text:004351EF movzx ecx, al int g_maze[10][10] = { { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, { 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 }, { 1, 0, 0, 0, 0, 0, 1, 0, 1, 1 }, { 1, 1, 1, 1, 1, 0, 1, 0, 0, 1 }, { 1, 0, 0, 0, 1, 0, 1, 0, 0, 1 }, { 1, 0, 1, 0, 0, 0, 1, 0, 1, 1 }, { 1, 0, 1, 1, 1, 1, 1, 0, 0, 1 }, { 1, 0, 0, 0, 0, 1, 1, 1, 0, 0 }, { 1, 1, 1, 1, 0, 0, 0, 0, 1, 0 }, { 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 } };
初始坐标(x,y)=(0,0)
0表示可以走, 1表示不能走
(8,3)这个不知道是算陷阱还是算出口
z: 向下
q: 向上
p: 向左
l: 向右
空格: 结束
向上和向右移动时, 来路会被堵上
根据上述条件, 由于没限制步数, 只走一步或者走完都是可以的
TFMwdUxpQXZJQQb92a72497b685c31013347a7276f371f8cf91085ab8322009bfed2df41d94f94
另外, sn的总长度也没限制, 因此在base64和hash之间插入多少字符都可以(总长不超过1024)
赞赏
他的文章
KCTF2020秋季赛 第十题 终焉之战
3190
KCTF2020秋季赛 第九题 命悬一线
2615
KCTF2020秋季赛 第八题 惊天阴谋
2765
KCTF2020秋季赛 第七题 鱼目混珠
2774
KCTF2020秋季赛 第四题 突破重围
1101