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
5c9c935f
Unverified
Commit
5c9c935f
authored
Nov 08, 2019
by
devttys0
Committed by
GitHub
Nov 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #391 from nmatt0/update-api-docs
make API example python3 compliant
parents
f42a200b
2d311188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
API.md
API.md
+3
-3
No files found.
API.md
View file @
5c9c935f
...
...
@@ -86,12 +86,12 @@ Each module object will also have an additional `extractor` attribute, which is
```
python
for
module
in
binwalk
.
scan
(
sys
.
argv
[
1
],
signature
=
True
,
quiet
=
True
,
extract
=
True
):
for
result
in
module
.
results
:
if
module
.
extractor
.
output
.
has_key
(
result
.
file
.
path
)
:
if
result
.
file
.
path
in
module
.
extractor
.
output
:
# These are files that binwalk carved out of the original firmware image, a la dd
if
module
.
extractor
.
output
[
result
.
file
.
path
]
.
carved
.
has_key
(
result
.
offset
)
:
if
result
.
offset
in
module
.
extractor
.
output
[
result
.
file
.
path
]
.
carved
:
print
"Carved data from offset 0x
%
X to
%
s"
%
(
result
.
offset
,
module
.
extractor
.
output
[
result
.
file
.
path
]
.
carved
[
result
.
offset
])
# These are files/directories created by extraction utilities (gunzip, tar, unsquashfs, etc)
if
module
.
extractor
.
output
[
result
.
file
.
path
]
.
extracted
.
has_key
(
result
.
offset
)
:
if
result
.
offset
in
module
.
extractor
.
output
[
result
.
file
.
path
]
.
extracted
:
print
"Extracted
%
d files from offset 0x
%
X to '
%
s' using '
%
s'"
%
(
len
(
module
.
extractor
.
output
[
result
.
file
.
path
]
.
extracted
[
result
.
offset
]
.
files
),
result
.
offset
,
module
.
extractor
.
output
[
result
.
file
.
path
]
.
extracted
[
result
.
offset
]
.
files
[
0
],
...
...
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