Created
August 24, 2016 18:05
-
-
Save ihaveamac/e5e143e7e24656d3f681778e1f255904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
if len(sys.argv) != 2: | |
sys.exit("padfirm.py firm.bin") | |
filenamesplit = os.path.splitext(sys.argv[1]) | |
filename = os.path.basename(filenamesplit[0]) | |
fileext = filenamesplit[1] | |
with open("%s_padded%s" % (filename, fileext), "wb") as f: | |
with open(sys.argv[1], "rb") as o: | |
f.write(o.read().ljust(0x400000, b"\x00")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment