Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error on QNX bootloader when trying to open MBR
Browse files Browse the repository at this point in the history
Schamper committed Nov 27, 2023
1 parent 47db0bd commit 7db14e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dissect/volume/disk/schemes/mbr.py
Original file line number Diff line number Diff line change
@@ -45,7 +45,10 @@ def __init__(self, fh: BinaryIO, sector_size: int = 512):
# This sucks but don't have a better way atm
sig = self.mbr.bootcode[3:11]
if any([v in sig for v in [b"MSDOS", b"MSWIN", b"NTFS", b"FAT", b"EXFAT", b"-FVE-FS-"]]):
raise DiskError("Sector is a filesystem VBR, not a MBR")
raise DiskError("Sector is a filesystem VBR, not an MBR")

Check warning on line 48 in dissect/volume/disk/schemes/mbr.py

Codecov / codecov/patch

dissect/volume/disk/schemes/mbr.py#L48

Added line #L48 was not covered by tests

if self.mbr.bootcode[18:38] == b"Hit Esc for .altboot" or self.mbr.bootcode[168:174] == b"\r\nQNX ":
raise DiskError("Sector is a QNX Boot Sector, not an MBR")

Check warning on line 51 in dissect/volume/disk/schemes/mbr.py

Codecov / codecov/patch

dissect/volume/disk/schemes/mbr.py#L51

Added line #L51 was not covered by tests

self.partitions: list[Partition] = list(self._partitions(self.mbr, self.offset))

0 comments on commit 7db14e5

Please sign in to comment.