4

As an academic and mental exercise, how would one download a precompiled binary file and execute methods in it on an iOS device?

I understand this violates Apple's License Agreement, section 3.2.2, but I am asking for personal projects and to learn more about the iOS runtime.

Goal

What I've tried

I haven't attempted anything concrete, but I would imagine that it would be possible to do something along the lines of...

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

Any examples or pointers on what kind of libraries this would work with would be appreciated.
Thanks.

1 Answer 1

3

Try something like

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

For more information you can read about dynamic loading here: http://en.wikipedia.org/wiki/Dynamic_loading

Sign up to request clarification or add additional context in comments.

1 Comment

is this valid? will a app with this kind of code be approved?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.