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
02ec8f1f
Commit
02ec8f1f
authored
Dec 05, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates to rehash
parent
23225665
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
rehash
src/bin/rehash
+12
-5
hashmatch.py
src/binwalk/hashmatch.py
+1
-1
No files found.
src/bin/rehash
View file @
02ec8f1f
...
...
@@ -7,6 +7,8 @@ import binwalk.hashmatch as hashmatch
from
binwalk.compat
import
*
from
getopt
import
GetoptError
,
gnu_getopt
as
GetOpt
DEFAULT_CUTOFF
=
50
def
usage
(
fd
):
fd
.
write
(
"
\n
"
)
fd
.
write
(
'Diff files or directories using Context Triggered Piecewise Hashing ("fuzzy" hashing).
\n
'
)
...
...
@@ -21,10 +23,10 @@ def usage(fd):
fd
.
write
(
"
\n
"
)
fd
.
write
(
"Diffing Options:
\n
"
)
fd
.
write
(
"
\t
-d, --diff
Show files that are different (default)
\n
"
)
fd
.
write
(
"
\t
-s, --same
S
how files that are the same
\n
"
)
fd
.
write
(
"
\t
-d, --diff
Only show files that are different
\n
"
)
fd
.
write
(
"
\t
-s, --same
Only s
how files that are the same
\n
"
)
fd
.
write
(
"
\t
-S, --strings Diff strings inside files instead of the entire file
\n
"
)
fd
.
write
(
"
\t
-c, --cutoff=<n> Set the cutoff percentage (default:
50
%
)
\n
"
)
fd
.
write
(
"
\t
-c, --cutoff=<n> Set the cutoff percentage (default:
%
d
%
)
\n
"
%
DEFAULT_CUTOFF
)
fd
.
write
(
"
\t
-m, --max=<n> Quit after n number of matches
\n
"
)
fd
.
write
(
"
\n
"
)
...
...
@@ -74,9 +76,9 @@ def main():
strings
=
False
symlinks
=
False
name
=
False
same
=
False
cutoff
=
None
same
=
None
max_results
=
None
cutoff
=
0
short_options
=
"acdf:hlm:no:qSstx:X:y:Y:"
long_options
=
[
...
...
@@ -149,6 +151,11 @@ def main():
if
opt
not
in
arguments
and
opt
not
in
options
and
not
opt
.
startswith
(
'-'
):
file_list
.
append
(
opt
)
if
same
is
None
:
same
=
True
elif
cutoff
==
0
:
cutoff
=
DEFAULT_CUTOFF
if
include_files
:
matches
[
True
]
=
include_files
if
exclude_files
:
...
...
src/binwalk/hashmatch.py
View file @
02ec8f1f
...
...
@@ -26,7 +26,7 @@ class HashMatch(object):
# Files smaller than this won't produce meaningful fuzzy results (from ssdeep.h)
FUZZY_MIN_FILE_SIZE
=
4096
FUZZY_DEFAULT_CUTOFF
=
5
0
FUZZY_DEFAULT_CUTOFF
=
0
def
__init__
(
self
,
cutoff
=
None
,
strings
=
False
,
same
=
False
,
symlinks
=
False
,
name
=
False
,
max_results
=
None
,
display
=
False
,
log
=
None
,
csv
=
False
,
quiet
=
False
,
format_to_screen
=
False
,
abspath
=
False
,
matches
=
{},
types
=
{}):
'''
...
...
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