首页
论坛
课程
招聘
[原创]第二题 南冥神功 解题
2021-5-11 18:27 2270

[原创]第二题 南冥神功 解题

2021-5-11 18:27
2270

是10x9数列,IDA分析看样子要求对所有为0的字节填1就OK了,把数据列出来,分析每次仅能移动1行1列,可以斜着,最后发现路径如图,找路径都找了半天,不过非常有趣啊!

 

然后上python代码爆破:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
'''
一个char分两次操作
第1次值为5 -  (index_in_string + index) %6
第2次值为(index + index_in_string / 6) % 6
{
0x53, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01,
0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01,
0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00
};
'''
 
road = [[0, 1], [1, 2], [2, 1], [2, 0], [3, 0], [4, 0], [4, 1],
        [5, 2], [6, 1], [6, 0], [7, 0], [8, 0],
        [8, 1], [8, 2], [7, 3], [7, 4], [8, 4], [8, 5], [7, 6],
        [6, 6], [5, 6], [4, 6], [3, 6], [3, 5], [4, 4],
        [4, 3], [3, 3], [2, 3], [1, 3], [0, 3], [0, 4], [1, 5],
        [1, 6], [0, 6], [0, 7], [1, 8], [1, 9], [2, 9],
        [3, 9], [3, 8], [4, 7], [5, 8], [6, 8], [7, 8], [8, 8], [8, 9]]
string = b'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
 
def target_value(row, column, current_row):
    target = 0
    if row == 0:
        if column < 0:
            target = 4
        elif column > 0:
            target = 1
        else:
            print("error")
    elif row > 0:
        if column > 0:
            target = 2
        elif column < 0:
            target = 3
        else:
            # print("error1")
            if current_row & 1 == 0:
                target = 2
            else:
                target = 3
    elif row < 0:
        if column > 0:
            target = 0
        elif column < 0:
            target = 5
        else:
            # print("error2")
            if current_row & 1 == 0:
                target = 0
            else:
                target = 5
    return target
 
 
def calc(r1, r2):
    row = r2[0] - r1[0]
    column = r2[1] - r1[1]
    return target_value(row, column, r2[0])
 
 
def search_char(index, v1, v2):
    for index_in_string, s in enumerate(string):
        if v1 == (5 - (index_in_string + index) % 6):
            if v2 == ((index + index_in_string // 6) % 6):
                return chr(s)
 
 
output = ""
last = [0, 0]
for i in range(len(road) // 2):
    v1 = calc(last, road[i*2])
    v2 = calc(road[i*2], road[i*2+1])
    last = road[i*2 + 1]
    output += search_char(i, v1, v2)
 
print(output)

发现结果GJ0V4LA4VKEVQZSVCNGJ00N,还有另外一条路径见图,所以至少有两个值。


[培训] 优秀毕业生寄语:恭喜id咸鱼炒白菜拿到远超3W月薪的offer,《安卓高级研修班》火热招生!!!

最后于 2021-6-21 11:26 被lynnux编辑 ,原因:
上传的附件:
收藏
点赞0
打赏
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回