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
03043abe
Commit
03043abe
authored
Mar 15, 2017
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added squashfs firmware test
parent
6b726073
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
firmware.squashfs
tests/input-vectors/firmware.squashfs
+0
-0
test_firmware_squashfs.py
tests/test_firmware_squashfs.py
+32
-0
No files found.
tests/input-vectors/firmware.squashfs
0 → 100644
View file @
03043abe
File added
tests/test_firmware_squashfs.py
0 → 100644
View file @
03043abe
from
os.path
import
dirname
import
binwalk
from
nose.tools
import
eq_
,
ok_
def
test_firmware_squashfs
():
'''
Test: Open hello-world.srec, scan for signatures
verify that only one signature is returned
verify that the only signature returned is Motorola S-rec data-signature
'''
expected_results
=
[
[
0
,
'DLOB firmware header, boot partition: "dev=/dev/mtdblock/2"'
],
[
112
,
'LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 3466208 bytes'
],
[
1179760
,
'PackImg section delimiter tag, little endian size: 11548416 bytes; big endian size: 3649536 bytes'
],
[
1179792
,
'Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 3647665 bytes, 1811 inodes, blocksize: 524288 bytes, created: 2013-09-17 06:43:22'
],
]
scan_result
=
binwalk
.
scan
(
dirname
(
__file__
)
+
'/input-vectors/firmware.squashfs'
,
signature
=
True
,
quiet
=
True
,
extract
=
True
)
# Throws a warning for missing external extractor
# Test number of modules used
eq_
(
len
(
scan_result
),
1
)
# Test number of results for that module
eq_
(
len
(
scan_result
[
0
]
.
results
),
len
(
expected_results
))
# Test result-description
for
i
in
range
(
0
,
len
(
scan_result
[
0
]
.
results
)):
eq_
(
scan_result
[
0
]
.
results
[
i
]
.
offset
,
expected_results
[
i
][
0
])
eq_
(
scan_result
[
0
]
.
results
[
i
]
.
description
,
expected_results
[
i
][
1
])
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