diff --git a/sysutils/bulk_extractor/Makefile b/sysutils/bulk_extractor/Makefile index 0ca940a5cbb1..000a3125a478 100644 --- a/sysutils/bulk_extractor/Makefile +++ b/sysutils/bulk_extractor/Makefile @@ -1,47 +1,48 @@ PORTNAME= bulk_extractor -PORTVERSION= 2.0.0 +PORTVERSION= 2.0.3 DISTVERSIONPREFIX= v -PORTREVISION= 4 CATEGORIES= sysutils MAINTAINER= nobutaka@FreeBSD.org COMMENT= Program that scans a disk image and extracts useful information WWW= https://github.com/simsong/bulk_extractor LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libafflib.so:sysutils/afflib \ libboost_system.so:devel/boost-libs \ libewf.so:devel/libewf \ libexiv2.so:graphics/exiv2 \ libexpat.so:textproc/expat2 \ libgcrypt.so:security/libgcrypt \ libgpg-error.so:security/libgpg-error USES= autoreconf compiler:c++17-lang gnome iconv:wchar_t localbase \ sqlite ssl USE_GITHUB= yes USE_GNOME= libxml2 GH_ACCOUNT= simsong GH_TUPLE= simsong:be20_api:${GH_TAG_BE20_API}:be20_api \ dfxml-working-group:dfxml_cpp:${GH_TAG_DFXML_CPP}:dfxml_cpp \ dfxml-working-group:dfxml_schema:${GH_TAG_DFXML_SCHEMA}:dfxml_schema GH_TAG_BE20_API= f63dcd5 GH_TAG_DFXML_CPP= 09030bc GH_TAG_DFXML_SCHEMA= f2a702e GNU_CONFIGURE= yes CXXFLAGS_powerpc= -DBIG_ENDIAN CXXFLAGS_powerpcspe= -DBIG_ENDIAN CONFIGURE_ARGS= --enable-exiv2=true +TEST_TARGET= check + PLIST_FILES= bin/bulk_extractor bin/test_be man/man1/bulk_extractor.1.gz post-extract: ${CP} -R ${WRKSRC_be20_api}/* ${WRKSRC}/src/be20_api/ ${CP} -R ${WRKSRC_dfxml_cpp}/* ${WRKSRC}/src/be20_api/dfxml_cpp/ ${CP} -R ${WRKSRC_dfxml_schema}/* ${WRKSRC}/dfxml_schema/ .include diff --git a/sysutils/bulk_extractor/distinfo b/sysutils/bulk_extractor/distinfo index 891d74b044f8..62bf07914da9 100644 --- a/sysutils/bulk_extractor/distinfo +++ b/sysutils/bulk_extractor/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1645265605 -SHA256 (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 57efb6fac52fdd70f9778bfad96f76ce01466b48e4a0bb732a39b66abb698cfb -SIZE (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 42333931 +TIMESTAMP = 1688292189 +SHA256 (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42c16b0d5708c3bda0bb44eec14dc06b69590496ede550ee736100597a43710f +SIZE (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42335471 SHA256 (simsong-be20_api-f63dcd5_GH0.tar.gz) = 76713af7d1430d5ade05603f218f5a0d9523357b292319e935ef941033a8b4c2 SIZE (simsong-be20_api-f63dcd5_GH0.tar.gz) = 485552 SHA256 (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = caf43f6b8440fb7acc3069602d513d36886c7413209043274cc88f6615363502 SIZE (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = 177520 SHA256 (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = ce7034f36dda27b7dd4192a05545c87f69a68bcc1321e7ffdaeb638bf41919be SIZE (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = 10421 diff --git a/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h b/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h new file mode 100644 index 000000000000..c01216240489 --- /dev/null +++ b/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h @@ -0,0 +1,13 @@ +--- src/be20_api/dfxml_cpp/src/dfxml_writer.h.orig 2023-07-02 09:24:33 UTC ++++ src/be20_api/dfxml_cpp/src/dfxml_writer.h +@@ -96,6 +96,10 @@ + #include + #endif + ++#ifdef HAVE_EXIV2 ++#include ++#endif ++ + #include "cpuid.h" + + class dfxml_writer { diff --git a/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp b/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp new file mode 100644 index 000000000000..ae9c9d6cd03c --- /dev/null +++ b/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp @@ -0,0 +1,125 @@ +--- src/scan_exiv2.cpp.orig 2023-04-07 18:27:14 UTC ++++ src/scan_exiv2.cpp +@@ -33,6 +33,8 @@ + #pragma GCC diagnostic ignored "-Weffc++" + #endif + ++using std::string; ++ + #include + #include + #include +@@ -90,7 +92,7 @@ static string fix_gps(string s) + std::vector parts = split(s,' '); + if(parts.size()!=3) return s; // return the original + double res = rational(parts[0]) + rational(parts[1])/60.0 + rational(parts[2])/3600.0; +- s = dtos(res); ++ s = std::to_string(res); + return s; + } + +@@ -106,7 +108,7 @@ void scan_exiv2(struct scanner_params &sp) + { + sp.check_version(); + if(sp.phase==scanner_params::PHASE_INIT){ +- sp.info.set_name("exiv2" ); ++ sp.info->set_name("exiv2" ); + sp.info->author = "Simson L. Garfinkel"; + sp.info->description = "Searches for EXIF information using exiv2. Use exif scanner if this is not available or if this crashes."; + sp.info->scanner_flags.default_enabled = false; +@@ -117,7 +119,7 @@ void scan_exiv2(struct scanner_params &sp) + } + if(sp.phase==scanner_params::PHASE_SCAN){ + +- const sbuf_t &sbuf = sp.sbuf; ++ const sbuf_t *sbuf = sp.sbuf; + feature_recorder &exif_recorder = sp.named_feature_recorder("exif"); + feature_recorder &gps_recorder = sp.named_feature_recorder("gps"); + +@@ -127,23 +129,23 @@ void scan_exiv2(struct scanner_params &sp) + #endif + + size_t pos_max = 1; // by default, just scan 1 byte +- if(sbuf.bufsize > min_exif_size){ +- pos_max = sbuf.bufsize - min_exif_size; // we can scan more! ++ if(sbuf->bufsize > min_exif_size){ ++ pos_max = sbuf->bufsize - min_exif_size; // we can scan more! + } + + /* Loop through all possible locations in the buffer */ + for(size_t pos=0;posbufsize-pos); ++ //size_t count = sbuf->bufsize-pos; // use all to end + + /* Explore the beginning of each 512-byte block as well as the starting location + * of any JPEG on any boundary. This will cause processing of any multimedia file + * that Exiv2 recognizes (for which I do not know all the headers. + */ +- if(pos%512==0 || jpeg_start(sbuf+pos)){ ++ if(pos%512==0 || jpeg_start(sbuf->slice(pos))){ + try { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(sbuf.buf+pos,count); ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(sbuf->slice(pos).get_buf(),count); + if(image->good()){ + image->readMetadata(); + +@@ -153,8 +155,8 @@ void scan_exiv2(struct scanner_params &sp) + /* + * Create the MD5 of the first 4K to use as a unique identifier. + */ +- sbuf_t tohash(sbuf,0,4096); +- string md5_hex = exif_recorder->fs.hasher.func(tohash.buf,tohash.bufsize); ++ sbuf_t tohash(*sbuf,0,4096); ++ string md5_hex = exif_recorder.hash(tohash.slice(0, tohash.bufsize)); + + char xmlbuf[1024]; + snprintf(xmlbuf,sizeof(xmlbuf), +@@ -250,10 +252,10 @@ void scan_exiv2(struct scanner_params &sp) + gps_lat = fix_gps(i->value().toString()); + } else if(key=="Exif.GPSInfo.GPSAltitude"){ + has_gps = true; +- gps_ele = dtos(rational(i->value().toString())); ++ gps_ele = std::to_string(rational(i->value().toString())); + } else if(key=="Exif.GPSInfo.GPSSpeed"){ + has_gps = true; +- gps_speed = dtos(rational(i->value().toString())); ++ gps_speed = std::to_string(rational(i->value().toString())); + } else if(key=="Exif.GPSInfo.GPSTrack"){ + has_gps = true; + gps_course = i->value().toString(); +@@ -262,20 +264,20 @@ void scan_exiv2(struct scanner_params &sp) + xml.append(""); + + // record EXIF +- exif_recorder->write(sp.sbuf.pos0+pos,md5_hex,xml); ++ exif_recorder.write(sp.sbuf->pos0+pos,md5_hex,xml); + + // record GPS + if (has_gps) { + if (has_gps_date) { + // record the GPS entry using the GPS date +- gps_recorder->write(sp.sbuf.pos0+pos,md5_hex, ++ gps_recorder.write(sp.sbuf->pos0+pos,md5_hex, + gps_date+"T"+gps_time+","+gps_lat_ref+gps_lat+"," + +gps_lon_ref+gps_lon+"," + +gps_ele+","+gps_speed+","+gps_course); + + } else { + // record the GPS entry using the date obtained from Photo +- gps_recorder->write(sp.sbuf.pos0+pos,md5_hex, ++ gps_recorder.write(sp.sbuf->pos0+pos,md5_hex, + photo_time+","+gps_lat_ref+gps_lat+"," + +gps_lon_ref+gps_lon+"," + +gps_ele+","+gps_speed+","+gps_course); +@@ -283,7 +285,7 @@ void scan_exiv2(struct scanner_params &sp) + } + } + } +- catch (Exiv2::AnyError &e) { } ++ catch (Exiv2::Error &e) { } + catch (std::exception &e) { } + } + }