Commit 4ddad90a by devttys0

Updated easy_install

parent f662d442
...@@ -18,7 +18,8 @@ class Plugin: ...@@ -18,7 +18,8 @@ class Plugin:
if binwalk.scan_type == binwalk.BINWALK: if binwalk.scan_type == binwalk.BINWALK:
self.comp = ctypes.cdll.LoadLibrary(ctypes.util.find_library("compress42")) self.comp = ctypes.cdll.LoadLibrary(ctypes.util.find_library("compress42"))
binwalk.magic_files.append(binwalk.config.find_magic_file('compressd')) if self.comp:
binwalk.magic_files.append(binwalk.config.find_magic_file('compressd'))
def __del__(self): def __del__(self):
try: try:
......
...@@ -22,18 +22,20 @@ class Plugin: ...@@ -22,18 +22,20 @@ class Plugin:
# The tinfl library is built and installed with binwalk # The tinfl library is built and installed with binwalk
self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library("tinfl")) self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library("tinfl"))
# Add an extraction rule if self.tinfl:
if self.binwalk.extractor.enabled: # Add an extraction rule
self.binwalk.extractor.add_rule(regex='^%s' % self.DESCRIPTION.lower(), extension="deflate", cmd=self._extractor) if self.binwalk.extractor.enabled:
self.binwalk.extractor.add_rule(regex='^%s' % self.DESCRIPTION.lower(), extension="deflate", cmd=self._extractor)
def pre_scan(self, fp): def pre_scan(self, fp):
# Make sure we'll be getting enough data for a good decompression test if self.tinfl:
if fp.MAX_TRAILING_SIZE < self.SIZE: # Make sure we'll be getting enough data for a good decompression test
fp.MAX_TRAILING_SIZE = self.SIZE if fp.MAX_TRAILING_SIZE < self.SIZE:
fp.MAX_TRAILING_SIZE = self.SIZE
self._deflate_scan(fp) self._deflate_scan(fp)
return PLUGIN_TERMINATE return PLUGIN_TERMINATE
def _extractor(self, file_name): def _extractor(self, file_name):
if self.tinfl: if self.tinfl:
......
...@@ -18,8 +18,9 @@ class Plugin: ...@@ -18,8 +18,9 @@ class Plugin:
if binwalk.scan_type == binwalk.BINWALK: if binwalk.scan_type == binwalk.BINWALK:
# Load libtinfl.so # Load libtinfl.so
self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library('tinfl')) self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library('tinfl'))
# Add the zlib file to the list of magic files if self.tinfl:
binwalk.magic_files.append(binwalk.config.find_magic_file('zlib')) # Add the zlib file to the list of magic files
binwalk.magic_files.append(binwalk.config.find_magic_file('zlib'))
def pre_scan(self, fd): def pre_scan(self, fd):
if self.tinfl: if self.tinfl:
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
function libmagic function libmagic
{ {
SITE="ftp://ftp.astron.com/pub/file/" SITE="ftp://ftp.astron.com/pub/file/"
VERSION="5.14" VERSION="5.11"
OUTFILE="file-$VERSION.tar.gz" OUTFILE="file-$VERSION.tar.gz"
URL="$SITE$OUTFILE" URL="$SITE$OUTFILE"
...@@ -52,7 +52,16 @@ function redhat ...@@ -52,7 +52,16 @@ function redhat
function darwin function darwin
{ {
sudo port install git-core arj p7zip py-matplotlib if [ "$(which easy_install)" == "" ]
then
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
fi
if [ "$(which easy_install)" != "" ]
then
easy_install -m numpy
easy_install -m matplotlib
fi
} }
if [ "$1" == "" ] || [ "$1" == "--sumount" ] if [ "$1" == "" ] || [ "$1" == "--sumount" ]
...@@ -107,16 +116,16 @@ case $DISTRO in ...@@ -107,16 +116,16 @@ case $DISTRO in
echo "" echo ""
echo "This system is not recognized by easy install! You may need to install dependent packages manually." echo "This system is not recognized by easy install! You may need to install dependent packages manually."
echo "" echo ""
echo "If your system is a derivative of Debian, RedHat or OSX, you can try manually specifying your system type on the command line:" echo "If your system is a derivative of Debian, RedHat, or OSX, you can try manually specifying your system type on the command line:"
echo "" echo ""
echo -e "\t$0 [debian | redhat | darwin] [--sumount]" echo -e "\t$0 [debian | redhat | darwin] [--sumount]"
echo "" echo ""
exit 1 exit 1
esac esac
if [ "$(python -c 'import magic; magic.MAGIC_NO_CHECK_TEXT' 2>/dev/null)" != 0 ] if [ "$(python -c 'import magic; print (magic.MAGIC_NO_CHECK_TEXT)' 2>/dev/null)" == "" ]
then then
echo "python-magic not installed or wrong version." echo "python-magic not installed, or wrong version."
libmagic libmagic
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment