summaryrefslogtreecommitdiffstats
path: root/src/file_rar.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-01-24 13:23:10 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2010-01-24 13:23:10 +0100
commitcb2b6ccb43c7975169b27dff6245d5fb3c55e952 (patch)
tree05d0c528c2269da16a706ba1e30d2bbb0a026b98 /src/file_rar.c
parent0fa875f97f6b679c56027a8fb8b63db2f928a5bc (diff)
PhotoRec: recover encrypted rar files
Diffstat (limited to 'src/file_rar.c')
-rw-r--r--src/file_rar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file_rar.c b/src/file_rar.c
index 2da3d0c..06f6d38 100644
--- a/src/file_rar.c
+++ b/src/file_rar.c
@@ -51,6 +51,7 @@ static void register_header_check_rar(file_stat_t *file_stat)
{
register_header_check(0, rar_header,sizeof(rar_header), &header_check_rar, file_stat);
}
+#define MHD_PASSWORD 0x0080U
static int header_check_rar(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)
{
@@ -58,7 +59,8 @@ static int header_check_rar(const unsigned char *buffer, const unsigned int buff
{
reset_file_recovery(file_recovery_new);
file_recovery_new->min_filesize=70;
- file_recovery_new->file_check=file_check_rar;
+ if((buffer[0xa] & MHD_PASSWORD)==0)
+ file_recovery_new->file_check=file_check_rar;
file_recovery_new->extension=file_hint_rar.extension;
return 1;
}