通过使用MobileSubstrate,越狱后的iPhone在我的神经上感染了iOS的一些基本API。在运行时检测iPhone上的UDID欺骗
http://www.iphonedevwiki.net/index.php/MobileSubstrate
我相信很多应用程序使用UDID为平均数,因为它是半自动和方便来验证设备和/或用户,但你应该知道这个问题的:的UIDevice是不是篡改它应该是证明。有一个名为UDID Faker的应用程序,它很容易让你在运行时欺骗别人的UDID。
http://www.iphone-network.net/how-to-fake-udid-on-ios-4/
这里是它的源代码:
//
// UDIDFaker.m
// UDIDFaker
//
#include "substrate.h"
#define ALog(...) NSLog(@"*** udidfaker: %@", [NSString stringWithFormat:__VA_ARGS__]);
#define kConfigPath @"/var/mobile/Library/Preferences/com.Reilly.UDIDFaker.plist"
@protocol Hook
- (NSString *)orig_uniqueIdentifier;
@end
NSString *fakeUDID = nil;
static NSString *$UIDevice$uniqueIdentifier(UIDevice<Hook> *self, SEL sel) {
if(fakeUDID != nil) {
ALog(@"fakeUDID %@", fakeUDID);
/* if it's a set value, make sure it's sane, and return it; else return the default one */
return ([fakeUDID length] == 40) ? fakeUDID : [self orig_uniqueIdentifier];
}
/* ... if it doesn't then return the original UDID */
else {
return [self orig_uniqueIdentifier];
}
}
__attribute__((constructor)) static void udidfakerInitialize() {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *appsBundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
ALog(@"Loading UDID Faker into %@", appsBundleIdentifier);
NSDictionary *config = [NSDictionary dictionaryWithContentsOfFile: kConfigPath];
fakeUDID = [config objectForKey: appsBundleIdentifier];
[fakeUDID retain];
if(fakeUDID != nil) {
ALog(@"Hooking UDID Faker into %@", appsBundleIdentifier);
MSHookMessage(objc_getClass("UIDevice"), @selector(uniqueIdentifier), (IMP)&$UIDevice$uniqueIdentifier, "orig_");
}
[pool release];
}
正如你所看到的,在的UIDevice类唯一标识符方法现在返回fakeUDID上的任何应用程序。
似乎Skype和其他一些应用程序检测到这种污点,但我不知道该怎么做。
我想要做的是:当启动时检测到受污染的UIDevice,警报并退出(0)。
想法?
伙计..你给这些想法给其他人..我的意思是你可以只发布没有示例代码和确切的API /欺骗链接的问题。现在,所有SO用户都知道如何欺骗一个UDID .. – lukya 2010-11-12 13:48:17
有这种意图的人要么没有理解上述代码的能力,要么有能力并且已经了解它。 – 2010-11-12 13:59:26
来吧,每个SO用户都应该知道如何使用谷歌。仅仅因为链接不在这里,并不意味着对此感兴趣的人不会找到它。 – JustSid 2010-11-12 14:01:39