summaryrefslogtreecommitdiffstats
path: root/src/analyse.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-08-12 20:38:12 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-08-12 20:38:12 +0200
commitde04a6886a6fb2dda1eb38c26691091f955a1918 (patch)
tree2309ec6e628ed1222bb64dcf18fec21838cfd772 /src/analyse.c
parenta1a86ea8e96e799c8e0c74e5fcddd97975b7190c (diff)
TestDisk: detects cramfs filesystem with offset 0
Diffstat (limited to 'src/analyse.c')
-rw-r--r--src/analyse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/analyse.c b/src/analyse.c
index 9201738..c901c9b 100644
--- a/src/analyse.c
+++ b/src/analyse.c
@@ -139,7 +139,9 @@ int search_FAT_backup(unsigned char *buffer, disk_t *disk, partition_t *partitio
int search_type_0(const unsigned char *buffer, disk_t *disk, partition_t *partition, const int verbose, const int dump_ind)
{
+ /* Expect a buffer filled with 8k to handle the SWAP detection */
const pv_disk_t *pv=(const pv_disk_t *)buffer;
+ const struct cramfs_super *cramfs=(const struct cramfs_super *)buffer;
const struct disk_fatx *fatx_block=(const struct disk_fatx*)buffer;
const struct disk_netware *netware_block=(const struct disk_netware *)buffer;
const struct exfat_super_block *exfat_header=(const struct exfat_super_block *)buffer;
@@ -206,6 +208,9 @@ int search_type_0(const unsigned char *buffer, disk_t *disk, partition_t *partit
if(memcmp(&wbfs->magic,"WBFS",4)==0 &&
recover_WBFS(disk, wbfs, partition, verbose, dump_ind)==0)
return 1;
+ if(cramfs->magic==le32(CRAMFS_MAGIC) &&
+ recover_cramfs(disk, cramfs, partition, verbose, dump_ind)==0)
+ return 1;
/* Try to locate logical partition that may host truecrypt encrypted filesystem */
if(buffer[0x1fe]==0x55 && buffer[0x1ff]==0xAA &&
recover_i386_logical(disk, buffer, partition)==0 &&