English 中文(简体)
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 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.

问题回答

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>




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签