summaryrefslogtreecommitdiffstats
path: root/src/file_mfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_mfa.c')
-rw-r--r--src/file_mfa.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/file_mfa.c b/src/file_mfa.c
index 6afd609..f765949 100644
--- a/src/file_mfa.c
+++ b/src/file_mfa.c
@@ -29,10 +29,7 @@
#include "types.h"
#include "filegen.h"
-
static void register_header_check_mfa(file_stat_t *file_stat);
-static int header_check_mfa(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_mfa(file_recovery_t *file_recovery);
const file_hint_t file_hint_mfa= {
.extension="mfa",
@@ -44,27 +41,22 @@ const file_hint_t file_hint_mfa= {
.register_header_check=&register_header_check_mfa
};
-static const unsigned char mfa_header[8]= { 'M', 'M', 'F', '2', 0x04, 0x00, 0x00, 0x00};
-
-static void register_header_check_mfa(file_stat_t *file_stat)
+static void file_check_mfa(file_recovery_t *file_recovery)
{
- register_header_check(0, mfa_header,sizeof(mfa_header), &header_check_mfa, file_stat);
+ const unsigned char mfa_footer[5]= {'!','D','N','E', '!'};
+ file_search_footer(file_recovery, mfa_footer, sizeof(mfa_footer), 0x84);
}
static int header_check_mfa(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,mfa_header,sizeof(mfa_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->file_check=file_check_mfa;
- file_recovery_new->extension=file_hint_mfa.extension;
- return 1;
- }
- return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->file_check=file_check_mfa;
+ file_recovery_new->extension=file_hint_mfa.extension;
+ return 1;
}
-static void file_check_mfa(file_recovery_t *file_recovery)
+static void register_header_check_mfa(file_stat_t *file_stat)
{
- const unsigned char mfa_footer[5]= {'!','D','N','E', '!'};
- file_search_footer(file_recovery, mfa_footer, sizeof(mfa_footer), 0x84);
+ static const unsigned char mfa_header[8]= { 'M', 'M', 'F', '2', 0x04, 0x00, 0x00, 0x00};
+ register_header_check(0, mfa_header,sizeof(mfa_header), &header_check_mfa, file_stat);
}