题目:
已知ID为0x8893CA58的温度传感器的未解码报文为:3EAAAAA56A69AA55A95995A569AA95565556 此时有另一个相同型号的传感器,其未解码报文为:3EAAAAA56A69AA556A965A5999596AA95656 请解出其ID,提交flag{hex(不含0x)}。
第一次碰到曼切斯特编码和差分曼切斯特编码,做的时候毫无头绪,编码原理参考:http://www.cnblogs.com/BinB-W/p/5045918.html
直接给出解码脚本吧(借鉴大佬的):
#!/usr/bin/env python
#coding:utf-8
import re
#hex1 = 'AAAAA56A69AA55A95995A569AA95565556' # # 0x8893CA58
hex1 = 'AAAAA56A69AA556A965A5999596AA95656'
def bintohex(s1):
s2 = ''
s1 = re.findall('.{4}',s1)
print ('每一个hex分隔:',s1)
for i in s1:
s2 += str(hex(int(i,2))).replace('0x','')
print ('ID:',s2)
def diffmqst(s):
s1 = ''