Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fishhook with dyld 3.0 #43

Open
LeoNatan opened this issue Jun 25, 2017 · 9 comments
Open

fishhook with dyld 3.0 #43

LeoNatan opened this issue Jun 25, 2017 · 9 comments

Comments

@LeoNatan
Copy link

https://developer.apple.com/videos/play/wwdc2017/413/

Apple is revamping its dynamic linker. One of the major changes is that they will be doing full symbol resolution at launch time, rather than using the on demand resolution using trampolines. Is this a risk for fishhook’s operation?

Right now, they new dynamic linker is not enabled for user applications. This is expected to happen somewhen soon.

@kastiglione
Copy link
Contributor

kastiglione commented Jun 27, 2017

Is this a risk for fishhook’s operation?

Maybe. I had heard that some APIs, like dlopen, would cause apps to use the old dyld behavior. If that's the case then it will still be possible to use fishhook if needed. If Apple one day forces apps to use dyld 3, then yes fishhook will no longer be applicable.

@LeoNatan
Copy link
Author

LeoNatan commented Jun 27, 2017

Dylibs loaded by dlopen are handled the old way, but then rebinding will only work for those dylibs.

I think there is a linker flag to achieve this if an apps functionality is broken. Just wanted to make sure I understood correctly the implications. Let’s keep this issue open for now, as it will be interesting to see how things go. I am familiar with projects that inject code by inserting LC_LOAD_DYLIB commands statically, and then on launch use fishhook to rebind symbols. As I understand it, such a project would fail to rebind, if the binary was not linked with that flag (so they might have to modify more portions of the binary in addition to inserting LC_LOAD_DYLIB commands).

@kastiglione
Copy link
Contributor

https://mobile.twitter.com/lgerbarg/status/882055176298704896

According to this third party apps have another year before being able to use dyld3.

@dzan
Copy link

dzan commented Oct 13, 2017

Any news on this now that iOS11 is released? On twitter people reported it was used in e.g. Safari already.

@mmmulani
Copy link

mmmulani commented Dec 1, 2017

I'm having trouble getting fishhook to work on iOS 11.1 on a project where it previously worked, so perhaps they enabled dyld 3.0 in 11.1?

@kastiglione
Copy link
Contributor

perhaps they enabled dyld 3.0 in 11.1

if you find out anything, please follow up

@LeoNatan
Copy link
Author

LeoNatan commented Dec 6, 2017

I don’t believe this to be the case. We’re using fishhook with Xcode 9.2 projects on iOS 11.2 and have observed no issues (other than already-known ones).

@dzan
Copy link

dzan commented Jan 19, 2018

Dyld3 source is available here; https://opensource.apple.com/tarballs/dyld/dyld-519.2.1.tar.gz

I haven't had the time yet to look into it but maybe someone else has? Please let us know what you find and if the fishhook approach is still valid.

@LeoNatan LeoNatan changed the title fishhook on iOS 11 / dyld 3.0 fishhook with dyld 3.0 Jan 19, 2018
@lanza
Copy link

lanza commented Jan 22, 2018

As far as I can tell this shouldn't be an issue unless some of the APIs are deprecated.

fishhook still works even if you call it after the symbol you are rebinding has been bound. (e.g. sin(); rebind_symbol({ "sin", my_sin, orig_sin }); sin();) Watching that video seems like the only thing changing is that the loader will be loading a cached version of the image with the symbols already resolved. Am I missing some aspect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants