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
142cfc64
Commit
142cfc64
authored
Nov 16, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/devttys0/binwalk
parents
85c22c71
d3977897
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
binwalk
src/bin/binwalk
+13
-13
No files found.
src/bin/binwalk
View file @
142cfc64
...
...
@@ -13,14 +13,14 @@ def display_status():
# Display the current scan progress when the enter key is pressed.
try
:
raw_input
()
print
"Progress:
%.2
f
%%
(
%
d /
%
d)
\n
"
%
(((
float
(
bwalk
.
total_scanned
)
/
float
(
bwalk
.
scan_length
))
*
100
),
bwalk
.
total_scanned
,
bwalk
.
scan_length
)
except
Exception
,
e
:
print
(
"Progress:
%.2
f
%%
(
%
d /
%
d)
\n
"
%
(((
float
(
bwalk
.
total_scanned
)
/
float
(
bwalk
.
scan_length
))
*
100
),
bwalk
.
total_scanned
,
bwalk
.
scan_length
)
)
except
Exception
:
pass
def
examples
():
name
=
os
.
path
.
basename
(
sys
.
argv
[
0
])
print
"""
print
(
"""
Scanning firmware for file signatures:
\t
$
%
s firmware.bin
...
...
@@ -54,7 +54,7 @@ Diffing multiple files:
\t
$
%
s -W firmware1.bin firmware2.bin firmware3.bin
See http://code.google.com/p/binwalk/wiki/TableOfContents for more.
"""
%
(
name
,
name
,
name
,
name
,
name
,
name
,
name
,
name
)
"""
%
(
name
,
name
,
name
,
name
,
name
,
name
,
name
,
name
)
)
sys
.
exit
(
0
)
def
usage
(
fd
):
...
...
@@ -255,7 +255,7 @@ def main():
try
:
opts
,
args
=
GetOpt
(
sys
.
argv
[
1
:],
short_options
,
long_options
)
except
GetoptError
,
e
:
except
GetoptError
as
e
:
sys
.
stderr
.
write
(
"
%
s
\n
"
%
str
(
e
))
usage
(
sys
.
stderr
)
...
...
@@ -348,15 +348,15 @@ def main():
markers
.
append
((
location
,
[{
'description'
:
description
,
'offset'
:
location
}]))
elif
opt
in
(
"-L"
,
"--list-plugins"
):
# List all user and system plugins, then exit
print
''
print
'NAME TYPE ENABLED DESCRIPTION'
print
'-'
*
115
print
(
''
)
print
(
'NAME TYPE ENABLED DESCRIPTION'
)
print
(
'-'
*
115
)
with
binwalk
.
Binwalk
()
as
bw
:
for
(
key
,
info
)
in
binwalk
.
plugins
.
Plugins
(
bw
)
.
list_plugins
()
.
iteritems
():
for
module_name
in
info
[
'modules'
]:
print
'
%-16
s
%-10
s
%-10
s
%
s'
%
(
module_name
,
key
,
info
[
'enabled'
][
module_name
],
info
[
'descriptions'
][
module_name
]
)
print
''
sys
.
exit
(
1
)
print
(
'
%-16
s
%-10
s
%-10
s
%
s'
%
(
module_name
,
key
,
info
[
'enabled'
][
module_name
],
info
[
'descriptions'
][
module_name
])
)
print
(
''
)
sys
.
exit
(
1
)
elif
opt
in
(
"-M"
,
"--matryoshka"
):
if
arg
:
matryoshka
=
binwalk
.
common
.
str2int
(
arg
)
...
...
@@ -398,7 +398,7 @@ def main():
sys
.
stdout
.
write
(
"done.
\n
"
)
sys
.
exit
(
0
)
except
Exception
,
e
:
except
Exception
as
e
:
if
'Permission denied'
in
str
(
e
):
sys
.
stderr
.
write
(
"failed (permission denied). Check your user permissions, or run the update as root.
\n
"
)
else
:
...
...
@@ -430,7 +430,7 @@ def main():
fd
=
open
(
tfile
,
"rb"
)
fd
.
close
()
target_files
.
append
(
tfile
)
except
Exception
,
e
:
except
Exception
as
e
:
sys
.
stdout
.
write
(
"Cannot open file :
%
s
\n
"
%
str
(
e
))
failed_open_count
+=
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