From f9500b9b19764cac4ed108d5e982a5ee67a91d0b Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Tue, 27 May 2014 21:53:55 +0200 Subject: [PATCH] Add files presents in .tar.bz2 but missing in git --- ChangeLog | 1 + photorec_64x64.png | Bin 0 -> 5429 bytes src/diskcp.c | 255 --------------------------------------------- src/fat_common.h | 36 +++++++ 4 files changed, 37 insertions(+), 255 deletions(-) create mode 100644 ChangeLog create mode 100644 photorec_64x64.png delete mode 100644 src/diskcp.c create mode 100644 src/fat_common.h diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..0b6eca93 --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +Use "git log" or consult http://git.cgsecurity.org/cgit/testdisk/ diff --git a/photorec_64x64.png b/photorec_64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..9e38dbdfefbfc5e9b20b5a092867917ec9904b36 GIT binary patch literal 5429 zcmV-570T*~P)KDG$#p#!ll$CpVyO_Qe9nLOeTlST=M^L(f2jiX#9wEeb1YZCUYqf4qrLW z)Bw`x{{etrWClu;A|)jSEEY>VM~oN&8yg##n3%xX*%@=^&J}+b8X77U2?FL-fj}_f z-w1#UwK&PeK7IO>7RKJ*o;-!|MN>&hiM~g4baY)TDhVqB{tW<_*A+Z4Fz~B{mNzLd z^7Hd08BxUN^WFa`00JZhrxy1;gqAi34<3yB_wUzI4f03zM**NFx$Cj9v1r}8^$!zX za{BxG*HsOd?+pN@>q6>DgnDpsarxrKH*3}ms;a7J*RCB}wQ5D{`-_@)53NK#&r1*xd0z_ybiMh~*XtckV={L>0M zS6SfD4ilU@)Dh>RjS+L%6wy~rvHOY%R$MfKZGJqYZe6-N8LQ6x`TR;9eg?Kp2Or2fv}}$plp8jR&W23^?ycp|acqmE2+YfMLkQ za3o>`PFMee2>w)@sG5bt?0E<)BXPmURfsA%jvHmSvAkdhB8n0*Dsdg$_AiE0zzjGH z8bBYTvepMD{y>CsJh7u< z61J51V8i>rkjKpdt8f)gzK=o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BIXbgGyl53b00000NkvXXu0mjfT_*-D literal 0 HcmV?d00001 diff --git a/src/diskcp.c b/src/diskcp.c deleted file mode 100644 index 76696ee5..00000000 --- a/src/diskcp.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - - File: diskcp.c - - Copyright (C) 2007 Christophe GRENIER - - 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 -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef HAVE_SYS_IOCTL_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include /* BLKFLSBUF */ -#endif -#ifdef HAVE_SYS_DISK_H -#include -#endif -#include "types.h" -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -enum { STATUS_NON_TRIED = '?', STATUS_NON_SPLIT = '/', STATUS_BAD_BLOCK = '-', STATUS_DONE = '+' }; - -const char *size_to_unit(uint64_t disk_size, char *buffer) -{ - if(disk_size<(uint64_t)10*1024) - sprintf(buffer,"%u B", (unsigned)disk_size); - else if(disk_size<(uint64_t)10*1024*1024) - sprintf(buffer,"%u KB / %u KiB", (unsigned)(disk_size/1000), (unsigned)(disk_size/1024)); - else if(disk_size<(uint64_t)10*1024*1024*1024) - sprintf(buffer,"%u MB / %u MiB", (unsigned)(disk_size/1000/1000), (unsigned)(disk_size/1024/1024)); - else if(disk_size<(uint64_t)10*1024*1024*1024*1024) - sprintf(buffer,"%u GB / %u GiB", (unsigned)(disk_size/1000/1000/1000), (unsigned)(disk_size/1024/1024/1024)); - else - sprintf(buffer,"%u TB / %u TiB", (unsigned)(disk_size/1000/1000/1000/1000), (unsigned)(disk_size/1024/1024/1024/1024)); - return buffer; -} - -int main(int argc, char **argv) -{ - int i; - int readsize; - int readsize_min; - int readsize_max; - uint64_t readok=0; - uint64_t location; - uint64_t old_status_location=0; - int old_status=STATUS_DONE; - int sector_size=512; - int current_disk=0; - int first_disk; - int nbr_disk=0; - int disk_src[1]; - int disk_dst; - FILE *log; - char *buffer; - uint64_t disk_size=0; - int gap=-1; - if(argc<=2) - { - printf("disk_cp src dst\n"); - return 1; - } - /* O_DIRECT ? */ - if((disk_src[nbr_disk++]=open(argv[1],O_LARGEFILE|O_RDONLY|O_BINARY))<0) - { - printf("Can't open file %s\n",argv[1]); - return 1; - } - if((disk_dst=open(argv[2],O_LARGEFILE|O_RDWR|O_BINARY|O_CREAT,0644))<0) - { - printf("Can't open file %s\n",argv[2]); - return 1; - } - { - void *res; - uint64_t longsectors64=0; - if (ioctl(disk_src[0], BLKGETSIZE64, &longsectors64)>=0) - { - disk_size=longsectors64; - } - readsize_min=sector_size; - /* 1,2,4,8,16,32 */ - readsize_max=16*sector_size; - readsize=readsize_min; - first_disk=current_disk; - if(posix_memalign(&res,4096,readsize_max)!=0) - { - printf("posix_memalign failed\n"); - close(disk_dst); - return 1; - } - buffer=(char*)res; - } - if(1==2) - { - if((log=fopen("diskcp.log","w"))==NULL) - { - printf("Can't create diskcp.log file\n"); - return 1; - } - /* It may be possible to improve the speed by using readv, a ttl (or a timestamp) may be used for bad disks */ - for(location=0;location=start[nbr];location-=readsize_min) - { - - } - } - } - } - fclose(log); - fclose(oldlog); - } - - /* Pass 3: read */ - for(i=0;i + + 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. + + */ +#ifndef _FAT_COMMON_H +#define _FAT_COMMON_H +#ifdef __cplusplus +extern "C" { +#endif +unsigned int fat_get_cluster_from_entry(const struct msdos_dir_entry *entry); +int is_fat_directory(const unsigned char *buffer); +unsigned int get_dir_entries(const struct fat_boot_sector *fat_header); +unsigned int fat_sector_size(const struct fat_boot_sector *fat_header); +unsigned int fat_sectors(const struct fat_boot_sector *fat_header); + +#ifdef __cplusplus +} /* closing brace for extern "C" */ +#endif +#endif