-
-
[原创] KCTF2021 第二题 南冥神功
-
发表于: 2021-5-12 15:12 4544
-
主要逻辑为读取输入Code
,将各个字符映射到各步走完迷宫即可。
每个字符得到两步:
每步对应的走法:
迷宫走法如下:
table
=
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
flag
=
''
res
=
[
[
1
,
2
], [
3
,
4
], [
3
,
2
], [
1
,
2
], [
3
,
4
], [
3
,
2
],
[
1
,
1
], [
0
,
1
], [
2
,
1
], [
0
,
0
], [
5
,
0
], [
5
,
4
],
[
3
,
4
], [
5
,
0
], [
5
,
0
], [
1
,
2
], [
1
,
0
], [
1
,
2
],
[
1
,
2
], [
3
,
4
], [
3
,
2
], [
2
,
3
], [
2
,
1
]
]
def
get_idx(i, c, n):
for
j
in
range
(
36
):
if
(i
+
j)
%
6
=
=
c
and
(i
+
j
/
/
6
)
%
6
=
=
n:
return
j
for
i
in
range
(
len
(res)):
cur_step, next_step
=
res[i]
# print(i, cur_step, next_step)
idx
=
get_idx(i,
5
-
cur_step, next_step)
flag
+
=
table[idx]
print
(flag)
# flag: GJ0V4LA4VKEVQZSVCNGJ00N
table
=
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
flag
=
''
res
=
[
[
1
,
2
], [
3
,
4
], [
3
,
2
], [
1
,
2
], [
3
,
4
], [
3
,
2
],
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
最后于 2021-5-12 15:17
被nwbjake编辑
,原因:
赞赏
看原图
赞赏
雪币:
留言: