summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-03-23 15:07:02 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-03-23 15:07:02 +0100
commitf84637a6a3c0ec1fd3e118b06b1beb4b3f478b79 (patch)
tree8aa8a83a3715131e9516eabd940576448dc7320a
parent753fe8a445eccd5792c81f55f19119c344d35048 (diff)
PhotoRec: better signature for .max file detection
-rw-r--r--src/file_max.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/file_max.c b/src/file_max.c
index dcd5048..c4c87c8 100644
--- a/src/file_max.c
+++ b/src/file_max.c
@@ -33,7 +33,6 @@
static void register_header_check_max(file_stat_t *file_stat);
-static int header_check_max(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);
const file_hint_t file_hint_max= {
.extension="max",
@@ -45,20 +44,14 @@ const file_hint_t file_hint_max= {
.register_header_check=&register_header_check_max
};
-static const unsigned char max_header[4] = { 'V','i','G','F'};
-
-static void register_header_check_max(file_stat_t *file_stat)
+static int header_check_max(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)
{
- register_header_check(0, max_header,sizeof(max_header), &header_check_max, file_stat);
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_max.extension;
+ return 1;
}
-static int header_check_max(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 register_header_check_max(file_stat_t *file_stat)
{
- if(memcmp(buffer,max_header,sizeof(max_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_max.extension;
- return 1;
- }
- return 0;
+ register_header_check(0, "ViGFk", 5, &header_check_max, file_stat);
}