PhotoRec: add support for
- Ahnenblatt .ahn - Microsoft Dynamics NAV (MS Navision) fbk/fdb/fob - Wink .wnk - tcpdump capture file .pcap
This commit is contained in:
parent
5a12cb2d50
commit
2b648d3b4d
8 changed files with 426 additions and 10 deletions
|
@ -17,9 +17,8 @@ fs_C = analyse.c bfs.c bsd.c cramfs.c fat.c fatx.c ext2.c jfs.c hfs.c hfsp.c l
|
|||
fs_H = analyse.h bfs.h bsd.h cramfs.h fat.h fatx.h ext2.h jfs_superblock.h jfs.h hfs.h hfsp.h luks.h lvm.h md.h netware.h ntfs.h rfs.h savehdr.h sun.h swap.h sysv.h ufs.h xfs.h
|
||||
|
||||
testdisk_SOURCES = testdisk.c $(base_C) $(base_H) $(fs_C) $(fs_H) testdisk.h adv.c adv.h dir.c dir.h dirpart.c dirpart.h edit.c edit.h ext2_dir.c ext2_dir.h ext2_inc.h fat_adv.c fat_adv.h fat_dir.c fat_dir.h geometry.c godmode.c godmode.h intrface.c intrface.h ntfs_adv.c ntfs_dir.c ntfs_dir.h ntfs_fix.c ntfs_inc.h rfs_dir.c rfs_dir.h $(ICON_TESTDISK) next.c next.h dimage.c dimage.h
|
||||
#ntfs_udl.c ntfs_udl.h
|
||||
|
||||
photorec_SOURCES = photorec.c photorec.h phcfg.c phcfg.h phrecn.c phrecn.h dir.c dir.h ext2grp.c ext2grp.h ext2p.c ext2p.h ext2_dir.c ext2_dir.h ext2_inc.h fat_dir.c fat_dir.h fatp.c fatp.h filegen.c filegen.h file_7z.c file_a.c file_ab.c file_ace.c file_aif.c file_all.c file_als.c file_amd.c file_amr.c file_arj.c file_asf.c file_asm.c file_au.c file_bkf.c file_bld.c file_bmp.c file_bz2.c file_cab.c file_cam.c file_chm.c file_cm.c file_crw.c file_ctg.c file_cwk.c file_dat.c file_dbf.c file_dim.c file_dir.c file_djv.c file_doc.c file_dpx.c file_drw.c file_ds2.c file_dsc.c file_dss.c file_dta.c file_dump.c file_dv.c file_dwg.c file_elf.c file_emf.c file_evt.c file_exe.c pe.h file_ext.c file_fcp.c file_fcs.c file_fh10.c file_fh5.c file_fits.c file_flac.c file_flv.c file_frm.c file_fs.c file_gho.c file_gif.c file_gpg.c file_gz.c file_ifo.c file_imb.c file_indd.c file_iso.c file_itu.c file_jpg.c file_jpg.h file_kdb.c file_lnk.c file_m2ts.c file_max.c file_mb.c file_mcd.c file_mdb.c file_mdf.c file_mfg.c file_mid.c file_mkv.c file_mov.c file_mp3.c file_mpg.c file_mrw.c file_mus.c file_mysql.c file_njx.c file_ogg.c file_one.c file_orf.c file_paf.c file_pap.c file_pct.c file_pcx.c file_pdf.c file_pfx.c file_png.c file_prc.c file_prt.c file_ps.c file_psd.c file_psp.c file_pst.c file_ptb.c file_qbb.c file_qdf.c file_qxd.c file_ra.c file_raf.c file_rar.c file_raw.c file_rdc.c file_reg.c file_res.c file_riff.c file_rm.c file_rns.c file_rpm.c file_sib.c file_sit.c file_skp.c file_spe.c file_spss.c file_sql.c file_stl.c file_stu.c file_swf.c file_tar.c file_tar.h file_tib.c file_tiff.c file_tph.c file_txt.c file_vmdk.c file_wpd.c file_wmf.c file_x3f.c file_xcf.c file_xm.c file_xsv.c file_veg.c file_wks.c file_zip.c memmem.h geometry.c list.c list.h ole.h ntfs_dir.c ntfs_dir.h ntfsp.c ntfsp.h ntfs_inc.h sessionp.c sessionp.h $(base_C) $(base_H) $(fs_C) $(fs_H) $(ICON_PHOTOREC)
|
||||
photorec_SOURCES = photorec.c photorec.h phcfg.c phcfg.h phrecn.c phrecn.h dir.c dir.h ext2grp.c ext2grp.h ext2p.c ext2p.h ext2_dir.c ext2_dir.h ext2_inc.h fat_dir.c fat_dir.h fatp.c fatp.h filegen.c filegen.h file_7z.c file_a.c file_ab.c file_ace.c file_ahn.c file_aif.c file_all.c file_als.c file_amd.c file_amr.c file_arj.c file_asf.c file_asm.c file_au.c file_bkf.c file_bld.c file_bmp.c file_bz2.c file_cab.c file_cam.c file_chm.c file_cm.c file_crw.c file_ctg.c file_cwk.c file_dat.c file_dbf.c file_dim.c file_dir.c file_djv.c file_doc.c file_dpx.c file_drw.c file_ds2.c file_dsc.c file_dss.c file_dta.c file_dump.c file_dv.c file_dwg.c file_elf.c file_emf.c file_evt.c file_exe.c pe.h file_ext.c file_fcp.c file_fcs.c file_fbk.c file_fdb.c file_fh10.c file_fh5.c file_fits.c file_flac.c file_flv.c file_fob.c file_frm.c file_fs.c file_gho.c file_gif.c file_gpg.c file_gz.c file_ifo.c file_imb.c file_indd.c file_iso.c file_itu.c file_jpg.c file_jpg.h file_kdb.c file_lnk.c file_m2ts.c file_max.c file_mb.c file_mcd.c file_mdb.c file_mdf.c file_mfg.c file_mid.c file_mkv.c file_mov.c file_mp3.c file_mpg.c file_mrw.c file_mus.c file_mysql.c file_njx.c file_ogg.c file_one.c file_orf.c file_paf.c file_pap.c file_pcap.c file_pct.c file_pcx.c file_pdf.c file_pfx.c file_png.c file_prc.c file_prt.c file_ps.c file_psd.c file_psp.c file_pst.c file_ptb.c file_qbb.c file_qdf.c file_qxd.c file_ra.c file_raf.c file_rar.c file_raw.c file_rdc.c file_reg.c file_res.c file_riff.c file_rm.c file_rns.c file_rpm.c file_sib.c file_sit.c file_skp.c file_spe.c file_spss.c file_sql.c file_stl.c file_stu.c file_swf.c file_tar.c file_tar.h file_tib.c file_tiff.c file_tph.c file_txt.c file_veg.c file_vmdk.c file_wks.c file_wmf.c file_wnk.c file_wpd.c file_x3f.c file_xcf.c file_xm.c file_xsv.c file_zip.c memmem.h geometry.c list.c list.h ole.h ntfs_dir.c ntfs_dir.h ntfsp.c ntfsp.h ntfs_inc.h sessionp.c sessionp.h $(base_C) $(base_H) $(fs_C) $(fs_H) $(ICON_PHOTOREC)
|
||||
|
||||
#diskcp_SOURCES = diskcp.c types.h
|
||||
|
||||
|
|
65
src/file_ahn.c
Normal file
65
src/file_ahn.c
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
|
||||
File: file_ahn.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
#include "memmem.h"
|
||||
|
||||
static void register_header_check_ahn(file_stat_t *file_stat);
|
||||
static int header_check_ahn(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);
|
||||
|
||||
const file_hint_t file_hint_ahn= {
|
||||
.extension="ahn",
|
||||
.description="Ahnenblatt",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_ahn
|
||||
};
|
||||
|
||||
static const unsigned char ahn_header[4] = {'d','b','f',0x00};
|
||||
static const unsigned char ahn_magic[10] = {'A','H','N','E','N','B','L','A','T','T'};
|
||||
|
||||
static void register_header_check_ahn(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(8, ahn_magic, sizeof(ahn_magic), &header_check_ahn, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_ahn(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, ahn_header, sizeof(ahn_header))==0 &&
|
||||
memcmp(&buffer[8], ahn_magic, sizeof(ahn_magic))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_ahn.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
63
src/file_fbk.c
Normal file
63
src/file_fbk.c
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
|
||||
File: file_fbk.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
#include "memmem.h"
|
||||
|
||||
static void register_header_check_fbk(file_stat_t *file_stat);
|
||||
static int header_check_fbk(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);
|
||||
|
||||
const file_hint_t file_hint_fbk= {
|
||||
.extension="fbk",
|
||||
.description="Microsoft Dynamics NAV (MS Navision)",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_fbk
|
||||
};
|
||||
|
||||
static const unsigned char fbk_header[10] = {'T','a','b','l','e','D','a','t','a',' '};
|
||||
|
||||
static void register_header_check_fbk(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(0, fbk_header, sizeof(fbk_header), &header_check_fbk, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_fbk(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, fbk_header, sizeof(fbk_header))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_fbk.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
66
src/file_fdb.c
Normal file
66
src/file_fdb.c
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
|
||||
File: file_fdb.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
#include "memmem.h"
|
||||
|
||||
static void register_header_check_fdb(file_stat_t *file_stat);
|
||||
static int header_check_fdb(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);
|
||||
|
||||
const file_hint_t file_hint_fdb= {
|
||||
.extension="fdb",
|
||||
.description="Microsoft Dynamics NAV (MS Navision)",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_fdb
|
||||
};
|
||||
|
||||
static const unsigned char fdb_header[7] = { 0x00, 0x00, 0x00, 0x5c, 0xa0, 0x83, 0x02};
|
||||
|
||||
static void register_header_check_fdb(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(5, fdb_header, sizeof(fdb_header), &header_check_fdb, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_fdb(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(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
|
||||
file_recovery->file_stat->file_hint==&file_hint_fdb)
|
||||
return 0;
|
||||
if(memcmp(&buffer[5], fdb_header, sizeof(fdb_header))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_fdb.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
85
src/file_fob.c
Normal file
85
src/file_fob.c
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
|
||||
File: file_fob.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
#include "memmem.h"
|
||||
|
||||
static void register_header_check_fob(file_stat_t *file_stat);
|
||||
static int header_check_fob(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);
|
||||
|
||||
const file_hint_t file_hint_fob= {
|
||||
.extension="fob",
|
||||
.description="Microsoft Dynamics NAV (MS Navision)",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_fob
|
||||
};
|
||||
|
||||
static const unsigned char sign_navnl[5] = {'N','A','V','N','L'};
|
||||
static const unsigned char sign_navw[4] = {'N','A','V','W'};
|
||||
static const unsigned char magic_codeunit[9] = {'C','o','d','e','u','n','i','t',' '};
|
||||
static const unsigned char magic_dataport[9] = {'D','a','t','a','p','o','r','t',' '};
|
||||
static const unsigned char magic_form[5] = {'F','o','r','m',' '};
|
||||
static const unsigned char magic_menusuite[10] = {'M','e','n','u','S','u','i','t','e',' '};
|
||||
static const unsigned char magic_report[7] = {'R','e','p','o','r','t',' '};
|
||||
static const unsigned char magic_table[6] = {'T','a','b','l','e',' '};
|
||||
static const unsigned char magic_xmlport[8] = {'X','M','L','p','o','r','t',' '};
|
||||
|
||||
static void register_header_check_fob(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(0, magic_codeunit, sizeof(magic_codeunit), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_dataport, sizeof(magic_dataport), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_form, sizeof(magic_form), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_menusuite, sizeof(magic_menusuite), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_report, sizeof(magic_report), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_table, sizeof(magic_table), &header_check_fob, file_stat);
|
||||
register_header_check(0, magic_xmlport, sizeof(magic_xmlport), &header_check_fob, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_fob(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, magic_codeunit, sizeof(magic_codeunit))==0 ||
|
||||
memcmp(buffer, magic_dataport, sizeof(magic_dataport))==0 ||
|
||||
memcmp(buffer, magic_form, sizeof(magic_form))==0 ||
|
||||
memcmp(buffer, magic_menusuite, sizeof(magic_menusuite))==0 ||
|
||||
memcmp(buffer, magic_report, sizeof(magic_report))==0 ||
|
||||
memcmp(buffer, magic_table, sizeof(magic_table))==0 ||
|
||||
memcmp(buffer, magic_xmlport, sizeof(magic_xmlport))==0) &&
|
||||
(td_memmem(buffer, buffer_size, sign_navnl, sizeof(sign_navnl))!=NULL ||
|
||||
td_memmem(buffer, buffer_size, sign_navw, sizeof(sign_navw))!=NULL))
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_fob.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
64
src/file_pcap.c
Normal file
64
src/file_pcap.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
|
||||
File: file_pcap.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
#include "memmem.h"
|
||||
|
||||
static void register_header_check_pcap(file_stat_t *file_stat);
|
||||
static int header_check_pcap(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);
|
||||
|
||||
const file_hint_t file_hint_pcap= {
|
||||
.extension="pcap",
|
||||
.description="tcpdump capture file",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_pcap
|
||||
};
|
||||
|
||||
static const unsigned char pcap_header[4] = {0xd4, 0xc3, 0xb2, 0xa1};
|
||||
/* pcap low-endian header */
|
||||
|
||||
static void register_header_check_pcap(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(0, pcap_header, sizeof(pcap_header), &header_check_pcap, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_pcap(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, pcap_header, sizeof(pcap_header))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_pcap.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
62
src/file_wnk.c
Normal file
62
src/file_wnk.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
|
||||
File: file_wnk.c
|
||||
|
||||
Copyright (C) 2008 Christophe GRENIER <grenier@cgsecurity.org>
|
||||
|
||||
This software is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write the Free Software Foundation, Inc., 51
|
||||
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "filegen.h"
|
||||
|
||||
static void register_header_check_wnk(file_stat_t *file_stat);
|
||||
static int header_check_wnk(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);
|
||||
|
||||
const file_hint_t file_hint_wnk= {
|
||||
.extension="wnk",
|
||||
.description="Wink",
|
||||
.min_header_distance=0,
|
||||
.max_filesize=PHOTOREC_MAX_FILE_SIZE,
|
||||
.recover=1,
|
||||
.enable_by_default=1,
|
||||
.register_header_check=®ister_header_check_wnk
|
||||
};
|
||||
|
||||
static const unsigned char wnk_header[6]= {'R','P','K','W','I',0x02};
|
||||
|
||||
static void register_header_check_wnk(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(0, wnk_header,sizeof(wnk_header), &header_check_wnk, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_wnk(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, wnk_header, sizeof(wnk_header))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_wnk.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -102,6 +102,7 @@ extern const file_hint_t file_hint_a;
|
|||
extern const file_hint_t file_hint_accdb;
|
||||
extern const file_hint_t file_hint_ace;
|
||||
extern const file_hint_t file_hint_addressbook;
|
||||
extern const file_hint_t file_hint_ahn;
|
||||
extern const file_hint_t file_hint_aif;
|
||||
extern const file_hint_t file_hint_all;
|
||||
extern const file_hint_t file_hint_als;
|
||||
|
@ -142,17 +143,21 @@ extern const file_hint_t file_hint_emf;
|
|||
extern const file_hint_t file_hint_evt;
|
||||
extern const file_hint_t file_hint_exe;
|
||||
extern const file_hint_t file_hint_ext2_sb;
|
||||
extern const file_hint_t file_hint_fbk;
|
||||
extern const file_hint_t file_hint_fcp;
|
||||
extern const file_hint_t file_hint_fcs;
|
||||
extern const file_hint_t file_hint_fdb;
|
||||
extern const file_hint_t file_hint_fh10;
|
||||
extern const file_hint_t file_hint_fh5;
|
||||
extern const file_hint_t file_hint_fits;
|
||||
extern const file_hint_t file_hint_flac;
|
||||
extern const file_hint_t file_hint_fasttxt;
|
||||
extern const file_hint_t file_hint_flv;
|
||||
extern const file_hint_t file_hint_fob;
|
||||
extern const file_hint_t file_hint_frm;
|
||||
extern const file_hint_t file_hint_fs;
|
||||
extern const file_hint_t file_hint_gif;
|
||||
extern const file_hint_t file_hint_gho;
|
||||
extern const file_hint_t file_hint_gif;
|
||||
extern const file_hint_t file_hint_gpg;
|
||||
extern const file_hint_t file_hint_gz;
|
||||
extern const file_hint_t file_hint_ifo;
|
||||
|
@ -184,6 +189,7 @@ extern const file_hint_t file_hint_one;
|
|||
extern const file_hint_t file_hint_orf;
|
||||
extern const file_hint_t file_hint_paf;
|
||||
extern const file_hint_t file_hint_pap;
|
||||
extern const file_hint_t file_hint_pcap;
|
||||
extern const file_hint_t file_hint_pct;
|
||||
extern const file_hint_t file_hint_pcx;
|
||||
extern const file_hint_t file_hint_pdf;
|
||||
|
@ -223,17 +229,17 @@ extern const file_hint_t file_hint_tar;
|
|||
extern const file_hint_t file_hint_tib;
|
||||
extern const file_hint_t file_hint_tiff;
|
||||
extern const file_hint_t file_hint_tph;
|
||||
extern const file_hint_t file_hint_fasttxt;
|
||||
extern const file_hint_t file_hint_txt;
|
||||
extern const file_hint_t file_hint_veg;
|
||||
extern const file_hint_t file_hint_vmdk;
|
||||
extern const file_hint_t file_hint_wpd;
|
||||
extern const file_hint_t file_hint_wks;
|
||||
extern const file_hint_t file_hint_wmf;
|
||||
extern const file_hint_t file_hint_wnk;
|
||||
extern const file_hint_t file_hint_wpd;
|
||||
extern const file_hint_t file_hint_x3f;
|
||||
extern const file_hint_t file_hint_xcf;
|
||||
extern const file_hint_t file_hint_xm;
|
||||
extern const file_hint_t file_hint_xsv;
|
||||
extern const file_hint_t file_hint_veg;
|
||||
extern const file_hint_t file_hint_wks;
|
||||
extern const file_hint_t file_hint_zip;
|
||||
|
||||
static alloc_data_t *update_search_space(const file_recovery_t *file_recovery, alloc_data_t *list_search_space, alloc_data_t **new_current_search_space, uint64_t *offset, const unsigned int blocksize);
|
||||
|
@ -810,6 +816,7 @@ int main( int argc, char **argv )
|
|||
{ .enable=0, .file_hint=&file_hint_accdb},
|
||||
{ .enable=0, .file_hint=&file_hint_ace },
|
||||
{ .enable=0, .file_hint=&file_hint_addressbook},
|
||||
{ .enable=0, .file_hint=&file_hint_ahn },
|
||||
{ .enable=0, .file_hint=&file_hint_aif },
|
||||
{ .enable=0, .file_hint=&file_hint_all },
|
||||
{ .enable=0, .file_hint=&file_hint_als },
|
||||
|
@ -850,13 +857,16 @@ int main( int argc, char **argv )
|
|||
{ .enable=0, .file_hint=&file_hint_evt },
|
||||
{ .enable=0, .file_hint=&file_hint_exe },
|
||||
{ .enable=0, .file_hint=&file_hint_ext2_sb },
|
||||
{ .enable=0, .file_hint=&file_hint_fbk },
|
||||
{ .enable=0, .file_hint=&file_hint_fcp },
|
||||
{ .enable=0, .file_hint=&file_hint_fcs },
|
||||
{ .enable=0, .file_hint=&file_hint_fdb },
|
||||
{ .enable=0, .file_hint=&file_hint_fh10 },
|
||||
{ .enable=0, .file_hint=&file_hint_fh5 },
|
||||
{ .enable=0, .file_hint=&file_hint_fits },
|
||||
{ .enable=0, .file_hint=&file_hint_flac },
|
||||
{ .enable=0, .file_hint=&file_hint_flv },
|
||||
{ .enable=0, .file_hint=&file_hint_fob },
|
||||
{ .enable=0, .file_hint=&file_hint_frm },
|
||||
{ .enable=0, .file_hint=&file_hint_fs },
|
||||
{ .enable=0, .file_hint=&file_hint_gho },
|
||||
|
@ -892,6 +902,7 @@ int main( int argc, char **argv )
|
|||
{ .enable=0, .file_hint=&file_hint_orf },
|
||||
{ .enable=0, .file_hint=&file_hint_paf },
|
||||
{ .enable=0, .file_hint=&file_hint_pap },
|
||||
{ .enable=0, .file_hint=&file_hint_pcap },
|
||||
{ .enable=0, .file_hint=&file_hint_pct },
|
||||
{ .enable=0, .file_hint=&file_hint_pcx },
|
||||
{ .enable=0, .file_hint=&file_hint_pdf },
|
||||
|
@ -934,14 +945,15 @@ int main( int argc, char **argv )
|
|||
{ .enable=0, .file_hint=&file_hint_fasttxt },
|
||||
{ .enable=0, .file_hint=&file_hint_txt },
|
||||
{ .enable=0, .file_hint=&file_hint_vmdk },
|
||||
{ .enable=0, .file_hint=&file_hint_wpd },
|
||||
{ .enable=0, .file_hint=&file_hint_veg },
|
||||
{ .enable=0, .file_hint=&file_hint_wks },
|
||||
{ .enable=0, .file_hint=&file_hint_wmf },
|
||||
{ .enable=0, .file_hint=&file_hint_wnk },
|
||||
{ .enable=0, .file_hint=&file_hint_wpd },
|
||||
{ .enable=0, .file_hint=&file_hint_x3f },
|
||||
{ .enable=0, .file_hint=&file_hint_xcf },
|
||||
{ .enable=0, .file_hint=&file_hint_xm },
|
||||
{ .enable=0, .file_hint=&file_hint_xsv },
|
||||
{ .enable=0, .file_hint=&file_hint_veg },
|
||||
{ .enable=0, .file_hint=&file_hint_wks },
|
||||
{ .enable=0, .file_hint=&file_hint_zip },
|
||||
{ .enable=0, .file_hint=NULL }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue