summaryrefslogtreecommitdiffstats
path: root/src/file_orf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-03-10 17:20:54 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-03-10 17:20:54 +0100
commit37c0136e2685ecc415580925083298952b8227d2 (patch)
tree1bdd56f241e580bf95a09752f3324abc62eda652 /src/file_orf.c
parent8323345dfc2f8b9cbcc9d87ef9302695379de097 (diff)
PhotoRec: modify Olympus orf recovery to use TIFF recovery functions
Diffstat (limited to 'src/file_orf.c')
-rw-r--r--src/file_orf.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/file_orf.c b/src/file_orf.c
index 662b622..0806f07 100644
--- a/src/file_orf.c
+++ b/src/file_orf.c
@@ -29,7 +29,7 @@
#include <stdio.h>
#include "types.h"
#include "filegen.h"
-
+#include "file_tiff.h"
static void register_header_check_orf(file_stat_t *file_stat);
static int header_check_orf(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new);
@@ -44,27 +44,29 @@ const file_hint_t file_hint_orf= {
.register_header_check=&register_header_check_orf
};
-static const unsigned char orf_header[4]= { 0x49, 0x49, 0x52, 0x53};
-static const unsigned char orf_header2[4]= { 'I', 'I', 'R', 'O'};
+static const unsigned char orf_header_IIRS[4]= { 0x49, 0x49, 0x52, 0x53};
+static const unsigned char orf_header_IIRO[4]= { 'I', 'I', 'R', 'O'};
static void register_header_check_orf(file_stat_t *file_stat)
{
- register_header_check(0, orf_header, sizeof(orf_header), &header_check_orf, file_stat);
- register_header_check(0, orf_header2, sizeof(orf_header2), &header_check_orf, file_stat);
+ register_header_check(0, orf_header_IIRS, sizeof(orf_header_IIRS), &header_check_orf, file_stat);
+ register_header_check(0, orf_header_IIRO, sizeof(orf_header_IIRO), &header_check_orf, file_stat);
}
static int header_check_orf(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
- if(memcmp(buffer, orf_header, sizeof(orf_header))==0)
+ if(memcmp(buffer, orf_header_IIRS, sizeof(orf_header_IIRS))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_orf.extension;
return 1;
}
- if(memcmp(buffer, orf_header2, sizeof(orf_header2))==0)
+ if(memcmp(buffer, orf_header_IIRO, sizeof(orf_header_IIRO))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_orf.extension;
+ file_recovery_new->time=get_date_from_tiff_header((const TIFFHeader *)buffer, buffer_size);
+ file_recovery_new->file_check=&file_check_tiff;
return 1;
}
return 0;