Created
May 23, 2010 10:58
-
-
Save craSH/410841 to your computer and use it in GitHub Desktop.
Write out all possible encodings that strings can deal with for a given file.
This file contains 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 | |
# Write out all possible encodings that strings can deal with for a given file. | |
input=$1 | |
# 7 bit ascii | |
mode="s" | |
strings $@ -e $mode $input > strings_$input.$mode | |
# 8 bit characters | |
mode="S" | |
strings $@ -e $mode $input > strings_$input.$mode | |
# 16 bit big endian | |
mode="b" | |
strings $@ -e $mode $input > strings_$input.$mode | |
# 16 bit little endian | |
mode="l" | |
strings $@ -e $mode $input > strings_$input.$mode | |
# 32 bit big endian | |
mode="B" | |
strings $@ -e $mode $input > strings_$input.$mode | |
# 32 bit little endian | |
mode="L" | |
strings $@ -e $mode $input > strings_$input.$mode | |
ls -lh strings_$input.[sSbBlL] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment