Created
August 18, 2016 16:32
-
-
Save jduck/49ffaeef85c5b9b6b379f8d1851ce5b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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