summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:12:36 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:12:36 +0100
commit622cb49d2d4125b74a9ac13eb77d6f42664c22b0 (patch)
tree01e8519f840aa6701b6adf2570f6db49c89114b5
parent8c5c6b34108ecf4ba0a647bb0511bba9059bc329 (diff)
New prototype for test_HFS()
-rw-r--r--src/hfs.c9
-rw-r--r--src/hfs.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/hfs.c b/src/hfs.c
index 46b7f04..203ed86 100644
--- a/src/hfs.c
+++ b/src/hfs.c
@@ -35,7 +35,7 @@
#include "fnctdsk.h"
#include "log.h"
-static int set_HFS_info(partition_t *partition, const hfs_mdb_t *hfs_mdb);
+static void set_HFS_info(partition_t *partition, const hfs_mdb_t *hfs_mdb);
int check_HFS(disk_t *disk_car,partition_t *partition,const int verbose)
{
@@ -83,7 +83,7 @@ int recover_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partitio
return 0;
}
-int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind)
+int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind)
{
/* Check for HFS signature */
if (hfs_mdb->drSigWord!=be16(HFS_SUPER_MAGIC))
@@ -117,19 +117,18 @@ int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,c
log_info("drAlBlSt %u\n",(unsigned) be16(hfs_mdb->drAlBlSt));
log_info("drFreeBks %u\n",(unsigned) be16(hfs_mdb->drFreeBks));
}
- partition->upart_type=UP_HFS;
return 0;
}
-static int set_HFS_info(partition_t *partition, const hfs_mdb_t *hfs_mdb)
+static void set_HFS_info(partition_t *partition, const hfs_mdb_t *hfs_mdb)
{
unsigned int name_size=sizeof(hfs_mdb->drVN)-1;
+ partition->upart_type=UP_HFS;
partition->blocksize=be32(hfs_mdb->drAlBlkSiz);
snprintf(partition->info, sizeof(partition->info),
"HFS blocksize=%u", partition->blocksize);
if(name_size>hfs_mdb->drVN[0])
name_size=hfs_mdb->drVN[0];
memcpy(partition->fsname,&hfs_mdb->drVN[0]+1,name_size);
- return 0;
}
diff --git a/src/hfs.h b/src/hfs.h
index a6767cb..9886916 100644
--- a/src/hfs.h
+++ b/src/hfs.h
@@ -76,7 +76,7 @@ struct hfs_mdb {
hfs_extent_rec drCTExtRec; /* 0x96 catalog B-tree's first 3 extents */
} __attribute__ ((gcc_struct, __packed__));
int check_HFS(disk_t *disk_car,partition_t *partition,const int verbose);
-int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind);
+int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb, const partition_t *partition, const int verbose, const int dump_ind);
int recover_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind, const int backup);
#ifdef __cplusplus