summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-03-05 19:24:34 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-03-05 19:24:34 +0100
commit65b2dc616792fe8f60477b0b013b8570d6928f0f (patch)
tree26e49adcf2faeabc1a2db0a874c660b0bad6d2ad /src
parent5c67e7303952a382a0b4b4e50d83cfb480bc483d (diff)
PhotoRec: Limit file size to 4G when recovering from a FAT
Diffstat (limited to 'src')
-rw-r--r--src/phrecn.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/phrecn.c b/src/phrecn.c
index 4b64a7a..12e938e 100644
--- a/src/phrecn.c
+++ b/src/phrecn.c
@@ -56,6 +56,7 @@
#include <winbase.h>
#endif
#include "dir.h"
+#include "fat.h"
#include "fat_dir.h"
#include "list.h"
#include "lang.h"
@@ -390,6 +391,12 @@ static int photorec_aux(disk_t *disk_car, partition_t *partition, const int verb
log_verbose("File should not be bigger than %llu, stop adding data\n",
(long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
}
+ if(res!=2 && file_recovery.file_size + blocksize >= PHOTOREC_MAX_SIZE_32 && is_fat(partition))
+ {
+ res=2;
+ log_verbose("File should not be bigger than %llu, stop adding data\n",
+ (long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
+ }
if(res==2)
{
alloc_data_t *datanext;
@@ -505,6 +512,13 @@ static void recovery_finished(disk_t *disk, const partition_t *partition, const
{
case 0:
wprintw(stdscr,"Recovery completed.");
+ if(file_nbr > 0)
+ {
+ wmove(stdscr, 12, 0);
+ wprintw(stdscr, "You are welcome to donate to support further development and encouragement");
+ wmove(stdscr, 13, 0);
+ wprintw(stdscr, "http://www.cgsecurity.org/wiki/Donation");
+ }
break;
case 1:
wprintw(stdscr,"Recovery aborted by the user.");