Wednesday, May 27, 2009

Legal Hackintosh


Getting Mac OS X up and running on a computer without an Apple label has always been a bit of a hassle. You needed customised Mac OS X disks, updates would ruin all your hard work, and there was lots of fiddling with EFI and the likes. Ever since the release of boot-132, this is no longer the case. Read on for how setting up a "Hack"intosh really is as easy as 1, 3, 2. 



As easy as 1, 3, 2


The most well-known way of setting up a Hackintosh is to download a hacked Mac OS X Leopard image, burn it to a disk, and go from there. This method, while easy, has several disadvantages. First of all, if you're in the United States, or another country with DMCA-like laws, this hacking can actually be against the law, and as such, it might not be a wise thing to do. Secondly, using such hacked Mac OS X images means that updates from Apple, such as the latest Leopard 10.5.7 update, will definitely ruin your system. 

However, ever since September last year, we have a new method, using a small boot CD called boot-132. If I understand it all correctly, it uses a modified Darwin kernel to bootstrap a regular, unaltered Mac OS X Leopard retail disc. Since Darwin is open source, this is completely legal, and doesn't break the DMCA since you're not actually hacking any protection measures. As soon as the regular retail disc is "running", the installer pops up, allowing you to install Mac OS X as if you're using any regular Macintosh. Once the installation is completed, you use the boot-132 CD to boot into the newly installed Leopard, and from there you install a bootloader (Chameleon) which enables you to boot without the CD. 

This method has several advantages. I already named the DMCA advantage, but on top of that comes the fact that since you're using an unaltered copy of Leopard, updates from Apple will install a lot more smoothly than when using a modified installation. Early on, this method was only viable when using hardware exactly the same as Apple uses, but soon after the boot-132 CD could be modified to include drivers for machines with more diverging hardware. Since writing drivers is not illegal, this also doesn't break the DMCA: no actual hacking of Apple code involved. 

Using the boot-132 method, I built myself a non-Apple Macintosh with a flick of the wrist. There were some small bumps along the road, but nothing show-stopping: I'm now enjoying a brand new Macintosh for less than 200 EUR. This computer isn't actually a hackintosh, since no Apple code was hacked to get it running. It only runs Mac OS X; I haven't installed any other operating systems on it. 



The hardware

The hardware used to build this Macintosh amounted to a total price of 199 EUR, ordered at my favourite Dutch online hardware retailer. The core of the system is a Foxconn barebone machine, the Foxconn L10-S3, which uses a slightly modified Intel Atom 330 mini-ITX motherboard (network and audio chip from Realtek). 

Foxconn 45CSX mini-ITX motherboard
Intel Atom 330 processor (dual-core, 2x1.6Ghz)
Intel 945GC+ICH7 chipset
Intel GMA950 graphics chip
Realtek ALC662 audio chip
Realtek RTL8100C ethernet chip
2GB of DDR2 RAM
160GB SATA hard drive
SATA DVD drive


This entire package cost 199.50 EUR here (excl. the DVD drive, I already owned that one), including shipping and 19% VAT. Note that you have to buy Mac OS X Leopard as well from retail! Using the boot-132 method, almost all of the hardware is supported. What is not supported are no deal breakers: the line-in doesn't work (a different driver might solve that), you have to turn HyperThreading off (no support for HT on the Atom 330 in Mac OS X 10.5.7), and sleep doesn't seem to work (some BIOS fiddling might solve that, though). For the rest, everything's supported. 


The guide

After you've ordered all the components from your favourite retailer, and assembled it, it's time to start the guide. Let's take a look at the pre-requisists first: 

The above hardware. This guide only works for this machine. Other machines require different guides.
A retail disc of Mac OS X Leopard; I used a 10.5.6 disc. We don't condone software piracy, so go out and buy one. Apple deserves it for delivering a high-quality operating system.
The Intel D945GCLF2_ISO boot-132 package. This is a modified boot-132 .iso for this specific motherboard.
The driver package for this motherboard. Included in the above D945 package. 
The Chameleon boot loader. Also included in the D945 package.


Let's get started with actually installing Leopard. 

Write the boot-132 .iso found in the D945 package onto a CD or DVD.
Boot using this disc, and when you hit the prompt, press "enter" once, and stop there.
At this point, remove the boot-132 disc, and insert the Leopard retail disc. Wait until the disc is spun up and the indicator light turns off.
Perform the installation. Use Disk Utility to partition the disc using the GUID scheme. I dedicated the entire drive to Mac OS X.
When the machine reboots after the installation, replace the Leopard disc with the boot-132 disc. Press enter at the prompt again, but this time, enter the hexadecimal code for the drive you installed Mac OS X to. This will most likely be 80 (first HDD) or 81 (second HDD). Leopard boots!


Now it's time for the post-installation tasks. 

Upon reboot, install the Chameleon boot loader, supplied with the D945 package.
Install the driver package, also supplied with the D945 package.
Reboot, and note how you no longer need the boot-132 disc.

Updating to Mac OS 10.5.7 is relatively easy, but there are two very important steps. 

Install OSx86Tools, and use this tool to backup your extensions folder - just in case something goes wrong. Be sure to backup to an external medium.
Run Software Update. As a safety precaution, install every update except the Mac OS X 10.5.7 update. This way, if anything goes wrong, you know it is not caused by the 10.5.7 update. You'll have to reboot.
Now it's time to install Mac OS X 10.5.7, again using Software Update. Reboot.
This step is important: go into the BIOS, and disable HyperThreading. Mac OS X 10.5.7 will not boot with HyperThreading enabled, most likely because it does not support it for the Atom 330.
Re-install the diver package.


Using OSx86Tools, there are some fun after-install things to do. They are not required, but fun nonetheless. Using OSx86Tools, you can change the processor and memory strings in "About This Mac" to properly describe the hardware in your machine. Since Leopard doesn't include strings for this hardware, you need to add them yourself. This is skin-deep only; System Profiler won't take it into account. The lack of these strings does not affect the utilisation of your hardware in any way, however. 


Apple stickers

That's it! My small and lovely little (and cheap!) Atom 330 dual-core machine now runs Mac OS X Leopard 10.5.7 without breaking the DMCA or doing any difficult hacking. Updates apply just fine, and software installs and runs without any problems as well. Office 2008 (update to SP1 went fine as well), iLife '08, Adium; they all work without any issues. 

The boot-132 method is the holy grail of the OSx86 community. Apple can't do anything about this, short of introducing special DRM chips in their machines. However, those will get cracked rather quickly, meaning it'll only be a waste of money. The only possible problem here is the EULA, which forbids installing Mac OS X on hardware that is not "Apple-labeled". I solved that issue by placing an actual apple on top of my machine, and I've got various Apple stickers here as well which could solve the problem in a more permanent fashion (I ate the apple...). 

 





Rests me to say that this InsanelyMac forum thread contains a list of modified boot-132 discs and packages for all sorts of hardware. Feel free to check if yours is included!

==================================================================

Post has been retrived from http://mobile.osnews.com/story.php/21564/Building-a-Hackintosh-Apple-Cant-Sue-You-For/ . Author Thom Holwerda .

==================================================================

Thanks for reading

Saturday, May 16, 2009

Hacking Tutorials VI

  Cleaning up
  ~~~~~~~~~~~


Remember when we logedin to target.edu as luser, and used su to become root?
Take a look to this line:

  Last login: Fry Sep 22 20:47:59 from xx.xx.xx.xx.

Yes, that was displayed by the target box when we logedin there.
It refers to the last login that the real luser did.

So, what will be displayed when luser logsin again?

  Last login: Sun Sep 24 10:32:14 from .

Then luser writes a mail to the admin:

"It has happen some strange thing, when I loggedin today, I've read a line like this:

 Last login: Sun Sep 24 10:32:14 from .

 Does it mean I did login yesterday? It can't be, I don't work on sundays!
 I think it's a bug and this is your fault."

The admin responds to luser:

"That wasn't a bug! this line means someone acceded the system using your password, don't
 worry for that, we got his IP. That means we can ask his ISP what phone number did call
 at 10:32 and get . Then we shall call the police and he'll get busted"

So you'll get busted because luser was a bit clever (sometimes happens).

So we gotta find a way to delete that.

This information can be stored in: 
 
/usr/adm/lastlog 
/var/adm/lastlog 
/var/log/lastlog

and we can erase it using lled (get it from my site) 

lled gots a buitin help that explains how to use it, remember to chmod the fake file
created by lled like the substitute lastlog file.

There is also some information we'd like to erase:

Remember when i told you not to use FTP? Well, in case you did it, you must now 
use wted to clean up. Its sintax is very similar to lled.
you can get it from my site.


The who command shows us (and the admin) which lusers are logedin at the moment.
What if we login and the admin is there?

 sh-2.03$ who
 root tty1 Sep 25 18:18 

Then we shall use zap2. If you loggedin as 'luser', then type:

 sh-2.03$ ./zap2 luser
 Zap2!
 sh-2.03$ who
 sh-2.03$

And luser has never been here.

  Greetings
  ~~~~~~~~~


Ok, this is all for now (i'll make a newer version). I hope it has been useful to you and you 
decide to continue learning and become a real hacker. You can visit my site (www.3b0x.com)
for more advanced tutorials so you can improve your skills.

I'd get very happy if you send me a mail telling me your impression about this paper (wether
is good or bad), and you help me to improve it.

I'd like to send my greetings to every hacker that has tought me in any way, through newsgroups
or other tutorials like this one. thanks to all.