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
489fc2e8
Commit
489fc2e8
authored
Nov 20, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed python2.6 bugs
parent
37fbbcfa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
common.py
src/binwalk/common.py
+2
-2
compression.py
src/binwalk/compression.py
+1
-1
entropy.py
src/binwalk/entropy.py
+1
-1
extractor.py
src/binwalk/extractor.py
+3
-3
hexdiff.py
src/binwalk/hexdiff.py
+1
-1
smartstrings.py
src/binwalk/smartstrings.py
+1
-1
No files found.
src/binwalk/common.py
View file @
489fc2e8
...
@@ -139,11 +139,11 @@ class BlockFile(io.FileIO):
...
@@ -139,11 +139,11 @@ class BlockFile(io.FileIO):
io
.
FileIO
.
__init__
(
self
,
fname
,
mode
)
io
.
FileIO
.
__init__
(
self
,
fname
,
mode
)
# Work around for python 2.6 where FileIO.
name raises an exception
# Work around for python 2.6 where FileIO.
_name is not defined
try
:
try
:
self
.
name
self
.
name
except
AttributeError
:
except
AttributeError
:
self
.
name
=
fname
self
.
_
name
=
fname
self
.
seek
(
self
.
offset
)
self
.
seek
(
self
.
offset
)
...
...
src/binwalk/compression.py
View file @
489fc2e8
...
@@ -148,7 +148,7 @@ class CompressionEntropyAnalyzer(object):
...
@@ -148,7 +148,7 @@ class CompressionEntropyAnalyzer(object):
Returns None.
Returns None.
'''
'''
self
.
fp
=
common
.
BlockFile
(
fname
,
'r
b
'
,
offset
=
start
,
length
=
length
)
self
.
fp
=
common
.
BlockFile
(
fname
,
'r'
,
offset
=
start
,
length
=
length
)
# Read block size must be at least as large as our analysis block size
# Read block size must be at least as large as our analysis block size
if
self
.
fp
.
READ_BLOCK_SIZE
<
self
.
BLOCK_SIZE
:
if
self
.
fp
.
READ_BLOCK_SIZE
<
self
.
BLOCK_SIZE
:
...
...
src/binwalk/entropy.py
View file @
489fc2e8
...
@@ -135,7 +135,7 @@ class FileEntropy(object):
...
@@ -135,7 +135,7 @@ class FileEntropy(object):
if
not
self
.
block
:
if
not
self
.
block
:
self
.
block
=
self
.
DEFAULT_BLOCK_SIZE
self
.
block
=
self
.
DEFAULT_BLOCK_SIZE
self
.
fd
=
common
.
BlockFile
(
file_name
,
'r
b
'
,
offset
=
self
.
start
,
length
=
self
.
length
)
self
.
fd
=
common
.
BlockFile
(
file_name
,
'r'
,
offset
=
self
.
start
,
length
=
self
.
length
)
self
.
start
=
self
.
fd
.
offset
self
.
start
=
self
.
fd
.
offset
self
.
fd
.
MAX_TRAILING_SIZE
=
0
self
.
fd
.
MAX_TRAILING_SIZE
=
0
if
self
.
fd
.
READ_BLOCK_SIZE
<
self
.
block
:
if
self
.
fd
.
READ_BLOCK_SIZE
<
self
.
block
:
...
...
src/binwalk/extractor.py
View file @
489fc2e8
...
@@ -428,16 +428,16 @@ class Extractor:
...
@@ -428,16 +428,16 @@ class Extractor:
try
:
try
:
# Open the target file and seek to the offset
# Open the target file and seek to the offset
fdin
=
BlockFile
(
file_name
,
"rb"
,
length
=
size
)
fdin
=
BlockFile
(
file_name
,
'r'
,
length
=
size
)
fdin
.
seek
(
offset
)
fdin
.
seek
(
offset
)
# Open the output file
# Open the output file
try
:
try
:
fdout
=
BlockFile
(
fname
,
"wb"
)
fdout
=
BlockFile
(
fname
,
'w'
)
except
Exception
as
e
:
except
Exception
as
e
:
# Fall back to the default name if the requested name fails
# Fall back to the default name if the requested name fails
fname
=
unique_file_name
(
default_bname
,
extension
)
fname
=
unique_file_name
(
default_bname
,
extension
)
fdout
=
BlockFile
(
fname
,
"wb"
)
fdout
=
BlockFile
(
fname
,
'w'
)
while
total_size
<
size
:
while
total_size
<
size
:
(
data
,
dlen
)
=
fdin
.
read_block
()
(
data
,
dlen
)
=
fdin
.
read_block
()
...
...
src/binwalk/hexdiff.py
View file @
489fc2e8
...
@@ -112,7 +112,7 @@ class HexDiff(object):
...
@@ -112,7 +112,7 @@ class HexDiff(object):
read_block_size
=
common
.
BlockFile
.
READ_BLOCK_SIZE
read_block_size
=
common
.
BlockFile
.
READ_BLOCK_SIZE
for
f
in
files
:
for
f
in
files
:
fp
=
common
.
BlockFile
(
f
,
'r
b
'
,
length
=
size
,
offset
=
offset
)
fp
=
common
.
BlockFile
(
f
,
'r'
,
length
=
size
,
offset
=
offset
)
fp
.
READ_BLOCK_SIZE
=
read_block_size
fp
.
READ_BLOCK_SIZE
=
read_block_size
fp
.
MAX_TRAILING_SIZE
=
0
fp
.
MAX_TRAILING_SIZE
=
0
fps
.
append
(
fp
)
fps
.
append
(
fp
)
...
...
src/binwalk/smartstrings.py
View file @
489fc2e8
...
@@ -75,7 +75,7 @@ class FileStrings(object):
...
@@ -75,7 +75,7 @@ class FileStrings(object):
# the entropy analysis, block offsets won't line up.
# the entropy analysis, block offsets won't line up.
self
.
start
-=
(
self
.
start
%
self
.
block
)
self
.
start
-=
(
self
.
start
%
self
.
block
)
self
.
fd
=
common
.
BlockFile
(
file_name
,
'r
b
'
,
length
=
length
,
offset
=
self
.
start
)
self
.
fd
=
common
.
BlockFile
(
file_name
,
'r'
,
length
=
length
,
offset
=
self
.
start
)
# TODO: This is not optimal. We should read in larger chunks and process it into self.block chunks.
# TODO: This is not optimal. We should read in larger chunks and process it into self.block chunks.
self
.
fd
.
READ_BLOCK_SIZE
=
self
.
block
self
.
fd
.
READ_BLOCK_SIZE
=
self
.
block
self
.
fd
.
MAX_TRAILING_SIZE
=
0
self
.
fd
.
MAX_TRAILING_SIZE
=
0
...
...
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