Main Page | Data Structures | Directories | File List | Data Fields | Globals

# gpt.h

    00001 /*
    00002  * The Sleuth Kit
    00003  *
    00004  * $Date: 2007/04/19 19:01:34 $
    00005  *
    00006  * Brian Carrier [carrier@sleuthkit.org]
    00007  * Copyright (c) 2004-2005 Brian Carrier.  All rights reserved
    00008  *
    00009  */
    00010
    00011 #ifndef _GPT_H
    00012 #define _GPT_H
    00013
    00014 #ifdef __cplusplus
    00015 extern "C" {
    00016 #endif
    00017
    00018 /* Partition type in the safety DOS partition table */
    00019 #define GPT_PART_SOFFSET        0
    00020 #define GPT_DOS_TYPE    0xEE
    00021
    00022
    00023
    00024 /* This is located in sector 1 of the disk */
    00025 #define GPT_HEAD_OFFSET 1
    00026 #define GPT_HEAD_SIG    0x5452415020494645ULL
    00027
    00028     typedef struct {
    00029         uint8_t signature[8];   /* EFI PART */
    00030         uint8_t version[4];
    00031         uint8_t head_size_b[4]; /* size of partition header */
    00032         uint8_t head_crc[4];    /* crc of header */
    00033         uint8_t f1[4];
    00034         uint8_t head_lba[8];    /* lba of this header */
    00035         uint8_t head2_lba[8];   /* lba of second header */
    00036         uint8_t partarea_start[8];      /* lba of partition area start */
    00037         uint8_t partarea_end[8];        /* lba of partition area end */
    00038         uint8_t guid[16];       /* disk GUID */
    00039         uint8_t tab_start_lba[8];       /* lba of table start */
    00040         uint8_t tab_num_ent[4]; /* num of table entries */
    00041         uint8_t tab_size_b[4];  /* size of each table entry */
    00042         uint8_t tab_crc[4];     /* crc of table */
    00043         uint8_t f2[420];
    00044     } gpt_head;
    00045
    00046
    00047 /* The location of this is specified in the header - tab_start */
    00048     typedef struct {
    00049         uint8_t type_guid[16];  /* partition type guid */
    00050         uint8_t id_guid[16];    /* unique partition GUID */
    00051         uint8_t start_lba[8];   /* Starting lba of part */
    00052         uint8_t end_lba[8];     /* end lba of part */
    00053         uint8_t flags[8];       /* flags */
    00054         uint8_t name[72];       /* name in unicode */
    00055     } gpt_entry;
    00056
    00057
    00058 #ifdef __cplusplus
    00059 }
    00060 #endif
    00061 #endif