Polidea / ios-class-guard

Simple Objective-C obfuscator for Mach-O executables.
http://www.polidea.com
1.64k stars 240 forks source link

Why NSObject isn't in forbidden list? #22

Closed AloneMonkey closed 9 years ago

AloneMonkey commented 9 years ago

Why NSObject isn't in forbidden list?

AloneMonkey commented 9 years ago

I define custom class ViewController that inherit from UIViewController。but the ios-class-guard will obfuscate funtion 'viewDidLoad'。this function is from UIViewController and shouldn't obfuscated。

like this:

ifndef viewDidLoad

define viewDidLoad z62

endif // viewDidLoad

It shouldn't define in "symbols.h"。

wiktor commented 9 years ago

It is probably that SDK root path is wrongly set. Can you share you arguments to ios-class-guard?

Do you see while running tool following line?

Processing external symbols from UIKit…

On Mon, Jan 26, 2015 at 9:29 AM, Alone_Monkey notifications@github.com wrote:

I define custom class ViewController that inherit from UIViewController。but the ios-class-guard will obfuscate funtion 'viewDidLoad'。this function is from UIViewController and shouldn't obfuscated。 like this:

ifndef viewDidLoad

define viewDidLoad z62

endif // viewDidLoad

It shouldn't define in "symbols.h"。

Reply to this email directly or view it on GitHub: https://github.com/Polidea/ios-class-guard/issues/22#issuecomment-71427492

AloneMonkey commented 9 years ago

yeah, but when I run on the MAC, It can't find any function from UIKit and the offset of section is always 0.

Then I found that 'SDKroot/System/Library/Frameworks/UIKit.framework/UIKit' is just a symbols file.

the real UIKit file in iphone device: /System/Library/Caches/com.apple.dyld/ , Idyld_decache it.

Get new UIKit instead of SDK root UIKit. It's run OK!

AloneMonkey commented 9 years ago

Static library also be obfuscated.

ayufan commented 9 years ago

This may also be problem with a Xcode 6.0/6.1. For that versions you need to compile an app for iOS Simulator.

tgrf commented 9 years ago

@AloneMonkey try to obfuscate your project with the most recent version of obfuscate_project tool. We've changed SDK root to Simulator's one. As @ayufan said, since iOS SDK8 & Xcode 6, device's (iPhoneOS.platform) frameworks within Xcode files are just stubs.

tgrf commented 9 years ago

Closing this ticket, since it's fixed with the obfuscate_project script update (#23).