Skip to content

Instantly share code, notes, and snippets.

@lsparrish
Created January 4, 2010 05:26
Show Gist options
  • Save lsparrish/268323 to your computer and use it in GitHub Desktop.
Save lsparrish/268323 to your computer and use it in GitHub Desktop.
export OFFSET=4967232
alias extract="dd if=retroImage of=blocks.blk skip=$OFFSET ibs=4"
alias inject="dd if=blocks.blk of=retroImage ibs=4 bs=4 seek=$OFFSET"
alias text="tr -d '\000' < blocks.blk > blocks.txt"
alias block="sed -e 's/\(.\)/\1\x00\x00\x00/g' < blocks.txt > blocks.blk"
alias readable="fold -w 64 blocks.txt > readable.txt"
alias writable="tr -d '\012' < readable.txt > blocks.txt"
alias get='extract; text; readable'
alias put='writable; block; inject'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment