summaryrefslogtreecommitdiffstats
path: root/src/file_template.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-04-03 18:13:23 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-04-03 18:13:23 +0200
commit785602ec29ec09a2de4e2ce00f13b5b61ff6d2a5 (patch)
tree3361d5a52e7ec123fa91463fbc6d48e62907328c /src/file_template.c
parent43be59675b8a5f9f55953884dd4839fee1d11714 (diff)
PhotoRec: new template file
Diffstat (limited to 'src/file_template.c')
-rw-r--r--src/file_template.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/file_template.c b/src/file_template.c
index 97abab5..7ceea8d 100644
--- a/src/file_template.c
+++ b/src/file_template.c
@@ -31,8 +31,6 @@
#include "filegen.h"
static void register_header_check_EXTENSION(file_stat_t *file_stat);
-static int header_check_EXTENSION(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_EXTENSION(file_recovery_t *file_recovery);
const file_hint_t file_hint_EXTENSION= {
.extension="EXTENSION",
@@ -44,15 +42,18 @@ const file_hint_t file_hint_EXTENSION= {
.register_header_check=&register_header_check_EXTENSION
};
+static void file_check_EXTENSION(file_recovery_t *file_recovery)
+{
+ const unsigned char EXTENSION_footer[FOOTER_SIZE]= {
+ FOOTER_MAGIC
+ };
+ file_search_footer(file_recovery, EXTENSION_footer, sizeof(EXTENSION_footer), FOOTER_EXTRA);
+}
+
static const unsigned char EXTENSION_header[HEADER_SIZE]= {
HEADER_MAGIC
};
-static void register_header_check_EXTENSION(file_stat_t *file_stat)
-{
- register_header_check(HEADER_LOC, EXTENSION_header, sizeof(EXTENSION_header), &header_check_EXTENSION, file_stat);
-}
-
static int header_check_EXTENSION(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[HEADER_LOC], EXTENSION_header, sizeof(EXTENSION_header))==0)
@@ -65,10 +66,7 @@ static int header_check_EXTENSION(const unsigned char *buffer, const unsigned in
return 0;
}
-static void file_check_EXTENSION(file_recovery_t *file_recovery)
+static void register_header_check_EXTENSION(file_stat_t *file_stat)
{
- const unsigned char EXTENSION_footer[FOOTER_SIZE]= {
- FOOTER_MAGIC
- };
- file_search_footer(file_recovery, EXTENSION_footer, sizeof(EXTENSION_footer), FOOTER_EXTRA);
+ register_header_check(HEADER_LOC, EXTENSION_header, sizeof(EXTENSION_header), &header_check_EXTENSION, file_stat);
}