Creating a libsubstrate for iPhone Simulator

非 Y 不嫁゛ 提交于 2019-12-11 13:58:28

问题


I am working on mobilesubstrate plugins on a JB iPhone. i have created a dylib in xcode for my iphone which builds fine for Device, but when i try to build it for Simulator, it gives me an error "_MSHOOKMESSAGE reference from: blah blah". I have placed all the headers in proper locations. I got libsubstrate from device but that is i think the problem. The libsubstrate from device is not gonna work for Simulator. So my question is how to create a libsubstrate for Simulator?


回答1:


If you simply need to use MSHookMessageEx (which superseded MSHookMessage), you can

#define MSHookMessageEx(class, selector, replacement, result) \
 (*(result) = method_setImplementation(class_getInstanceMethod((class), (selector)), (replacement)))

Of course, MSHookMessageEx in Mobile Substrate is more complex than this, but for testing purpose this is usually enough.




回答2:


http://www.ipodtouchfans.com/forums/showthread.php?t=103558 May be this can help you. Good luck.



来源:https://stackoverflow.com/questions/2175007/creating-a-libsubstrate-for-iphone-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!