summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-04-07 09:03:37 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-04-07 09:03:37 +0200
commit68f42b7846fb884e52f182b167f35c92f1e25e5f (patch)
treeb3459730f48acab9e9594575896f90b0abc564b5 /src
parenta4a280354dc516db44d106ece40e73bb0c49aadf (diff)
PhotoRec: distinguish Debian Archive .deb from .a
Diffstat (limited to 'src')
-rw-r--r--src/file_a.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file_a.c b/src/file_a.c
index 2a6cf0d..3a63320 100644
--- a/src/file_a.c
+++ b/src/file_a.c
@@ -44,6 +44,7 @@ const file_hint_t file_hint_a= {
};
static const unsigned char a_header[8] = { '!','<','a','r','c','h','>','\n'};
+static const unsigned char a_header_debian[14] = { '!','<','a','r','c','h','>','\n','d','e','b','i','a','n'};
static void register_header_check_a(file_stat_t *file_stat)
{
@@ -52,6 +53,12 @@ static void register_header_check_a(file_stat_t *file_stat)
static int header_check_a(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,a_header_debian,sizeof(a_header_debian))==0)
+ {
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension="deb";
+ return 1;
+ }
if(memcmp(buffer,a_header,sizeof(a_header))==0)
{
reset_file_recovery(file_recovery_new);