
Code: Select all
hdiutil convert /path/to/file.dmg -format UDTO -o /path/to/file.iso Code: Select all
hdiutil convert /dev/disk1s1s2 -format UDTO -o ~/Desktop/CD Name hdiutil burn ~/Desktop/CDName.dmg -noverifyburn -noeject creating data dvds mkisofs -V Disk Label -J -r -o myimage.iso data_dir ...Code: Select all
#!/usr/bin/perl -w
# Changes:
#
# Tue Apr 26 15:49:53 EDT 2005 Jeff Mahoney <jeff.mahoney@gmail.com>
# * read/writes now do so in 4k blocks rather than allocate
# huge chunks of memory
use MIME::Base64;
use strict ;
local ($^W) = 1; #use warnings ;
use Compress::Zlib ;
my $x = inflateInit()
or die "ERROR: Cannot create inflation stream. Is Compress::zlib installed?\n" ;
my $zfblock="\x00"; for (0..8) { $zfblock.=$zfblock; }
my $indxbeg=0;
my $indxend=0;
my $blocksz = 4096;
my @plist;
print "dmg2iso v0.2a by vu1tur (vu1tur\@gmx.de)\n\n";
if (@ARGV."" != 2) { die "Syntax: dmg2iso.pl filename.dmg filename.iso\n"; }
my $zeroblock = "\x00";
for (0..8) { $zeroblock.=$zeroblock; }
my $tmp;
my ($output,$status);
my $buffer;
open(FINPUT,$ARGV[0]) or die "ERROR: Can't open input file\n";
binmode FINPUT;
sysseek(FINPUT,-0x200000,2);
print "reading property list...";
my $fpos = sysseek(FINPUT,0,1);
while(my $ar = sysread(FINPUT,$buffer,0x10000))
{
my $fpos = sysseek(FINPUT,0,1)-$ar;
if ($buffer =~ /(.*)<plist version=\"1.0\">/s)
{
$indxbeg = $fpos+length($1);
}
if ($buffer =~ /(.*)<\/plist>/s)
{
$indxend = $fpos+length($1)+8;
}
}
open(FOUTPUT,">".$ARGV[1]) or die "ERROR: Can't open output file\n";
binmode FOUTPUT;
my $indxcur = $indxbeg + 0x28;
sysseek(FINPUT,$indxbeg,0);
sysread(FINPUT,$tmp,$indxend-$indxbeg);
if ($tmp =~ s/.*<key>blkx<\/key>.*?\s*<array>(.*?)<\/array>.*/$1/s)
{
while ($tmp =~ s/.*?<data>(.*?)<\/data>//s)
{
my $t = $1;
$t =~ s/\t//g;
$t =~ s/^\n//g;
push @plist,decode_base64($t);
}
} else {
die "PropertyList is corrupted\n";
}
print "found ".@plist." partitions\n";
print "decompressing:\n";
my $t=0;
my $zoffs = 0;
my $tempzoffs = 0;
foreach (@plist)
{
print "partition ".$t++."\n";
s/^.{204}//s;
while (s/^(.{8})(.{8})(.{8})(.{8})(.{8})//s)
{
$x = inflateInit();
my $block_type = unpack("H*",$1);
my $out_offs = 0x200*hex(unpack("H*",$2));
my $out_size = 0x200*hex(unpack("H*",$3));
my $in_offs = hex(unpack("H*",$4));
my $in_size = hex(unpack("H*",$5));
# $1 - block type, $2 - output offs $3 - output size $4 input offset $5 - input size
sysseek(FINPUT,$in_offs+$zoffs,0);
if ($block_type =~ /^80000005/ or $block_type =~ /^00000001/)
{
do {
my ($toread, $res);
$toread = $blocksz;
$toread = $in_size if ($in_size < $blocksz);
$res = sysread (FINPUT, $tmp, $toread);
die "read failure" if ($res != $toread);
$output = $tmp;
# If compressed, inflate it
if ($block_type =~ /^80000005/) {
($output,$status) = $x->inflate($tmp);
die "\nConversion failed.File may be corrupted.\n"
if (!($status == Z_OK or $status == Z_STREAM_END));
}
print FOUTPUT $output;
$in_size -= $toread;
} while ($in_size > 0);
}
if ($block_type =~ /^00000002/)
{
for(1..$out_size/0x200)
{
syswrite(FOUTPUT,$zeroblock,0x200);
}
}
if ($block_type =~ /^FFFFFFFF/i)
{
$zoffs += $tempzoffs;
}
$tempzoffs = $in_offs+$in_size;
}
}
print "\nconversion successful\n";
Code: Select all
# Grab a working copy of dmg2iso.pl
wget http://blinkenlights.ch/gnupod/dmg2iso.pl
# Convert the dmg into iso
perl dmg2iso.pl yourfile.dmg yournewfile.iso
eleanor@localhost ~ $ perl /home/eleanor/dmg2iso.pl /home/eleanor/Desktop/macosx_10.4.3_8f1111_for_dtk_userdvd.dmg /home/eleanor/Desktop/mac.iso
Can't locate Compress/Zlib.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.8.6/i386-linux /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i386-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i386-linux /usr/lib/perl5/5.8.6 /usr/local/lib/site_perl .) at /home/eleanor/dmg2iso.pl line 15.
BEGIN failed--compilation aborted at /home/eleanor/dmg2iso.pl line 15.

Any ideas? The only thing left for me is to download an iso, right?dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)
reading property list...found 4 partitions
decompressing:
partition 0
partition 1
Conversion failed. File may be corrupted.

Code: Select all
mandrake ~ # file OS7.5.3.iso
OS7.5.3.iso: dataCode: Select all
mandrake ~ # file dsl-1.0.iso
dsl-1.0.iso: ISO 9660 CD-ROM filesystem data 'KNOPPIX ' (bootable)