Question: I am trying to write this python program out: The first partition entry is located at the address 1BE (hex). Print out the status byte
I am trying to write this python program out: The first partition entry is located at the address 1BE (hex). Print out the status byte (1 byte located at the starting address), the partition type (1 byte located at the address 1BE + 4) and the address of the first sector in the partition (1BE + 8). Below is my code. Did I write this out correctly?
import struct
mbr = bytearray()
with open("block.dd", "rb") as f:
mbr = f.read(2048)
status = mbr[0x1BE]
result = struct.unpack("
print(result)
result = mbr[0x1BE]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
