File size: 534 Bytes
45da73e |
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 |
import glob
import binascii
filename = 'result.zip'
with open(filename, 'rb') as f:
content = f.read()
hex = str(binascii.hexlify(content))
sz = len(hex)
step = 10
for i in range(step):
with open(f"out-{i}.txt", "w") as f:
f.write(hex[sz//step * i: min(sz//step * (i + 1), sz)])
construct = ""
for f in sorted(glob.glob("tmp/out*")):
with open(f, 'r') as inf:
construct += inf.read()
bytes = binascii.unhexlify(construct[2:-1])
with open("constuction.zip", 'wb') as f:
f.write(bytes) |