The OP needs to get off his high horse and come to the realization that some people are a bit more clever than him (or Apple). But anyways you guys all forgot something big, virtualization. Can't OS X Server 10.5 be (legally) virtualized? Any hardware checks will either break in a virtualized environment, or a hackintosh will pretend to be virtualized, either way you lose. I bet the OP is the type of guy who thinks fighting piracy makes business sense too.

On Jul 30, 2008, at 1:34 PM, Scott Lahteine wrote:

Hi,

There are a couple of ways to definitively test for a hackintosh. You could look at the IO Registry for unusual hardware configurations. But as it happens, the latest Hackintosh kernels all use custom Machine Type strings. So you can test to see if it's one of the known Mac models, and if it isn't you can assume it's probably a Hackintosh.

Unfortunately, this breaks if future Macs introduce new Machine Type strings, which is almost certain. You'll notice I'm not testing for AppleTV, for example, because I don't happen to know its string.

The following is what I use in "TabletMagic" to detect a TabletPC :


- (BOOL)detectHackintosh
{
 SInt32 gestaltReturnValue;
 BOOL is_known_mac = NO;
 if (!Gestalt(gestaltUserVisibleMachineName, &gestaltReturnValue))
 {
char *known_machines[] = {"AAPL","iMac","PowerBook","PowerMac","RackMac",
       "Macmini","MacPro","MacBookPro","MacBook"};
   StringPtr pmach = (StringPtr)gestaltReturnValue;
   int i, len = pmach[0];
   char *machine_string = (char*)malloc(len+2);
   strncpy(machine_string, (char*)&pmach[1], len+1);

   for (i=sizeof(known_machines)/sizeof(known_machines[0]); i--;)
if (!strncmp(machine_string, known_machines[i], strlen(known_machines[i]))) { is_known_mac = YES; break; }

   free(machine_string);
 }

 if (is_known_mac)
 {
   // delete the tab having identifier "6"
[ tabview removeTabViewItem: [ tabview tabViewItemAtIndex: [ tabview indexOfTabViewItemWithIdentifier: @"6" ] ] ];
 }

 return !is_known_mac;
}



--
 Scott Lahteine          Thinkyhead Software
 [EMAIL PROTECTED]    http://www.thinkyhead.com/


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.w.burnett%40gmail.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to