views:

336

answers:

1

Hi Everyone,

I just wanna create a MS plugin to hook SpringBoard. I'm following "gojohnnyboi" tutorial from here "http://www.ipodtouchfans.com/forums/showthread.php?t=103558".

To create a dylib on XCode, I'm following "SkylarEC" tutorial. I mix these two great tutorials and finally got succeed by getting a dylib. But when I placed the dylib in the /Library/MobileSubstrate/DynamicLibraries/ nothing is happened (no alert was shown).

By evaluating, I found that, this dylib doesn't have any starting point when it was loaded into the memory. So I mentioned a starting point by declaring a constructor in the .mm file like,

__ attribute__((constructor)) static void init()
{
    Class _$SBAppIcon = objc_getClass("SBApplicationIcon");
    MSHookMessage(_$SBAppIcon, @selector(launch), (IMP) &__$ExampleHook_AppIcon_Launch, "__OriginalMethodPrefix_");  
}

But when I'm trying to compile this, I'm getting an error like,

**Undefined symbols:
  "_MSHookMessage", referenced from:
      init()      in ExampleHook.o
ld: symbol(s) not found
collect2: ld returned 1 exit status.**

Does anyone has idea how to solve this? It would be great and more helpful if anyone share the detailed tutorial/instructions to create a dylib on XCode.

P.S I placed all the libsubstrate.dylib and substrate.h files in the corresponding location. And the locations are,

  • libsubstrate.dylib : /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/
  • substrate.h : /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include

and my base SDK is 3.0.

A: 
KennyTM
@Kenny Thanks for the reply.If I remove the "__ attribute__((constructor))" in my code its getting compiled successfully. I already added the "libsubstrate.dylib" to existing frameworks. But no luck. Can you please help me to solve this compiling issue?Why can't you (as I see, you've thorough knowledge and kind heart) wrote a tutorial for the beginners like me? Really that would be more helpful and greatly appreciated.
prathumca