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
82cce9a0
Commit
82cce9a0
authored
Apr 23, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Windows specific exceptions
parent
cfa9fad7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
common.py
src/binwalk/core/common.py
+5
-0
entropy.py
src/binwalk/modules/entropy.py
+6
-5
hexdiff.py
src/binwalk/modules/hexdiff.py
+1
-2
No files found.
src/binwalk/core/common.py
View file @
82cce9a0
...
...
@@ -6,6 +6,7 @@ import re
import
sys
import
ast
import
hashlib
import
platform
import
operator
as
op
from
binwalk.core.compat
import
*
...
...
@@ -16,6 +17,10 @@ if not __debug__:
else
:
DEBUG
=
False
def
MSWindows
():
# Returns True if running in a Microsoft Windows OS
return
(
platform
.
system
()
==
'Windows'
)
def
debug
(
msg
):
'''
Displays debug messages to stderr only if the Python interpreter was invoked with the -O flag.
...
...
src/binwalk/modules/entropy.py
View file @
82cce9a0
...
...
@@ -117,14 +117,15 @@ class Entropy(Module):
# Need to invoke the pyqtgraph stuff via a separate process, as calling pg.exit
# is pretty much required. pg.exit calls os._exit though, and we don't want to
# exit out of the main process (especially if being run via the API).
try
:
if
not
binwalk
.
core
.
common
.
MSWindows
()
:
p
=
multiprocessing
.
Process
(
target
=
self
.
_run
)
p
.
start
()
p
.
join
()
except
IOError
as
e
:
# Windows Python2.7 imp.find_module fails to find the binwalk module;
# this eventually leads to an Invalid Argument IOError in the multiprocessing
# module. This means that when run in Windows, pg.exit will cause binwalk
else
:
# There seem to be all kinds of issues using the multiprocessing module in
# Windows, as done above.
#
# This means that when run in Windows, pg.exit will cause binwalk
# to exit.
self
.
_run
()
...
...
src/binwalk/modules/hexdiff.py
View file @
82cce9a0
import
os
import
sys
import
string
import
platform
import
binwalk.core.common
as
common
from
binwalk.core.compat
import
*
from
binwalk.core.module
import
Module
,
Option
,
Kwarg
...
...
@@ -206,7 +205,7 @@ class HexDiff(Module):
self
.
HEADER
=
self
.
HEADER
[
0
]
# Set up the tty for colorization, if it is supported
if
hasattr
(
sys
.
stderr
,
'isatty'
)
and
sys
.
stderr
.
isatty
()
and
platform
.
system
()
!=
'Windows'
:
if
hasattr
(
sys
.
stderr
,
'isatty'
)
and
sys
.
stderr
.
isatty
()
and
not
common
.
MSWindows
()
:
import
curses
curses
.
setupterm
()
self
.
colorize
=
self
.
_colorize
...
...
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