Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UBI Remove OOB Data
#!/usr/bin/env python3
import sys
PAGE, OOB= 2048, 64
BLOCK = PAGE + OOB
orig_dump = open(sys.argv[1], 'rb').read()
out_dump = open(sys.argv[2], 'wb')
nblocks = int(len(orig_dump) / BLOCK)
for i in range(nblocks):
out_dump.write(orig_dump[i*BLOCK:((i+1)*BLOCK)-OOB])
out_dump.close()
orig_dump.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment