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
9420878d
Commit
9420878d
authored
Mar 19, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed entropy sys.exit bug
parent
32f91494
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
extract.conf
src/binwalk/config/extract.conf
+3
-0
entropy.py
src/binwalk/modules/entropy.py
+4
-1
extractor.py
src/binwalk/modules/extractor.py
+2
-3
unjffs2.py
src/binwalk/plugins/unjffs2.py
+1
-1
signature_scan.py
src/scripts/examples/signature_scan.py
+2
-0
No files found.
src/binwalk/config/extract.conf
View file @
9420878d
...
@@ -53,6 +53,9 @@
...
@@ -53,6 +53,9 @@
^
ext2
filesystem
:
ext2
:
mkdir
ext2
-
root
&&
mount
-
t
ext2
'%e'
ext2
-
root
^
ext2
filesystem
:
ext2
:
mkdir
ext2
-
root
&&
mount
-
t
ext2
'%e'
ext2
-
root
^
romfs
filesystem
:
romfs
:
mkdir
romfs
-
root
&&
mount
-
t
romfs
'%e'
romfs
-
root
^
romfs
filesystem
:
romfs
:
mkdir
romfs
-
root
&&
mount
-
t
romfs
'%e'
romfs
-
root
# Use sviehb's jefferson.py tool for JFFS2 extraction
^
jffs2
filesystem
:
jffs2
:
jefferson
.
py
-
d
'%%jffs2-root%%'
'%e'
# These were extractors used from FMK that still need suitable replacements.
# These were extractors used from FMK that still need suitable replacements.
#^bff volume entry:bff:/opt/firmware-mod-kit/src/bff/bffxtractor.py '%e'
#^bff volume entry:bff:/opt/firmware-mod-kit/src/bff/bffxtractor.py '%e'
#^wdk file system:wdk:/opt/firmware-mod-kit/src/firmware-tools/unwdk.py '%e'
#^wdk file system:wdk:/opt/firmware-mod-kit/src/firmware-tools/unwdk.py '%e'
...
...
src/binwalk/modules/entropy.py
View file @
9420878d
...
@@ -135,7 +135,10 @@ class Entropy(Module):
...
@@ -135,7 +135,10 @@ class Entropy(Module):
if
not
self
.
save_plot
:
if
not
self
.
save_plot
:
from
pyqtgraph.Qt
import
QtGui
from
pyqtgraph.Qt
import
QtGui
QtGui
.
QApplication
.
instance
()
.
exec_
()
QtGui
.
QApplication
.
instance
()
.
exec_
()
pg
.
exit
()
# Calling pg.exit causes a sys.exit. If using the binwalk module
# from a script, this is probably undesirable. Are there any negative
# side effect to *not* calling pg.exit?
#pg.exit()
def
calculate_file_entropy
(
self
,
fp
):
def
calculate_file_entropy
(
self
,
fp
):
# Tracks the last displayed rising/falling edge (0 for falling, 1 for rising, None if nothing has been printed yet)
# Tracks the last displayed rising/falling edge (0 for falling, 1 for rising, None if nothing has been printed yet)
...
...
src/binwalk/modules/extractor.py
View file @
9420878d
...
@@ -120,14 +120,13 @@ class Extractor(Module):
...
@@ -120,14 +120,13 @@ class Extractor(Module):
else
:
else
:
size
=
r
.
size
size
=
r
.
size
if
r
.
valid
:
binwalk
.
core
.
common
.
debug
(
"Extractor callback for
%
s:
%
d [
%
s &
%
s &
%
s]"
%
(
r
.
file
.
name
,
r
.
offset
,
str
(
r
.
valid
),
str
(
r
.
display
),
str
(
r
.
extract
)))
# Only extract valid results that have been marked for extraction and displayed to the user.
# Only extract valid results that have been marked for extraction and displayed to the user.
# Note that r.display is still True even if --quiet has been specified; it is False if the result has been
# Note that r.display is still True even if --quiet has been specified; it is False if the result has been
# explicitly excluded via the -y/-x options.
# explicitly excluded via the -y/-x options.
if
r
.
valid
and
r
.
extract
and
r
.
display
:
if
r
.
valid
and
r
.
extract
and
r
.
display
:
# Attempt extraction
# Attempt extraction
binwalk
.
core
.
common
.
debug
(
"Extractor callback for
%
s @
%
d [
%
s]"
%
(
r
.
file
.
name
,
r
.
offset
,
r
.
description
))
(
extraction_directory
,
dd_file
)
=
self
.
extract
(
r
.
offset
,
r
.
description
,
r
.
file
.
path
,
size
,
r
.
name
)
(
extraction_directory
,
dd_file
)
=
self
.
extract
(
r
.
offset
,
r
.
description
,
r
.
file
.
path
,
size
,
r
.
name
)
# If the extraction was successful, self.extract will have returned the output directory and name of the dd'd file
# If the extraction was successful, self.extract will have returned the output directory and name of the dd'd file
...
...
src/binwalk/plugins/unjffs2.py
View file @
9420878d
...
@@ -151,7 +151,7 @@ class UnJFFS2Plugin(binwalk.core.plugin.Plugin):
...
@@ -151,7 +151,7 @@ class UnJFFS2Plugin(binwalk.core.plugin.Plugin):
MODULES
=
[
'Signature'
]
MODULES
=
[
'Signature'
]
def
init
(
self
):
def
init
(
self
):
if
self
.
module
.
extractor
.
enabled
:
if
False
:
#
self.module.extractor.enabled:
self
.
module
.
extractor
.
add_rule
(
txtrule
=
None
,
self
.
module
.
extractor
.
add_rule
(
txtrule
=
None
,
regex
=
'^jffs2 filesystem'
,
regex
=
'^jffs2 filesystem'
,
extension
=
'jffs2'
,
extension
=
'jffs2'
,
...
...
src/scripts/examples/signature_scan.py
View file @
9420878d
...
@@ -11,3 +11,5 @@ try:
...
@@ -11,3 +11,5 @@ try:
print
(
"
\t
%
s 0x
%.8
X
%
s [
%
s]"
%
(
result
.
file
.
name
,
result
.
offset
,
result
.
description
,
str
(
result
.
valid
)))
print
(
"
\t
%
s 0x
%.8
X
%
s [
%
s]"
%
(
result
.
file
.
name
,
result
.
offset
,
result
.
description
,
str
(
result
.
valid
)))
except
binwalk
.
ModuleException
as
e
:
except
binwalk
.
ModuleException
as
e
:
pass
pass
print
"Done."
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