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
78ab6ece
Commit
78ab6ece
authored
Feb 12, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fuzzy hash bugs
parent
ab8893a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
hashmatch.py
src/binwalk/modules/hashmatch.py
+9
-10
No files found.
src/binwalk/modules/hashmatch.py
View file @
78ab6ece
...
@@ -277,14 +277,14 @@ class HashMatch(Module):
...
@@ -277,14 +277,14 @@ class HashMatch(Module):
for
directory
in
haystack
:
for
directory
in
haystack
:
dir_files
=
self
.
_get_file_list
(
directory
)
dir_files
=
self
.
_get_file_list
(
directory
)
for
f
in
source_files
:
for
source_file
in
source_files
:
if
f
in
dir_files
:
for
dir_file
in
dir_files
:
file1
=
os
.
path
.
join
(
needle
,
f
)
file1
=
os
.
path
.
join
(
needle
,
source_file
)
file2
=
os
.
path
.
join
(
directory
,
f
)
file2
=
os
.
path
.
join
(
directory
,
dir_file
)
m
=
self
.
_compare_files
(
file1
,
file2
)
m
=
self
.
_compare_files
(
file1
,
file2
)
if
m
is
not
None
and
self
.
is_match
(
m
):
if
m
is
not
None
and
self
.
is_match
(
m
):
self
.
_show_result
(
m
,
file2
)
self
.
_show_result
(
m
,
"
%
s =>
%
s"
%
(
file1
,
file2
)
)
self
.
total
+=
1
self
.
total
+=
1
if
self
.
max_results
and
self
.
total
>=
self
.
max_results
:
if
self
.
max_results
and
self
.
total
>=
self
.
max_results
:
...
@@ -297,14 +297,13 @@ class HashMatch(Module):
...
@@ -297,14 +297,13 @@ class HashMatch(Module):
'''
'''
Main module method.
Main module method.
'''
'''
needle
=
self
.
next_file
()
.
name
# Access the raw self.config.files list directly here, since we accept both
haystack
=
[]
# files and directories and self.next_file only works for files.
needle
=
self
.
config
.
files
[
0
]
haystack
=
self
.
config
.
files
[
1
:]
self
.
header
()
self
.
header
()
for
fp
in
iter
(
self
.
next_file
,
None
):
haystack
.
append
(
fp
.
name
)
if
os
.
path
.
isfile
(
needle
):
if
os
.
path
.
isfile
(
needle
):
if
os
.
path
.
isfile
(
haystack
[
0
]):
if
os
.
path
.
isfile
(
haystack
[
0
]):
self
.
hash_files
(
needle
,
haystack
)
self
.
hash_files
(
needle
,
haystack
)
...
...
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