Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials

Reply
 
LinkBack Thread Tools Display Modes
Old 12-05-2009, 01:19 PM   #26 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 96
Default

Quote:
Originally Posted by gonk View Post
So, what's the consensus on this? Does this really prevent piracy, or is it just wasted effort? If it only slows down the pirates by a few minutes, what's the point?

Is it really true that all pirated apps have to have a "signer identity"?

More generally, do the pirates HAVE to modify the info.plist in some way to pirate the app?
this piracy method is better than nothing, but very weak. this method has been used way too many times for it to be effective, and a half-skilled pirate could get around this in minutes. pirates need not touch the info.plist to crack an app. of course the info.plist tweak is much easier, but still.

a better, but still weak method is to compare md5 checksums of the info.plist.
hellrider is offline   Reply With Quote
Old 12-05-2009, 04:07 PM   #27 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Location: Virginia
Posts: 203
Default

Quote:
Originally Posted by gonk View Post
So, what's the consensus on this? Does this really prevent piracy, or is it just wasted effort? If it only slows down the pirates by a few minutes, what's the point?

Is it really true that all pirated apps have to have a "signer identity"?

More generally, do the pirates HAVE to modify the info.plist in some way to pirate the app?
Any method of anti-piracy can be cracked, no matter how hard you try. But for smaller iPhone developers/companies, I believe piracy protection to be crucial. The majority of crackers are newbs when it comes to cracking, almost every cracker uses Crackulous or another cracking program that can be downloaded from Cydia. So by eliminating automated cracking attempts, you can easily cut down on the majority of cracking attempts, and by using some of the methods used in this tutorial, you can prevent even more of the would be crackers. But don't get me wrong, if a dedicated "Hacker" wants to crack your application you stand little chance of beating them at their own game. By being a smaller iPhone developer/company, and by using some basic anti-piracy code in your apps, chances are good that you won't have your application cracked which can save you some money. Good luck!
Shmoopi is offline   Reply With Quote
Old 12-06-2009, 10:47 AM   #28 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

So what is the method used in Crackulous? Anybody knows?
rocotilos is offline   Reply With Quote
Old 12-06-2009, 10:58 AM   #29 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Location: Virginia
Posts: 203
Default

Quote:
Originally Posted by rocotilos View Post
So what is the method used in Crackulous? Anybody knows?
You can check out the source code online, or you can read this excerpt from Hackulo.com written by KYEK:
Quote:
So here's the scoop on how the App Store works
Apple has every application available in the app store on their servers. You already know that -- it's pretty obvious. You can download it, therefore it's coming from them. But what most people DON'T know is that every app on Apple's servers is already cracked. It's not encrypted. It's not signed. It will work on anyone's phone.

When you download an app from the store, though, Apple doesn't give you one of those programs right away. First, they take the program, and they pick out a chunk of it that the program needs to launch. And then they encrypt it -- turning that section into a code that can only be broken with YOUR iTunes account. Apple keeps the key that breaks it on file -- you don't even get to see it, but it is unique to you. Like a password you're never allowed to know.

Then Apple flips a switch on the program to let the iPhone know that it's been encrypted, Apple "signs" it (like a real signature on it that only Apple can make) so the iPhone knows it's a for-real Apple program, and then they send it to you. All of that happens instantly. You end up with a program that only you can run, since only you have access to your key.

Ok, that makes sense. So how do we crack it?
Before we get into that, you should know that the iPhone (I keep saying phone, but iPod Touch is the same thing) can run any code whether it's encrypted with your key or not -- it just has to be signed. So if you could get the unencrypted copy Apple has on their server, you could run it with no problem. You just have to sign the sucker.

So here's what we do. The iPhone can't actually run encrypted code. No computer can. The computer has to DEcrypt it (using your iTunes account key) as soon as you run it, store that decrypted section in memory, and then run that.

It's a weird concept, I know, but think about it for a second and it makes sense. The phone can't read Apple's code directly, so it decodes it, writes down the decoded version, and runs that. Easy-peasey. And the iPhone holds on to that decoded section the whole time the app is running, because it might need it again. It just stores it in the phone's memory.

What we do to crack it is freeze the phone when the program we want to crack is running, and we dump out all the memory from it. Actually, it's even better than that. We do a few simple calculations and figure out EXACTLY where in memory the decoded stuff is, and we dump JUST that out. We just save it to a file. The iPhone did all the decrypting work FOR us -- we just take what it came up with, and we write it down.

Finally, to crack the app itself, we take advantage of something really cool: The code that Apple sent us is the EXACT same size encrypted as it is decrypted! So all we need to do is take the decrypted stuff we just got from the iPhone's memory, open up the application file Apple sent us, and replace the encrypted stuff with it. The idea is dead easy, right? That's because it is This concept of taking decrypted code from memory and replacing encrypted stuff with it would be on the first page of Hacking for Dummies, if that book existed. EVERY hacker knows it. Most run-of-the-mill developers are fully aware that this is possible. It is not some profound secret that we came up with. To finish the cracking process, all we need to do is turn off that little switch that tells the phone it's encrypted -- because it's not any more. Ta-da!

Cool, but what about the signing?
We can't fake Apple's signature. I could get into how signatures work and why they're so secure, but that doesn't even matter at this point because we just can't do it. But what we CAN do is alter the part of the iPhone's operating system that makes it CHECK for Apple's signature, and make it so that it works with ANY signature -- not just Apple's. If your phone is Jailbroken, you've already done this. This is a small part of what Jailbreaking actually is -- letting your phone run code signed by anyone.

So all we need to do in order to run a cracked program on an iPhone is just sign it ourselves -- and that is the final step of cracking a program. Sign it, and now that no one's phone needs to decrypt the program, anyone with a jailbroken phone can run it!
Shmoopi is offline   Reply With Quote
Old 12-06-2009, 05:07 PM   #30 (permalink)
Beast Iphone Developor
 
justill45's Avatar
 
Join Date: Aug 2009
Location: Atlanta, Georgia
Age: 16
Posts: 1,302
Default

Quote:
Originally Posted by Shmoopi View Post
You can check out the source code online, or you can read this excerpt from Hackulo.com written by KYEK:
hmm, pretty interesting to read
justill45 is offline   Reply With Quote
Old 12-07-2009, 01:46 AM   #31 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 30
Default

Forgive me if this is a silly question, but I just released my first app and it was cracked. So if i implement this anti pirate code in my next app update will it affect previously downloaded pirated versions of my app?
Karts9 is offline   Reply With Quote
Old 12-07-2009, 10:12 AM   #32 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

Quote:
Originally Posted by Shmoopi View Post
You can check out the source code online, or you can read this excerpt from Hackulo.com written by KYEK:
Thanks for the post..

So why Apple let a way exist to jailbreak the iphone? I mean, jailbreak maybe ok for certain ppl who use it just to do something extra, but why make it one of the step to getting pirated app? Can't Apple separate these two?

Why not make the decrypting of the code resides in hardware (ie the chips in iPhone)? Make it such that if you want to get pirated apps, u need to change the chips. This surely would reduce the amount of piracy available - bcos one wont be so jumpy in letting anyone opening up their iphone and changing some chips.

And so the answer is only one: Apple, PERHAPS, WANTS apps to be pirated, thus in a way promote their hardware - coz that is what Apple is selling. That is also why their Leopard OS is dirt cheap compared to Microsoft Winblows.
rocotilos is offline   Reply With Quote
Old 12-07-2009, 12:45 PM   #33 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 169
Default

Quote:
Originally Posted by rocotilos View Post
And so the answer is only one: Apple, PERHAPS, WANTS apps to be pirated, thus in a way promote their hardware - coz that is what Apple is selling.
If you really think this is the case, go develop for another platform.

Conspiracy theories are rarely even remotely accurate.

Apple does not see the piracy issue as one they need to address before other problems or issues in their business model, but that's the nature of all businesses.

Everyone who is really in business prioritizes their expenses and efforts to support their business.

If Apple felt an impact of the pirating of iPhone Apps, you can believe they would address it.

Since Apple is not feeling an impact - developers are still flocking to the platform in record numbers - they see no need to address the problem.

The only way to get their attention is for developers to speak with a common voice and demand a solution to the problem or WE WILL GO SOMEWHERE ELSE.

The reality is with 50,000,000 iPhones in circulation, the platform is simply too interesting to abandon, so we stay in spite of the activities of the pirates.

Apple has not created a platform with the intent that pirates can steal our Apps. That's simply silly.

-t
thewitt is offline   Reply With Quote
Old 12-07-2009, 02:42 PM   #34 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

Well, i was just speculating. Blindly at that too. LOL!

Yeah, it is true, the number of developers are increasing everyday. And many who are frustrated only says "I'm quitting developing for iPhone!!!", but next day comes back with different account. LOL!

But to be honest, Apple will NEVER feel any impact. Because there are already a good amount of high quality and very very interesting apps in the store that showcases the iPhone's capability. And because of that, since Apple is targeting profits mostly from the hardware, no amount of piracy will give impact to Apple at this point.

Even so, I just cannot believe that Apple did not anticipate the pirates even before iPhone was launched. Take the PlayStation for example. It has a piracy prevention chip. So if one wanted to play a pirated game, one need to change the chip to a hacked one.
So, this suppresses the number of people who will get the pirated games.

Or maybe Apple HAS INDEED FORESEEN the future, that the piracy will NEVER give big impact to their profits, hence, do not bother to take a higher level of piracy deterrant methods?? *clap2x Apple*
rocotilos is offline   Reply With Quote
Old 12-07-2009, 03:05 PM   #35 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 129
Default

Quote:
Originally Posted by Karts9 View Post
Forgive me if this is a silly question, but I just released my first app and it was cracked. So if i implement this anti pirate code in my next app update will it affect previously downloaded pirated versions of my app?
No. The best you could hope for is that a pirate might update his copy of the app, then perhaps discover that it doesn't work because of the piracy protection, so then he'll just roll back to the old version until someone cracks your latest version and posts it to all the pirate sites.
gonk is offline   Reply With Quote
Old 12-07-2009, 07:53 PM   #36 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 30
Default

Quote:
Originally Posted by gonk View Post
No. The best you could hope for is that a pirate might update his copy of the app, then perhaps discover that it doesn't work because of the piracy protection, so then he'll just roll back to the old version until someone cracks your latest version and posts it to all the pirate sites.
Ah ok, Thanks gonk. Actually I was suprised that my app was even pirated since it has such little sales and you would have to search for it to find, I think he must have grabbed a promo code that I posted here.
Karts9 is offline   Reply With Quote
Old 12-17-2009, 12:54 PM   #37 (permalink)
Registered Member
 
Join Date: May 2009
Location: Italy
Age: 23
Posts: 12
Send a message via Skype™ to i_mush
Default

Is the signer identity stuff the only way they could use to crack an app?
I mean do you know if there are several other ways to make an application run cracked even without adding the SignerIdentity key into the plist?

I was looking for a workaround because someone just cracked my app (probably via crackulous) and I would like to know if I have to focus just on the SignerIdentity or to take care even of something else.
i_mush is offline   Reply With Quote
Old 12-17-2009, 01:55 PM   #38 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 169
Default

I'm considering going with kaliap.com - though I would like to hear from more developers who have experience with them.

It does smell a little funny to me however - since their history is all about jailbreaking phones and writing utility programs to help people with their jailbroken phones...

-t

Last edited by thewitt; 12-17-2009 at 02:02 PM.
thewitt is offline   Reply With Quote
Old 12-17-2009, 02:40 PM   #39 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Location: Virginia
Posts: 203
Default

Quote:
Originally Posted by i_mush View Post
Is the signer identity stuff the only way they could use to crack an app?
I mean do you know if there are several other ways to make an application run cracked even without adding the SignerIdentity key into the plist?

I was looking for a workaround because someone just cracked my app (probably via crackulous) and I would like to know if I have to focus just on the SignerIdentity or to take care even of something else.
Absolutely not, there is one new method that doesn't require adding SignerIdentity to the plist but they are not widely implemented as of yet. But there are also many other ways of implementing piracy protection. I'm thinking about writing another tutorial on 2-3 new methods that I have been researching. What do you guys think? Should I write another tutorial? Who's up for iPhone Piracy Protection Code Part 2?
Shmoopi is offline   Reply With Quote
Old 12-17-2009, 03:02 PM   #40 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 169
Default

I'm of the opinion that the only way we'll beat this problem is with broad dissemination of the problem and more people talking about how to defeat it...

Though the crackers read these threads as well, the ultimate goal of support within the device for an unbreakable protection method may be assisted by elevating the problem in the mind of all developers.

-t
thewitt is offline   Reply With Quote
Old 12-17-2009, 09:21 PM   #41 (permalink)
Registered Member
 
Join Date: May 2009
Location: Italy
Age: 23
Posts: 12
Send a message via Skype™ to i_mush
Default

Quote:
Originally Posted by Shmoopi View Post
Absolutely not, there is one new method that doesn't require adding SignerIdentity to the plist but they are not widely implemented as of yet. But there are also many other ways of implementing piracy protection. I'm thinking about writing another tutorial on 2-3 new methods that I have been researching. What do you guys think? Should I write another tutorial? Who's up for iPhone Piracy Protection Code Part 2?
of course it'll be useful, my only fear is that sometimes sharing knowledge may cause that it could fall in the wrong hands...and that means that crackers may overcome the walls with new techniques.

If it is a software it is crackable imho.
i_mush is offline   Reply With Quote
Old 12-18-2009, 05:53 AM   #42 (permalink)
Maker of Games
 
Mr Jack's Avatar
 
Join Date: Nov 2009
Location: Coventry, UK
Posts: 395
Default

Quote:
Originally Posted by Shmoopi View Post
I'm thinking about writing another tutorial on 2-3 new methods that I have been researching. What do you guys think? Should I write another tutorial? Who's up for iPhone Piracy Protection Code Part 2?
I'm certainly interested.
__________________


Visit Mr Jack Games for my blog and more about my games
Mr Jack is offline   Reply With Quote
Old 12-18-2009, 02:46 PM   #43 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 129
Default

Quote:
Originally Posted by Shmoopi View Post
Absolutely not, there is one new method that doesn't require adding SignerIdentity to the plist but they are not widely implemented as of yet. But there are also many other ways of implementing piracy protection. I'm thinking about writing another tutorial on 2-3 new methods that I have been researching. What do you guys think? Should I write another tutorial? Who's up for iPhone Piracy Protection Code Part 2?
I'd love to know what the crackers are doing to crack the apps. It's probably a good idea not to go into too much detail on how to fight the crack, however, because then everyone will use the exact same method, making it too easy for the crackers.
gonk is offline   Reply With Quote
Old 12-19-2009, 11:31 PM   #44 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 126
Default

Great tutorial, and I would definitely be interested in a part 2. I was wondering though, is it possible to combine methods (more importantly, will that work better, or will bypassing one bypass them all). For instance:

Code:
	NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
	NSFileManager *fileManager = [NSFileManager defaultManager];
	NSString* path = [NSString stringWithFormat:@"%@/Info.plist", bundlePath ];
	NSDictionary *fileInfo = [[NSBundle mainBundle] infoDictionary];
	NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path traverseLink:YES];
	
	if (fileAttributes != nil) {
		NSNumber *fileSize;
		
		
		if(fileSize = [fileAttributes objectForKey:NSFileSize]){
			
			NSString *cSID = [[NSString alloc] initWithFormat:@"%@%@%@%@%@",@"Si",@"gne",@"rIde",@"ntity",@""];
			BOOL checkedforPir = false;
			
			if([fileInfo objectForKey:cSID] == nil || [fileInfo objectForKey:cSID] != nil)
				if([fileSize unsignedLongLongValue] == kInfoSize)
					checkedforPir = true;
			
			if(!checkedforPir){
				//pirated
			}
		        [cSID release];
		}
	}
Will that work better (or at all ) than the above methods alone? Thanks.
javaconvert is offline   Reply With Quote
Old 12-20-2009, 01:30 AM   #45 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 99
Default

Quote:
Originally Posted by gonk View Post
I'd love to know what the crackers are doing to crack the apps. It's probably a good idea not to go into too much detail on how to fight the crack, however, because then everyone will use the exact same method, making it too easy for the crackers.
At the most basic level they run the app through crackulous to remove apple DRM. If this doesn't work it's because the developer put in some piracy detection. From there the real hacking begins (usually with the script kiddy giving up and posting the app somewhere for real hackers to have a go at it).

A full tutorial on what the hackers will do to circumvent our anti-piracy efforts is available here. This can involve looking for certain strings and changing them (what would happen if your app looks for "SignerIdentitz" instead of "SignerIdentity"?), or looking for the Compare opcode from the if statement in your detection code and changing it.

It's an arms war, man the torpedos!
Mizonnz is offline   Reply With Quote
Old 12-20-2009, 11:50 AM   #46 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Location: Virginia
Posts: 203
Default

Quote:
Originally Posted by javaconvert View Post
Great tutorial, and I would definitely be interested in a part 2. I was wondering though, is it possible to combine methods (more importantly, will that work better, or will bypassing one bypass them all). For instance:

Code:
	NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
	NSFileManager *fileManager = [NSFileManager defaultManager];
	NSString* path = [NSString stringWithFormat:@"%@/Info.plist", bundlePath ];
	NSDictionary *fileInfo = [[NSBundle mainBundle] infoDictionary];
	NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path traverseLink:YES];
	
	if (fileAttributes != nil) {
		NSNumber *fileSize;
		
		
		if(fileSize = [fileAttributes objectForKey:NSFileSize]){
			
			NSString *cSID = [[NSString alloc] initWithFormat:@"%@%@%@%@%@",@"Si",@"gne",@"rIde",@"ntity",@""];
			BOOL checkedforPir = false;
			
			if([fileInfo objectForKey:cSID] == nil || [fileInfo objectForKey:cSID] != nil)
				if([fileSize unsignedLongLongValue] == kInfoSize)
					checkedforPir = true;
			
			if(!checkedforPir){
				//pirated
			}
		        [cSID release];
		}
	}
Will that work better (or at all ) than the above methods alone? Thanks.
I like the innovation, the code sample you provided is a lot more secure than some of the single methods I posted. With the way you set up the code it appears that the user is guilty until proven innocent, first you check to see if they have messed with the SignerIdentity string, then check to see if the plist is edited, and finally, if none are wrong, you declare them innocent. Excellent strategy, this is definitely a good way to go.
Shmoopi is offline   Reply With Quote
Old 12-20-2009, 04:21 PM   #47 (permalink)
Registered Member
 
kierster's Avatar
 
Join Date: Mar 2009
Location: Canada!
Posts: 261
Default

Has anyone done such a thing as.. make the game ad-supported with a pirated copy? Can this be done without breaking any rules?
__________________
Check out some of my apps:
Boltz ($0.99)
FreeBoltz (FREE)
Cross Digits ($2.99) [Universal!]
Cross Digits Lite (FREE) [Universal!]
Targets ($0.99) (Facebook | YouTube Demo)
Greg's Apps
kierster is offline   Reply With Quote
Old 12-20-2009, 04:26 PM   #48 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 96
Default

That's easy to pull off. Also, apple would never know that you implemented that, nor could they do anything, as according to them piracy is not a big deal.
hellrider is offline   Reply With Quote
Old 12-20-2009, 04:29 PM   #49 (permalink)
Registered Member
 
kierster's Avatar
 
Join Date: Mar 2009
Location: Canada!
Posts: 261
Default

Quote:
Originally Posted by hellrider View Post
That's easy to pull off. Also, apple would never know that you implemented that, nor could they do anything, as according to them piracy is not a big deal.
Haha yea I guess this is true. The ad networks are probably fine with this too, gotta reach everyone right? - including people with jailbroken devices that download pirated apps
__________________
Check out some of my apps:
Boltz ($0.99)
FreeBoltz (FREE)
Cross Digits ($2.99) [Universal!]
Cross Digits Lite (FREE) [Universal!]
Targets ($0.99) (Facebook | YouTube Demo)
Greg's Apps

Last edited by kierster; 12-20-2009 at 04:37 PM. Reason: to be politically correct
kierster is offline   Reply With Quote
Old 12-20-2009, 04:32 PM   #50 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Location: Virginia
Posts: 203
Default

Quote:
Originally Posted by kierster View Post
Has anyone done such a thing as.. make the game ad-supported with a pirated copy? Can this be done without breaking any rules?
Absolutely, if you read These forums, you'll see that thousands of developers implement anti-piracy code in their applications. All of the code samples posted in this tutorial are 100% compliant with SDK rules and regulations.
Shmoopi is offline   Reply With Quote
Reply

Bookmarks

Tags
anti-piracy, identity, piracy, protection, signer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:33 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0