dff: migrage python and make it work

This commit is contained in:
blshkv 2017-01-10 20:26:48 +08:00
parent 6597e01e49
commit 777eb1b440
No known key found for this signature in database
GPG key ID: 9CCF6FCB8D8A14BF
11 changed files with 108 additions and 329 deletions

View file

@ -1,2 +1 @@
DIST dff-1.3.0.tar.gz 3905813 SHA256 6ab0a6854ff81bc5ccf891131291dc73a42c21e4382b2c9c3e2fc00376edbc0f SHA512 a77aa517a4b87939cc584b88f3ab60c625ed36eab5ba58ba56a34a4cc426f1bc69465febe76e4f0ea5682f6078ac7c9e5d5a3e27f66f957770b07cd8e800da03 WHIRLPOOL 3c02124ea592bad05ece5ed69c1cc9683f2a4298cdc3a4679c4500446b25551da3be7e1593b2c7a42eab0ae9cf8e3cfab0e78a18b2d6160418b3462a07291e64
DIST dff-src-1.2.0.tar.gz 9925178 SHA256 e6342f1b105fa9077d4b859e1dba0214e5e899ce152b9d26342a9f14659c6de6 SHA512 761145570955214dec86704967e16ca202dc94765c0feb123556d2521f88b0083d5e5368641e352cb51dfd46264aa79977bbd654ea940e5668703f9d27931c93 WHIRLPOOL fe908b13270d3a05cbe58223eef06d6cf84279ddcfa3c5b7c7bdd499069cd52efba2cc6fdd0d365aa267e719ef81cfe96a4333126ffae6251f4a6fcf5f4e8e83

View file

@ -1,49 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_DEPEND="2:2.6"
inherit cmake-utils python
DESCRIPTION="A digital forensics framework which aims to analyze and recover any
kind of digital artifact."
HOMEPAGE="http://tracker.digital-forensic.org/"
SRC_URI="http://dev.pentoo.ch/~zero/distfiles/${PN}-src-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="doc ewf +aff +pff"
DEPEND=">=dev-lang/swig-1.3.38
dev-python/sip
doc? ( >=dev-python/PyQt4-4.4.0[webkit,assistant] )
!doc? ( >=dev-python/PyQt4-4.4.0 )
>=sys-apps/file-4.26[python]
"
RDEPEND="${DEPEND}
ewf? ( >=app-forensics/libewf-20100226 )
aff? ( >=app-forensics/afflib-3.6.8 )
pff? ( >=app-forensics/libpff-0.0.20120513_alpha )
"
pkg_setup() {
python_set_active_version 2
python_pkg_setup
}
src_prepare() {
epatch "${FILESDIR}/${P}-disable-qtassistant.patch"
epatch "${FILESDIR}/${P}-libpff-0.0.20120513.patch"
python_convert_shebangs -r 2 .
sed -i 's:^python:python2:' ressources/linux_launcher.sh || die "sed makefile"
}
src_configure() {
mycmakeargs+=( "-DINSTALL:BOOLEAN=ON" )
cmake-utils_src_configure
}

View file

@ -0,0 +1,65 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit cmake-utils python-single-r1 multilib
DESCRIPTION="A framework which aims to analyze and recover any kind of digital artifact"
HOMEPAGE="http://tracker.digital-forensic.org/"
SRC_URI="http://dev.pentoo.ch/~zero/distfiles/${PN}-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc ewf +aff +dff +pff"
RDEPEND="${PYTHON_DEPS}
dev-python/sip[${PYTHON_USEDEP}]
doc? ( >=dev-python/PyQt4-4.4.0[help,webkit,assistant,${PYTHON_USEDEP}] )
!doc? ( >=dev-python/PyQt4-4.4.0[${PYTHON_USEDEP}] )
dev-python/python-magic[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}
ewf? ( >=app-forensics/libewf-20100226 )
aff? ( >=app-forensics/afflib-3.6.8 )
dff? ( >=app-forensics/libbfio-0.0.20120425 )
pff? ( >=app-forensics/libpff-0.0.20120802_alpha )
>=dev-lang/swig-1.3.38
dev-libs/tre[python]
"
pkg_setup() {
python-single-r1_pkg_setup
}
src_prepare() {
#epatch "${FILESDIR}/${P}-disable-qtassistant.patch"
#epatch "${FILESDIR}/${P}-libpff-0.0.20120513.patch"
epatch "${FILESDIR}/${PV}-libav10.patch"
epatch "${FILESDIR}/${PV}-fix-ftbfs-libav9.patch"
python_fix_shebang .
sed -i 's:^python:python2:' ressources/linux_launcher.sh || die "sed makefile"
sed -i 's|^declare_icu_component(le|#declare_icu_component(le|' cmake_modules/FindICU.cmake
sed -i 's|^declare_icu_component(lx|#declare_icu_component(lx|' cmake_modules/FindICU.cmake
}
src_configure() {
export LIBDIR=$(get_libdir)
mycmakeargs+=( "-DINSTALL:BOOLEAN=ON" )
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
#byte-complation fix
python_optimize
}

View file

@ -1,50 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_DEPEND="2:2.6"
inherit cmake-utils python
DESCRIPTION="A digital forensics framework which aims to analyze and recover any
kind of digital artifact."
HOMEPAGE="http://tracker.digital-forensic.org/"
SRC_URI="http://dev.pentoo.ch/~zero/distfiles/${PN}-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE="doc ewf +aff +dff +pff"
DEPEND=">=dev-lang/swig-1.3.38
dev-python/sip
doc? ( >=dev-python/PyQt4-4.4.0[webkit,assistant] )
!doc? ( >=dev-python/PyQt4-4.4.0 )
>=sys-apps/file-4.26[python]
"
RDEPEND="${DEPEND}
ewf? ( >=app-forensics/libewf-20100226 )
aff? ( >=app-forensics/afflib-3.6.8 )
dff? ( >=app-forensics/libbfio-0.0.20120425 )
pff? ( >=app-forensics/libpff-0.0.20120802_alpha )
"
pkg_setup() {
python_set_active_version 2
python_pkg_setup
}
src_prepare() {
#epatch "${FILESDIR}/${P}-disable-qtassistant.patch"
#epatch "${FILESDIR}/${P}-libpff-0.0.20120513.patch"
python_convert_shebangs -r 2 .
sed -i 's:^python:python2:' ressources/linux_launcher.sh || die "sed makefile"
}
src_configure() {
mycmakeargs+=( "-DINSTALL:BOOLEAN=ON" )
cmake-utils_src_configure
}

View file

@ -0,0 +1,22 @@
Index: dff/dff/api/gui/video/video.cpp
===================================================================
--- dff.orig/dff/api/gui/video/video.cpp 2013-07-08 13:03:30.372074867 +0200
+++ dff/dff/api/gui/video/video.cpp 2013-08-29 11:28:17.314265471 +0200
@@ -124,7 +124,7 @@
this->_clear();
throw std::string("can't open input stream");
}
- if (av_find_stream_info(this->_formatContext) < 0)
+ if (avformat_find_stream_info(this->_formatContext, NULL) < 0)
{
this->_clear();
throw std::string("can't find video info");
@@ -419,7 +419,7 @@
}
this->_codecContext->workaround_bugs = 1;
- if (avcodec_open(this->_codecContext, this->_codec) < 0)
+ if (avcodec_open2(this->_codecContext, this->_codec, NULL) < 0)
{
this->_clear();
throw std::string("Could not open video");

View file

@ -0,0 +1,16 @@
From: Sebastian Ramacher <sramacher@debian.org>
To: 739240@bugs.debian.org
Subject: Re: Bug#739240: FTBFS with libav10
Date: Mon, 24 Feb 2014 20:38:32 +0100
--- dff-1.3.0+dfsg.1.orig/dff/api/gui/video/video.cpp
+++ dff-1.3.0+dfsg.1/dff/api/gui/video/video.cpp
@@ -160,7 +160,7 @@ void VideoDecoder::_clear(void)
}
if (this->_formatContext)
{
- av_close_input_file(this->_formatContext);
+ avformat_close_input(&this->_formatContext);
this->_formatContext = NULL;
}
if (this->_codec) //return by avcodec_find_decoder not allocated ?

View file

@ -1,40 +0,0 @@
--- dff/ui/gui/mainwindow.py.orig 2011-10-04 23:38:44.000000000 +0800
+++ dff/ui/gui/mainwindow.py 2011-10-10 07:51:41.000000000 +0800
@@ -52,7 +52,11 @@
from ui.gui.resources.ui_mainwindow import Ui_MainWindow
# Documentation
-from ui.gui.widget.help import Help
+HELP = True
+try:
+ from ui.gui.widget.help import Help
+except ImportError:
+ HELP = False
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, app, debug = False):
@@ -99,7 +103,8 @@
self.connect(self.actionNodeBrowser, SIGNAL("triggered()"), self.addNodeBrowser)
self.connect(self.actionShell, SIGNAL("triggered()"), self.shellActions.create)
self.connect(self.actionPython_interpreter, SIGNAL("triggered()"), self.interpreterActions.create) ## About menu
- self.connect(self.actionHelp, SIGNAL("triggered()"), self.addHelpWidget)
+ if HELP:
+ self.connect(self.actionHelp, SIGNAL("triggered()"), self.addHelpWidget)
self.connect(self.actionAbout, SIGNAL("triggered()"), self.dialog.about)
# list used to build toolbar
# None will be a separator
@@ -110,12 +115,13 @@
self.actionShell,
self.actionPython_interpreter,
self.actionIdeOpen,
- self.actionHelp,
None,
self.actionMaximize,
self.actionFullscreen_mode,
self.actionBrowse_modules,
]
+ if HELP:
+ self.toolbarList = [self.actionHelp]
# Set up toolbar
self.setupToolBar()

View file

@ -1,173 +0,0 @@
--- dff-1.2.0/modules/mailbox/pff/pff_export.cpp.orig 2011-10-04 23:38:45.000000000 +0800
+++ dff-1.2.0/modules/mailbox/pff/pff_export.cpp 2012-05-19 09:34:59.792450004 +0800
@@ -186,7 +186,7 @@
size_t folder_name_size = 0;
int result = 0;
- result = libpff_folder_get_name_size(folder, &folder_name_size, &(this->pff_error));
+ result = libpff_folder_get_utf8_name_size(folder, &folder_name_size, &(this->pff_error));
if (result == 0 || result == -1 || folder_name_size == 0)
{
std::ostringstream folderName;
@@ -197,7 +197,7 @@
else
{
folder_name = (uint8_t *) new uint8_t[folder_name_size];
- result = libpff_folder_get_name(folder, folder_name, folder_name_size, NULL);
+ result = libpff_folder_get_utf8_name(folder, folder_name, folder_name_size, NULL);
subFolder = new PffNodeFolder(std::string((char *)folder_name), parent, this);
}
@@ -234,7 +234,7 @@
PffNodeFolder* nodeFolder = new PffNodeFolder(messageName.str(), parent, this);
- if (libpff_message_get_transport_headers_size(email, &transport_headers_size, &(this->pff_error)))
+ if (libpff_message_get_utf8_transport_headers_size(email, &transport_headers_size, &(this->pff_error)))
{
if (transport_headers_size > 0)
new PffNodeEmailTransportHeaders("Transport Headers", nodeFolder, this, email, &(this->pff_error), &(this->pff_file), clone);
@@ -297,7 +297,7 @@
continue;
}
if (attachment_type == LIBPFF_ATTACHMENT_TYPE_DATA)
- libpff_attachment_get_long_filename_size(attachment, &attachment_filename_size,&(this->pff_error));
+ libpff_attachment_get_utf8_long_filename_size(attachment, &attachment_filename_size,&(this->pff_error));
attachment_filename = new uint8_t[attachment_filename_size];
if (attachment_filename == NULL)
@@ -309,7 +309,7 @@
std::ostringstream attachmentName;
if (attachment_type == LIBPFF_ATTACHMENT_TYPE_DATA)
{
- if ( libpff_attachment_get_long_filename(attachment, attachment_filename, attachment_filename_size, NULL ) != 1 )
+ if ( libpff_attachment_get_utf8_long_filename(attachment, attachment_filename, attachment_filename_size, NULL ) != 1 )
attachmentName << std::string("Attachment") << attachment_iterator + 1;
else
attachmentName << std::string((char*)attachment_filename);
--- dff-1.2.0/modules/mailbox/pff/pff_node_email_attributes.cpp.orig 2012-05-19 09:56:29.432450001 +0800
+++ dff-1.2.0/modules/mailbox/pff/pff_node_email_attributes.cpp 2012-05-19 09:59:35.751450002 +0800
@@ -164,7 +164,7 @@
size_t message_transport_headers_size = 0;
uint8_t *entry_string = NULL;
- if (libpff_message_get_transport_headers_size(item, &message_transport_headers_size,
+ if (libpff_message_get_utf8_transport_headers_size(item, &message_transport_headers_size,
this->pff_error) != 1)
return (0);
@@ -173,7 +173,7 @@
entry_string = new uint8_t [message_transport_headers_size];
- if (libpff_message_get_transport_headers(item, entry_string, message_transport_headers_size, this->pff_error ) != 1 )
+ if (libpff_message_get_utf8_transport_headers(item, entry_string, message_transport_headers_size, this->pff_error ) != 1 )
{
delete entry_string;
return (0);
@@ -210,7 +210,7 @@
maximum_entry_value_string_size = entry_value_string_size;
}
}
- if (libpff_recipients_get_display_name_size(recipients, recipient_iterator, &entry_value_string_size, NULL) == 1)
+ if (libpff_recipients_get_utf8_display_name_size(recipients, recipient_iterator, &entry_value_string_size, NULL) == 1)
{
if (entry_value_string_size > maximum_entry_value_string_size)
maximum_entry_value_string_size = entry_value_string_size;
@@ -357,11 +357,11 @@
int result = 0;
maximum_entry_value_string_size = 24;
- check_maximum_size(libpff_item_get_display_name_size)
- check_maximum_size(libpff_message_get_conversation_topic_size)
- check_maximum_size(libpff_message_get_subject_size)
- check_maximum_size(libpff_message_get_sender_name_size)
- check_maximum_size(libpff_message_get_sender_email_address_size)
+ check_maximum_size(libpff_item_get_utf8_display_name_size)
+ check_maximum_size(libpff_message_get_utf8_conversation_topic_size)
+ check_maximum_size(libpff_message_get_utf8_subject_size)
+ check_maximum_size(libpff_message_get_utf8_sender_name_size)
+ check_maximum_size(libpff_message_get_utf8_sender_email_address_size)
if (!(maximum_entry_value_string_size))
return (0);
@@ -392,11 +392,11 @@
(*attr)["Flags"] = new Variant(flags.str());
}
- value_string_to_attribute(libpff_item_get_display_name, "Display name")
- value_string_to_attribute(libpff_message_get_conversation_topic, "Conversation topic")
- value_string_to_attribute(libpff_message_get_subject, "Subject")
- value_string_to_attribute(libpff_message_get_sender_name, "Sender name")
- value_string_to_attribute(libpff_message_get_sender_email_address, "Sender email address")
+ value_string_to_attribute(libpff_item_get_utf8_display_name, "Display name")
+ value_string_to_attribute(libpff_message_get_utf8_conversation_topic, "Conversation topic")
+ value_string_to_attribute(libpff_message_get_utf8_subject, "Subject")
+ value_string_to_attribute(libpff_message_get_utf8_sender_name, "Sender name")
+ value_string_to_attribute(libpff_message_get_utf8_sender_email_address, "Sender email address")
if (libpff_message_get_importance(item, &entry_value_32bit, NULL) == 1)
{
--- dff-1.2.0/modules/mailbox/pff/pff_node_email_attributes.cpp.orig 2012-05-19 10:05:25.315450001 +0800
+++ dff-1.2.0/modules/mailbox/pff/pff_node_email_attributes.cpp 2012-05-19 10:07:50.120450001 +0800
@@ -235,7 +235,7 @@
if (libpff_item_get_entry_value_utf8_string(recipients, recipient_iterator, LIBPFF_ENTRY_TYPE_DISPLAY_NAME, entry_value_string, maximum_entry_value_string_size, 0, NULL) == 1)
attrRecipient["Display Name"] = new Variant(std::string((char *)entry_value_string));
- if (libpff_recipients_get_display_name(recipients, recipient_iterator, entry_value_string, maximum_entry_value_string_size, NULL) == 1)
+ if (libpff_recipients_get_utf8_display_name(recipients, recipient_iterator, entry_value_string, maximum_entry_value_string_size, NULL) == 1)
attrRecipient["Recipient display name"] = new Variant(std::string((char*)entry_value_string));
if (libpff_item_get_entry_value_utf8_string(recipients, recipient_iterator, LIBPFF_ENTRY_TYPE_ADDRESS_TYPE, entry_value_string, maximum_entry_value_string_size, 0, NULL) == 1)
--- dff-1.2.0/modules/mailbox/pff/pff_node_email_transport_headers.cpp.orig 2012-05-19 10:12:24.811450000 +0800
+++ dff-1.2.0/modules/mailbox/pff/pff_node_email_transport_headers.cpp 2012-05-19 10:12:51.297450001 +0800
@@ -20,7 +20,7 @@
{
size_t headers_size = 0;
- if (libpff_message_get_transport_headers_size(mail, &headers_size, this->pff_error) == 1)
+ if (libpff_message_get_utf8_transport_headers_size(mail, &headers_size, this->pff_error) == 1)
{
if (headers_size > 0)
this->setSize(headers_size);
@@ -45,7 +45,7 @@
else
item = *(this->pff_item);
entry_string = new uint8_t [this->size()];
- if (libpff_message_get_transport_headers(item, entry_string, this->size(), this->pff_error ) != 1 )
+ if (libpff_message_get_utf8_transport_headers(item, entry_string, this->size(), this->pff_error ) != 1 )
{
if (this->pff_item == NULL)
libpff_item_free(&item, this->pff_error);
--- dff-1.2.0/modules/mailbox/pff/libbfio_wrapper.cpp.orig 2012-05-19 10:26:07.420450001 +0800
+++ dff-1.2.0/modules/mailbox/pff/libbfio_wrapper.cpp 2012-05-19 11:59:22.003450003 +0800
@@ -44,13 +44,22 @@
io_handle->access_flags = 0;
io_handle->file = NULL;
- io_handle->parent = parent;
- if (libbfio_handle_initialize(handle, (intptr_t*)io_handle,
- dff_libbfio_file_io_handle_free, dff_libbfio_file_io_handle_clone, dff_libbfio_file_open,
- dff_libbfio_file_close, dff_libbfio_file_read, dff_libbfio_file_write,
- dff_libbfio_file_seek_offset, dff_libbfio_file_exists, dff_libbfio_file_is_open,
- dff_libbfio_file_get_size,
- LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION, error ) != 1 )
+ io_handle->parent = parent;
+ if (libbfio_handle_initialize(
+ handle,
+ (intptr_t*)io_handle,
+ (int (*)(intptr_t **, libbfio_error_t **)) dff_libbfio_file_io_handle_free,
+ (int (*)(intptr_t **, intptr_t *, libbfio_error_t **)) dff_libbfio_file_io_handle_clone,
+ (int (*)(intptr_t *, int, libbfio_error_t **)) dff_libbfio_file_open,
+ (int (*)(intptr_t *, libbfio_error_t **)) dff_libbfio_file_close,
+ (ssize_t (*)(intptr_t *, uint8_t *, size_t, libbfio_error_t **)) dff_libbfio_file_read,
+ (ssize_t (*)(intptr_t *, const uint8_t *, size_t, libbfio_error_t **)) dff_libbfio_file_write,
+ (off64_t (*)(intptr_t *, off64_t, int, libbfio_error_t **)) dff_libbfio_file_seek_offset,
+ (int (*)(intptr_t *, libbfio_error_t **)) dff_libbfio_file_exists,
+ (int (*)(intptr_t *, libbfio_error_t **)) dff_libbfio_file_is_open,
+ (int (*)(intptr_t *, size64_t *, libbfio_error_t **)) dff_libbfio_file_get_size,
+ LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION,
+ error ) != 1 )
{
dff_libbfio_file_io_handle_free((intptr_t *) io_handle, NULL );
return (-1);

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
<email>ikelos@gentoo.org</email>
</maintainer>
<use>
<flag name="doc">
Enables the help option within the program, which is optional
because it requires further qt dependencies.
</flag>
</use>
</pkgmetadata>

View file

@ -1,7 +1,8 @@
dev-python/capstone-python cython
#required by fern-wifi-cracker and kde
dev-python/PyQt4 compat webkit declarative sql script
#help is required by dff
dev-python/PyQt4 help compat webkit declarative sql script
# required by w3af dev-python/nltk
dev-lang/python tk

View file

@ -1,4 +1,6 @@
sys-apps/file python
#dev-python/python-magic requires file[-python]
sys-apps/file -python
sys-apps/hwdata-gentoo binary-drivers
sys-apps/lm_sensors sensord
sys-apps/usermode-utilities fuse