Created
August 24, 2022 04:51
-
-
Save soxrok2212/0d94ec68f09ed57164d59ddfcf524eff to your computer and use it in GitHub Desktop.
UBI Remove OOB Data
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 | |
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