Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking for Hackintosh



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@hidden    http://www.thinkyhead.com/


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden
References: 
 >Re: Checking for Hackintosh (From: Scott Lahteine <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.