[HITCON2018]ev3basic

知识点

蓝牙协议??

参考

https://w0y.at/writeup/2018/10/22/hitcon-2018-ev3-basic.html
https://www.youncyb.cn/?p=493
https://ctftime.org/writeup/11942
https://shawroot.hatenablog.com/entry/2020/01/12/HITCON2018/BUUCTF-ev3basic

脚本


flagp = ["0a:28:68", "14:28:69", "1e:28:74", "1e:44:5f", "14:52:6f", "0a:36:5f",
        "1e:52:70", "14:36:63", "0a:44:6e", "14:44:64", "1e:36:6f", "0a:52:6c",
        "64:52:7d", "46:28:7b", "5a:28:31", "3c:28:6e", "28:28:63", "6e:28:64",
        "32:28:6f", "50:28:6d", "78:36:69", "28:52:65", "46:52:6b", "3c:44:72",
        "28:44:66", "5a:44:61", "3c:36:75", "64:36:61", "32:44:69", "78:28:35",
        "64:28:6e", "5a:52:74", "78:44:5f", "64:44:72", "46:36:6e", "50:52:69",
        "32:36:6d", "28:36:6d", "5a:36:63", "46:44:6d", "6e:36:74", "50:36:69",
        "3c:52:5f", "50:44:77", "32:52:72", "6e:44:65", "8c:44:65", "a0:36:61",
        "96:44:76", "82:44:64", "a0:44:65", "96:28:72", "82:36:6f", "a0:28:6d",
        "8c:28:30", "96:36:5f", "82:28:74", "8c:36:6e"]

dic={}

for i in flagp:
    tmp = i.split(":")
    dic[(int(tmp[1],16),int(tmp[0],16))]=chr(int(tmp[2],16))

dl1=sorted(dic,key=lambda dic : dic[1])
dl2=sorted(dl1,key=lambda dl1 : dl1[0])
print(dl2)

res =open("res.txt","w")
s=""
cnt=0
for i in range(165):
    s+="\n"
    if cnt>=len(dl2):
            break
    for j in range(165):
        if i==dl2[cnt][0] and j==dl2[cnt][1]:
            print(dl2[cnt])
            s+=dic[dl2[cnt]]
            cnt+=1
        else:
            s+=" "
        if cnt>=len(dl2):
            break
res.write(s)
res.close()

posted @ 2023-01-06 21:42  云千  阅读(120)  评论(0)    收藏  举报