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
9e0a0c1f
Commit
9e0a0c1f
authored
Nov 08, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-implemented support for adjust signature keyword
parent
3c87c3b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
magic.py
src/binwalk/core/magic.py
+1
-0
firmware
src/binwalk/magic/firmware
+5
-6
signature.py
src/binwalk/modules/signature.py
+3
-2
No files found.
src/binwalk/core/magic.py
View file @
9e0a0c1f
...
@@ -34,6 +34,7 @@ class SignatureResult(object):
...
@@ -34,6 +34,7 @@ class SignatureResult(object):
self
.
size
=
0
self
.
size
=
0
self
.
name
=
None
self
.
name
=
None
self
.
offset
=
0
self
.
offset
=
0
self
.
adjust
=
0
self
.
strlen
=
0
self
.
strlen
=
0
self
.
string
=
False
self
.
string
=
False
self
.
invalid
=
False
self
.
invalid
=
False
...
...
src/binwalk/magic/firmware
View file @
9e0a0c1f
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
>(7.b+40) string x boot partition: "%s"
>(7.b+40) string x boot partition: "%s"
# TP-Link firmware header structure; thanks to Jonathan McGowan for reversing and documenting this format
# TP-Link firmware header structure; thanks to Jonathan McGowan for reversing and documenting this format
0 string TP-LINK\x20Technologies TP-Link firmware header,{offset-adjust:-4}
4 string TP-LINK\x20Technologies TP-Link firmware header,
#>-4 lelong x header version: %d,
#>-4 lelong x header version: %d,
>0x94 beshort x firmware version: %d.
>0x94 beshort x firmware version: %d.
>0x96 beshort x \b%d.
>0x96 beshort x \b%d.
...
@@ -404,15 +404,14 @@
...
@@ -404,15 +404,14 @@
>4 byte 0 {invalid},
>4 byte 0 {invalid},
>4 string x version: "%s"
>4 string x version: "%s"
0 string \x00\x00\x00\x00PART Ubiquiti partition header,{offset-adjust:4}
4 string \x00\x00\x00\x00PART Ubiquiti partition header,
>0 byte x header size: 56 bytes,
>0 byte x header size: 56 bytes,
>8 byte 0 {invalid}
>8 byte 0 {invalid}
>8 string x name: "%s",
>8 string x name: "%s",
>44 belong x base address: 0x%.8X,
>44 belong x base address: 0x%.8X,
>52 belong x data size: %d bytes
>52 belong x data size: %d bytes{size:%d}
>52 belong x {file-size:%d}
0 string \x00\x00\x00\x00END\x2e Ubiquiti end header, header size: 12 bytes,{offset-adjust:4}
4 string \x00\x00\x00\x00END\x2e Ubiquiti end header, header size: 12 bytes,
>12 belong !0 {invalid},
>12 belong !0 {invalid},
>8 belong x cumulative ~CRC32: 0x%.8X
>8 belong x cumulative ~CRC32: 0x%.8X
...
@@ -483,7 +482,7 @@
...
@@ -483,7 +482,7 @@
>19 string AES-256\n \b, encrypted AES-256
>19 string AES-256\n \b, encrypted AES-256
# http://forum.xda-developers.com/showthread.php?p=47818657
# http://forum.xda-developers.com/showthread.php?p=47818657
0 string imgARMcC Roku aimage SB{offset-adjust:-8}
8 string imgARMcC Roku aimage SB
# Boot ROM images for Sun/Cobalt Linux server appliances
# Boot ROM images for Sun/Cobalt Linux server appliances
0 string Cobalt\ Networks\ Inc.\nFirmware\ v Paged Sun/COBALT boot rom,
0 string Cobalt\ Networks\ Inc.\nFirmware\ v Paged Sun/COBALT boot rom,
...
...
src/binwalk/modules/signature.py
View file @
9e0a0c1f
...
@@ -152,10 +152,11 @@ class Signature(Module):
...
@@ -152,10 +152,11 @@ class Signature(Module):
continue
continue
# Keep a record of the relative offset of this signature inside the current data block
# Keep a record of the relative offset of this signature inside the current data block
relative_offset
=
r
.
offset
# (used later for setting current_block_offset).
relative_offset
=
r
.
offset
+
r
.
adjust
# Set the absolute offset inside the target file
# Set the absolute offset inside the target file
r
.
offset
=
block_start
+
r
.
offset
r
.
offset
=
block_start
+
r
elative_
offset
# Provide an instance of the current file object
# Provide an instance of the current file object
r
.
file
=
fp
r
.
file
=
fp
...
...
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