Hello,
I have recently been working on using MobileSubstrate to hook bundles loaded by an application in iOS, but I have ran into a few problems. I know that you must initialize the hooks when the bundle/library is loaded, and I have tried to use _dyld_register_func_for_add_image() to wait for the executable to load the target library, but the hooks are initialized too early, because when this function is called, the classes (grabbed using objc_getClass) are still nil
. As Apple phrases it: 'it is called as each new image is loaded and bound (but initializers not yet run)'. What is another way i can get notified when a library loads, after the classes are initialized?
An example of the current code i am using can be found here. (Sorry for the confusing names, its meant for the compiler's eyes, not a persons, as it uses the logos preprocessor)