summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-06-13 11:34:51 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-06-13 11:34:51 +0200
commit1ebca60563ede40843a9d451ef78413f35587d39 (patch)
tree5a2a9d0ef0512c32d28c527b955f669166312535
parentd5b19fa0e196a273ad7b1e5e3429a1335549358b (diff)
PhotoRec: modify .indd recovery to not use min_header_distance anymore
-rw-r--r--src/file_indd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/file_indd.c b/src/file_indd.c
index 8016389..9c624cb 100644
--- a/src/file_indd.c
+++ b/src/file_indd.c
@@ -46,7 +46,7 @@ static void file_check_indd(file_recovery_t *file_recovery);
const file_hint_t file_hint_indd= {
.extension="indd",
.description="InDesign File",
- .min_header_distance=8192,
+ .min_header_distance=0,
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
.recover=1,
.enable_by_default=1,
@@ -124,6 +124,10 @@ static int header_check_indd(const unsigned char *buffer, const unsigned int buf
const struct InDesignMasterPage *hdr0 = (const struct InDesignMasterPage *)buffer;
const struct InDesignMasterPage *hdr1 = (const struct InDesignMasterPage *)&buffer[4096];
hdr=(le64(hdr0->fSequenceNumber) > le64(hdr1->fSequenceNumber) ? hdr0 : hdr1);
+ if(file_recovery->file_stat!=NULL &&
+ file_recovery->file_stat->file_hint==&file_hint_indd &&
+ file_recovery->file_size <= 8192)
+ return 0;
if(hdr->fObjectStreamEndian!=1 && hdr->fObjectStreamEndian!=2)
return 0;
if(le32(hdr->fFilePages)==0)