Tag Archives: mount

[MacOS] Handle DMG Images under Microsoft Windows

Are you one of those lonesome people who tried to access the contents of a DMG image under Windows? Yes, there are several ways like converting to ISO with programs like Magic-Iso or mounting with Mac-Drive. All these solutions are nice, handy and well… expensive…

Simply using 7-zip is in my opinion the easiest way, as all of us should have 7-Zip installed anyway ;-)

  • right click the .dmg file
  • choose:
    7-Zip
  • a submenu opens, in that submenu choose:
    unpack to <nameofmydmg\>
  • wait a couple of secs while unpacking and
    open the subfolder <nameofmydmg\>
  • you should find a bunch of files:
    0.MBR
    1.Primary GPT Header
    2.Primary GPT Table
    3.free
    4.hfs
    5.free
    6.Backup GPT Table
    7.Backup GPT Header
  • The file for further examination is “4.hfs”. It mostly is a lot bigger than all the rest of the files.
  • now do a right click on "4.hfs" again and
  • choose 7-Zip
  • a submenu opens again, now in that submenu choose:
    unpack to <4\>
  • et voilà…

you’re done with unpacking… now fire IDA and find the jump ;-)

[MacOS] Chameleon On USB: Mounting USB Stick Correctly

Inserting USB sticks to your Mac OS X based system makes Mac OS X mount the stick without assigning certain permissions like owners, or groups.

I. How things get mounted on Mac OS

The mount command on the terminal returns most likely some lines, like that:

  • testuser$ mount
  • /dev/disk0s2 on / (hfs, local, journaled)
    devfs on /dev (devfs, local, nobrowse)
    map -hosts on /net (autofs, nosuid, automounted, nobrowse)
    map auto_home on /home (autofs, automounted, nobrowse)
    /dev/disk3s1 on /Volumes/CHAMBOOT (hfs, local, nodev, nosuid, journaled, noowners)
    /dev/disk1s4 on /Volumes/Mac OS X Install DVD (hfs, local, nodev, nosuid, noowners)

You can see quite a lot of slices (i.e. ~partitions) are mounted to that system I am running here. For instance disk1s4 is the forth slice of disk1 and it countains an image of a Mac OS X Install DVD. And you can see a CHAMBOOT named drive mounted with several options.

II. Mount Options/Permissions

Our beloved USB stick named CHAMBOOT (contains Chameleon and) is disk3s1 and is mounted to /Volumes/CHAMBOOT. Mac OS handles USB mounting for most of our every day life operations fairly reliable. But this comes at a cost, as this simplicity is achieved here by applying options like nosuid and noowners during the mount process.

For people willing to run Chameleon from a USB stick permissions are inevitable, as for instance an Extensions.mkext kextcache can only be generated with proper file permissions being set.

II. Mounting USB with permissions

This just requires some simple mount operations being performed manually on the terminal. Do the following:

  • testuser$ sudo -s
    Become ultimate root now.
  • testuser$ cd
    Get back to the home folder whereever you’ve been before.
  • testuser$ sync
    Force completion of pending disk writes.
  • testuser$ umount -f /Volumes/CHAMBOOT
    This unmounts the USB stick called CHAMBOOT
  • testuser$ mkdir chamboottemp
    Create a temporary folder for our mounting session
  • testuser$ mount_hfs /dev/disk3s1 chamboottemp/
    Mount the USB stick to the temporary folder
  • testuser$ mount
    See how the drives are mounted now
  • /dev/disk0s2 on / (hfs, local, journaled)
    devfs on /dev (devfs, local, nobrowse)
    map -hosts on /net (autofs, nosuid, automounted, nobrowse)
    map auto_home on /home (autofs, automounted, nobrowse)
    /dev/disk3s1 on /Users/admin/chamboottemp (hfs, local, journaled)
    /dev/disk1s4 on /Volumes/Mac OS X Install DVD (hfs, local, nodev, nosuid, noowners)
    You can see the USB stick is now mounted without “extra” options.

Now you can apply changes to the USB stick’s files in the proper manner (like copying files, repairing permissions and creating a kextcache). After having performed all the changes, you can correctly unmount. Read here:

III. Manually Unmounting

  • testuser$ cd
    Get back to the home folder whereever you’ve been before.
  • testuser$ umount -f chamboottemp
    Force to unmount the device mounted to the chamboottemp folder now.
  • testuser$ rmdir chamboottemp
    It is safe to delete the chamboottemp folder now.

IV. Links

» Mac OS X Reference Library: Man Page for “sync”
» Mac OS X Reference Library: Man Page for “mount”
» AsereBln.BlogSpot.com: Some terminal work

[MacOS] Install Leopard from .dmg Image to your System

“and first for something complete different”: Muzaq… coding or administrating system can’t do without gooood muzaq. Check our latest tunes here :-)

This time we’re gonna install Leopard from a .dmg image instead from DVD. The purpose is having a repair and recovery system by the hand in case you need it. My story is this: after having had a clean install of Leopard finished and having had applied all the updates, my MBP simply crashed again and again (two mouse pointers error – I found a solution in the meantime: that bug belongs to the Leopard Graphics Update – read it here howto fix it), since at that point I could not fix it, I then decided to reinstall. Something seemed fishy and would hopefully be gone after another fresh install. But as you expect: the same problem occurred again. I then decided to restore my previous tiger install and installed the Leopard DVD to a second partition. This way nothing can stop me, whereever I am, whatever does not work…

Ok what to do now?

I assume

  • You don’t have a bootcamp partition installed
  • means your harddrive is single partitioned
  • You got Tiger installed
  • You know the size of your harddrive (you can also find out in “Disk Utility”)

Now, let the game begin…

    1. Insert Leopard installation DVD into your drive
    2. Start “Disk Utility” to make a .dmg image of your installation DVD (see picture)
    3. click the Mac OS X Install DVD (highlight it) and choose New Image

 

beforedmg

  1. Choose Read as type of image and name it Mac OS X Install DVD(see picture)

    makedmg

  2. Wait forever (15-20minutes)
  3. Close Diskutility and
  4. Open terminal and enter:
    sudo diskutil resizeVolume disk0s2 139G "HFS+" "LeoInst" 10G
    (in this example the total harddrive size is 149GB = “139G + 10G”)
  5. This command resizes the first partition to 139GB and generates a second partition formated in “HFS+” with size of 10GB. The name of the second partition will be LeoInst (disk0s1 is in this case the EFI partition – see here, what makes the EFI partition so interesting, system partition starts at disk0s2 – that’s the partition we’re gonna resize and split into disk0s2 and disk0s3)
  6. After having executed this command successfully you need to reboot
  7. After reboot open “Disk Utility” again
  8. You should now see two partitition on your harddrive (see picture)

    LeoInst

  9. Click on the second partition named “LeoInst”
  10. Click “Restore”
  11. As Source choose your Mac OS X Install DVD.dmg image (should be located on the desktop!)
  12. As destination drag and drop the second partition called “LeoInst”
  13. click “Restore”
  14. Wait about forever to have the DVD copied to your drive (again 15-20mins)

    diskutil01

  15. Close Disk Utility
  16. Go to “System Preferences” and choose “Startup Disk”
  17. Choose your Mac OS X Install DVD (which is in fact now a partition) as start volume
  18. reboot system and install Leopard

Additional notes

These instructions are intended to be applied to genuine Apple systems rather than HackMacs. In my case I used my MacBook Pro. Because of the different .kexts to be applied to HackMacs this guide will not work for those systems! Be warned!