summaryrefslogtreecommitdiffstats
path: root/src/file_tz.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-04-12 18:49:05 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-04-12 18:49:05 +0200
commit349d85840b4fe4394cd342023bec8d7d6541ec84 (patch)
tree9d30f3251ad7fa3851759c5a7aa7f7d67a987cec /src/file_tz.c
parentb40cb297b2df674137a0b239cc877d4e37d6dc0e (diff)
PhotoRec: recover TZif2 timeinfo zone files
Diffstat (limited to 'src/file_tz.c')
-rw-r--r--src/file_tz.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/file_tz.c b/src/file_tz.c
index 75cfe50..1aaaee6 100644
--- a/src/file_tz.c
+++ b/src/file_tz.c
@@ -57,14 +57,25 @@ static const unsigned char tz_header[20]=
0x00, 0x00, 0x00, 0x00,
};
+static const unsigned char tz2_header[20]=
+{
+ 'T', 'Z', 'i', 'f',
+ '2', 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+
static void register_header_check_tz(file_stat_t *file_stat)
{
register_header_check(0, tz_header, sizeof(tz_header), &header_check_tz, file_stat);
+ register_header_check(0, tz2_header, sizeof(tz2_header), &header_check_tz, file_stat);
}
static int header_check_tz(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,tz_header,sizeof(tz_header))==0)
+ if(memcmp(buffer,tz_header,sizeof(tz_header))==0 ||
+ memcmp(buffer,tz2_header,sizeof(tz2_header))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_tz.extension;