InterposeKit icon indicating copy to clipboard operation
InterposeKit copied to clipboard

`_dyld_register_func_for_add_image` callback is run before Objective-C classes are loaded

Open fumoboy007 opened this issue 4 years ago • 1 comments

_dyld_register_func_for_add_image is called during dlopen but before the Objective-C classes in the image are loaded. The effect of this is that the interposition(s) for a given class are run on the next dlopen after the class is loaded. This may be too late depending on the interposition use case. Thoughts on clever ways to install a callback just after the Objective-C classes for a given image are loaded?

fumoboy007 avatar Jan 20 '21 04:01 fumoboy007

According to the documentation, your registration is invoked with every image already loaded, so it doesn't matter when you register.

tinder-tannerbennett avatar Jan 20 '22 23:01 tinder-tannerbennett