summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-04-14 17:47:56 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-04-14 17:47:56 +0200
commit45f7713904c8cd88d7e4c9a1b6ddcff956d7a305 (patch)
tree8b5834fcd0b652c38ea1f7a6c80012531254bdd6
parent66038c1fb70d3c8f5af723fd7c777a0af5f47166 (diff)
Add Apple APFS and Extended Boot Partition
-rw-r--r--src/common.h5
-rw-r--r--src/partgpt.c15
-rw-r--r--src/parti386.c1
3 files changed, 21 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index c031222..67645f5 100644
--- a/src/common.h
+++ b/src/common.h
@@ -122,6 +122,9 @@ struct efi_guid_s
((const efi_guid_t){le32(0x00000000),le16(0x0000),le16(0x0000),0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}})
#define GPT_ENT_TYPE_EFI \
((const efi_guid_t){le32(0xc12a7328),le16(0xf81f),le16(0x11d2),0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}})
+/* Extended Boot Partition */
+#define GPT_ENT_TYPE_EBP \
+ ((const efi_guid_t){le32(0xbc13c2ff),le16(0x59e6),le16(0x4262),0xa3,0x52,{0xb2,0x75,0xfd,0x6f,0x71,0x72}})
#define GPT_ENT_TYPE_MBR \
((const efi_guid_t){le32(0x024dee41),le16(0x33e7),le16(0x11d3),0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}})
#define GPT_ENT_TYPE_FREEBSD \
@@ -174,6 +177,8 @@ struct efi_guid_s
#define GPT_ENT_TYPE_HPUX_SERVICE \
((const efi_guid_t){le32(0xe2a1e728),le16(0x32e3),le16(0x11d6),0xa6,0x82,{0x7b,0x03,0xa0,0x00,0x00,0x00}})
+#define GPT_ENT_TYPE_MAC_AFS \
+ ((const efi_guid_t){le32(0x7c3457ef),le16(0x0000),le16(0x11aa),0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}})
#define GPT_ENT_TYPE_MAC_HFS \
((const efi_guid_t){le32(0x48465300),le16(0x0000),le16(0x11aa),0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}})
#define GPT_ENT_TYPE_MAC_UFS \
diff --git a/src/partgpt.c b/src/partgpt.c
index 806ac75..0652a09 100644
--- a/src/partgpt.c
+++ b/src/partgpt.c
@@ -78,6 +78,7 @@ static const char *get_gpt_typename(const efi_guid_t part_type_gpt);
const struct systypes_gtp gpt_sys_types[] = {
{ GPT_ENT_TYPE_EFI, "EFI System" },
+ { GPT_ENT_TYPE_EBP, "Extended Boot" },
{ GPT_ENT_TYPE_MBR, "MBR" },
{ GPT_ENT_TYPE_FREEBSD, "FreeBSD" },
{ GPT_ENT_TYPE_FREEBSD_SWAP, "FreeBSD Swap" },
@@ -90,6 +91,7 @@ const struct systypes_gtp gpt_sys_types[] = {
{ GPT_ENT_TYPE_MS_LDM_METADATA, "MS LDM MetaData" },
{ GPT_ENT_TYPE_MS_LDM_DATA, "MS LDM Data" },
{ GPT_ENT_TYPE_MS_RECOVERY, "Windows Recovery Env" },
+// { GPT_ENT_TYPE_LINUX_DATA
{ GPT_ENT_TYPE_LINUX_RAID, "Linux Raid" },
{ GPT_ENT_TYPE_LINUX_SWAP, "Linux Swap" },
{ GPT_ENT_TYPE_LINUX_LVM, "Linux LVM" },
@@ -99,6 +101,7 @@ const struct systypes_gtp gpt_sys_types[] = {
{ GPT_ENT_TYPE_LINUX_DATA, "Linux filesys. data" },
{ GPT_ENT_TYPE_HPUX_DATA, "HPUX Data" },
{ GPT_ENT_TYPE_HPUX_SERVICE, "HPUX Service" },
+ { GPT_ENT_TYPE_MAC_AFS, "Apple APFS" },
{ GPT_ENT_TYPE_MAC_HFS, "Mac HFS" },
{ GPT_ENT_TYPE_MAC_UFS, "Mac UFS" },
{ GPT_ENT_TYPE_MAC_RAID, "Mac Raid" },
@@ -511,6 +514,18 @@ static const char *get_gpt_typename(const efi_guid_t part_type_gpt)
for(i=0; gpt_sys_types[i].name!=NULL; i++)
if(guid_cmp(gpt_sys_types[i].part_type, part_type_gpt)==0)
return gpt_sys_types[i].name;
+ log_info("%8x %04x %04x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ part_type_gpt.time_low,
+ part_type_gpt.time_mid,
+ part_type_gpt.time_hi_and_version,
+ part_type_gpt.clock_seq_hi_and_reserved,
+ part_type_gpt.clock_seq_low,
+ part_type_gpt.node[0],
+ part_type_gpt.node[1],
+ part_type_gpt.node[2],
+ part_type_gpt.node[3],
+ part_type_gpt.node[4],
+ part_type_gpt.node[5]);
return NULL;
}
diff --git a/src/parti386.c b/src/parti386.c
index 350a38b..2c334b1 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -199,6 +199,7 @@ static const struct systypes i386_sys_types[] = {
{0xe1, "SpeedStor FAT12 ext"},
{0xe3, "DOS RO"},
{0xe4, "SpeedStor FAT16 ext"},
+ {0xea, "Boot (BLS)"},
{P_BEOS, "BeFS"},
{0xee, "EFI GPT"}, /* Intel EFI GUID Partition Table */
{0xef, "EFI (FAT-12/16/32)"},/* Intel EFI System Partition */