ddctf writeup

看到题目,发现是十六进制,先转换为二进制

1
2
3
4
a="d4e8e1f4a0f7e1f3a0e6e1f3f4a1a0d4e8e5a0e6ece1e7a0e9f3baa0c4c4c3d4c6fbb9e1b2e2e5e2b5b4e4b8b7e6e1e1b6b9e4b5e3b8b1b1e3e5b5b6b4b1b0e4e6b2fd"


a=bin(int(a,16))

将二进制提取出来,每隔8个放在一起,保存在res列表中,去掉每个8字符的第一位,保存在rest列表中,将rest中的二进制字符串变为字符串保存在rst中,最终拼接起来。即可得到flag

1
2
3
4
5
6
7
8
9
10
11
12
a='11010100111010001110000111110100101000001111011111100001111100111010000011100110111000011111001111110100101000011010000011010100111010001110010110100000111001101110110011100001111001111010000011101001111100111011101010100000110001001100010011000011110101001100011011111011101110011110000110110010111000101110010111100010101101011011010011100100101110001011011111100110111000011110000110110110101110011110010010110101111000111011100010110001101100011110001111100101101101011011011010110100101100011011000011100100111001101011001011111101'

res=[]
for i in range(0,len(a),8):
res.append(a[i:i+8])

rest=[]
for i in res:
rest.append(i[1:])

rst=[chr(int(i,2)) for i in rest]
print "".join(rst)