Open szcoder opened 13 years ago
Below is the source of my test.m file
id (*savedFuncPtr)(id obj, SEL sel, ...);
id my_msgSend(id obj, SEL sel, ...) { printf("my_msgSend Called\n"); return nil; }
int main(int argc, const char* argv[]) { mach_override_ptr(objc_msgSend, my_msgSend, (void**)&savedFuncPtr); //objc_msgSend(nil, nil); return 0; }
Thank you for this project. I successfully use mach_override to replace local functions and stdio functions. However I failed to override cocoa functions, for example, objc_msgSend and NSLog. The error is below
mach_override: some instructions unknown! Need to update mach_override.c err = f8000001 /Volumes/Data/rentzsch-mach_star-b5c0803/mach_override/mach_override.c:226 err = f8000001 /Volumes/Data/rentzsch-mach_star-b5c0803/mach_override/mach_override.c:239 err = f8000001 /Volumes/Data/rentzsch-mach_star-b5c0803/mach_override/mach_override.c:245 err = f8000001 /Volumes/Data/rentzsch-mach_star-b5c0803/mach_override/mach_override.c:259 err = f8000001 /Volumes/Data/rentzsch-mach_star-b5c0803/mach_override/mach_override.c:264
I am using Xcode 4.2 and Mac OS X Lion 10.7.2, 64bit kernel and app. Can you please look into it? Many thanks.