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
56f5f34b
Commit
56f5f34b
authored
Nov 16, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed setup.py bug in setting python2 interpreter over multiple runs of setup.py
parent
1901cfdd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
prettyprint.py
src/binwalk/prettyprint.py
+15
-6
setup.py
src/setup.py
+1
-1
No files found.
src/binwalk/prettyprint.py
View file @
56f5f34b
...
...
@@ -108,12 +108,13 @@ class PrettyPrint:
else
:
self
.
fp
.
write
(
data
)
def
_pprint
(
self
,
data
):
def
_pprint
(
self
,
data
,
nolog
=
False
,
noprint
=
False
):
'''
Print data to stdout and the log file.
'''
if
not
self
.
quiet
:
if
not
self
.
quiet
and
not
noprint
:
sys
.
stdout
.
write
(
data
)
if
not
nolog
:
self
.
_log
(
data
)
def
_file_md5
(
self
,
file_name
):
...
...
@@ -214,11 +215,19 @@ class PrettyPrint:
Returns None.
'''
nolog
=
False
md5sum
=
self
.
_file_md5
(
file_name
)
timestamp
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
log_csv
:
nolog
=
True
self
.
_pprint
(
"
%
s
%
s
%
s"
%
(
file_name
,
md5sum
,
timestamp
),
noprint
=
True
)
self
.
_pprint
(
"
\n
"
)
self
.
_pprint
(
"Scan Time:
%
s
\n
"
%
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
)
self
.
_pprint
(
"Signatures:
%
d
\n
"
%
self
.
binwalk
.
parser
.
signature_count
)
self
.
_pprint
(
"Target File:
%
s
\n
"
%
file_name
)
self
.
_pprint
(
"MD5 Checksum:
%
s
\n
"
%
self
.
_file_md5
(
file_name
)
)
self
.
_pprint
(
"Scan Time:
%
s
\n
"
%
timestamp
,
nolog
=
nolog
)
self
.
_pprint
(
"Signatures:
%
d
\n
"
%
self
.
binwalk
.
parser
.
signature_count
,
nolog
=
nolog
)
self
.
_pprint
(
"Target File:
%
s
\n
"
%
file_name
,
nolog
=
nolog
)
self
.
_pprint
(
"MD5 Checksum:
%
s
\n
"
%
md5sum
,
nolog
=
nolog
)
def
header
(
self
,
file_name
=
None
,
header
=
None
,
description
=
DEFAULT_DESCRIPTION_HEADER
):
'''
...
...
src/setup.py
View file @
56f5f34b
...
...
@@ -112,7 +112,7 @@ if python2_path and binwalk_path:
for
line
in
open
(
binwalk_path
,
'rb'
)
.
readlines
():
if
i
==
0
:
line
=
line
.
replace
(
"python"
,
"python2"
)
line
=
"#!/usr/bin/env python2
\n
"
data
+=
line
i
+=
1
...
...
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