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
8d0afa75
Commit
8d0afa75
authored
May 12, 2017
by
devttys0
Committed by
GitHub
May 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #273 from EmilyBragg/master
Added ability to toggle binary flags through python kwargs
parents
62e9caa1
bacdb574
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
module.py
src/binwalk/core/module.py
+17
-13
No files found.
src/binwalk/core/module.py
View file @
8d0afa75
...
@@ -665,19 +665,23 @@ class Modules(object):
...
@@ -665,19 +665,23 @@ class Modules(object):
def
__exit__
(
self
,
t
,
v
,
b
):
def
__exit__
(
self
,
t
,
v
,
b
):
self
.
cleanup
()
self
.
cleanup
()
def
_set_arguments
(
self
,
argv
=
[],
kargv
=
{}):
def
_set_arguments
(
self
,
argv
=
None
,
kargv
=
None
):
for
(
k
,
v
)
in
iterator
(
kargv
):
if
kargv
:
k
=
self
.
_parse_api_opt
(
k
)
for
(
k
,
v
)
in
iterator
(
kargv
):
if
v
not
in
[
True
,
False
,
None
]:
k
=
self
.
_parse_api_opt
(
k
)
if
not
isinstance
(
v
,
list
):
if
v
not
in
[
True
,
False
,
None
]:
v
=
[
v
]
if
not
isinstance
(
v
,
list
):
for
value
in
v
:
v
=
[
v
]
if
not
isinstance
(
value
,
str
):
for
value
in
v
:
value
=
str
(
bytes2str
(
value
))
if
not
isinstance
(
value
,
str
):
argv
.
append
(
k
)
value
=
str
(
bytes2str
(
value
))
argv
.
append
(
value
)
argv
.
append
(
k
)
else
:
argv
.
append
(
value
)
argv
.
append
(
k
)
else
:
# Only append if the value is True; this allows for toggling values
# by the function call.
if
v
:
argv
.
append
(
k
)
if
not
argv
and
not
self
.
arguments
:
if
not
argv
and
not
self
.
arguments
:
self
.
arguments
=
sys
.
argv
[
1
:]
self
.
arguments
=
sys
.
argv
[
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