summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--NEWS2
-rw-r--r--README4
-rw-r--r--src/file_type.c50
4 files changed, 50 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index cc7ca15..bfabe37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
- new : functions for RPM; DBF; XCF(Gimp); ESRI and CDF
+
+0.3.0.pv1 new : functions for RPM; DBF; XCF(Gimp); ESRI; DjVu and CDF
change : DEB; ZIP; TTF; Gnumeric; some Perl and Python files
Optimization for text based files (not completed yet)
diff --git a/NEWS b/NEWS
index 707edc4..4962570 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+ext4magic 0.3.0 pv1 New features for restoring Gimp images, many of document formats and
+ enhancements to recover text-based files.
ext4magic 0.3.0 pv0 Contains the first experimental version of the magic function for ext4
diff --git a/README b/README
index 4291a63..d7f41f1 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for ext4magic V-0.2.2
+README for ext4magic V-0.3.x
=============================
1.0 Accidentally deleted files
@@ -224,7 +224,7 @@ This works only correct for a limited time if you continue to write into the fil
Extensive testing has confirmed that magic-scan-functions are now stable with libmagic.so >= version 5.04.
Good support exists for: many text file types, a lot of image formats,
- often-used video and audio file types, Open Office documents,
+ often-used video and audio file types, Office documents,
PDF, RAR, TAR, CPIO, BZ2, ZIP, GZIP, 7Z ...
Many other file types are also found and restored with default function, but without examining
diff --git a/src/file_type.c b/src/file_type.c
index e053ce7..1efaa65 100644
--- a/src/file_type.c
+++ b/src/file_type.c
@@ -3782,6 +3782,45 @@ int file_iff(unsigned char *buf, int *size, __u32 scan , int flag, struct found_
return ret;
}
+//DjVu
+int file_djvu(unsigned char *buf, int *size, __u32 scan , int flag, struct found_data_t* f_data){
+ int i,ret = 0;
+ __u32 ssize;
+ char token[5];
+ char type[] = "DJVU DJVM DJVI THUM ";
+
+ switch (flag){
+ case 0 :
+ if ((f_data->size) && (f_data->inode->i_size >= f_data->size)) {
+ ssize = ((f_data->size-1) % current_fs->blocksize) +1;
+ if (f_data->inode->i_size > (f_data->size - ssize)){
+ *size = ssize;
+ ret =1;
+ }
+ }
+ break;
+ case 1 :
+ return (scan & (M_IS_META | M_CLASS_1 )) ? 0 :1 ;
+ break;
+
+ case 2 :
+ if ((buf[0]==0x41) && (buf[1]==0x54) && (buf[2] ==0x26) && (buf[3]==0x54)
+ && (buf[4]==0x46) && (buf[5]==0x4f) && (buf[6] ==0x52) && (buf[7]==0x4d)){
+ for (i=0;i<4;i++)
+ token[i]=buf[i+12];
+ token[i] = 0;
+ if(strstr(type,token)){
+ f_data->size = (buf[8]<<24) + (buf[9]<<16) + (buf[10]<<8) + buf[11] + 12;
+ f_data->scantype = DATA_LENGTH ;
+ ret =1;
+ }
+ }
+ break;
+ }
+return ret;
+}
+
+
struct pcx_priv_t {
__u16 width;
__u16 height;
@@ -6004,7 +6043,7 @@ static int follow_cdf(unsigned char *buf, __u16 blockcount, __u32 *offset, __u32
(priv->extra_FAT_blocks)--;
}
else{
- printf("ERROR CDF Extra FAT: %lu \n",priv-> s_offset);
+// printf("ERROR CDF Extra FAT: %lu \n",priv-> s_offset);
ret = 0;
}
break;
@@ -6025,7 +6064,7 @@ static int follow_cdf(unsigned char *buf, __u16 blockcount, __u32 *offset, __u32
}
}
else {
- printf("ERROR CDF Extra FAT: %lu \n",priv-> s_offset);
+// printf("ERROR CDF Extra FAT: %lu \n",priv-> s_offset);
ret = 0;
}
break;
@@ -6064,7 +6103,6 @@ static int follow_cdf(unsigned char *buf, __u16 blockcount, __u32 *offset, __u32
break;
case 0x10 :
if (zero_space(buf, f_offset)){
- printf("Ende: %lu \n",priv-> s_offset);
ret = 2;
}
else{
@@ -6072,7 +6110,7 @@ static int follow_cdf(unsigned char *buf, __u16 blockcount, __u32 *offset, __u32
ret = 2;
}
else{
- printf("CDF ERROR Ende: %lu \n",priv-> s_offset);
+// printf("ERROR CDF EOF: %lu \n",priv-> s_offset);
ret = 0;
}
}
@@ -7637,7 +7675,7 @@ void get_file_property(struct found_data_t* this){
break;
case 0x0120 : //x-dbf
-//FIXME this->func = file_dbf ;
+ this->func = file_dbf ;
strncat(this->name,".dbf",7);
break;
@@ -8026,7 +8064,7 @@ void get_file_property(struct found_data_t* this){
break;
case 0x0308 : //vnd.djvu
- // this->func = file_vnd.djvu ;
+ this->func = file_djvu ;
strncat(this->name,".djvu",7);
break;