summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Wildi <3668514+vwildi@users.noreply.github.com>2020-03-09 18:09:59 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2020-03-09 18:09:59 +0100
commit5934cf54e9d22ee80759d0e78d784f53fa19d78a (patch)
tree69660534a4487f14b7260aa4b9e2c84323078eeb /src
parentcc8c9454d38c74754741e434e14c59f10188c4c1 (diff)
Support for further WISO Steuer software versionsHEADmaster
Close https://github.com/cgsecurity/testdisk/pull/77 Edited by Christophe GRENIER
Diffstat (limited to 'src')
-rw-r--r--src/file_steuer2014.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/file_steuer2014.c b/src/file_steuer2014.c
index e293825..eba0702 100644
--- a/src/file_steuer2014.c
+++ b/src/file_steuer2014.c
@@ -33,10 +33,17 @@
#include "common.h"
static void register_header_check_steuer(file_stat_t *file_stat);
+static const char *extension_steuer2014="steuer2014";
+static const char *extension_steuer2015="steuer2015";
+static const char *extension_steuer2016="steuer2016";
+static const char *extension_steuer2017="steuer2017";
+static const char *extension_steuer2018="steuer2018";
+static const char *extension_steuer2019="steuer2019";
+static const char *extension_steuer2020="steuer2020";
const file_hint_t file_hint_steuer2014= {
.extension="steuer2014",
- .description="Steuer 2014/2015",
+ .description="Steuer 2014/...",
.max_filesize=100*1024*1024,
.recover=1,
.enable_by_default=1,
@@ -59,10 +66,30 @@ static int header_check_steuer(const unsigned char *buffer, const unsigned int b
return 0;
memset(&tm_time, 0, sizeof(struct tm));
reset_file_recovery(file_recovery_new);
- if(le32(h->version1)>=0x13)
- file_recovery_new->extension="steuer2015";
- else
- file_recovery_new->extension=file_hint_steuer2014.extension;
+ switch(le32(h->version1))
+ {
+ case 0x00 ... 0x12:
+ file_recovery_new->extension=extension_steuer2014;
+ break;
+ case 0x13:
+ file_recovery_new->extension=extension_steuer2015;
+ break;
+ case 0x14:
+ file_recovery_new->extension=extension_steuer2016;
+ break;
+ case 0x15:
+ file_recovery_new->extension=extension_steuer2017;
+ break;
+ case 0x16:
+ file_recovery_new->extension=extension_steuer2018;
+ break;
+ case 0x17:
+ file_recovery_new->extension=extension_steuer2019;
+ break;
+ default:
+ file_recovery_new->extension=extension_steuer2020;
+ break;
+ }
#ifdef HAVE_STRPTIME
strptime(h->date_string, "%b %d %Y %H:%M:%S", &tm_time);
file_recovery_new->time=mktime(&tm_time);