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-depend
binwalk
Commits
fdd6944e
Commit
fdd6944e
authored
8 years ago
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved CPIO, Windows CE, and ISO 9660 signature validation
parent
34db0f73
master
…
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.0
python27
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletions
+23
-1
filesystems
src/binwalk/magic/filesystems
+1
-0
firmware
src/binwalk/magic/firmware
+1
-1
cpio.py
src/binwalk/plugins/cpio.py
+21
-0
No files found.
src/binwalk/magic/filesystems
View file @
fdd6944e
...
...
@@ -597,6 +597,7 @@
32769 string CD001 ISO
>6144 string !NSR0 9660 CD-ROM filesystem data,
>6144 string NSR0 UDF filesystem data,
>32770 byte !1 {invalid}
>6148 string 1 version 1.0,
>6148 string 2 version 2.0,
>6148 string 3 version 3.0
...
...
This diff is collapsed.
Click to expand it.
src/binwalk/magic/firmware
View file @
fdd6944e
...
...
@@ -290,7 +290,7 @@
0 string B000FF Windows CE image header,
>7 ulelong x image start: 0x%X,
>11 ulelong x image length: %d
>11 ulelong x {size:%d}
#Windows CE RomImage
63 string \x00ECEC Windows CE memory segment header,
...
...
This diff is collapsed.
Click to expand it.
src/binwalk/plugins/cpio.py
View file @
fdd6944e
...
...
@@ -61,12 +61,33 @@ class CPIOPlugin(binwalk.core.plugin.Plugin):
self
.
found_archive
=
False
self
.
found_archive_in_file
=
None
def
_get_file_name
(
self
,
description
):
name
=
''
if
'file name: "'
in
description
:
name
=
description
.
split
(
'file name: "'
)[
1
]
.
split
(
'"'
)[
0
]
return
name
def
_get_file_name_length
(
self
,
description
):
length
=
0
if
'file name length: "'
in
description
:
length_string
=
description
.
split
(
'file name length: "'
)[
1
]
.
split
(
'"'
)[
0
]
length
=
int
(
length_string
,
0
)
return
length
def
scan
(
self
,
result
):
if
result
.
valid
:
# ASCII CPIO archives consist of multiple entries, ending with an entry named 'TRAILER!!!'.
# Displaying each entry is useful, as it shows what files are contained in the archive,
# but we only want to extract the archive when the first entry is found.
if
result
.
description
.
startswith
(
'ASCII cpio archive'
):
# Validate the reported name length
file_name
=
self
.
_get_file_name
(
result
.
description
)
file_name_length
=
self
.
_get_file_name_length
(
result
.
description
)
if
len
(
file_name
)
!=
file_name_length
:
result
.
valid
=
False
return
self
.
consecutive_hits
+=
1
if
not
self
.
found_archive
or
self
.
found_archive_in_file
!=
result
.
file
.
name
:
...
...
This diff is collapsed.
Click to expand it.
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