Skip to content

Instantly share code, notes, and snippets.

@jduck
Created August 18, 2016 16:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jduck/49ffaeef85c5b9b6b379f8d1851ce5b5 to your computer and use it in GitHub Desktop.
Save jduck/49ffaeef85c5b9b6b379f8d1851ce5b5 to your computer and use it in GitHub Desktop.
#!/bin/sh
IMG=zImage
[ -n "$1" ] && IMG="$1"
binwalk -y gzip -e "$IMG"
mv _"$IMG".extracted/* piggy && rmdir _"$IMG".extracted
if [ -f piggy ]; then
ls -l piggy
[ -f piggy ] && ( strings piggy | grep 'Linux version' )
exit 0
fi
binwalk -y lzo -e "$IMG"
mv _"$IMG".extracted/* piggy && rmdir _"$IMG".extracted
ls -l piggy
[ -f piggy ] && ( strings piggy | grep 'Linux version' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment