summaryrefslogtreecommitdiff
path: root/app-forensics/foremost
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
commitdeba8115d2c2af26df42966b91ef04ff4dd79cde (patch)
tree9a48f42594e1a9e6b2020d5535a784314434d7a7 /app-forensics/foremost
parent38423c67c8a23f6a1bc42038193182e2da3116eb (diff)
gentoo resync : 14.05.2020
Diffstat (limited to 'app-forensics/foremost')
-rw-r--r--app-forensics/foremost/Manifest3
-rw-r--r--app-forensics/foremost/files/foremost-1.5.7-set-but-unused.patch230
-rw-r--r--app-forensics/foremost/foremost-1.5.7-r3.ebuild11
3 files changed, 236 insertions, 8 deletions
diff --git a/app-forensics/foremost/Manifest b/app-forensics/foremost/Manifest
index ea5b05a4e1f4..b4f23fef7fa6 100644
--- a/app-forensics/foremost/Manifest
+++ b/app-forensics/foremost/Manifest
@@ -1,5 +1,6 @@
AUX foremost-1.4-config-location.patch 462 BLAKE2B 7dadc7fd049b09992e9e3019aaaa27d53268a6b6cea03146d965bdd3f0ec3165fbde33c2ecd41a949758ff4b8d36259d048869d17b828e2f600ea9418e3d0bce SHA512 7b6dcc18cba4676ef4d54b87c9c31747754ecbebd9424340b2dd059495c9c6cec11513307fff802a336a99bc07c4bcd2ffcfad1c77ccdc49277ef7e40e30029e
AUX foremost-1.5.7-format-security.patch 680 BLAKE2B 5565dc9d255ccbb4b721cdb0b41fef4f86369c4965000e35678e6ece00acec5ead0b15d90bd71a2456b812ab74fa9283bdf70c2fc36003a3d659105bb04a139d SHA512 1c28ed1fceedec728a5060b195214fd3ec3b0fa529e87f7421ee72d73f71ecc0d48a69a5b5ff4c6179dd65781552fbd272437134498ec865bd5c620375b6f85b
+AUX foremost-1.5.7-set-but-unused.patch 7720 BLAKE2B 047c4a31d26750706a9dad36078e848e68e89f0013a6572369dc42fa014234d37120bdb3c51ec7e83b7c99d4c497c541039e334af1d3bd144cf8250a1212f920 SHA512 1be57b3a63e38556b3a6758c1f24e5424076f11608dba148703c9cef16bac9954366a2540720912e8720d0e291f6d5933f2830b0f1b497a5f6feabc570231a52
DIST foremost-1.5.7.tar.gz 52352 BLAKE2B 5642c1afd86aab0a2f90986c3b030d37b37700c5d0e4b04e4f4a2004d69745280fabd4086a72c33b9eab05b57d125d6b11105c9e11b0112e30077f101eeab7ac SHA512 8827c29d52496783be26374f3943eb26a154d842f34e50fb489f87b3a5045bf85f1e44d7d8d8b12b2355ba3fe4b06a0db979cc22c0f431593c5976001eb931ab
-EBUILD foremost-1.5.7-r3.ebuild 884 BLAKE2B ce1257966c1b49fdfa9272c165d34d18915300a2a2e24a5eb52111d990d7aad3e7a7eab726ef6e7a45b29a6bf5a8dfa88ae128f155c7227d837d3108467cb6ce SHA512 f900a27bcb24e414f194955c047b6c634a4e9463121ce3dea336e642d36aed94be30a0633e6a71aac8b221e8f0ae9af893dd6d76206cff7d6a847773fef96dcc
+EBUILD foremost-1.5.7-r3.ebuild 889 BLAKE2B 4c6efebcd368b06250afef4a665ce84e7538eeb82a83988b148f1e2ef3fa94e769d7172b05d78156488e1e066aa2fa927a5fd0b8f3073cc7a754f0793d2e08fd SHA512 b1156aeeeef8718e631fc9e24a030a2191951238a76da2754e52ed62f35084294517f40c2809d2466953cfd5a723d71bf5497ed44726a0723df8b30d4b6d17ef
MISC metadata.xml 303 BLAKE2B 14bc09979926d326ccb75438d8e32f9a60b1df8078e6344f4dc2e32a33c0994bf2740a4b29d7c1a479bb514815f037d2d9a9ac9c8387fbc01b7795e2a37fea86 SHA512 165c108232c3a65d3fbeb0fb2f612c7c4c4c16a57e4b3e280c4ef40d6a586b56df437454283ff5b52fa3a0880d9643682493b3d75cac01170edab53bb5f1ce52
diff --git a/app-forensics/foremost/files/foremost-1.5.7-set-but-unused.patch b/app-forensics/foremost/files/foremost-1.5.7-set-but-unused.patch
new file mode 100644
index 000000000000..59b52c68615d
--- /dev/null
+++ b/app-forensics/foremost/files/foremost-1.5.7-set-but-unused.patch
@@ -0,0 +1,230 @@
+diff --git a/api.c b/api.c
+index e3ee339..67463a6 100755
+--- a/api.c
++++ b/api.c
+@@ -478,7 +478,7 @@ int dump_dirent(int which_one)
+ {
+ int i;
+ char *p;
+- short unknown;
++ // short unknown;
+ struct OLE_DIR *dir;
+
+ dir = (struct OLE_DIR *) &buffer[which_one * sizeof(struct OLE_DIR)];
+@@ -493,7 +493,7 @@ int dump_dirent(int which_one)
+ p = dir->name;
+ if (*p < ' ')
+ {
+- unknown = *((short *)p);
++ //unknown = *((short *)p);
+
+ //fprintf (stderr, "%04x\t", unknown);
+ p += 2; /* step over unknown short */
+diff --git a/engine.c b/engine.c
+index 85add5f..4a1ef13 100755
+--- a/engine.c
++++ b/engine.c
+@@ -316,7 +316,6 @@ int search_chunk(f_state *s, unsigned char *buf, f_info *i, u_int64_t chunk_size
+ //u_int64_t buf_off = 0;
+
+ unsigned char *foundat = buf;
+- unsigned char *current_pos = NULL;
+ unsigned char *header_pos = NULL;
+ unsigned char *newbuf = NULL;
+ unsigned char *ind_ptr = NULL;
+@@ -461,7 +460,6 @@ int search_chunk(f_state *s, unsigned char *buf, f_info *i, u_int64_t chunk_size
+ }
+
+ c_offset = (foundat - buf);
+- current_pos = foundat;
+
+ /*Now lets analyze the file and see if we can determine its size*/
+
+@@ -511,12 +509,12 @@ int search_chunk(f_state *s, unsigned char *buf, f_info *i, u_int64_t chunk_size
+ newbuf = read_from_disk(c_offset + f_offset, i, needle->max_len);
+ if (newbuf == NULL)
+ break;
+- current_pos = extract_file(s,
+- c_offset,
+- newbuf,
+- needle->max_len,
+- needle,
+- f_offset);
++ extract_file(s,
++ c_offset,
++ newbuf,
++ needle->max_len,
++ needle,
++ f_offset);
+
+ /*Lets put the fp back*/
+ fseeko(i->handle, saveme, SEEK_SET);
+diff --git a/extract.c b/extract.c
+index 9639117..4fecde5 100755
+--- a/extract.c
++++ b/extract.c
+@@ -553,7 +553,6 @@ unsigned char *extract_htm(f_state *s, u_int64_t c_offset, unsigned char *founda
+ {
+ unsigned char *buf = foundat;
+ unsigned char *extractbuf = NULL;
+- unsigned char *currentpos = NULL;
+
+ int bytes_to_search = 0;
+ int i = 0;
+@@ -582,7 +581,6 @@ unsigned char *extract_htm(f_state *s, u_int64_t c_offset, unsigned char *founda
+ }
+
+ /*Store the current position and search for the HTML> tag*/
+- currentpos = foundat;
+ foundat = bm_search(needle->footer,
+ needle->footer_len,
+ foundat,
+@@ -1146,15 +1144,15 @@ unsigned char *extract_mov(f_state *s, u_int64_t c_offset, unsigned char *founda
+ unsigned char *extract_wmv(f_state *s, u_int64_t c_offset, unsigned char *foundat, u_int64_t buflen,
+ s_spec *needle, u_int64_t f_offset)
+ {
+-
+- unsigned char *currentpos = NULL;
++#ifdef DEBUG
++ u_int64_t fileObjHeaderSize = 0;
++#endif
+ unsigned char *header = foundat;
+ unsigned char *extractbuf = NULL;
+ unsigned char *buf = foundat;
+ unsigned int size = 0;
+ u_int64_t file_size = 0;
+ u_int64_t headerSize = 0;
+- u_int64_t fileObjHeaderSize = 0;
+ int numberofHeaderObjects = 0;
+ int reserved[2];
+ int bytes_to_search = 0;
+@@ -1184,7 +1182,6 @@ unsigned char *extract_wmv(f_state *s, u_int64_t c_offset, unsigned char *founda
+ return foundat;
+ }
+
+- currentpos = foundat;
+ if (buflen - (foundat - buf) >= needle->max_len)
+ bytes_to_search = needle->max_len;
+ else
+@@ -1201,7 +1198,9 @@ unsigned char *extract_wmv(f_state *s, u_int64_t c_offset, unsigned char *founda
+ if (foundat)
+ {
+ foundat += 16; /*jump to the headersize*/
++#ifdef DEBUG
+ fileObjHeaderSize = htoll(foundat, FOREMOST_LITTLE_ENDIAN);
++#endif
+ //printx(foundat,0,8);
+ foundat += 24; //Jump to the file size obj
+ size = htoi(foundat, FOREMOST_LITTLE_ENDIAN);
+@@ -1401,7 +1400,6 @@ unsigned char *extract_gif(f_state *s, u_int64_t c_offset, unsigned char *founda
+ s_spec *needle, u_int64_t f_offset)
+ {
+ unsigned char *buf = foundat;
+- unsigned char *currentpos = foundat;
+ unsigned char *extractbuf = NULL;
+ int bytes_to_search = 0;
+ unsigned short width = 0;
+@@ -1420,7 +1418,6 @@ unsigned char *extract_gif(f_state *s, u_int64_t c_offset, unsigned char *founda
+ sprintf(comment, " (%d x %d)", width, height);
+ strcat(needle->comment, comment);
+
+- currentpos = foundat;
+ if (buflen - (foundat - buf) >= needle->max_len)
+ bytes_to_search = needle->max_len;
+ else
+@@ -1821,7 +1818,6 @@ unsigned char *extract_jpeg(f_state *s, u_int64_t c_offset, unsigned char *found
+ s_spec *needle, u_int64_t f_offset)
+ {
+ unsigned char *buf = foundat;
+- unsigned char *currentpos = NULL;
+
+ unsigned char *extractbuf = NULL;
+ unsigned short headersize;
+@@ -1899,8 +1895,6 @@ unsigned char *extract_jpeg(f_state *s, u_int64_t c_offset, unsigned char *found
+ return buf + needle->header_len;
+ }
+
+- currentpos = foundat;
+-
+ //sprintf("Searching for footer\n");
+ if (buflen < (foundat - buf)) {
+ #ifdef DEBUG
+@@ -2094,19 +2088,21 @@ unsigned char *extract_exe(f_state *s, u_int64_t c_offset, unsigned char *founda
+ unsigned char *extractbuf = NULL;
+ u_int64_t file_size = 0;
+ unsigned short pe_offset = 0;
+- unsigned int SizeOfCode = 0;
+- unsigned int SizeOfInitializedData = 0;
+- unsigned int SizeOfUninitializedData = 0;
+- unsigned int rva = 0;
+ unsigned int offset = 0;
+ unsigned short sections = 0;
+- unsigned int sizeofimage = 0;
+ unsigned int raw_section_size = 0;
+- unsigned int size_of_headers = 0;
+ unsigned short dll = 0;
+ unsigned int sum = 0;
+ unsigned short exe_char = 0;
++#ifdef DEBUG
++ unsigned int SizeOfInitializedData = 0;
++ unsigned int SizeOfUninitializedData = 0;
++ unsigned int SizeOfCode = 0;
++ unsigned int rva = 0;
++ unsigned int sizeofimage = 0;
++ unsigned int size_of_headers = 0;
+ unsigned int align = 0;
++#endif
+ int i = 0;
+ time_t compile_time = 0;
+ struct tm *ret_time;
+@@ -2167,14 +2163,16 @@ unsigned char *extract_exe(f_state *s, u_int64_t c_offset, unsigned char *founda
+
+ foundat += 0x18; /*Jump to opt header should be 0x0b 0x01*/
+
++#ifdef DEBUG
+ SizeOfCode = htoi(&foundat[4], FOREMOST_LITTLE_ENDIAN);
+ SizeOfInitializedData = htoi(&foundat[8], FOREMOST_LITTLE_ENDIAN);
+ SizeOfUninitializedData = htoi(&foundat[12], FOREMOST_LITTLE_ENDIAN);
+ rva = htoi(&foundat[16], FOREMOST_LITTLE_ENDIAN);
+ align = htoi(&foundat[36], FOREMOST_LITTLE_ENDIAN);
+-
+ sizeofimage = htoi(&foundat[56], FOREMOST_LITTLE_ENDIAN);
+ size_of_headers = htoi(&foundat[60], FOREMOST_LITTLE_ENDIAN);
++#endif
++
+ foundat += 224;
+
+ /*Start of sections*/
+@@ -2193,13 +2191,13 @@ unsigned char *extract_exe(f_state *s, u_int64_t c_offset, unsigned char *founda
+ sum = offset + raw_section_size;
+ }
+
+- /*
++#ifdef DEBUG
+ printf("rva is %d sum= %d\n",rva,sum);
+ printf("soi is %d,soh is %d \n",sizeofimage,size_of_headers);
+ printf("we are off by %d\n",sum-buflen);
+ printf("soc=%d ,soidr=%d, souid=%d\n",SizeOfCode,SizeOfInitializedData,SizeOfUninitializedData);
+ printf("fs=%d ,extr=%d\n",SizeOfCode+SizeOfInitializedData,SizeOfUninitializedData);
+- */
++#endif
+ file_size = sum;
+ if (file_size < 512 || file_size > 4 * MEGABYTE)
+ {
+@@ -2267,7 +2265,6 @@ unsigned char *extract_rar(f_state *s, u_int64_t c_offset, unsigned char *founda
+ {
+ unsigned char *buf = foundat;
+ unsigned char *extractbuf = NULL;
+- u_int64_t file_size = 0;
+ unsigned short headersize = 0;
+ unsigned short flags = 0;
+ unsigned int filesize = 0;
+@@ -2424,8 +2421,6 @@ unsigned char *extract_rar(f_state *s, u_int64_t c_offset, unsigned char *founda
+
+ /*We found the EOF, write the file to disk and return*/
+ tot_file_size = (foundat - buf);
+- if (tot_file_size > buflen)
+- file_size = buflen;
+
+ extractbuf = buf;
+ write_to_disk(s, needle, tot_file_size, extractbuf, c_offset + f_offset);
diff --git a/app-forensics/foremost/foremost-1.5.7-r3.ebuild b/app-forensics/foremost/foremost-1.5.7-r3.ebuild
index 531cf1318f8e..56cdeee6ed5d 100644
--- a/app-forensics/foremost/foremost-1.5.7-r3.ebuild
+++ b/app-forensics/foremost/foremost-1.5.7-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -15,12 +15,9 @@ KEYWORDS="amd64 ppc x86"
IUSE=""
LICENSE="public-domain"
SLOT="0"
-
-src_prepare() {
- epatch "${FILESDIR}/${PN}-1.4-config-location.patch"
- epatch "${FILESDIR}/${PN}-1.5.7-format-security.patch"
- default_src_prepare
-}
+PATCHES=("${FILESDIR}/${PN}-1.4-config-location.patch"
+ "${FILESDIR}/${PN}-1.5.7-format-security.patch"
+ "${FILESDIR}/${PN}-1.5.7-set-but-unused.patch")
src_compile() {
emake RAW_FLAGS="${CFLAGS} -Wall ${LDFLAGS}" RAW_CC="$(tc-getCC) -DVERSION=\\\"${PV}\\\"" \