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
7d7a10ba
Commit
7d7a10ba
authored
Nov 21, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added back trx validation checks
parent
49fd6ad4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
22 deletions
+10
-22
magic.py
src/binwalk/core/magic.py
+3
-1
firmware
src/binwalk/magic/firmware
+7
-19
signature.py
src/binwalk/modules/signature.py
+0
-2
No files found.
src/binwalk/core/magic.py
View file @
7d7a10ba
...
...
@@ -754,9 +754,11 @@ 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:
if
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
# signature is valid, or if invalid results were requested.
if
(
not
tags
[
'invalid'
]
or
self
.
show_invalid
)
and
not
self
.
_filtered
(
tags
[
'description'
]):
...
...
src/binwalk/magic/firmware
View file @
7d7a10ba
...
...
@@ -89,34 +89,22 @@
>48 string x root device: "%s"
# trx image file
0 string HDR0 TRX firmware header, little endian, header size: 28 bytes,
>4 ulelong x image size: %d bytes,
>8 ulelong x CRC32: 0x%X
>12 uleshort x flags: 0x%X,
>14 uleshort 1 version: %d,
>>16 ulelong x loader offset: 0x%X,
>>20 ulelong x linux kernel offset: 0x%X,
>>24 ulelong x rootfs offset: 0x%X
>>24 ulelong 0 {invalid}
0 string HDR0 TRX firmware header, little endian, header size: 28 bytes,
>4 ulelong x image size: %d bytes,
>8 ulelong x CRC32: 0x%X
>12 uleshort x flags: 0x%X,
>14 uleshort 1 version: %d,
>>16 ulelong x kernel offset: 0x%X,
>>20 ulelong x rootfs offset: 0x%X
>>24 ulelong !0 {invalid}
0 string HDR0 TRX firmware header, little endian, header size: 32 bytes,
>4 lelong <1 {invalid}
>4 ulelong x image size: %d bytes,
>8 ulelong x CRC32: 0x%X
>12 uleshort x flags: 0x%X,
>14 uleshort !1
>>14 uleshort !2 {invalid}
>14 uleshort 2 version: %d,
>>16 ulelong x loader offset: 0x%X,
>>20 ulelong x linux kernel offset: 0x%X,
>>24 ulelong x rootfs offset: 0x%X,
>>28 ulelong x bin-header offset: 0x%X
>14 uleshort 1 version: %d,
>>16 ulelong x kernel offset: 0x%X,
>>20 ulelong x rootfs offset: 0x%X
>>24 ulelong !0 {invalid}
# Ubicom firmware image
0 belong 0xFA320080 Ubicom firmware header,
...
...
src/binwalk/modules/signature.py
View file @
7d7a10ba
...
...
@@ -85,7 +85,6 @@ class Signature(Module):
# Create a signature from the raw bytes, if any
if
self
.
raw_bytes
:
print
(
self
.
raw_bytes
)
raw_signatures
=
[]
for
raw_bytes
in
self
.
raw_bytes
:
raw_signatures
.
append
(
"0 string
%
s
%
s"
%
(
raw_bytes
,
raw_bytes
))
...
...
@@ -139,7 +138,6 @@ class Signature(Module):
# Scan this data block for magic signatures
for
r
in
self
.
magic
.
scan
(
data
,
dlen
):
# current_block_offset is set when a jump-to-offset keyword is encountered while
# processing signatures. This points to an offset inside the current data block
# that scanning should jump to, so ignore any subsequent candidate signatures that
...
...
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