Skip to content

Instantly share code, notes, and snippets.

@soxrok2212
Created August 24, 2022 04:51
Show Gist options
  • Save soxrok2212/0d94ec68f09ed57164d59ddfcf524eff to your computer and use it in GitHub Desktop.
Save soxrok2212/0d94ec68f09ed57164d59ddfcf524eff to your computer and use it in GitHub Desktop.
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