Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
4ddad90a
Commit
4ddad90a
authored
Nov 21, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated easy_install
parent
f662d442
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
16 deletions
+29
-16
compressd.py
src/binwalk/plugins/compressd.py
+2
-1
deflate.py
src/binwalk/plugins/deflate.py
+10
-8
zlib.py
src/binwalk/plugins/zlib.py
+3
-2
easy_install.sh
src/easy_install.sh
+14
-5
No files found.
src/binwalk/plugins/compressd.py
View file @
4ddad90a
...
@@ -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
:
...
...
src/binwalk/plugins/deflate.py
View file @
4ddad90a
...
@@ -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
:
...
...
src/binwalk/plugins/zlib.py
View file @
4ddad90a
...
@@ -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
:
...
...
src/easy_install.sh
View file @
4ddad90a
...
@@ -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.1
4
"
VERSION
=
"5.1
1
"
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment