Closed vtky closed 9 years ago
You modified the TARGET in the Makefile, right? Try importing CoreGraphics in logging.mm.
If you haven't modified InspectiveC, you can just use the latest deb from the stable_debs folder or from my cydia repo.
Yes, I had to modify the TARGET, otherwise compile will complain about me not having 8.1 SDK.
Got it solved, as you said, I imported CoreGraphics and also had to import UIKit into logging.mm
Just wanted to figure out how to get it compiling and then look at your code, been wanting to do something like InspectiveC on my own, but managed to stumble onto yours.
Thanks for the great project and being helpful !
If you don't mind me asking, I would like to pick your brain to see if you know a solution to a problem I'm having with my tweak.
I am trying to hook the opendir C function and CCCrypt CommonCrypto function, however, when an app runs with my dylib injected it crashes. Almost every other C function works fine, just that this one and CCCrypt is just causing me pain.
Sample code for opendir: DIR _(_orig_opendir) (const char dirname) = opendir; DIR replaced_opendir (const char *dirname) { NSLog(@"opendir: %s", dirname); return orig_opendir(dirname); };
I did some research and came up with this: http://stackoverflow.com/questions/8636422/cannot-hook-certain-library-calls-using-mshookfunction
However, David Kaplan the person who asked and replied his own question: " I never got to the bottom of this. I was thinking that maybe MobileSubstrate calls functions in the same memory page that I'm trying to hook and therefore the mem protections get all messed up.
I got around this by writing my own hooking function."
What does implement your own hooking function mean? And is there any sample code or resource that I could refer to? Should I be looking at rewriting MSHookFunction?
If it's ok with you perhaps we could take this offline and I'll ping you at your email address?
I'm honestly not sure. It could be a bug with MobileSubstrate, or perhaps the opendir function is a stub (as someone said on that stackoverflow post). Or maybe MobileSubstrate tries to use that function when replacing it, causing problems.
Yeah, you'd have to write your own MSHookFunction. Try contacting saurik.
cool! thanks man
Hi David,
Could you let me know how you compiled InspectiveC? I am compiling this against my MBA, Yosemite 10.10.3, iOS SDK 8.3
By just running
make
against the Makefile in the InspectiveC directory I am getting a whole bunch of errors, for example,logging.mm:304:9: error: use of undeclared identifier 'CGAffineTransform'; did you mean 'CFStringTransform'? CGAffineTransform at = va_arg(args, CGAffineTransform); ^
~~~~ CFStringTransformlogging.mm:304:26: error: expected ';' after expression CGAffineTransform at = va_arg(args, CGAffineTransform); ^ ;
logging.mm:307:9: error: unknown type name 'CGPoint'; did you mean 'Point'? CGPoint point = va_arg(args, CGPoint); ^
~~ Pointlogging.mm:310:36: error: unknown type name 'CGRect'; did you mean 'Rect'? CGRect rect = va_arg(args, CGRect); ^
~RectI have been able to compile my own tweaks properly, but somehow am having trouble with compiling the InspectiveC dylib.
Any help is appreciated.