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
92ee2050
Commit
92ee2050
authored
Aug 13, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed directory recursion logic.
parent
9db3bb99
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
extractor.py
src/binwalk/modules/extractor.py
+6
-4
No files found.
src/binwalk/modules/extractor.py
View file @
92ee2050
...
@@ -416,8 +416,6 @@ class Extractor(Module):
...
@@ -416,8 +416,6 @@ class Extractor(Module):
original_dir
=
os
.
getcwd
()
original_dir
=
os
.
getcwd
()
rules
=
self
.
match
(
description
)
rules
=
self
.
match
(
description
)
file_path
=
os
.
path
.
realpath
(
file_name
)
file_path
=
os
.
path
.
realpath
(
file_name
)
# Don't recurse by default; any successful extraction rule will override this.
recurse
=
False
# No extraction rules for this file
# No extraction rules for this file
if
not
rules
:
if
not
rules
:
...
@@ -438,6 +436,12 @@ class Extractor(Module):
...
@@ -438,6 +436,12 @@ class Extractor(Module):
for
i
in
range
(
0
,
len
(
rules
)):
for
i
in
range
(
0
,
len
(
rules
)):
rule
=
rules
[
i
]
rule
=
rules
[
i
]
# Make sure we don't recurse into any extracted directories if instructed not to
if
rule
[
'recurse'
]
in
[
True
,
False
]:
recurse
=
rule
[
'recurse'
]
else
:
recurse
=
True
# Copy out the data to disk, if we haven't already
# Copy out the data to disk, if we haven't already
fname
=
self
.
_dd
(
file_path
,
offset
,
size
,
rule
[
'extension'
],
output_file_name
=
name
)
fname
=
self
.
_dd
(
file_path
,
offset
,
size
,
rule
[
'extension'
],
output_file_name
=
name
)
...
@@ -473,8 +477,6 @@ class Extractor(Module):
...
@@ -473,8 +477,6 @@ class Extractor(Module):
# If the command executed OK, don't try any more rules
# If the command executed OK, don't try any more rules
if
extract_ok
==
True
:
if
extract_ok
==
True
:
# Make sure we recurse into any extracted directories if instructed to
recurse
=
rule
[
'recurse'
]
break
break
# Else, remove the extracted file if this isn't the last rule in the list.
# Else, remove the extracted file if this isn't the last rule in the list.
# If it is the last rule, leave the file on disk for the user to examine.
# If it is the last rule, leave the file on disk for the user to examine.
...
...
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