summaryrefslogtreecommitdiffstats
path: root/src/file_orf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-06-30 07:56:21 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-06-30 07:56:21 +0200
commit413bff3c0e0e35cc32a42d998a23d9337b019bbf (patch)
tree24290044da1af5062acebaadde17e420d4134614 /src/file_orf.c
parente0f52d0d477f267bcbffad4feb17c3eceeb3575b (diff)
PhotoRec: recover Olympus Raw File .orf begiining by "IIRO"
Diffstat (limited to 'src/file_orf.c')
-rw-r--r--src/file_orf.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/file_orf.c b/src/file_orf.c
index dc28aff..662b622 100644
--- a/src/file_orf.c
+++ b/src/file_orf.c
@@ -2,7 +2,7 @@
File: file_orf.c
- Copyright (C) 1998-2005,2007 Christophe GRENIER <grenier@cgsecurity.org>
+ Copyright (C) 1998-2005,2007-2008 Christophe GRENIER <grenier@cgsecurity.org>
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,16 +44,24 @@ 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_header[4]= { 0x49, 0x49, 0x52, 0x53};
+static const unsigned char orf_header2[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_header, sizeof(orf_header), &header_check_orf, file_stat);
+ register_header_check(0, orf_header2, sizeof(orf_header2), &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, sizeof(orf_header))==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)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_orf.extension;