本文整理汇总了C++中reset_file_recovery函数的典型用法代码示例。如果您正苦于以下问题:C++ reset_file_recovery函数的具体用法?C++ reset_file_recovery怎么用?C++ reset_file_recovery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reset_file_recovery函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: header_check_amr
static int header_check_amr(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,amr_header,sizeof(amr_header))==0)
{
reset_file_recovery(file_recovery_new);
#if 0
file_recovery_new->calculated_file_size=6;
file_recovery_new->data_check=&data_check_amr;
file_recovery_new->file_check=&file_check_size;
#endif
file_recovery_new->extension=file_hint_amr.extension;
return 1;
}
return 0;
}
开发者ID:Eemaa26,项目名称:photorec-testdisk,代码行数:15,代码来源:file_amr.c
示例2: header_check_vmdk3
static int header_check_vmdk3(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 VMDK3Header *hdr=(const VMDK3Header *)buffer;
const unsigned int cluster_sectors = le32(hdr->granularity);
if(cluster_sectors==0)
return 0;
reset_file_recovery(file_recovery_new);
#ifdef DJGPP
file_recovery_new->extension="vmd";
#else
file_recovery_new->extension=file_hint_vmdk.extension;
#endif
file_recovery_new->min_filesize=512;
return 1;
}
开发者ID:mdhowle,项目名称:testdisk,代码行数:15,代码来源:file_vmdk.c
示例3: header_check_dbx
static int header_check_dbx(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 uint64_t size=(uint64_t)buffer[DBX_SIZE_POINTER] +
(((uint64_t)buffer[DBX_SIZE_POINTER+1])<<8) +
(((uint64_t)buffer[DBX_SIZE_POINTER+2])<<16) +
(((uint64_t)buffer[DBX_SIZE_POINTER+3])<<24);
if(size < DBX_SIZE_POINTER + 4)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension="dbx";
file_recovery_new->calculated_file_size=size;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:15,代码来源:file_pst.c
示例4: header_check_reg_9x
static int header_check_reg_9x(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 struct creg_file_header*header=(const struct creg_file_header*)buffer;
if(le32(header->rgdb_offset)+4 > buffer_size)
return 0;
{
const struct rgdb_block*block=(const struct rgdb_block*)(buffer+le32(header->rgdb_offset));
if(memcmp(block,"RGDB",4)!=0)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->min_filesize=0x1000;
file_recovery_new->extension=file_hint_reg.extension;
return 1;
}
}
开发者ID:Ctrlshiftm,项目名称:ICU,代码行数:15,代码来源:file_reg.c
示例5: header_check_psd
static int header_check_psd(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,psd_header,sizeof(psd_header))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->min_filesize=70;
file_recovery_new->extension=file_hint_psd.extension;
/* File header */
file_recovery_new->calculated_file_size=0x1a;
file_recovery_new->data_check=&psd_skip_color_mode;
file_recovery_new->file_check=&file_check_psd;
return 1;
}
return 0;
}
开发者ID:Tom9X,项目名称:TestDisk,代码行数:15,代码来源:file_psd.c
示例6: header_check_a
static int header_check_a(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 const unsigned char a_header_debian[14] = { '!','<','a','r','c','h','>','\n','d','e','b','i','a','n'};
static const char magic[2]= { 0x60, 0x0a};
const struct file_header *fh=(const struct file_header *)&buffer[8];
if(memcmp(fh->magic, magic, 2)!=0)
return 0;
/* http://en.wikipedia.org/wiki/Ar_%28Unix%29 */
reset_file_recovery(file_recovery_new);
if(memcmp(buffer,a_header_debian,sizeof(a_header_debian))==0)
file_recovery_new->extension="deb";
else
file_recovery_new->extension=file_hint_a.extension;
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:15,代码来源:file_a.c
示例7: header_check_ldf
static int header_check_ldf(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(buffer[0x00]==0x01 && buffer[0x01]==0x0f && buffer[0x02]==0x00 && buffer[0x03]==0x00 &&
buffer[0x08]==0x00 && buffer[0x09]==0x00 && buffer[0x0a]==0x00 && buffer[0x0b]==0x00 &&
buffer[0x0c]==0x00 && buffer[0x0d]==0x00 && buffer[0x0e]==0x00 && buffer[0x0f]==0x00 &&
buffer[0x10]==0x00 && buffer[0x11]==0x00 && buffer[0x12]==0x00 && buffer[0x13]==0x00 &&
buffer[0x14]==0x00 && buffer[0x15]==0x00 && buffer[0x16]==0x02 && buffer[0x17]==0x00 &&
buffer[0x18]==0x63 && buffer[0x19]==0x00 && buffer[0x1A]==0x00 && buffer[0x1B]==0x00)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_ldf.extension;
return 1;
}
return 0;
}
开发者ID:AndychenCL,项目名称:TestDisk,代码行数:15,代码来源:file_ldf.c
示例8: header_check_dxf
static int header_check_dxf(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_dxf, sizeof(header_dxf))==0 ||
memcmp(buffer, header_dxf_dos, sizeof(header_dxf_dos))==0 ||
memcmp(buffer, header_dxflib, sizeof(header_dxflib))==0 ||
memcmp(buffer, header_dxflib_dos, sizeof(header_dxflib_dos))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_dxf.extension;
file_recovery_new->data_check=&data_check_dxf;
file_recovery_new->file_check=&file_check_dxf;
return 1;
}
return 0;
}
开发者ID:Tom9X,项目名称:TestDisk,代码行数:15,代码来源:file_dxf.c
示例9: header_check_png
static int header_check_png(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)
{
/* SolidWorks files contains a png */
if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_doc &&
(strcmp(file_recovery->extension,"sld")==0 ||
strcmp(file_recovery->extension,"sldprt")==0))
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_png.extension;
file_recovery_new->calculated_file_size=8;
file_recovery_new->data_check=&data_check_png;
file_recovery_new->file_check=&file_check_size;
return 1;
}
开发者ID:Eemaa26,项目名称:photorec-testdisk,代码行数:15,代码来源:file_png.c
示例10: header_check_le16_txt
static int header_check_le16_txt(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)
{
unsigned int i;
for(i=0; i+1 < buffer_size; i+=2)
{
if(!( buffer[i+1]=='\0' && (isprint(buffer[i]) || buffer[i]=='\n' || buffer[i]=='\r' || buffer[i]==0xbb)))
{
if(i<40)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->calculated_file_size=i;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
file_recovery_new->extension="utf16";
return 1;
}
}
reset_file_recovery(file_recovery_new);
file_recovery_new->calculated_file_size=i;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
file_recovery_new->extension="utf16";
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:24,代码来源:file_txt.c
示例11: header_check_fit
static int header_check_fit(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 struct fits_header* h = (const struct fits_header *)buffer;
if (h->header_size < 12)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension = file_hint_fit.extension;
file_recovery_new->min_filesize = 12;
file_recovery_new->calculated_file_size=(uint64_t)le32(h->data_size) + h->header_size;
if(h->header_size >= 14)
file_recovery_new->calculated_file_size+=2; /* CRC at the end of the file */
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
}
开发者ID:cgsecurity,项目名称:testdisk,代码行数:15,代码来源:file_fit.c
示例12: header_check_rx2
static int header_check_rx2(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[0], rx2_header, sizeof(rx2_header))==0 &&
memcmp(&buffer[8], "REX2HEAD", 8)==0)
{
const struct rx2_header *rx2=(const struct rx2_header *)buffer;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_rx2.extension;
file_recovery_new->calculated_file_size=(uint64_t)be32(rx2->size)+8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
}
return 0;
}
开发者ID:Eemaa26,项目名称:photorec-testdisk,代码行数:15,代码来源:file_rx2.c
示例13: header_check_xmp
static int header_check_xmp(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(buffer[35]=='\0')
return 0;
if(file_recovery->file_stat!=NULL &&
(file_recovery->file_stat->file_hint==&file_hint_pdf ||
file_recovery->file_stat->file_hint==&file_hint_tiff))
return 0;
/* Adobe's Extensible Metadata Platform */
reset_file_recovery(file_recovery_new);
file_recovery_new->data_check=&data_check_txt;
file_recovery_new->file_check=&file_check_size;
file_recovery_new->extension="xmp";
return 1;
}
开发者ID:mdhowle,项目名称:testdisk,代码行数:15,代码来源:file_txt.c
示例14: header_check_xfs_inode
static int header_check_xfs_inode(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 xfs_dinode_core_t *inode=(const xfs_dinode_core_t *)buffer;
if(safe_header_only>0)
return 0;
if(inode->di_version!=2 ||
inode->di_pad[0]!=0 || inode->di_pad[1]!=0 ||
inode->di_pad[2]!=0 || inode->di_pad[3]!=0 ||
inode->di_pad[4]!=0 || inode->di_pad[5]!=0 ||
inode->di_pad[6]!=0 || inode->di_pad[7]!=0)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_xfs.extension;
file_recovery_new->data_check=&data_check_stopasap;
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:16,代码来源:file_xfs.c
示例15: header_check_aif
static int header_check_aif(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 struct aif_header *hdr=(const struct aif_header *)buffer;
if(be32(hdr->ckSize)<4)
return 0;
if(buffer[8]=='A' && buffer[9]=='I' && buffer[10]=='F' && (buffer[11]=='F' || buffer[11]=='C'))
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_aif.extension;
file_recovery_new->calculated_file_size=be32(hdr->ckSize)+8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
}
return 0;
}
开发者ID:Ctrlshiftm,项目名称:ICU,代码行数:16,代码来源:file_aif.c
示例16: header_check_wv
static int header_check_wv(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 WavpackHeader *wv=(const WavpackHeader*)buffer;
if(le32(wv->block_index)!=0)
return 0;
if(sizeof(WavpackHeader) > le32(wv->ckSize)+8)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_wv.extension;
file_recovery_new->min_filesize=le32(wv->ckSize)+8;
if(file_recovery_new->blocksize < 8)
return 1;
file_recovery_new->data_check=&data_check_wv;
file_recovery_new->file_check=&file_check_size;
return 1;
}
开发者ID:cgsecurity,项目名称:testdisk,代码行数:16,代码来源:file_wv.c
示例17: header_check_bac
static int header_check_bac(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 struct block_header *hdr=(const struct block_header *)buffer;
if(be32(hdr->BlockSize) < 0x18)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_bac.extension;
file_recovery_new->min_filesize=be32(hdr->BlockSize);
file_recovery_new->calculated_file_size=0;
if(file_recovery_new->blocksize >= 0x18)
{
file_recovery_new->data_check=&data_check_bac;
file_recovery_new->file_check=&file_check_size;
}
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:16,代码来源:file_bac.c
示例18: header_check_dex
static int header_check_dex(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 struct dex_header *dex=(const struct dex_header*)buffer;
if(!isdigit(buffer[4]) || !isdigit(buffer[5]) || !isdigit(buffer[6]) || buffer[7]!=0x00)
return 0;
if(le32(dex->header_size) < 0x28)
return 0;
if(le32(dex->header_size) >= le32(dex->file_size))
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_dex.extension;
file_recovery_new->calculated_file_size=le32(dex->file_size);
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:16,代码来源:file_dex.c
示例19: header_check_flv
static int header_check_flv(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 struct flv_header *flv=(const struct flv_header *)buffer;
if((flv->type_flags & 0xfa)==0 && be32(flv->data_offset)>=9)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_flv.extension;
if(file_recovery_new->blocksize < 15)
return 1;
file_recovery_new->calculated_file_size=be32(flv->data_offset);
file_recovery_new->data_check=&data_check_flv;
file_recovery_new->file_check=&file_check_size;
return 1;
}
return 0;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:16,代码来源:file_flv.c
示例20: header_check_tiff_le_new
static int header_check_tiff_le_new(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 char raf_fp[15]={0x49, 0x49, 0x2a, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xf0, 0x0d, 0x00, 0x01};
const char *potential_error=NULL;
const TIFFHeader *header=(const TIFFHeader *)buffer;
if((uint32_t)le32(header->tiff_diroff) < sizeof(TIFFHeader))
return 0;
/* Avoid a false positiv with some RAF files */
if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_raf &&
memcmp(buffer, raf_fp, 15)==0)
{
header_ignored(file_recovery_new);
return 0;
}
if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_jpg)
{
header_ignored(file_recovery_new);
return 0;
}
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_tiff.extension;
/* Canon RAW */
if(buffer[8]=='C' && buffer[9]=='R' && buffer[10]==2)
file_recovery_new->extension="cr2";
else if(find_tag_from_tiff_header_le(header, buffer_size, TIFFTAG_DNGVERSION, &potential_error)!=NULL)
{
/* Adobe Digital Negative, ie. NIKON D50 */
file_recovery_new->extension="dng";
}
else
{
const char *tag_make;
tag_make=find_tag_from_tiff_header_le(header, buffer_size, TIFFTAG_MAKE, &potential_error);
if(tag_make!=NULL && tag_make >= (const char *)buffer && tag_make < (const char *)buffer + buffer_size - 20)
{
if(strcmp(tag_make, "SONY")==0)
file_recovery_new->extension="sr2";
else if(strncmp(tag_make, "SONY ",5)==0)
file_recovery_new->extension="arw";
}
}
file_recovery_new->time=get_date_from_tiff_header(header, buffer_size);
file_recovery_new->file_check=&file_check_tiff;
return 1;
}
开发者ID:AndrewSmart,项目名称:testdisk,代码行数:47,代码来源:file_tiff.c
注:本文中的reset_file_recovery函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论