View | Details | Raw Unified | Return to bug 272311 | Differences between
and this patch

Collapse All | Expand All

(-)b/sysutils/bulk_extractor/Makefile (-2 / +4 lines)
Lines 1-47 Link Here
1
PORTNAME=	bulk_extractor
1
PORTNAME=	bulk_extractor
2
PORTVERSION=	2.0.0
2
PORTVERSION=	2.0.3
3
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=	v
4
PORTREVISION=	5
4
PORTREVISION=	0
5
CATEGORIES=	sysutils
5
CATEGORIES=	sysutils
6
6
7
MAINTAINER=	nobutaka@FreeBSD.org
7
MAINTAINER=	nobutaka@FreeBSD.org
8
COMMENT=	Program that scans a disk image and extracts useful information
8
COMMENT=	Program that scans a disk image and extracts useful information
9
WWW=		https://github.com/simsong/bulk_extractor
9
WWW=		https://github.com/simsong/bulk_extractor
10
10
11
LICENSE=	MIT
11
LICENSE=	MIT
12
LICENSE_FILE=	${WRKSRC}/COPYING
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
13
14
LIB_DEPENDS=	libafflib.so:sysutils/afflib \
14
LIB_DEPENDS=	libafflib.so:sysutils/afflib \
15
		libboost_system.so:devel/boost-libs \
15
		libboost_system.so:devel/boost-libs \
16
		libewf.so:devel/libewf \
16
		libewf.so:devel/libewf \
17
		libexiv2.so:graphics/exiv2 \
17
		libexiv2.so:graphics/exiv2 \
18
		libexpat.so:textproc/expat2 \
18
		libexpat.so:textproc/expat2 \
19
		libgcrypt.so:security/libgcrypt \
19
		libgcrypt.so:security/libgcrypt \
20
		libgpg-error.so:security/libgpg-error
20
		libgpg-error.so:security/libgpg-error
21
21
22
USES=		autoreconf compiler:c++17-lang gnome iconv:wchar_t localbase \
22
USES=		autoreconf compiler:c++17-lang gnome iconv:wchar_t localbase \
23
		sqlite ssl
23
		sqlite ssl
24
USE_GITHUB=	yes
24
USE_GITHUB=	yes
25
USE_GNOME=	libxml2
25
USE_GNOME=	libxml2
26
26
27
GH_ACCOUNT=	simsong
27
GH_ACCOUNT=	simsong
28
GH_TUPLE=	simsong:be20_api:${GH_TAG_BE20_API}:be20_api \
28
GH_TUPLE=	simsong:be20_api:${GH_TAG_BE20_API}:be20_api \
29
		dfxml-working-group:dfxml_cpp:${GH_TAG_DFXML_CPP}:dfxml_cpp \
29
		dfxml-working-group:dfxml_cpp:${GH_TAG_DFXML_CPP}:dfxml_cpp \
30
		dfxml-working-group:dfxml_schema:${GH_TAG_DFXML_SCHEMA}:dfxml_schema
30
		dfxml-working-group:dfxml_schema:${GH_TAG_DFXML_SCHEMA}:dfxml_schema
31
GH_TAG_BE20_API=	f63dcd5
31
GH_TAG_BE20_API=	f63dcd5
32
GH_TAG_DFXML_CPP=	09030bc
32
GH_TAG_DFXML_CPP=	09030bc
33
GH_TAG_DFXML_SCHEMA=	f2a702e
33
GH_TAG_DFXML_SCHEMA=	f2a702e
34
34
35
GNU_CONFIGURE=	yes
35
GNU_CONFIGURE=	yes
36
CXXFLAGS_powerpc=	-DBIG_ENDIAN
36
CXXFLAGS_powerpc=	-DBIG_ENDIAN
37
CXXFLAGS_powerpcspe=	-DBIG_ENDIAN
37
CXXFLAGS_powerpcspe=	-DBIG_ENDIAN
38
CONFIGURE_ARGS=	--enable-exiv2=true
38
CONFIGURE_ARGS=	--enable-exiv2=true
39
39
40
TEST_TARGET=	check
41
40
PLIST_FILES=	bin/bulk_extractor bin/test_be man/man1/bulk_extractor.1.gz
42
PLIST_FILES=	bin/bulk_extractor bin/test_be man/man1/bulk_extractor.1.gz
41
43
42
post-extract:
44
post-extract:
43
	${CP} -R ${WRKSRC_be20_api}/* ${WRKSRC}/src/be20_api/
45
	${CP} -R ${WRKSRC_be20_api}/* ${WRKSRC}/src/be20_api/
44
	${CP} -R ${WRKSRC_dfxml_cpp}/* ${WRKSRC}/src/be20_api/dfxml_cpp/
46
	${CP} -R ${WRKSRC_dfxml_cpp}/* ${WRKSRC}/src/be20_api/dfxml_cpp/
45
	${CP} -R ${WRKSRC_dfxml_schema}/* ${WRKSRC}/dfxml_schema/
47
	${CP} -R ${WRKSRC_dfxml_schema}/* ${WRKSRC}/dfxml_schema/
46
48
47
.include <bsd.port.mk>
49
.include <bsd.port.mk>
(-)b/sysutils/bulk_extractor/distinfo (-3 / +3 lines)
Lines 1-9 Link Here
1
TIMESTAMP = 1645265605
1
TIMESTAMP = 1688292189
2
SHA256 (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 57efb6fac52fdd70f9778bfad96f76ce01466b48e4a0bb732a39b66abb698cfb
2
SHA256 (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42c16b0d5708c3bda0bb44eec14dc06b69590496ede550ee736100597a43710f
3
SIZE (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 42333931
3
SIZE (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42335471
4
SHA256 (simsong-be20_api-f63dcd5_GH0.tar.gz) = 76713af7d1430d5ade05603f218f5a0d9523357b292319e935ef941033a8b4c2
4
SHA256 (simsong-be20_api-f63dcd5_GH0.tar.gz) = 76713af7d1430d5ade05603f218f5a0d9523357b292319e935ef941033a8b4c2
5
SIZE (simsong-be20_api-f63dcd5_GH0.tar.gz) = 485552
5
SIZE (simsong-be20_api-f63dcd5_GH0.tar.gz) = 485552
6
SHA256 (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = caf43f6b8440fb7acc3069602d513d36886c7413209043274cc88f6615363502
6
SHA256 (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = caf43f6b8440fb7acc3069602d513d36886c7413209043274cc88f6615363502
7
SIZE (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = 177520
7
SIZE (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = 177520
8
SHA256 (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = ce7034f36dda27b7dd4192a05545c87f69a68bcc1321e7ffdaeb638bf41919be
8
SHA256 (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = ce7034f36dda27b7dd4192a05545c87f69a68bcc1321e7ffdaeb638bf41919be
9
SIZE (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = 10421
9
SIZE (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = 10421
(-)b/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h (+13 lines)
Added Link Here
1
--- src/be20_api/dfxml_cpp/src/dfxml_writer.h.orig	2023-07-02 09:24:33 UTC
2
+++ src/be20_api/dfxml_cpp/src/dfxml_writer.h
3
@@ -96,6 +96,10 @@
4
 #include <uuid/uuid.h>
5
 #endif
6
 
7
+#ifdef HAVE_EXIV2
8
+#include <exiv2/exiv2.hpp>
9
+#endif
10
+
11
 #include "cpuid.h"
12
 
13
 class dfxml_writer {
(-)b/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp (-1 / +125 lines)
Added Link Here
0
- 
1
--- src/scan_exiv2.cpp.orig	2023-04-07 18:27:14 UTC
2
+++ src/scan_exiv2.cpp
3
@@ -33,6 +33,8 @@
4
 #pragma GCC diagnostic ignored "-Weffc++"
5
 #endif
6
 
7
+using std::string;
8
+
9
 #include <exiv2/image.hpp>
10
 #include <exiv2/exif.hpp>
11
 #include <exiv2/error.hpp>
12
@@ -90,7 +92,7 @@ static string fix_gps(string s)
13
     std::vector<std::string> parts = split(s,' ');
14
     if(parts.size()!=3) return s;	// return the original
15
     double res = rational(parts[0]) + rational(parts[1])/60.0 + rational(parts[2])/3600.0;
16
-    s = dtos(res);
17
+    s = std::to_string(res);
18
     return s;
19
 }
20
 
21
@@ -106,7 +108,7 @@ void scan_exiv2(struct scanner_params &sp)
22
 {
23
     sp.check_version();
24
     if(sp.phase==scanner_params::PHASE_INIT){
25
-        sp.info.set_name("exiv2" );
26
+        sp.info->set_name("exiv2" );
27
         sp.info->author         = "Simson L. Garfinkel";
28
         sp.info->description    = "Searches for EXIF information using exiv2. Use exif scanner if this is not available or if this crashes.";
29
         sp.info->scanner_flags.default_enabled = false;
30
@@ -117,7 +119,7 @@ void scan_exiv2(struct scanner_params &sp)
31
     }
32
     if(sp.phase==scanner_params::PHASE_SCAN){
33
 
34
-	const sbuf_t &sbuf = sp.sbuf;
35
+	const sbuf_t *sbuf = sp.sbuf;
36
 	feature_recorder &exif_recorder = sp.named_feature_recorder("exif");
37
 	feature_recorder &gps_recorder  = sp.named_feature_recorder("gps");
38
 
39
@@ -127,23 +129,23 @@ void scan_exiv2(struct scanner_params &sp)
40
 #endif
41
 
42
 	size_t pos_max = 1;		// by default, just scan 1 byte
43
-	if(sbuf.bufsize > min_exif_size){
44
-	    pos_max = sbuf.bufsize - min_exif_size; //  we can scan more!
45
+	if(sbuf->bufsize > min_exif_size){
46
+	    pos_max = sbuf->bufsize - min_exif_size; //  we can scan more!
47
 	}
48
 
49
 	/* Loop through all possible locations in the buffer */
50
 	for(size_t pos=0;pos<pos_max;pos++){
51
 	    size_t count = exif_gulp_size;
52
-	    count = min(count,sbuf.bufsize-pos);
53
-	    //size_t count = sbuf.bufsize-pos; // use all to end
54
+	    count = min(count,sbuf->bufsize-pos);
55
+	    //size_t count = sbuf->bufsize-pos; // use all to end
56
 
57
 	    /* Explore the beginning of each 512-byte block as well as the starting location
58
 	     * of any JPEG on any boundary. This will cause processing of any multimedia file
59
 	     * that Exiv2 recognizes (for which I do not know all the headers.
60
 	     */
61
-	    if(pos%512==0 || jpeg_start(sbuf+pos)){
62
+	    if(pos%512==0 || jpeg_start(sbuf->slice(pos))){
63
 		try {
64
-		    Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(sbuf.buf+pos,count);
65
+		    Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(sbuf->slice(pos).get_buf(),count);
66
 		    if(image->good()){
67
 			image->readMetadata();
68
 
69
@@ -153,8 +155,8 @@ void scan_exiv2(struct scanner_params &sp)
70
 			/*
71
 			 * Create the MD5 of the first 4K to use as a unique identifier.
72
 			 */
73
-			sbuf_t tohash(sbuf,0,4096);
74
-			string md5_hex = exif_recorder->fs.hasher.func(tohash.buf,tohash.bufsize);
75
+			sbuf_t tohash(*sbuf,0,4096);
76
+			string md5_hex = exif_recorder.hash(tohash.slice(0, tohash.bufsize));
77
 
78
 			char xmlbuf[1024];
79
 			snprintf(xmlbuf,sizeof(xmlbuf),
80
@@ -250,10 +252,10 @@ void scan_exiv2(struct scanner_params &sp)
81
 				gps_lat = fix_gps(i->value().toString());
82
 			    } else if(key=="Exif.GPSInfo.GPSAltitude"){
83
                                 has_gps = true;
84
-				gps_ele   = dtos(rational(i->value().toString()));
85
+				gps_ele   = std::to_string(rational(i->value().toString()));
86
 			    } else if(key=="Exif.GPSInfo.GPSSpeed"){
87
                                 has_gps = true;
88
-				gps_speed = dtos(rational(i->value().toString()));
89
+				gps_speed = std::to_string(rational(i->value().toString()));
90
 			    } else if(key=="Exif.GPSInfo.GPSTrack"){
91
                                 has_gps = true;
92
 				gps_course = i->value().toString();
93
@@ -262,20 +264,20 @@ void scan_exiv2(struct scanner_params &sp)
94
 			xml.append("</exiv2>");
95
 
96
                         // record EXIF
97
-			exif_recorder->write(sp.sbuf.pos0+pos,md5_hex,xml);
98
+			exif_recorder.write(sp.sbuf->pos0+pos,md5_hex,xml);
99
 
100
                         // record GPS
101
                         if (has_gps) {
102
                             if (has_gps_date) {
103
                                 // record the GPS entry using the GPS date
104
-                                gps_recorder->write(sp.sbuf.pos0+pos,md5_hex,
105
+                                gps_recorder.write(sp.sbuf->pos0+pos,md5_hex,
106
 					    gps_date+"T"+gps_time+","+gps_lat_ref+gps_lat+","
107
 					    +gps_lon_ref+gps_lon+","
108
 					    +gps_ele+","+gps_speed+","+gps_course);
109
 
110
                             } else {
111
                                 // record the GPS entry using the date obtained from Photo
112
-                                gps_recorder->write(sp.sbuf.pos0+pos,md5_hex,
113
+                                gps_recorder.write(sp.sbuf->pos0+pos,md5_hex,
114
 					    photo_time+","+gps_lat_ref+gps_lat+","
115
 					    +gps_lon_ref+gps_lon+","
116
 					    +gps_ele+","+gps_speed+","+gps_course);
117
@@ -283,7 +285,7 @@ void scan_exiv2(struct scanner_params &sp)
118
 			}
119
 		    }
120
 		}
121
-		catch (Exiv2::AnyError &e) { }
122
+		catch (Exiv2::Error &e) { }
123
 		catch (std::exception &e) { }
124
 	    }
125
 	}

Return to bug 272311