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
9b505a7b
Commit
9b505a7b
authored
Nov 14, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed magic.py bug
parent
b666c8fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
magic.py
src/binwalk/core/magic.py
+11
-1
filesystems
src/binwalk/magic/filesystems
+8
-1
No files found.
src/binwalk/core/magic.py
View file @
9b505a7b
...
...
@@ -700,6 +700,16 @@ class Magic(object):
return
tags
def
match
(
self
,
data
):
'''
Match the beginning of a data buffer to a signature.
@data - The data buffer to match against the loaded signature list.
Returns a list of SignatureResult objects.
'''
return
self
.
scan
(
data
,
1
)
def
scan
(
self
,
data
,
dlen
=
None
):
'''
Scan a data block for matching signatures.
...
...
@@ -732,7 +742,7 @@ class Magic(object):
# If this offset has already been matched to a previous signature, ignore it unless
# self.show_invalid has been specified. Also ignore obviously invalid offsets (<1)
# as well as those outside the specified self.data range (dlen).
if
(
offset
not
in
matched_offsets
or
self
.
show_invalid
)
and
offset
>=
0
and
offset
<
=
dlen
:
if
(
offset
not
in
matched_offsets
or
self
.
show_invalid
)
and
offset
>=
0
and
offset
<
dlen
:
# Analyze the data at this offset using the current signature rule
tags
=
self
.
_analyze
(
signature
,
offset
)
# Generate a SignatureResult object and append it to the results list if the
...
...
src/binwalk/magic/filesystems
View file @
9b505a7b
...
...
@@ -123,7 +123,14 @@
>20 ubelong x data offset: 0x%X
# http://lxr.free-electrons.com/source/fs/ubifs/ubifs-media.h
0 lelong 0x06101831 UBIFS superblock,
0 lelong 0x06101831 UBIFS master node,
>20 ubyte !7 {invalid} # Only look for the master node
>22 leshort !0 {invalid}
>24 lequad x highest inode: %d,
>32 lequad x commit number: %d
# http://lxr.free-electrons.com/source/fs/ubifs/ubifs-media.h
0 lelong 0x06101831 UBIFS superblock node,
>20 ubyte !6 {invalid} # Only look for the superblock node
>4 ulelong x CRC: 0x%X,
#>8 lequad x sqnum: %ld,
...
...
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