Skip to content

Instantly share code, notes, and snippets.

@shalzz
Created May 3, 2017 08:09
Show Gist options
  • Save shalzz/a28b91190ba600aec5f2b3d9888fe7f5 to your computer and use it in GitHub Desktop.
Save shalzz/a28b91190ba600aec5f2b3d9888fe7f5 to your computer and use it in GitHub Desktop.
System image from stock sparse system images
simg2img system.img_sparsechunk.* system.img.raw.tmp
offset=`LANG=C grep -aobP -m1 '\x53\xEF' system.img.raw.tmp | head -1 | awk '{print $1 - 1080}'`
dd if=system.img.raw.tmp of=system.img.raw ibs=$offset skip=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment