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-depend
binwalk
Commits
c04728f6
Commit
c04728f6
authored
Mar 26, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed python3 & install bugs.
parent
b62f15f9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
14 deletions
+19
-14
Makefile.in
Makefile.in
+3
-3
setup.py
setup.py
+1
-1
common.py
src/binwalk/core/common.py
+8
-3
settings.py
src/binwalk/core/settings.py
+1
-1
extractor.py
src/binwalk/modules/extractor.py
+4
-4
tar.py
src/binwalk/plugins/tar.py
+2
-2
No files found.
Makefile.in
View file @
c04728f6
...
...
@@ -7,16 +7,16 @@ export exec_prefix=@exec_prefix@
export
LIBDIR
=
@libdir@
export
INSTALL_OPTIONS
=
@INSTALL_OPTIONS@
PYTHON
=
python
PYTHON
=
python
3
SRC_C_DIR
=
"./src/C"
.PHONY
:
all install build deps clean uninstall
all
:
build
install
:
build
install
:
make
-C
$(SRC_C_DIR)
install
$(PYTHON)
./setup.py install
$(PYTHON)
./setup.py install
--yes
ldconfig
||
true
build
:
...
...
setup.py
View file @
c04728f6
...
...
@@ -51,7 +51,7 @@ def warning(lines, terminate=True, prompt=True):
print
(
"*"
*
WIDTH
,
"
\n
"
)
if
prompt
:
if
raw_input
(
'Continue
installation
anyway (Y/n)? '
)
.
lower
()
.
startswith
(
'n'
):
if
raw_input
(
'Continue anyway (Y/n)? '
)
.
lower
()
.
startswith
(
'n'
):
terminate
=
True
else
:
terminate
=
False
...
...
src/binwalk/core/common.py
View file @
c04728f6
...
...
@@ -15,13 +15,18 @@ if has_key(__builtins__, 'BLOCK_FILE_PARENT_CLASS'):
else
:
BLOCK_FILE_PARENT_CLASS
=
io
.
FileIO
# The __debug__ value is a bit backwards; by default it is set to True, but
# then set to False if the Python interpreter is run with the -O option.
if
not
__debug__
:
DEBUG
=
True
else
:
DEBUG
=
False
def
debug
(
msg
):
'''
Displays debug messages to stderr only if the Python interpreter was invoked with the -O flag.
'''
# The __debug__ value is a bit backwards; by default it is set to True, but
# then set to False if the Python interpreter is run with the -O option.
if
not
__debug__
:
if
DEBUG
:
sys
.
stderr
.
write
(
"DEBUG: "
+
msg
+
"
\n
"
)
sys
.
stderr
.
flush
()
...
...
src/binwalk/core/settings.py
View file @
c04728f6
...
...
@@ -70,7 +70,7 @@ class Settings:
Returns the path, if it exists; returns None otherwise.
'''
if
self
.
paths
.
has_key
(
usersys
)
and
has_key
(
self
.
paths
[
usersys
],
fname
)
and
self
.
paths
[
usersys
][
fname
]:
if
has_key
(
self
.
paths
,
usersys
)
and
has_key
(
self
.
paths
[
usersys
],
fname
)
and
self
.
paths
[
usersys
][
fname
]:
return
self
.
paths
[
usersys
][
fname
]
return
None
...
...
src/binwalk/modules/extractor.py
View file @
c04728f6
...
...
@@ -274,7 +274,7 @@ class Extractor(Module):
except
KeyboardInterrupt
as
e
:
raise
e
except
Exception
as
e
:
if
self
.
config
.
verbose
:
if
binwalk
.
core
.
common
.
DEBUG
:
raise
Exception
(
"Extractor.load_defaults failed to load file '
%
s':
%
s"
%
(
extract_file
,
str
(
e
)))
def
build_output_directory
(
self
,
path
):
...
...
@@ -547,8 +547,8 @@ class Extractor(Module):
except
Exception
as
e
:
binwalk
.
core
.
common
.
warning
(
"Extractor.execute failed to run internal extractor '
%
s':
%
s"
%
(
str
(
cmd
),
str
(
e
)))
else
:
# If not in
verbose
mode, create a temporary file to redirect stdout and stderr to
if
not
self
.
config
.
verbose
:
# If not in
debug
mode, create a temporary file to redirect stdout and stderr to
if
not
binwalk
.
core
.
common
.
DEBUG
:
tmp
=
tempfile
.
TemporaryFile
()
# Replace all instances of FILE_NAME_PLACEHOLDER in the command with fname
...
...
@@ -568,7 +568,7 @@ class Extractor(Module):
# Silently ignore no such file or directory errors. Why? Because these will inevitably be raised when
# making the switch to the new firmware mod kit directory structure. We handle this elsewhere, but it's
# annoying to see this spammed out to the console every time.
if
self
.
config
.
verbose
or
(
not
hasattr
(
e
,
'errno'
)
or
e
.
errno
!=
2
):
if
binwalk
.
core
.
common
.
DEBUG
or
(
not
hasattr
(
e
,
'errno'
)
or
e
.
errno
!=
2
):
binwalk
.
core
.
common
.
warning
(
"Extractor.execute failed to run external extrator '
%
s':
%
s"
%
(
str
(
cmd
),
str
(
e
)))
retval
=
None
...
...
src/binwalk/plugins/tar.py
View file @
c04728f6
...
...
@@ -25,13 +25,13 @@ class TarPlugin(binwalk.core.plugin.Plugin):
"""
# There are two possible encodings for a number field, see
# itn() below.
if
s
[
0
]
!=
chr
(
0
20
0
):
if
s
[
0
]
!=
chr
(
0
x8
0
):
try
:
n
=
int
(
self
.
nts
(
s
)
or
"0"
,
8
)
except
ValueError
:
raise
ValueError
(
"invalid tar header"
)
else
:
n
=
0
L
n
=
0
for
i
in
xrange
(
len
(
s
)
-
1
):
n
<<=
8
n
+=
ord
(
s
[
i
+
1
])
...
...
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