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
e59b1483
Commit
e59b1483
authored
Dec 20, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed python3 bug
parent
325b4424
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
binwalk
src/bin/binwalk
+5
-5
compat.py
src/binwalk/core/compat.py
+9
-3
compressd.py
src/binwalk/plugins/compressd.py
+1
-1
cpio.py
src/binwalk/plugins/cpio.py
+1
-1
lzmamod.py
src/binwalk/plugins/lzmamod.py
+1
-1
No files found.
src/bin/binwalk
View file @
e59b1483
...
...
@@ -3,12 +3,13 @@
import
sys
import
binwalk
from
threading
import
Thread
from
binwalk.core.compat
import
user_input
def
display_status
(
m
):
# Display the current scan progress when the enter key is pressed.
while
True
:
try
:
raw
_input
()
user
_input
()
sys
.
stderr
.
write
(
"Progress:
%.2
f
%%
(
%
d /
%
d)
\n\n
"
%
(((
float
(
m
.
status
.
completed
)
/
float
(
m
.
status
.
total
))
*
100
),
m
.
status
.
completed
,
m
.
status
.
total
))
except
KeyboardInterrupt
as
e
:
raise
e
...
...
@@ -31,9 +32,7 @@ def main():
if
len
(
sys
.
argv
)
==
1
:
usage
(
modules
)
elif
not
modules
.
execute
():
for
module
in
modules
.
execute
(
*
sys
.
argv
[
1
:],
signature
=
True
):
for
result
in
module
.
results
:
print
result
.
description
modules
.
execute
(
*
sys
.
argv
[
1
:],
signature
=
True
)
except
binwalk
.
ModuleException
as
e
:
sys
.
exit
(
1
)
...
...
@@ -47,4 +46,5 @@ if __name__ == '__main__':
else
:
main
()
except
KeyboardInterrupt
:
print
(
""
)
sys
.
stdout
.
write
(
"
\n
"
)
src/binwalk/core/compat.py
View file @
e59b1483
...
...
@@ -7,10 +7,7 @@ import string
PY_MAJOR_VERSION
=
sys
.
version_info
[
0
]
if
PY_MAJOR_VERSION
>
2
:
import
urllib.request
as
urllib2
string
.
letters
=
string
.
ascii_letters
else
:
import
urllib2
def
iterator
(
dictionary
):
'''
...
...
@@ -66,3 +63,12 @@ def string_decode(string):
else
:
return
string
.
decode
(
'string_escape'
)
def
user_input
(
prompt
=
''
):
'''
For getting raw user input in Python 2 and 3.
'''
if
PY_MAJOR_VERSION
>
2
:
return
input
(
prompt
)
else
:
return
raw_input
(
prompt
)
src/binwalk/plugins/compressd.py
View file @
e59b1483
...
...
@@ -2,7 +2,7 @@ import ctypes
import
ctypes.util
from
binwalk.core.common
import
*
class
Plugin
:
class
Plugin
(
object
)
:
'''
Searches for and validates compress'd data.
'''
...
...
src/binwalk/plugins/cpio.py
View file @
e59b1483
class
Plugin
:
class
Plugin
(
object
)
:
'''
Ensures that ASCII CPIO archive entries only get extracted once.
'''
...
...
src/binwalk/plugins/lzmamod.py
View file @
e59b1483
...
...
@@ -3,7 +3,7 @@ import shutil
from
binwalk.core.compat
import
*
from
binwalk.core.common
import
BlockFile
class
Plugin
:
class
Plugin
(
object
)
:
'''
Finds and extracts modified LZMA files commonly found in cable modems.
Based on Bernardo Rodrigues' work: http://w00tsec.blogspot.com/2013/11/unpacking-firmware-images-from-cable.html
...
...
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