Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The purpose of this assignment is to write a program to extract partition inform

ID: 3878823 • Letter: T

Question

The purpose of this assignment is to write a program to extract partition information from a disk image that
follows a certain standard. In class, we looked at the MBR specification and how it encodes information
about disks and partitions. For this assignment you will have to read the documented specification for the
GUID Partition Table (GPT) standard (which is slowly replacing the traditional MBR format); use the
Wikipedia link (https://en.wikipedia.org/wiki/GUID_Partition_Table) since it contains all the information
needed to complete this assignment.


Description


Write a C/C++ program called GPTInfo that reads an acquired disk image file to perform the following
tasks.


1) Verify that the GPT signature is present; if not present, your program should display an error
message and exit.


2) Print the disk GUID in hex notation.


3) LBA addresses for the following:
a) first usable LBA for user partitions
b) last usable LBA for user partitions
c) starting LBA where partition entries begin


4) Number of partition entries.


5) Size of each partition entry.


Then for each partition, it should print the following information.


6) The partition type GUID (make sure you print it in the proper XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX
format). You may want to check your printed result with the GUIDs listed in the
Wikipedia link; it should match one of them.


7) First and last LBA addresses of the partition.


8) Attribute flags in hex notation.


9) The name of the partition.


Unless otherwise specified, all numeric values should be printed in the decimal format followed by hex
notation. Make sure there is proper byte-level padding when printing hex values. E.g. the decimal number
10 should be printed as 10 (0x0A) and decimal number 320 should be printed as 320 (0x0140).
When reading the specification, pay attention to how values are stored (its usually little endian unless
stated).


Do not attempt to read the entire disk image file to a memory array. Acquired disk images can easily be
multiple gigabytes in size.


You must fully comment your program.

Upload your GPTInfo.cpp (or .c) file to Canvas.

Explanation / Answer

APHeader.c

===================================================================================

APHeader.h

====================================================================================

BinExtractor.c

====================================================================================

BinExtractor.h

===============================================================================

GPT.c

==================================================================================

GPT.h