summaryrefslogtreecommitdiffstats
path: root/src/file_zip.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-11-01 11:13:27 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-11-01 11:13:27 +0100
commit3718ffa3328b530ad61bba2007842716201b89a2 (patch)
treeee26ce4ec629e929af51ab6aebf9cf910420e815 /src/file_zip.c
parent650b7d41e93b08100d22d386f5d123d971c4884e (diff)
PhotoRec: record last valid offset of a file, will be usefull for bruteforce
Diffstat (limited to 'src/file_zip.c')
-rw-r--r--src/file_zip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/file_zip.c b/src/file_zip.c
index 9bd06e9..b147d05 100644
--- a/src/file_zip.c
+++ b/src/file_zip.c
@@ -482,9 +482,11 @@ static void file_check_zip(file_recovery_t *fr)
fseek(fr->handle, 0, SEEK_SET);
fr->file_size = 0;
fr->offset_error=0;
+ fr->offset_ok=0;
while (1)
{
+ uint64_t file_size_old;
uint32_t header;
int status;
@@ -504,6 +506,7 @@ static void file_check_zip(file_recovery_t *fr)
log_flush();
#endif
fr->file_size += 4;
+ file_size_old=fr->file_size;
switch (header)
{
@@ -550,6 +553,7 @@ static void file_check_zip(file_recovery_t *fr)
/* Only end of central dir is end of archive, 64b version of it is before */
if (header==ZIP_END_CENTRAL_DIR)
return;
+ fr->offset_ok=file_size_old;
}
}