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
9170015f
Commit
9170015f
authored
Mar 23, 2016
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup; added some extraction API methods.
parent
5fdad3c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
extractor.py
src/binwalk/modules/extractor.py
+17
-8
No files found.
src/binwalk/modules/extractor.py
View file @
9170015f
...
@@ -146,8 +146,6 @@ class Extractor(Module):
...
@@ -146,8 +146,6 @@ class Extractor(Module):
# Holds a dictionary of the last directory listing for a given directory; used for identifying
# Holds a dictionary of the last directory listing for a given directory; used for identifying
# newly created/extracted files that need to be appended to self.pending.
# newly created/extracted files that need to be appended to self.pending.
self
.
last_directory_listing
=
{}
self
.
last_directory_listing
=
{}
# Contains the path to the base output directory for extracted files
# self.directory = None
def
callback
(
self
,
r
):
def
callback
(
self
,
r
):
# Make sure the file attribute is set to a compatible instance of binwalk.core.common.BlockFile
# Make sure the file attribute is set to a compatible instance of binwalk.core.common.BlockFile
...
@@ -398,6 +396,23 @@ class Extractor(Module):
...
@@ -398,6 +396,23 @@ class Extractor(Module):
if
binwalk
.
core
.
common
.
DEBUG
:
if
binwalk
.
core
.
common
.
DEBUG
:
raise
Exception
(
"Extractor.load_defaults failed to load file '
%
s':
%
s"
%
(
extract_file
,
str
(
e
)))
raise
Exception
(
"Extractor.load_defaults failed to load file '
%
s':
%
s"
%
(
extract_file
,
str
(
e
)))
def
get_output_directory_override
(
self
):
'''
Returns the current output directory basename override value.
'''
return
self
.
output_directory_override
def
override_output_directory_basename
(
self
,
dirname
):
'''
Allows the overriding of the default extraction directory basename.
@dirname - The directory base name to use.
Returns the current output directory basename override value.
'''
self
.
output_directory_override
=
dirname
return
self
.
output_directory_override
def
build_output_directory
(
self
,
path
):
def
build_output_directory
(
self
,
path
):
'''
'''
Set the output directory for extracted files.
Set the output directory for extracted files.
...
@@ -435,12 +450,6 @@ class Extractor(Module):
...
@@ -435,12 +450,6 @@ class Extractor(Module):
else
:
else
:
output_directory
=
self
.
extraction_directories
[
path
]
output_directory
=
self
.
extraction_directories
[
path
]
# Set the initial base extraction directory for later determining the level of recusion.
# Note that self.directory is set to None by self.reset.
#if self.directory is None:
# self.directory = os.path.realpath(output_directory) + os.path.sep
# self.output[path].directory = self.directory
return
output_directory
return
output_directory
def
cleanup_extracted_files
(
self
,
tf
=
None
):
def
cleanup_extracted_files
(
self
,
tf
=
None
):
...
...
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