diff --git a/Makefile.am b/Makefile.am index 7f41dd24..0ccabc1b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -80,6 +80,18 @@ extras: extrasstatic: $(MAKE) LDFLAGS="$(LDFLAGS) -static" LIBS="$(PTHREAD_LIBS) $(LIBS)" CFLAGS="$(PTHREAD_CFLAGS) $(CFLAGS)" CXXFLAGS="$(PTHREAD_CFLAGS) $(CXXFLAGS)" extras +session_doc.framac: src/file_doc.c src/common.c src/filegen.c src/log.c src/setdate.c + gcc -W -Wall -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I. $^ + frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ + +session_id3.framac: src/file_mp3.c src/common.c src/filegen.c src/log.c + gcc -W -Wall -DMAIN_id3 -DHAVE_CONFIG_H -O -o demo -I. $^ + frama-c $^ -cpp-extra-args="-DMAIN_id3 -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ + +session_jpg.framac: src/file_jpg.c src/common.c src/filegen.c src/log.c src/suspend_no.c src/setdate.c + gcc -W -Wall -DMAIN_jpg -DHAVE_CONFIG_H -O -o demo -I. $^ -ljpeg + frama-c $^ -cpp-extra-args="-DMAIN_jpg -DHAVE_CONFIG_H -D__x86_64__ -I/usr/include -I $(frama-c -print-path)/libc" $(FRAMA_C_FLAGS) -save $@ + session_tiff_be.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c src/common.c src/filegen.c src/log.c gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^ frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ @@ -88,14 +100,6 @@ session_tiff_le.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c sr gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^ frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ -session_id3.framac: src/file_mp3.c src/common.c src/filegen.c src/log.c - gcc -W -Wall -DMAIN_id3 -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_id3 -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ - -session_doc.framac: src/file_doc.c src/common.c src/filegen.c src/log.c src/setdate.c - gcc -W -Wall -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ - session_%.framac: src/file_%.c src/common.c src/filegen.c src/log.c gcc -W -Wall -DMAIN_$* -DHAVE_CONFIG_H -O -o demo -I. $^ frama-c $^ -cpp-extra-args="-DMAIN_$* -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ diff --git a/configure.ac b/configure.ac index 388e9529..40ee68dc 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_INIT([testdisk],[7.2-WIP],[grenier@cgsecurity.org]) AC_LANG(C) sinclude(acx_pthread.m4) sinclude(mkdir.m4) -TESTDISKDATE="July 2019" +TESTDISKDATE="November 2019" AC_SUBST(TESTDISKDATE) AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release]) AC_CONFIG_AUX_DIR(config) diff --git a/src/file_exe.c b/src/file_exe.c index dd82e253..ade58b0e 100644 --- a/src/file_exe.c +++ b/src/file_exe.c @@ -912,7 +912,7 @@ int main() file_stats.file_hint=&file_hint_exe; file_stats.not_recovered=0; file_stats.recovered=0; - file_hint_exe.register_header_check(&file_stats); + register_header_check_exe(&file_stats); if(header_check_exe(buffer, BLOCKSIZE, 0u, &file_recovery, &file_recovery_new)!=1) return 0; /*@ assert valid_read_string((char *)&fn); */ diff --git a/src/file_m2ts.c b/src/file_m2ts.c index ca3a7bf5..3a8a4568 100644 --- a/src/file_m2ts.c +++ b/src/file_m2ts.c @@ -120,7 +120,7 @@ static int header_check_m2ts(const unsigned char *buffer, const unsigned int buf if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_m2ts && (file_recovery->data_check==&data_check_ts_192 || - file_recovery->blocksize < 5)) + file_recovery_new->blocksize < 5)) { header_ignored(file_recovery_new); return 0; diff --git a/src/file_mp3.c b/src/file_mp3.c index 65950a14..25d688ac 100644 --- a/src/file_mp3.c +++ b/src/file_mp3.c @@ -665,7 +665,7 @@ int main() file_stats.file_hint=&file_hint_mp3; file_stats.not_recovered=0; file_stats.recovered=0; - file_hint_mp3.register_header_check(&file_stats); + register_header_check_mp3(&file_stats); if(header_check_id3(buffer, BLOCKSIZE, 0u, &file_recovery, &file_recovery_new) != 1) return 0; /*@ assert valid_read_string((char *)&fn); */ diff --git a/src/setdate.c b/src/setdate.c index d05e7168..5e26e1ac 100644 --- a/src/setdate.c +++ b/src/setdate.c @@ -49,10 +49,12 @@ int set_date(const char *pathname, time_t actime, time_t modtime) return -1; ut.actime = actime; ut.modtime = modtime; +#ifndef __FRAMAC__ if (utime(pathname, &ut)) { log_error("ERROR: Couldn't set the file's date and time for %s\n", pathname); return -1; } +#endif #endif return 0; }