Load and execute iOS code dynamically at runtime

As an academic and mental exercise, how can I download a precompiled binary and execute methods on it on an iOS device?

I understand that this violates the Apple License Agreement, section 3.2.2, but I ask for personal projects and to learn more about iOS runtime.

purpose

What i tried

I did not try anything specific, but I would suggest that something could be done in accordance with ...

void *myDownloadedLibrary = dlopen("/path/to/newly/downloaded/framework/MyCoolBinary.framework")
dlsym(myDownloadedLibrary)

Any examples or pointers to which libraries this will work with will be appreciated. Thank.

+4
1

-

void *uikit = dlopen("path_to_dylib", RTLD_LAZY);
id (*FunctionName)(id) = dlsym(uikit, "FunctionName");
FunctionName(arg1);
dlclose(uikit);

: http://en.wikipedia.org/wiki/Dynamic_loading

+3

Source: https://habr.com/ru/post/1537300/


All Articles