Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2015 12:26:23 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r382401 - in head/security/py-volatility: . files
Message-ID:  <201503271226.t2RCQNmh028182@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Fri Mar 27 12:26:22 2015
New Revision: 382401
URL: https://svnweb.freebsd.org/changeset/ports/382401
QAT: https://qat.redports.org/buildarchive/r382401/

Log:
  Adjust to run better with new versions of openpyxl

Added:
  head/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py   (contents, props changed)
  head/security/py-volatility/files/patch-volatility_plugins_timeliner.py   (contents, props changed)
Modified:
  head/security/py-volatility/Makefile
  head/security/py-volatility/files/patch-setup.py

Modified: head/security/py-volatility/Makefile
==============================================================================
--- head/security/py-volatility/Makefile	Fri Mar 27 12:24:06 2015	(r382400)
+++ head/security/py-volatility/Makefile	Fri Mar 27 12:26:22 2015	(r382401)
@@ -3,7 +3,7 @@
 
 PORTNAME=	volatility
 PORTVERSION=	2.4
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	security python
 MASTER_SITES=	http://downloads.volatilityfoundation.org/releases/${PORTVERSION}/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -33,11 +33,6 @@ DOCSDIR=	${PREFIX}/share/doc/py-${PORTNA
 
 PYDISTUTILS_INSTALLARGS+=--install-data ${DATADIR}
 
-post-patch:
-	@${REINPLACE_CMD} 's,openpyxl.style,openpyxl.styles,' \
-		${WRKSRC}/volatility/plugins/malware/psxview.py \
-		${WRKSRC}/volatility/plugins/timeliner.py
-
 post-install:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}

Modified: head/security/py-volatility/files/patch-setup.py
==============================================================================
--- head/security/py-volatility/files/patch-setup.py	Fri Mar 27 12:24:06 2015	(r382400)
+++ head/security/py-volatility/files/patch-setup.py	Fri Mar 27 12:26:22 2015	(r382401)
@@ -1,6 +1,6 @@
---- setup.py.orig	2014-08-03 18:09:32 +0000
+--- setup.py.orig	2014-08-03 18:09:32 UTC
 +++ setup.py
-@@ -44,7 +44,10 @@
+@@ -44,7 +44,10 @@ def find_files(topdirs, py = False):
      ret = []
      for topdir in topdirs:
          for r, _ds, fs in os.walk(topdir):

Added: head/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py	Fri Mar 27 12:26:22 2015	(r382401)
@@ -0,0 +1,88 @@
+--- volatility/plugins/malware/psxview.py.orig	2014-08-03 18:09:34 UTC
++++ volatility/plugins/malware/psxview.py
+@@ -32,7 +32,7 @@ try:
+     from openpyxl.workbook import Workbook
+     from openpyxl.writer.excel import ExcelWriter
+     from openpyxl.cell import get_column_letter
+-    from openpyxl.style import Color, Fill
++    from openpyxl.styles import Color, Fill, Style, PatternFill, Border, Side, Alignment, Protection, Font
+     from openpyxl.cell import Cell
+     from openpyxl import load_workbook
+     has_openpyxl = True 
+@@ -208,6 +208,57 @@ class PsXview(common.AbstractWindowsComm
+                     yield offset, source[offset], ps_sources
+ 
+     def render_xlsx(self, outfd, data):
++        BoldStyle = Style(font=Font(name='Calibri',
++                 size=11,
++                 bold=True,
++                 italic=False,
++                 vertAlign=None,
++                 underline='none',
++                 strike=False,
++                 color='FFFFFFFF'),
++            fill=PatternFill(fill_type="solid",
++                 start_color='FF000000',
++                 end_color='FF000000'))
++        RedStyle = Style(font=Font(name='Calibri',
++                 size=11,
++                 bold=False,
++                 italic=False,
++                 vertAlign=None,
++                 underline='none',
++                 strike=False,
++                 color='FF000000'),
++            border=Border(left=Side(border_style="thick",
++                                color='FF000000'),
++                      right=Side(border_style="thick",
++                                 color='FF000000'),
++                      top=Side(border_style="thick",
++                               color='FF000000'),
++                      bottom=Side(border_style="thick",
++                                  color='FF000000'),
++                      diagonal=Side(border_style="thick",
++                                    color='FF000000'),
++                      diagonal_direction=0,
++                      outline=Side(border_style="thick",
++                                   color='FF000000'),
++                      vertical=Side(border_style="thick",
++                                    color='FF000000'),
++                      horizontal=Side(border_style="thick",
++                                     color='FF000000')),
++            fill=PatternFill(start_color = 'FFFF0000',
++                    end_color = 'FFFF0000',
++                    fill_type = 'solid'))
++        GreenStyle = Style(font=Font(name='Calibri',
++                 size=11,
++                 bold=False,
++                 italic=False,
++                 vertAlign=None,
++                 underline='none',
++                 strike=False,
++                 color='FF000000'),
++            fill=PatternFill(start_color = "FF00FF00",
++                    end_color = "FF00FF00",
++                    fill_type = "solid"))
++
+         wb = Workbook(optimized_write = True)
+         ws = wb.create_sheet()
+         ws.title = "Psxview Output"
+@@ -274,15 +325,13 @@ class PsXview(common.AbstractWindowsComm
+         wb = load_workbook(filename = self._config.OUTPUT_FILE)
+         ws = wb.get_sheet_by_name(name = "Psxview Output")
+         for col in xrange(1, 12):
+-            ws.cell("{0}{1}".format(get_column_letter(col), 1)).style.font.bold = True
++            ws.cell("{0}{1}".format(get_column_letter(col), 1)).style = BoldStyle
+         for row in xrange(2, total + 1):
+             for col in xrange(4, 11):
+                 if ws.cell("{0}{1}".format(get_column_letter(col), row)).value == "False":
+-                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+-                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = "FFFF0000"
++                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style = RedStyle
+                 else:
+-                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+-                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = "FF00FF00" 
++                    ws.cell("{0}{1}".format(get_column_letter(col), row)).style = GreenStyle
+         wb.save(filename = self._config.OUTPUT_FILE)
+ 
+     def render_text(self, outfd, data):

Added: head/security/py-volatility/files/patch-volatility_plugins_timeliner.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/py-volatility/files/patch-volatility_plugins_timeliner.py	Fri Mar 27 12:26:22 2015	(r382401)
@@ -0,0 +1,35 @@
+--- volatility/plugins/timeliner.py.orig	2014-08-03 18:49:58 UTC
++++ volatility/plugins/timeliner.py
+@@ -56,7 +56,6 @@ try:
+     from openpyxl.workbook import Workbook
+     from openpyxl.writer.excel import ExcelWriter
+     from openpyxl.cell import get_column_letter
+-    from openpyxl.style import Color, Fill
+     from openpyxl.cell import Cell
+     from openpyxl import load_workbook
+     has_openpyxl = True
+@@ -193,11 +192,6 @@ class TimeLiner(common.AbstractWindowsCo
+             if line != None:
+                 outfd.write(line) 
+ 
+-    def fill(self, ws, row, max = 6, color = "RED"):
+-        for col in xrange(1, max): 
+-            ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+-            ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = colors.get(color, "RED")
+-
+     def render_xlsx(self, outfd, data):
+         wb = Workbook(optimized_write = True)
+         ws = wb.create_sheet()
+@@ -214,12 +208,9 @@ class TimeLiner(common.AbstractWindowsCo
+         if self._config.HIGHLIGHT != None:
+             wb = load_workbook(filename = self._config.OUTPUT_FILE)
+             ws = wb.get_sheet_by_name(name = "Timeline Output")
+-            for col in xrange(1, len(header) + 1):
+-                ws.cell("{0}{1}".format(get_column_letter(col), 1)).style.font.bold = True
+             for row in xrange(2, total + 1):
+                 for col in xrange(2, len(header)):
+                     if ws.cell("{0}{1}".format(get_column_letter(col), row)).value in self.suspicious.keys():
+-                        self.fill(ws, row, len(header) + 1, self.suspicious[ws.cell("{0}{1}".format(get_column_letter(col), row)).value]["color"])
+                         ws.cell("{0}{1}".format(get_column_letter(col + 1), row)).value = self.suspicious[ws.cell("{0}{1}".format(get_column_letter(col), row)).value]["reason"]
+                     
+             wb.save(filename = self._config.OUTPUT_FILE)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503271226.t2RCQNmh028182>