summaryrefslogtreecommitdiffstats
path: root/src/file_ptf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-02-25 14:15:49 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-02-25 14:15:49 +0100
commitbf584d2d814ac28f787006513668b2f1b7ec8d75 (patch)
tree91529e3a3a7bda89da0fba11d5b1be66853189c9 /src/file_ptf.c
parentfb8c132b70aec83c1a7cefcbe52e1d31ff0b109c (diff)
PhotoRec: recover .ptx Pro Tools session file
Diffstat (limited to 'src/file_ptf.c')
-rw-r--r--src/file_ptf.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/file_ptf.c b/src/file_ptf.c
index c2ba225..bbe24a9 100644
--- a/src/file_ptf.c
+++ b/src/file_ptf.c
@@ -43,14 +43,26 @@ const file_hint_t file_hint_ptf= {
static int header_check_ptf(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)
{
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_ptf.extension;
- return 1;
+ switch(buffer[0x12])
+ {
+ case 1:
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_ptf.extension;
+ return 1;
+ case 5:
+ if(memcmp(&buffer[0x2d], "Pro Tools", 9)!=0)
+ return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension="ptx";
+ return 1;
+ default:
+ return 0;
+ }
}
static void register_header_check_ptf(file_stat_t *file_stat)
{
- static const unsigned char ptf_header[19]= {
+ static const unsigned char ptf_header[18]= {
0x03, '0' , '0' , '1' , '0' , '1' , '1' , '1' ,
'1', '0' , '0' , '1' , '0' , '1' , '0' , '1' ,
'1', 0x00, 0x01