Commit 4ddad90a by devttys0

Updated easy_install

parent f662d442
......@@ -18,7 +18,8 @@ class Plugin:
if binwalk.scan_type == binwalk.BINWALK:
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):
try:
......
......@@ -22,18 +22,20 @@ class Plugin:
# The tinfl library is built and installed with binwalk
self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library("tinfl"))
# Add an extraction rule
if self.binwalk.extractor.enabled:
self.binwalk.extractor.add_rule(regex='^%s' % self.DESCRIPTION.lower(), extension="deflate", cmd=self._extractor)
if self.tinfl:
# Add an extraction rule
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):
# Make sure we'll be getting enough data for a good decompression test
if fp.MAX_TRAILING_SIZE < self.SIZE:
fp.MAX_TRAILING_SIZE = self.SIZE
if self.tinfl:
# Make sure we'll be getting enough data for a good decompression test
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):
if self.tinfl:
......
......@@ -18,8 +18,9 @@ class Plugin:
if binwalk.scan_type == binwalk.BINWALK:
# Load libtinfl.so
self.tinfl = ctypes.cdll.LoadLibrary(ctypes.util.find_library('tinfl'))
# Add the zlib file to the list of magic files
binwalk.magic_files.append(binwalk.config.find_magic_file('zlib'))
if self.tinfl:
# 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):
if self.tinfl:
......
......@@ -4,7 +4,7 @@
function libmagic
{
SITE="ftp://ftp.astron.com/pub/file/"
VERSION="5.14"
VERSION="5.11"
OUTFILE="file-$VERSION.tar.gz"
URL="$SITE$OUTFILE"
......@@ -52,7 +52,16 @@ function redhat
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" ]
......@@ -107,16 +116,16 @@ case $DISTRO in
echo ""
echo "This system is not recognized by easy install! You may need to install dependent packages manually."
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 -e "\t$0 [debian | redhat | darwin] [--sumount]"
echo ""
exit 1
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
echo "python-magic not installed or wrong version."
echo "python-magic not installed, or wrong version."
libmagic
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