开发者

How to create mobile substrate plugins on XCode?

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 X开发者_Python百科Code.

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.


You should probably check out iOSOpenDev


(These are very old tutorials. Some modern MS code can be found in http://iphonedevwiki.net/index.php/MobileSubstrate. Eventually someone needs to write an updated tutorial...)


Make sure you have added libsubstrate.dylib in your Xcode project (Add → Existing files...). The compiler will not automatically find which dylib to link unless you tell it so.


Try http://unlimapps.com/?p=15 it will be much easier to compile plugins using the methods in that post


You have to copy CydiaSubstrate.framework to /Library/Frameworks in your mac and link to CydiaSubstrate

#include <CydiaSubstrate/CydiaSubstrate.h>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜