NationalSecurityAgency/ghidra · error · IOException

No system partitions found. Perhaps the decryption failed?

Error message

No system partitions found. Perhaps the decryption failed?

What it means

DmgFileReader drives a PartitionSystemRecognizer over the (possibly decrypted) random-access stream; if no recognizable partition scheme (MBR/GPT/APM/etc.) is detected, getPartitionSystem() returns null and this IOException is thrown. The message explicitly suggests decryption failure, because the most common cause is a silently-bad decryption producing bytes that no partition recognizer accepts.

Source

Thrown at GPL/DMG/src/dmg/java/mobiledevices/dmg/reader/DmgFileReader.java:79

		System.err.println("Trying to detect UDIF structure...");
		if (UDIFRecognizer.isUDIF(rras)) {
			System.err.println("UDIF structure found! Creating filter stream...");

			UDIFFile udifFile = new UDIFFile(new ReadableFileStream(file.getAbsolutePath()));
			debug(udifFile.getView().getPlistData(), "dmg-xml");

			UDIFRandomAccessStream stream = new UDIFRandomAccessStream(rras);
			rras = stream;
		}
		else {
			System.err.println("UDIF structure not found. Proceeding...");
		}

		PartitionSystemRecognizer partitionSystemRecognizer = new PartitionSystemRecognizer(rras);
		PartitionSystem partitionSystem = partitionSystemRecognizer.getPartitionSystem();

		if (partitionSystem == null) {
			throw new IOException("No system partitions found. Perhaps the decryption failed?");
		}

		Partition[] partitions = partitionSystem.getUsedPartitionEntries();
		for (Partition partition : partitions) {
			openPartition(partition);
		}
	}

	private void debug(byte[] plistData, String fileName) {
		// TODO Auto-generated method stub
	}

	private void openPartition(Partition selectedPartition) throws IOException {
		long fsOffset = selectedPartition.getStartOffset();//getPmPyPartStart()+selectedPartition.getPmLgDataStart())*blockSize;
		long fsLength = selectedPartition.getLength();//getPmDataCnt()*blockSize;

		FileSystemRecognizer fsr = new FileSystemRecognizer(rras, fsOffset);
		FileSystemRecognizer.FileSystemType fsType = fsr.detectFileSystem();

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Confirm the DMG is encrypted and, if so, that the decryption key and decryption step ran successfully before partition recognition.
  2. Verify the input is actually a DMG disk image (check the koly/trailer UDIF signature) and is not truncated.
  3. If the image is a raw filesystem (no partition table), route it directly to the filesystem reader instead of the partition recognizer.
  4. Re-download / re-extract the DMG and confirm checksums.

Example fix

// before
PartitionSystem ps = new PartitionSystemRecognizer(rras).getPartitionSystem();
if (ps == null) throw new IOException("No system partitions found...");

// after - distinguish encryption vs. raw-image cases
if (!decryptedSuccessfully) {
    throw new IOException("DMG decryption did not complete; cannot recognize partitions");
}
PartitionSystem ps = new PartitionSystemRecognizer(rras).getPartitionSystem();
if (ps == null) {
    throw new IOException("No partition table recognized; if this is a raw filesystem image, open it directly");
}
Defensive patterns

Strategy: validation

Validate before calling

// Before partition recognition, confirm the stream is plausibly a decrypted, partitioned image
if (!decryptedSuccessfully) {
    throw new IOException("Cannot recognize partitions: DMG decryption not completed successfully");
}
// Optionally probe the first sector for known partition-map signatures
byte[] head = new byte[512];
rras.readFully(0, head);
boolean looksPartitioned = (head[510] == 0x55 && head[511] == (byte) 0xAA) /* MBR */
    || (head[0] == 'E' && head[1] == 'R') /* APM */
    || "EFI PART".equals(new String(head, 512, 8)); /* GPT - would need offset 512 */
if (!looksPartitioned) {
    throw new IOException("No partition-map signature found; image may be raw or undecrypted");
}

Type guard

boolean isLikelyPartitioned(byte[] firstSector) {
    return (firstSector[510] & 0xFF) == 0x55 && (firstSector[511] & 0xFF) == 0xAA;
}

Try / catch

try {
    new DmgFileReader(...); // or the partition-recognition step
} catch (IOException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("No system partitions found")) {
        // Distinguish decryption failure from raw-image case before surfacing
        throw new IOException("Partition recognition failed: verify decryption and that the image has a partition table", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: PartitionSystemRecognizer.getPartitionSystem() returns null after probing the stream. This happens when the stream does not begin with a valid partition map signature, e.g. because the DMG was encrypted and the decryption step was skipped/failed, or the image is not a partitioned disk image.

Common situations: Encrypted DMG processed without the correct key or with the decryption step omitted (most common, per the message); a DMG that is a raw filesystem image rather than a partitioned disk; a truncated/corrupt image missing the partition map; wrong file passed (not a DMG at all).

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/18fc5518a4e082ad. Report an issue: GitHub.