raziiq
raziiq

Reputation: 549

Creating a libsubstrate for iPhone Simulator

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?

Upvotes: 1

Views: 2139

Answers (2)

new soul
new soul

Reputation: 322

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

Upvotes: 1

kennytm
kennytm

Reputation: 523614

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.

Upvotes: 1

Related Questions