Skip to content

Instantly share code, notes, and snippets.

@Devjam81
Forked from larryhou/hdiutil-dmg-convert.sh
Last active August 20, 2018 08:48
Show Gist options
  • Save Devjam81/673d78c5e54c487fb5d8285d566d1ad6 to your computer and use it in GitHub Desktop.
Save Devjam81/673d78c5e54c487fb5d8285d566d1ad6 to your computer and use it in GitHub Desktop.
hdiutil convert disk.dmg -format UDBZ -encryption AES-256 -o output.dmg
Now you can delete the original encrypted DMG. Finally, use ASR on the computer to add checksums:
asr -imagescan XXX-XXXXX-XXX.dmg
An alternative way to build a read only DMG (UDZO) is to type:
dmg build XXX-XXXXX-XXX-decrypted.dmg XXX-XXXXX-XXX.dmg
hdiutil attach XXX-XXXXX-XXX.dmg -debug
Reverse size ramdisk.dmg
hdiutil convert -format UDRW Ramdisk.dmg -o Converted.dmg
Mount the ramdisk:
hdiutil attach Ramdisk.dmg
remove file uselless "nice checksums file"
cp file patched
fix hash bin *ldid
Unmount the ramdisk:
hdiutil detach /Volumes/ramdisk
xpwntool ramdisk.dmg pwned_Ramdisk.dmg -t orig_xxx-xxxx-xxx.dmg -iv .. -k ..
enjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment