Modifying GPT

GPT – Guid Partition Table

PGPT – (Partition GPT)

EFI Bootloader – The Extensible Firmware Interface partition located inside PGPT that contains properties about the GPT Partitions.

Importing PGPT File

  • You can load a PGPT file without loading a scatter file.
  • If you are going load a PGPT file only, you must specify the size of the memory (Device EMMC or NAND) and create a partition for “PRELOADER” and “PGPT” with following steps from 1 – 6.
  • If you are going to load PGPT with a Scatter File, make sure the scatter file is loaded first and it does not have any issues. You don’t need steps 1-6 and you should see step 7 right away.
  1. Import PGPT – Click the triple dot button to import a pgpt file.
  2. Estimate the memory size
  3. After that, It will ask you where “PRELOADER” partition is located. Select the “_EMPTY_” partition to create a new preloader partition.
  4. Enter the size that you want (Commonly, the Size should be 0x400000 which is equivalent to 4MB). The position must be 0x0.
  5. Then it will ask you where PGPT partition is located. If you cannot locate any possible PGPT partition, you have to select “_EMPTY_” partition in order create a new one.
  6. Enter Size in Sector as 1024. Position must remain unchanged. When your done, click ok to continue.
  7. Check the “Scatter“,”PGPT” and “MBR” tabs and should it should look like the following images below.
    • Scatter tab
    • MBR tab 
    • PGPT tab 

Modifying PGPT File

  • Add from Scatter – adds a partition to the GPT by referring it to partition from scatter file. Ignore the type of partition which has no effect at all. GUID is automatically generated.
  • Delete Partition – deletes the GPT partition.
  • EFI Bootloader – (located at the right side panel of the image above.) – This is the modification of the “EFI Part” of the PGPT file. It contains the following Sub Categories.
    • Design – Category with one property(Name). This property if modified will only accept a maximum of 8 characters.
    • Layout – This category pertains to the actual data that is represented which can be changed by entering an Integer or Hexadecimal value. All values here must be divisible by 512 as Integer or 0x200 as Hexadecimal value. If you are going to modify values in this category, it will directly affect values on Sector category.
    • Sector – This category pertains to the raw data that is encoded. By default, every sectors have 512 bytes in it. So if you are going to modify values from this category, it will surely affect the values from Layout Category.
    • Unknown Properties – This are the properties that are unknown to me. If you know some of this, please let me know.

Understanding EFI Bootloader (EFI Part)

The things discussed on this part of the topic are not clear enough. I myself does not fully understand all the values encoded in this area of PGPT. If someone could give some info or reference, it would be a great help.

The illustration above describes the ‘EFI PART’ on PGPT file. The ‘EE’ on Master Bootrecord (above EFI PART) represents the partition as GPT. The “01 00 00 00” might represent the offset to “EFI Part”. The “ff bf d5 01” is similar to the value on EFI’s Bootloader Size. Therefore, if you try to modify the MBR’s GPT partition, you have to change the size of the EFI Bootloader which is less than or equal to the value of MBR’s GPT Partition Size. Likewise to the offset but the offset of “EFI Part” must be equal to the MBR’s GPT Partition Offset.

  • The Bootloader Size Property is the Size of the PGPT file.
  • The GPT Meta Offset is the offset of GPT’s Partitions.
  • The Flashable Size is the Sum the size of all GPT’s Patitions combined.