summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-03-14 08:58:01 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-03-14 08:58:01 +0100
commitb58ca3d7dbf868fe1a20d7af8c0019728711a4aa (patch)
treec782776d1185c686eecb350379305cc48b42858a /src
parent5148a5273b97c61a5625a9d900b835d41954c101 (diff)
PhotoRec: identify MS Publisher .pub files
Diffstat (limited to 'src')
-rw-r--r--src/file_doc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/file_doc.c b/src/file_doc.c
index 8fba854..3f646e0 100644
--- a/src/file_doc.c
+++ b/src/file_doc.c
@@ -162,6 +162,10 @@ static int header_check_doc(const unsigned char *buffer, const unsigned int buff
{ /* Outlook */
file_recovery_new->extension="msg";
}
+ else if(td_memmem(buffer,buffer_size,"Publisher",9)!=NULL)
+ { /* Publisher */
+ file_recovery_new->extension="pub";
+ }
else
file_recovery_new->extension=file_hint_doc.extension;
return 1;
@@ -180,7 +184,7 @@ static uint64_t test_OLE(FILE *IN)
if(!IN)
return 0;
fseek(IN,0,SEEK_SET);
- if(fread(&buffer_header,sizeof(buffer_header),1,IN)<0) /*reads first sector including OLE header */
+ if(fread(&buffer_header,sizeof(buffer_header),1,IN)!=1) /*reads first sector including OLE header */
return 0;
/*
log_trace("num_FAT_blocks %u\n",le32(header->num_FAT_blocks));
@@ -206,7 +210,7 @@ static uint64_t test_OLE(FILE *IN)
free(dif);
return 0;
}
- if(fread(dif_pos, (i<le32(header->num_extra_FAT_blocks)?128:(le32(header->num_FAT_blocks)-109)%127),4,IN)<0)
+ if(fread(dif_pos, (i<le32(header->num_extra_FAT_blocks)?128:(le32(header->num_FAT_blocks)-109)%127),4,IN)!=4)
{
free(dif);
return 0;
@@ -226,7 +230,7 @@ static uint64_t test_OLE(FILE *IN)
free(fat);
return 0;
}
- if(fread(fat+((j<<le16(header->uSectorShift))/4),(1<<le16(header->uSectorShift)),1,IN)<0)
+ if(fread(fat+((j<<le16(header->uSectorShift))/4),(1<<le16(header->uSectorShift)),1,IN)!=1)
{
free(dif);
free(fat);