summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFran├žois Revol <revol@free.fr>2020-07-13 18:54:18 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2020-07-13 18:54:18 +0200
commit40d473abc9d2c5c99728c74607ba0d75b2126337 (patch)
tree6cd5a81362a88d7aee88189bcbc971b60984b0bd
parent5a937961e7c93dfad499c76aa0255139a644a94c (diff)
Add support for BeFS for EFI GPT and Mac partition table
-rw-r--r--src/bfs.c1
-rw-r--r--src/common.h4
-rw-r--r--src/partgpt.c8
-rw-r--r--src/partmac.c4
4 files changed, 17 insertions, 0 deletions
diff --git a/src/bfs.c b/src/bfs.c
index 7b740cb..44802ff 100644
--- a/src/bfs.c
+++ b/src/bfs.c
@@ -86,5 +86,6 @@ int recover_BeFS(const disk_t *disk_car, const struct disk_super_block *beos_blo
set_BeFS_info(beos_block, partition);
partition->part_size=le64(beos_block->num_blocks) << le32(beos_block->block_shift);
partition->part_type_i386=(unsigned char)P_BEOS;
+ partition->part_type_mac=PMAC_BEOS;
return 0;
}
diff --git a/src/common.h b/src/common.h
index aeecaf5..fbe6191 100644
--- a/src/common.h
+++ b/src/common.h
@@ -111,6 +111,7 @@ struct efi_guid_s
#define PMAC_FWDRIVER 5
#define PMAC_SWAP 0x82
#define PMAC_LINUX 0x83
+#define PMAC_BEOS 0xEB
#define PMAC_HFS 0xAF
#define PMAC_MAP 6
#define PMAC_PATCHES 7
@@ -232,6 +233,9 @@ struct efi_guid_s
#define GPT_ENT_TYPE_SOLARIS_RESERVED5 \
((const efi_guid_t){le32(0x6a8d2ac7),le16(0x1dd2),le16(0x11b2),0x96,0xa6,{0x08,0x00,0x20,0x73,0x66,0x31}})
+#define GPT_ENT_TYPE_BEOS_BFS \
+ ((const efi_guid_t){le32(0x42465331),le16(0x3ba3),le16(0x10f1),0x80,0x2a,{0x48,0x61,0x69,0x6b,0x75,0x21}})
+
#define TESTDISK_O_RDONLY 00
#define TESTDISK_O_RDWR 02
#define TESTDISK_O_DIRECT 040000
diff --git a/src/partgpt.c b/src/partgpt.c
index 89d51ba..3674a7a 100644
--- a/src/partgpt.c
+++ b/src/partgpt.c
@@ -56,6 +56,7 @@
#include "chgtype.h"
#include "partgpt.h"
#include "savehdr.h"
+#include "bfs.h"
#include "exfat.h"
#include "fat.h"
#include "hfs.h"
@@ -129,6 +130,7 @@ const struct systypes_gtp gpt_sys_types[] = {
{ GPT_ENT_TYPE_SOLARIS_RESERVED3, "Solaris Reserved3" },
{ GPT_ENT_TYPE_SOLARIS_RESERVED4, "Solaris Reserved4" },
{ GPT_ENT_TYPE_SOLARIS_RESERVED5, "Solaris Reserved5" },
+ { GPT_ENT_TYPE_BEOS_BFS, "BeFS"},
{ GPT_ENT_TYPE_UNUSED, NULL }
};
@@ -501,6 +503,12 @@ static int check_part_gpt(disk_t *disk, const int verbose,partition_t *partition
if(ret!=0)
screen_buffer_add("No HFS or HFS+ structure\n");
}
+ else if(guid_cmp(partition->part_type_gpt, GPT_ENT_TYPE_BEOS_BFS)==0)
+ {
+ ret=check_BeFS(disk, partition);
+ if(ret!=0)
+ screen_buffer_add("No BFS structure\n");
+ }
log_set_levels(old_levels);
if(ret!=0)
{
diff --git a/src/partmac.c b/src/partmac.c
index 36e5e19..c97cbac 100644
--- a/src/partmac.c
+++ b/src/partmac.c
@@ -68,6 +68,7 @@ static const struct systypes mac_sys_types[] = {
{ PMAC_FWDRIVER, "FWDriver" },
{ PMAC_SWAP, "Swap" },
{ PMAC_LINUX, "Linux" },
+ { PMAC_BEOS, "BeFS" },
{ PMAC_HFS, "HFS" },
{ PMAC_MAP, "partition_map" },
{ PMAC_PATCHES, "Patches" },
@@ -173,6 +174,8 @@ static list_part_t *read_part_mac(disk_t *disk_car, const int verbose, const int
new_partition->part_type_mac=PMAC_MFS;
else if(strcmp(dpme->dpme_type,"Apple_PRODOS")==0)
new_partition->part_type_mac=PMAC_PRODOS;
+ else if(strcmp(dpme->dpme_type,"Be_BFS")==0)
+ new_partition->part_type_mac=PMAC_BEOS;
else if(strcmp(dpme->dpme_type,"DOS_FAT_32")==0)
new_partition->part_type_mac=PMAC_FAT32;
else
@@ -353,6 +356,7 @@ static int check_part_mac(disk_t *disk_car,const int verbose,partition_t *partit
case PMAC_NewWorld:
case PMAC_DRIVER:
case PMAC_MFS:
+ case PMAC_BEOS:
case PMAC_PRODOS:
break;
case PMAC_LINUX: