思路:
1、将“where_is_fag.txt”中的6个浮点数转换成字节串;
2、把这6个字节串拼接起来,打印输出即可。
Python源码:
# coding=utf-8
'''
72065910510177138000000000000000.000000
71863209670811371000000.000000
18489682625412760000000000000000.000000
72723257588050687000000.000000
4674659167469766200000000.000000
19061698837499292000000000000000000000.000000
'''
import struct
c_list = []
with open('where_is_flag.txt', 'r') as f:
for line in f:
c_list.append(line.strip())
print(c_list)
flag = b''
for i in c_list:
flag += struct.pack('<f', float(i))
print(flag)
flag = b''
for i in c_list:
flag += struct.pack('>f', float(i))
print(flag)
运行结果:
['72065910510177138000000000000000.000000', '71863209670811371000000.000000', '18489682625412760000000000000000.000000', '72723257588050687000000.000000', '4674659167469766200000000.000000', '19061698837499292000000000000000000000.000000']
b'afct'
b'afctf{se'
b'afctf{sec_is'
b'afctf{sec_is_eve'
b'afctf{sec_is_everywh'
b'afctf{sec_is_everywhere}'
b'tcfa'
b'tcfaes{f'
b'tcfaes{fsi_c'
b'tcfaes{fsi_ceve_'
b'tcfaes{fsi_ceve_hwyr'
b'tcfaes{fsi_ceve_hwyr}ere'
进程已结束,退出代码为 0
最后将:
b'afctf{sec_is_everywhere}'
修改成:
flag{sec_is_everywhere}