summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-03-03 07:00:53 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2017-03-03 07:00:53 +0100
commit626d38fcd0464b96f3f01b9e7e37e8274d57ce51 (patch)
tree2929d6db93b0c7f24a54df0a8a182a7f84e5c9d1 /src/file_txt.c
parent6a04c03af239801a600d4cf9bb54497ce0c5bcac (diff)
PhotoRec: do not search text files when another file is recovered except if it's also a text file
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index faaaf1f..5e9adef 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -1108,32 +1108,12 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
}
if(file_recovery->file_stat!=NULL)
{
- if(file_recovery->file_stat->file_hint == &file_hint_doc)
- {
- return 0;
- }
- else if(file_recovery->file_stat->file_hint == &file_hint_fasttxt ||
+ if(file_recovery->file_stat->file_hint == &file_hint_fasttxt ||
file_recovery->file_stat->file_hint == &file_hint_txt)
{
if(strstr(file_recovery->filename,".html")==NULL)
return 0;
}
- else if(file_recovery->file_stat->file_hint == &file_hint_jpg)
- {
- /* Don't search text at the beginning of JPG */
- if(file_recovery->file_size < file_recovery->min_filesize)
- return 0;
- /* Text should not be found in JPEG */
- if(td_memmem(buffer, buffer_size_test, "8BIM", 4)!=NULL ||
- td_memmem(buffer, buffer_size_test, "adobe", 5)!=NULL ||
- td_memmem(buffer, buffer_size_test, "exif:", 5)!=NULL ||
- td_memmem(buffer, buffer_size_test, "<rdf:", 5)!=NULL ||
- td_memmem(buffer, buffer_size_test, "<?xpacket", 9)!=NULL ||
- td_memmem(buffer, buffer_size_test, "<dict>", 6)!=NULL ||
- td_memmem(buffer, buffer_size_test, "xmp:CreatorTool>", 16)!=NULL ||
- td_memmem(buffer, buffer_size_test, "[camera info]", 13)!=NULL)
- return 0;
- }
else
return 0;
}