Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVTOOLS: dumper-companion: Support images with multiple partitions; don't warn about missing deps when not running mac mode #5412

merged 1 commit into from Nov 11, 2023


Copy link

This was inspired by a LucasArts disc having an additional (empty) HFS partition on the disc. Missing dependency warning was moved so as to not annoy users who only want to use the other modes.

…don't warn about missing deps when not running mac mode

Additionally fix a copy/paste error and remove an unused variable.
Copy link

coderabbitai bot commented Nov 11, 2023



The recent changes in the script have improved its functionality and efficiency. The script now supports partitioned volumes, with the addition of a new function to handle individual partitions. The import of xattr has been moved to a local scope, and its existence is now checked within the collect_forks function. Additionally, file path manipulation within the collect_forks function has been adjusted for better performance.


File Change Summary
devtools/ The import of xattr has been moved from the global scope to the collect_forks function. A new function extract_partition has been added to handle individual partitions. The extract_volume function has been modified to handle partitioned volumes. The existence of xattr is now checked within the collect_forks function. File path manipulation in the collect_forks function has been adjusted.


Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=

Comment on lines +304 to +341
partitions = []
with"rb") as f:
if == b"PM\x00\x00":
partition_num = 1
partition_type = ""
while partition_type != "Apple_HFS":
partition_num = 1

while True:
data =
if data == b"PM\x00\x00":
num_partitions, partition_start, partition_size = unpack(
), 1)
partition_type ="ascii").split("\x00")[0]
if partition_num <= num_partitions and partition_type != "Apple_HFS":, 1)
partition_type ="ascii").split("\x00")[0]
if partition_type == "Apple_HFS" and partition_size > 0:
# Found an HFS partition, log it
partitions.append((partition_start * 0x200, partition_size * 0x200))
if partition_num <= num_partitions:
# Move onto the next partition
partition_num += 1 * 0x200 + 4) * 0x200)
# We found the one we want or there's none
# Finished parsing the partition map
break * 0x200) * 0x200))
# Didn't find the Apple Partition Map, break so we can just
# load the entire image

if partitions:
for partition_start, partition_size in partitions:
extract_partition(args, vol)
extract_partition(args, vol)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for handling partitioned volumes seems sound. It reads the partition map, identifies HFS partitions, and then extracts each partition using the new extract_partition function. However, error handling is missing. Consider adding try-except blocks to handle potential IO errors.

Copy link

sev- commented Nov 11, 2023

Thank you!

@sev- sev- merged commit cc8f2d6 into scummvm:master Nov 11, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants