IMG=../2014-02-02_Android_Kobo_AuraHD.img
#0x0000000/200
dd if=$IMG of=parttable.bin bs=512 count=1
#0x0000200/200
dd if=$IMG of=serialnumber.bin bs=512 count=1 skip=1
#0x0000400/7fc
dd if=$IMG of=uboot.bin bs=512 count=1022 skip=2
#0x0080000
dd if=$IMG of=hwconfig.bin bs=512 count=1 skip=1024 count=2
# The image that ships with the kobo is < 470 512 byte blocks long. It's not clear
# if something else takes the space between the end of the image and the start of
# the epson display binaries, if it's dead space, or if there's room for bigger
# images.
#0x0080400
#dd if=$IMG of=bootlogo.bmp bs=512 skip=1026 count=470 
#0x00C0000/20000 cmdline
dd if=$IMG of=cmdline bs=512 skip=1536 count=256 
#0x00E0000/800
dd if=$IMG of=epson_display_setup.bin bs=512 skip=1792 count=8 

#0x00F0000
dd if=$IMG of=epson_display_setup2.bin bs=512 skip=1920 count=8
#0x00F1000
dd if=$IMG of=epson_waveform.bin bs=512 skip=1928 count=$((2048 - 1928))
#
dd if=$IMG of=kernel_img_sign bs=512 skip=2047 count=1
#0x0100000
dd if=$IMG of=kernel.bin bs=512 skip=2048 count=8192
#0x006ffe00/200 waveheader
dd if=$IMG of=waveheader bs=512 skip=14335 count=1
#0x00700000/18000 waveform
dd if=$IMG of=waveform bs=512 skip=14335 count=2229
#0x00818000
#0x8FFE00 :kogo bin heder
dd if=$IMG of=logo_nin_header bs=512 skip=18631 count=1

#0x00900000/100000
dd if=$IMG bs=1 skip=9437184 count=524288 of=raw_logo
cat raw_logo | convert -depth 4 -size 1440x1080+0 gray:- pic.png
