当前位置: 首页>>代码示例>>C++>>正文


C++ reset_file_recovery函数代码示例

本文整理汇总了C++中reset_file_recovery函数的典型用法代码示例。如果您正苦于以下问题:C++ reset_file_recovery函数的具体用法?C++ reset_file_recovery怎么用?C++ reset_file_recovery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了reset_file_recovery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的reset_file_recovery函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。