[Forensics-changes] [magicrescue] 04/19: Imported Upstream version 1.1.5
Joao Eriberto Mota Filho
eriberto at moszumanska.debian.org
Mon Nov 3 19:06:19 UTC 2014
This is an automated email from the git hooks/post-receive script.
eriberto pushed a commit to branch debian
in repository magicrescue.
commit ed3e6679e371f8eec12384c5cf4fb534b890a49c
Author: Joao Eriberto Mota Filho <eriberto at debian.org>
Date: Mon Nov 3 16:50:20 2014 -0200
Imported Upstream version 1.1.5
---
ChangeLog | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
NEWS | 5 ++++
README | 8 +++---
configure | 12 +++++----
doc/dupemap.1 | 6 ++---
doc/dupemap.pod | 2 +-
doc/magicrescue.1 | 4 +--
doc/magicsort.1 | 4 +--
recipes/canon-cr2 | 7 +++++
recipes/flac | 15 +++++++++++
src/dupemap.c | 4 +--
src/magicrescue.c | 8 +++---
src/recipe.c | 5 ++--
src/recipe.h | 6 ++---
src/scanner.c | 10 +++----
src/scanner.h | 8 +++---
src/util.c | 6 ++---
src/util.h | 8 +++---
tools/textextract.c | 13 ++++-----
19 files changed, 157 insertions(+), 50 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index abe582b..b64483f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,82 @@
For less detailed change information, see the NEWS file
------------------------------------------------------------------------
+r602 | jbj | 2008-01-17 12:33:57 +0100 (Thu, 17 Jan 2008) | 1 line
+Changed paths:
+ M /magicrescue/trunk/configure
+
+Workaround for Solaris /bin/sh non-POSIX 'trap' command
+------------------------------------------------------------------------
+r590 | jbj | 2007-12-31 16:25:04 +0100 (Mon, 31 Dec 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/src/dupemap.c
+ M /magicrescue/trunk/src/magicrescue.c
+ M /magicrescue/trunk/src/recipe.c
+ M /magicrescue/trunk/src/recipe.h
+ M /magicrescue/trunk/src/scanner.c
+ M /magicrescue/trunk/src/scanner.h
+ M /magicrescue/trunk/src/util.c
+ M /magicrescue/trunk/src/util.h
+ M /magicrescue/trunk/tools/textextract.c
+
+Change buffers to signed string types to silence gcc warnings
+------------------------------------------------------------------------
+r589 | jbj | 2007-12-31 15:37:57 +0100 (Mon, 31 Dec 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/new_NEWS
+
+news
+------------------------------------------------------------------------
+r588 | jbj | 2007-12-31 15:13:24 +0100 (Mon, 31 Dec 2007) | 1 line
+Changed paths:
+ A /magicrescue/trunk/recipes/canon-cr2
+
+Add a recipe for Canon CR2 RAW files
+------------------------------------------------------------------------
+r490 | jbj | 2007-06-22 10:49:38 +0200 (Fri, 22 Jun 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/configure
+
+typo
+------------------------------------------------------------------------
+r489 | jbj | 2007-06-21 22:30:14 +0200 (Thu, 21 Jun 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/configure
+
+Syntax fix to make configure script work on the dash shell (Debian, Ubuntu, ...)
+------------------------------------------------------------------------
+r488 | jbj | 2007-06-03 23:30:57 +0200 (Sun, 03 Jun 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/doc/dupemap.pod
+
+typo
+------------------------------------------------------------------------
+r483 | jbj | 2007-05-01 22:14:43 +0200 (Tue, 01 May 2007) | 1 line
+Changed paths:
+ M /magicrescue/trunk/new_NEWS
+ A /magicrescue/trunk/recipes/flac
+
+Add flac recipe
+------------------------------------------------------------------------
+r333 | jbj | 2004-08-15 11:19:08 +0200 (Sun, 15 Aug 2004) | 1 line
+Changed paths:
+ M /magicrescue/trunk/configure
+
+Proper cleanup after configure
+------------------------------------------------------------------------
+r332 | jbj | 2004-08-15 01:31:23 +0200 (Sun, 15 Aug 2004) | 1 line
+Changed paths:
+ M /magicrescue/trunk/README
+
+No users know what X/OPEN is
+------------------------------------------------------------------------
+r330 | jbj | 2004-08-15 01:16:20 +0200 (Sun, 15 Aug 2004) | 1 line
+Changed paths:
+ M /magicrescue/trunk/NEWS
+ M /magicrescue/trunk/new_NEWS
+
+Release 1.1.4
+------------------------------------------------------------------------
r329 | jbj | 2004-08-15 01:10:37 +0200 (Sun, 15 Aug 2004) | 1 line
Changed paths:
M /magicrescue/trunk/new_NEWS
diff --git a/NEWS b/NEWS
index 3027059..c845da0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Version 1.1.5: Thu Jan 17 14:03:49 CET 2008
+- Recipe for Flac files
+- Recipe for Canon CR2 RAW files
+- Configure script compatibility fix for Debian-based Linuxes
+
Version 1.1.4: Sun Aug 15 01:11:27 CEST 2004
- Fixed a minor bug that prevented some not yet written recipes from working
perfectly
diff --git a/README b/README
index aecc06b..df30814 100644
--- a/README
+++ b/README
@@ -16,10 +16,10 @@ Find the latest version at http://jbj.rapanden.dk/magicrescue/
Building
--------
-There are no build requirements other than a C library and an X/OPEN system
-interface. To use the dupemap(1) utility, you must have the NDBM
-compatibility header, which either comes with your system or the development
-libraries of GDBM or Berkeley DB.
+There are no build requirements other than a C library and a UNIXish system.
+To use the dupemap(1) utility, you must have the NDBM compatibility header,
+which either comes with your system or the development libraries of GDBM or
+Berkeley DB.
./configure && make && make install
diff --git a/configure b/configure
index a8ca396..90b2f06 100755
--- a/configure
+++ b/configure
@@ -33,7 +33,7 @@ def_CFLAGS="-O3 -Wall"
MAKE_VARS=
if [ -f config.config ]; then
- . config.config
+ . ./config.config
fi
#
@@ -96,7 +96,7 @@ if mv -f config.h config.h.bak 2>/dev/null; then
trap "mv config.h.bak config.h" 0
fi
cat > config.h << EOF
-/* XXX This file automatically generated by configure. */
+/* XXX This file was automatically generated by configure. */
EOF
@@ -173,7 +173,11 @@ EOF
. "$f"
done
-rm -f conftest.c conftest.o conftest
+#
+# Clean up
+#
+trap "" 0
+rm -f config.h.bak conftest.c conftest.o conftest
#
# Generate Makefile
@@ -201,7 +205,5 @@ fi
chmod 444 Makefile
-trap - 0
-
echo
echo "Done. Now type 'make' to compile"
diff --git a/doc/dupemap.1 b/doc/dupemap.1
index 78a1c84..35b43eb 100644
--- a/doc/dupemap.1
+++ b/doc/dupemap.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "DUPEMAP 1"
-.TH DUPEMAP 1 "2004-07-11" "1.1.4" "Magic Rescue"
+.TH DUPEMAP 1 "2007-12-31" "1.1.5" "Magic Rescue"
.SH "NAME"
dupemap \- Creates a database of file checksums and uses it to eliminate
duplicates
@@ -216,7 +216,7 @@ The easiest operations to understand is when the \fB\-d\fR option is not given.
delete all duplicate files in \fI/tmp/recovered\-files\fR, do:
.PP
.Vb 1
-\& $ dupemap delete /tmp/recovered files
+\& $ dupemap delete /tmp/recovered-files
.Ve
.PP
Often, \fBdupemap scan\fR is run to produce a checksum database of all files in a
diff --git a/doc/dupemap.pod b/doc/dupemap.pod
index a3e4506..cbf91c9 100644
--- a/doc/dupemap.pod
+++ b/doc/dupemap.pod
@@ -111,7 +111,7 @@ Ignore files above this size.
The easiest operations to understand is when the B<-d> option is not given. To
delete all duplicate files in F</tmp/recovered-files>, do:
- $ dupemap delete /tmp/recovered files
+ $ dupemap delete /tmp/recovered-files
Often, B<dupemap scan> is run to produce a checksum database of all files in a
directory tree. Then B<dupemap delete> is run on another directory, possibly
diff --git a/doc/magicrescue.1 b/doc/magicrescue.1
index 2b88554..622aabb 100644
--- a/doc/magicrescue.1
+++ b/doc/magicrescue.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "MAGICRESCUE 1"
-.TH MAGICRESCUE 1 "2004-07-11" "1.1.4" "Magic Rescue"
+.TH MAGICRESCUE 1 "2007-12-31" "1.1.5" "Magic Rescue"
.SH "NAME"
magicrescue \- Scans a block device and extracts known file types by looking at
magic bytes.
diff --git a/doc/magicsort.1 b/doc/magicsort.1
index 4110c60..8ebc0d9 100644
--- a/doc/magicsort.1
+++ b/doc/magicsort.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "MAGICSORT 1"
-.TH MAGICSORT 1 "2004-05-02" "1.1.4" "Magic Rescue"
+.TH MAGICSORT 1 "2007-12-31" "1.1.5" "Magic Rescue"
.SH "NAME"
magicsort \- Categorize files by their \fBfile\fR(1) magic
.SH "SYNOPSIS"
diff --git a/recipes/canon-cr2 b/recipes/canon-cr2
new file mode 100644
index 0000000..1a354df
--- /dev/null
+++ b/recipes/canon-cr2
@@ -0,0 +1,7 @@
+# Extract (at most 30 MB) Canon CR2 RAW files. These are used by the Powershot
+# and EOS digital cameras.
+# This recipe was contributed by Daniel J Blueman
+0 string II*
+8 string CR
+extension CR2
+command dd bs=1024k count=30 of="$1" 2>/dev/null; dcraw -i "$1" || rm -f "$1"
diff --git a/recipes/flac b/recipes/flac
new file mode 100644
index 0000000..c17e685
--- /dev/null
+++ b/recipes/flac
@@ -0,0 +1,15 @@
+# Extracts flac sound files: http://flac.sourceforge.net/
+# Contributed by Richard Zidlicky <rz (at) linux (dash) m68k (dot) org>
+
+0 string fLaC
+
+extension flac
+
+# Allow infinite overlap because the recompressed file may be much larger than
+# the original one.. at least in theory
+
+allow_overlap -1
+
+
+# hope that flac will do the right thing
+command flac -d - | flac -8 - > "$1"
diff --git a/src/dupemap.c b/src/dupemap.c
index f121635..64c16e5 100644
--- a/src/dupemap.c
+++ b/src/dupemap.c
@@ -198,7 +198,7 @@ typedef struct {
static int checksum_calc(checksum_t *checksum, const char *file)
{
- static unsigned char buf[BUFLEN];
+ static char buf[BUFLEN];
ssize_t bytes_read;
off_t _length = 0;
long _crc = 0;
@@ -212,7 +212,7 @@ static int checksum_calc(checksum_t *checksum, const char *file)
}
while ((bytes_read = fread(buf, 1, BUFLEN, fp)) > 0) {
- unsigned char *cp = buf;
+ char *cp = buf;
_length += bytes_read;
while (bytes_read--)
diff --git a/src/magicrescue.c b/src/magicrescue.c
index 0964eb2..4ecd7fe 100644
--- a/src/magicrescue.c
+++ b/src/magicrescue.c
@@ -67,7 +67,7 @@ struct progress progress;
static ssize_t overlap = 0;
/* General-purpose buffer. Mostly used to hold the raw data when scanning. */
-static unsigned char *buf;
+static char *buf;
static const size_t bufsize = 102400;
@@ -117,7 +117,7 @@ static void scanners_free(void)
* them.
* Returns 1 if an external program has been called, which means the file
* position has changed. Returns -1 on fatal error. */
-static int scan_buf(const unsigned char *scanbuf, ssize_t scanbuf_len,
+static int scan_buf(const char *scanbuf, ssize_t scanbuf_len,
int fd, off_t scanbuf_filepos)
{
int filepos_changed = 0;
@@ -145,7 +145,7 @@ static int scan_buf(const unsigned char *scanbuf, ssize_t scanbuf_len,
}
array_foreach(&scanners, scanner) {
- const unsigned char *p = scanbuf + scanner->offset;
+ const char *p = scanbuf + scanner->offset;
while (p - scanbuf < scanbuf_len &&
(p = scanner->func(p, scanbuf_len - (p-scanbuf) +
@@ -226,7 +226,7 @@ static void scan_disk(const char *device, const char *offset)
int fd = 0;
int result, firsttime = 1;
- unsigned char *readbuf = buf, *scanbuf = buf;
+ char *readbuf = buf, *scanbuf = buf;
size_t readsize = bufsize;
off_t offset_before_read;
diff --git a/src/recipe.c b/src/recipe.c
index 27079b3..dde02b3 100644
--- a/src/recipe.c
+++ b/src/recipe.c
@@ -26,13 +26,14 @@
#include "recipe.h"
-int op_string(const unsigned char *s, union param *p)
+int op_string(const char *s, union param *p)
{
return memcmp(s, p->string.s, p->string.l) == 0;
}
-int op_int32(const unsigned char *s, union param *p)
+int op_int32(const char *s_signed, union param *p)
{
+ const unsigned char *s = (unsigned char *)s_signed;
return ((s[0]<<24 | s[1]<<16 | s[2]<<8 | s[3]) & p->int32.mask)
== p->int32.val;
}
diff --git a/src/recipe.h b/src/recipe.h
index 6966853..88b275c 100644
--- a/src/recipe.h
+++ b/src/recipe.h
@@ -10,7 +10,7 @@ union param {
} int32;
};
-typedef int (*op_function)(const unsigned char *, union param *);
+typedef int (*op_function)(const char *, union param *);
struct operation {
op_function func;
@@ -29,8 +29,8 @@ struct recipe {
int allow_overlap;
};
-int op_string(const unsigned char *s, union param *p);
-int op_int32(const unsigned char *s, union param *p);
+int op_string(const char *s, union param *p);
+int op_int32(const char *s, union param *p);
void op_destroy(struct operation *op);
void recipe_init(struct recipe *r);
diff --git a/src/scanner.c b/src/scanner.c
index 3121425..f6d36c9 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -28,13 +28,13 @@
#include "recipe.h"
#include "scanner.h"
-const unsigned char *scanner_char(const unsigned char *scanbuf,
+const char *scanner_char(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset)
{
return memchr(scanbuf, param->c, scanbuf_len);
}
-const unsigned char *scanner_block(const unsigned char *scanbuf,
+const char *scanner_block(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset)
{
long extrabytes = (long)offset & (param->block-1);
@@ -47,12 +47,12 @@ const unsigned char *scanner_block(const unsigned char *scanbuf,
return scanbuf;
}
-const unsigned char *scanner_string(const unsigned char *scanbuf,
+const char *scanner_string(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset)
{
- const unsigned char *p = scanbuf + param->scanstring.magicoff;
+ const char *p = scanbuf + param->scanstring.magicoff;
struct string string = param->scanstring.string;
- unsigned char magicchar = param->scanstring.magicchar;
+ char magicchar = param->scanstring.magicchar;
scanbuf_len += param->scanstring.magicoff;
while ((size_t)(p - scanbuf) < scanbuf_len &&
diff --git a/src/scanner.h b/src/scanner.h
index 7096691..2d54934 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -15,7 +15,7 @@ union scan_param {
} scanstring;
};
-typedef const unsigned char *(*scan_function)(const unsigned char *, size_t,
+typedef const char *(*scan_function)(const char *, size_t,
union scan_param *, off_t);
struct scanner {
@@ -26,11 +26,11 @@ struct scanner {
struct array recipes;
};
-const unsigned char *scanner_char(const unsigned char *scanbuf,
+const char *scanner_char(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset);
-const unsigned char *scanner_block(const unsigned char *scanbuf,
+const char *scanner_block(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset);
-const unsigned char *scanner_string(const unsigned char *scanbuf,
+const char *scanner_string(const char *scanbuf,
size_t scanbuf_len, union scan_param *param, off_t offset);
void scanner_string_init(union scan_param *param);
diff --git a/src/util.c b/src/util.c
index 31aa0eb..e42518a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -32,14 +32,14 @@
/** Returns the value (0-15) of a single hex digit. Returns 0 on error. */
-int hex2num(unsigned char c)
+int hex2num(char c)
{
return (c >= '0' && c <= '9' ? c-'0' :
(c >= 'a' && c <= 'f' ? c-'a'+10 :
(c >= 'A' && c <= 'F' ? c-'A'+10 : 0)));
}
-long long hextoll(const unsigned char *str)
+long long hextoll(const char *str)
{
long long result = 0;
size_t i, len = strlen(str);
@@ -109,7 +109,7 @@ off_t rich_seek(int fd, const char *string)
/** Initializes a struct string from a 0-terminated string, parsing escape
* sequences. The struct string will not be 0-terminated. */
-void string_init(struct string *dst, const unsigned char *src)
+void string_init(struct string *dst, const char *src)
{
const size_t slen = strlen(src);
size_t i;
diff --git a/src/util.h b/src/util.h
index 1b3db4c..7234535 100644
--- a/src/util.h
+++ b/src/util.h
@@ -8,16 +8,16 @@
#endif
struct string {
- unsigned char *s;
+ char *s;
size_t l;
};
-int hex2num(unsigned char c);
-long long hextoll(const unsigned char *str);
+int hex2num(char c);
+long long hextoll(const char *str);
long atol_calc(const char *str);
off_t rich_seek(int fd, const char *string);
-void string_init(struct string *dst, const unsigned char *src);
+void string_init(struct string *dst, const char *src);
void string_destroy(struct string *string);
#define _UTIL_H
diff --git a/tools/textextract.c b/tools/textextract.c
index dcc84a4..f5f24e9 100644
--- a/tools/textextract.c
+++ b/tools/textextract.c
@@ -38,20 +38,20 @@ static int max_reverse = 0;
static long max_bytes = 0;
static size_t bufsize = 8192;
-static unsigned char *buf;
+static char *buf;
static short scorelut[UCHAR_MAX+1], replut[UCHAR_MAX+1];
struct rule {
short score, rep;
- unsigned char *ranges;
+ char *ranges;
};
enum direction { DIR_FORWARD, DIR_REVERSE };
static enum direction direction = DIR_FORWARD;
struct scores {
- unsigned char *last_letter;
+ char *last_letter;
unsigned char repeated_char;
int sum_score, sum_repeats, cur_line;
off_t offset;
@@ -168,7 +168,8 @@ static void make_luts(void)
};
for (rule = rules; rule->ranges != NULL; rule++) {
- unsigned char a, b, *range = rule->ranges;
+ unsigned char a, b;
+ char *range = rule->ranges;
int i;
do {
@@ -219,7 +220,7 @@ static void usage(void)
static int read_backward(struct scores *s, int outfd)
{
ssize_t read_count;
- unsigned char *p;
+ char *p;
if (s->offset <= 0)
return 0;
@@ -257,7 +258,7 @@ static int read_backward(struct scores *s, int outfd)
static int read_forward(struct scores *s, int outfd)
{
ssize_t read_count;
- unsigned char *p, *bufpos;
+ char *p, *bufpos;
bufpos = buf;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/magicrescue.git
More information about the forensics-changes
mailing list