Skip to content

Instantly share code, notes, and snippets.

@umstek
Last active May 13, 2017 15:57
Show Gist options
  • Save umstek/3f95699a08a8210dd2382075dc405e5a to your computer and use it in GitHub Desktop.
Save umstek/3f95699a08a8210dd2382075dc405e5a to your computer and use it in GitHub Desktop.
Convert MD5 hashes from VirusShare back to binary
import os
if not os.path.exists('bin'):
os.makedirs('bin')
for i in range(0, 289):
print(f'Parsing file {i:d}')
lines = open('VirusShare_' + f'{i:05d}' + '.md5').readlines()[6:]
chunks = bytearray()
for line in lines:
chunks.extend(bytearray.fromhex(line.strip()))
with open('bin/VirusShare_' + f'{i:05d}' + '.md5' '.bin', 'wb') as f_out:
f_out.write(chunks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment