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
01ea4f53
Unverified
Commit
01ea4f53
authored
Jan 12, 2018
by
devttys0
Committed by
GitHub
Jan 12, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #310 from nezza/master
Add support for extracing into subdirectories named by the offset.
parents
2ed5e099
bb3d1e74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
extractor.py
src/binwalk/modules/extractor.py
+11
-0
No files found.
src/binwalk/modules/extractor.py
View file @
01ea4f53
...
...
@@ -100,6 +100,10 @@ class Extractor(Module):
long
=
'carve'
,
kwargs
=
{
'run_extractors'
:
False
},
description
=
"Carve data from files, but don't execute extraction utilities"
),
Option
(
short
=
'T'
,
long
=
'subdirs'
,
kwargs
=
{
'extract_into_subdirs'
:
True
},
description
=
"Extract into sub-directories named by the offset"
),
]
KWARGS
=
[
...
...
@@ -110,6 +114,7 @@ class Extractor(Module):
Kwarg
(
name
=
'remove_after_execute'
,
default
=
False
),
Kwarg
(
name
=
'load_default_rules'
,
default
=
False
),
Kwarg
(
name
=
'run_extractors'
,
default
=
True
),
Kwarg
(
name
=
'extract_into_subdirs'
,
default
=
False
),
Kwarg
(
name
=
'manual_rules'
,
default
=
[]),
Kwarg
(
name
=
'matryoshka'
,
default
=
0
),
Kwarg
(
name
=
'enabled'
,
default
=
False
),
...
...
@@ -580,6 +585,12 @@ class Extractor(Module):
if
os
.
path
.
isfile
(
file_path
):
os
.
chdir
(
output_directory
)
# Extract into subdirectories named by the offset
if
self
.
extract_into_subdirs
:
# Remove trailing L that is added by hex()
offset_dir
=
"0x
%
X"
%
offset
os
.
mkdir
(
offset_dir
)
os
.
chdir
(
offset_dir
)
# Loop through each extraction rule until one succeeds
for
i
in
range
(
0
,
len
(
rules
)):
...
...
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