summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-04-30 14:03:17 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2018-04-30 14:03:17 +0200
commit24a279a03caa4911c60e327d14687509dde2149d (patch)
treecd2006024b0b51405821e328725b4a9ac851b781
parent4408ca953535551db9211149c1fa07b9d7cfdfa2 (diff)
PhotoRec: cosmetic changes in src/file_rar.c
-rw-r--r--src/file_rar.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/file_rar.c b/src/file_rar.c
index 24423fc..e51ce88 100644
--- a/src/file_rar.c
+++ b/src/file_rar.c
@@ -32,13 +32,9 @@
static void register_header_check_rar(file_stat_t *file_stat);
-static int header_check_rar15fmt(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);
-static void file_check_rar15fmt(file_recovery_t *file_recovery);
-static int header_check_rar50fmt(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);
-static void file_check_rar50fmt(file_recovery_t *file_recovery);
const file_hint_t file_hint_rar= {
- .extension="rar", /* What is the correct extension ? */
+ .extension="rar",
.description="Rar archive",
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
.recover=1,
@@ -46,16 +42,11 @@ const file_hint_t file_hint_rar= {
.register_header_check=&register_header_check_rar
};
-static const unsigned char rar15fmt_header[7]={0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
-static const unsigned char rar50fmt_header[8]={0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 };
-
-static const unsigned char rar15fmt_footer[7]={0xc4, 0x3d, 0x7b, 0x00, 0x40, 0x07, 0x00 };
-static const unsigned char rar50fmt_footer[8]={0x1d, 0x77, 0x56, 0x51, 0x03, 0x05, 0x04, 0x00 };
-
#define MHD_PASSWORD 0x0080U
static void file_check_rar15fmt(file_recovery_t *file_recovery)
{
+ static const unsigned char rar15fmt_footer[7]={0xc4, 0x3d, 0x7b, 0x00, 0x40, 0x07, 0x00 };
file_search_footer(file_recovery, rar15fmt_footer, sizeof(rar15fmt_footer), 0);
}
@@ -71,6 +62,7 @@ static int header_check_rar15fmt(const unsigned char *buffer, const unsigned int
static void file_check_rar50fmt(file_recovery_t *file_recovery)
{
+ static const unsigned char rar50fmt_footer[8]={0x1d, 0x77, 0x56, 0x51, 0x03, 0x05, 0x04, 0x00 };
file_search_footer(file_recovery, rar50fmt_footer, sizeof(rar50fmt_footer), 0);
}
@@ -86,6 +78,8 @@ static int header_check_rar50fmt(const unsigned char *buffer, const unsigned int
static void register_header_check_rar(file_stat_t *file_stat)
{
+ static const unsigned char rar15fmt_header[7]={0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
+ static const unsigned char rar50fmt_header[8]={0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 };
register_header_check(0, rar15fmt_header,sizeof(rar15fmt_header), &header_check_rar15fmt, file_stat);
register_header_check(0, rar50fmt_header,sizeof(rar50fmt_header), &header_check_rar50fmt, file_stat);
}