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
45474ebd
Commit
45474ebd
authored
Oct 22, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how --dumb and --invalid are interpreted by the signature scan
parent
d6e09d49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
__init__.py
src/binwalk/modules/__init__.py
+11
-7
general.py
src/binwalk/modules/general.py
+0
-1
signature.py
src/binwalk/modules/signature.py
+12
-9
No files found.
src/binwalk/modules/__init__.py
View file @
45474ebd
# Don't load the disasm module if the capstone module can't be found
try
:
from
binwalk.modules.disasm
import
Disasm
except
ImportError
:
pass
from
binwalk.modules.signature
import
Signature
#from binwalk.modules.binvis import Plotter
from
binwalk.modules.hexdiff
import
HexDiff
#from binwalk.modules.hashmatch import HashMatch
from
binwalk.modules.general
import
General
from
binwalk.modules.extractor
import
Extractor
from
binwalk.modules.entropy
import
Entropy
#from binwalk.modules.heuristics import HeuristicCompressionAnalyzer
from
binwalk.modules.compression
import
RawCompression
try
:
from
binwalk.modules.disasm
import
Disasm
except
ImportError
:
pass
# These are depreciated.
#from binwalk.modules.binvis import Plotter
#from binwalk.modules.hashmatch import HashMatch
#from binwalk.modules.heuristics import HeuristicCompressionAnalyzer
src/binwalk/modules/general.py
View file @
45474ebd
...
...
@@ -113,7 +113,6 @@ class General(Module):
self
.
_open_target_files
()
self
.
_set_verbosity
()
#self.filter = binwalk.core.filter.Filter(self._display_invalid)
self
.
filter
=
binwalk
.
core
.
filter
.
Filter
(
self
.
show_invalid
)
# Set any specified include/exclude filters
...
...
src/binwalk/modules/signature.py
View file @
45474ebd
...
...
@@ -99,16 +99,19 @@ class Signature(Module):
'''
Called automatically by self.result.
'''
if
not
r
.
description
:
r
.
valid
=
False
if
self
.
config
.
filter
.
show_invalid_results
:
r
.
valid
=
True
else
:
if
not
r
.
description
:
r
.
valid
=
False
if
r
.
size
and
(
r
.
size
+
r
.
offset
)
>
r
.
file
.
size
:
r
.
valid
=
False
if
r
.
size
and
(
r
.
size
+
r
.
offset
)
>
r
.
file
.
size
:
r
.
valid
=
False
if
r
.
jump
and
(
r
.
jump
+
r
.
offset
)
>
r
.
file
.
size
:
r
.
valid
=
False
if
r
.
jump
and
(
r
.
jump
+
r
.
offset
)
>
r
.
file
.
size
:
r
.
valid
=
False
r
.
valid
=
self
.
config
.
filter
.
valid_result
(
r
.
description
)
r
.
valid
=
self
.
config
.
filter
.
valid_result
(
r
.
description
)
def
scan_file
(
self
,
fp
):
current_file_offset
=
0
...
...
@@ -149,8 +152,8 @@ class Signature(Module):
# self.result automatically calls self.validate for result validation
self
.
result
(
r
=
r
)
# Is this a valid result and did it specify a jump-to-offset keyword?
if
r
.
valid
and
r
.
jump
>
0
:
# Is this a valid result and did it specify a jump-to-offset keyword
, and are we doing a "smart" scan
?
if
r
.
valid
and
r
.
jump
>
0
and
not
self
.
dumb_scan
:
absolute_jump_offset
=
r
.
offset
+
r
.
jump
current_block_offset
=
candidate_offset
+
r
.
jump
...
...
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