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
aa00f9d6
Commit
aa00f9d6
authored
9 years ago
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completely disabled compressd plugin.
parent
fcc46601
master
…
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.0
v2.1.1
python27
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
compressd.py
src/binwalk/plugins/compressd.py
+20
-20
No files found.
src/binwalk/plugins/compressd.py
View file @
aa00f9d6
import
binwalk.core.C
import
binwalk.core.plugin
from
binwalk.core.common
import
*
#
import binwalk.core.C
#
import binwalk.core.plugin
#
from binwalk.core.common import *
class
CompressdPlugin
(
binwalk
.
core
.
plugin
.
Plugin
):
'''
Searches for and validates compress'd data.
'''
#
class CompressdPlugin(binwalk.core.plugin.Plugin):
#
'''
#
Searches for and validates compress'd data.
#
'''
MODULES
=
[
'Signature'
]
#MODULES = [
]
READ_SIZE
=
64
#
READ_SIZE = 64
COMPRESS42
=
"compress42"
#
COMPRESS42 = "compress42"
#COMPRESS42_FUNCTIONS = [
# binwalk.core.C.Function(name="is_compressed", type=bool),
#]
comp
=
None
#
comp = None
def
init
(
self
):
#
def init(self):
#self.comp = binwalk.core.C.Library(self.COMPRESS42, self.COMPRESS42_FUNCTIONS)
# This plugin is currently disabled due to the need to move away from supporting C
# libraries and into a pure Python project, for cross-platform support and ease of
# installation / package maintenance. A Python implementation will likely need to
# be custom developed in the future, but for now, since this compression format is
# not very common, especially in firmware, simply disable it.
self
.
comp
=
None
#
self.comp = None
def
scan
(
self
,
result
):
if
self
.
comp
and
result
.
file
and
result
.
description
.
lower
()
.
startswith
(
"compress'd data"
):
fd
=
self
.
module
.
config
.
open_file
(
result
.
file
.
name
,
offset
=
result
.
offset
,
length
=
self
.
READ_SIZE
)
compressed_data
=
fd
.
read
(
self
.
READ_SIZE
)
fd
.
close
()
#
def scan(self, result):
#
if self.comp and result.file and result.description.lower().startswith("compress'd data"):
#
fd = self.module.config.open_file(result.file.name, offset=result.offset, length=self.READ_SIZE)
#
compressed_data = fd.read(self.READ_SIZE)
#
fd.close()
if
not
self
.
comp
.
is_compressed
(
compressed_data
,
len
(
compressed_data
)):
result
.
valid
=
False
#
if not self.comp.is_compressed(compressed_data, len(compressed_data)):
#
result.valid = False
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