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
94f6b9bb
Commit
94f6b9bb
authored
Jul 16, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option for specifying a custom output directory
parent
f2ce2992
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
extractor.py
src/binwalk/modules/extractor.py
+11
-1
No files found.
src/binwalk/modules/extractor.py
View file @
94f6b9bb
...
...
@@ -56,6 +56,11 @@ class Extractor(Module):
type
=
int
,
kwargs
=
{
'matryoshka'
:
0
},
description
=
'Limit matryoshka recursion depth (default: 8 levels deep)'
),
Option
(
short
=
'C'
,
long
=
'directory'
,
type
=
str
,
kwargs
=
{
'base_directory'
:
0
},
description
=
'Extract files/folders to a custom directory (default: current working directory)'
),
Option
(
short
=
'j'
,
long
=
'size'
,
type
=
int
,
...
...
@@ -73,6 +78,7 @@ class Extractor(Module):
KWARGS
=
[
Kwarg
(
name
=
'max_size'
,
default
=
None
),
Kwarg
(
name
=
'base_directory'
,
default
=
None
),
Kwarg
(
name
=
'remove_after_execute'
,
default
=
False
),
Kwarg
(
name
=
'load_default_rules'
,
default
=
False
),
Kwarg
(
name
=
'run_extractors'
,
default
=
True
),
...
...
@@ -336,7 +342,12 @@ class Extractor(Module):
# Make sure we put the initial extracted file in the CWD
if
self
.
directory
is
None
:
if
self
.
base_directory
is
None
:
basedir
=
os
.
getcwd
()
else
:
basedir
=
self
.
base_directory
if
not
os
.
path
.
exists
(
basedir
):
os
.
mkdir
(
basedir
)
outdir
=
os
.
path
.
join
(
basedir
,
'_'
+
basename
)
output_directory
=
unique_file_name
(
outdir
,
extension
=
'extracted'
)
...
...
@@ -353,7 +364,6 @@ class Extractor(Module):
if
self
.
directory
is
None
:
self
.
directory
=
os
.
path
.
realpath
(
output_directory
)
+
os
.
path
.
sep
return
output_directory
...
...
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