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

Dylib injection not always working #256

Open
moon-cacke opened this issue Feb 5, 2025 · 9 comments
Open

Dylib injection not always working #256

moon-cacke opened this issue Feb 5, 2025 · 9 comments
Labels
bug Something isn't working

Comments

@moon-cacke
Copy link

Version

iOS 18.1.1

Start going into detail..

Hi,

First of all thanks for that amazing app and thanks for making it opensource :)

When I inject dylib with command line tools or web installer or telegram bot they work correctly.

But when they are injected with feather they dont always work, here is a clear example: (my example have nothing to do with piracy I am loading normal app without any crack)

Lets take Surge app as an example it require a dylib for the VPN tunnel to work, this can be injected on
https://signer.apptesters.org
With the option "Inject SideloadKeychainFix and WidgetExtensionFix.dylib" which will inject a single file "PluginsInject.dylib" which is the combination of both fixes, this is required to make the Surge app VPN tunnel to work, or any other VPN app... this works.

That dylib is basically blatant dylib by blatant which have a telegram bot as well that permit to inject the library which works as well.

On Feather when we inject that PluginsInject.dylib it is not injected correctly/fully and the VPN tunnel is not fixed.

Is there anything that can be done on feather to make such injection work?

Thanks a lot

@moon-cacke moon-cacke added the bug Something isn't working label Feb 5, 2025
@GottaLoveAng
Copy link
Collaborator

i believe this is due to the injection path not being customizable with feather. but i could be wrong.

i've seen it talked about before but i think it was either put off or forgotten about as of late. this might be a good reminder to add it though

@moon-cacke
Copy link
Author

moon-cacke commented Feb 5, 2025

Thanks a lot for your reply...

As additional information, eSign App suffer from the same bug and changing the directory to "/" or "Frameworks/" does not fix it.
Also changing the path @executabe/@rpath does not fix it as well. I will check again to make sure this info is correct...

I did not push the debugging further but last time I checked the dylib was correctly linked to the main binary by feather same as other injection tools, I guess something subtle is missing.

Thanks a lot for checking

@khcrysalis
Copy link
Owner

Thanks for making an issue, I know feathers dylib injection stuff isnt perfect but all I know that it does work for most things.

I'm not sure about the context used for the dylibs you're using so its hard to figure out what is exactly wrong, so you need to link the debs so I can test it locally.

Also regarding the injection path in reality makes no difference.

@moon-cacke
Copy link
Author

moon-cacke commented Feb 5, 2025

Thanks a lot for the reply... I am going to do some binary reversals and post back the exact issue ;) soon

@asdfzxcvbn
Copy link

to correctly inject plugins patcher you need to also insert the LC in all plugin binaries

@moon-cacke
Copy link
Author

moon-cacke commented Feb 5, 2025

Indeed the issue was a lack of injection/linkage of the the dylib on the mach-o binary of each plugin, this is what other tools do and Feather dont, in addition to the main app's binary injection/linkage.

Here is a concrete example, pluginsinject.dylib, fix the the lack of VPN tunnel establishments (connect button does nothing) on VPN apps like Surge by hooking some keychain methods and other related methods to adapt the app to a sideloaded environment.

pluginsinject.zip just unzip before usage ;)

If the dylib is linked to the main binary + plugins it works but don't if its only linked to the main app's binary (current situation)

Not all dylibs needs to be injected on plugins, one solution could be a feature that permit to inject a specific dylib to plugins in addition to the main binary, this can eventually be done with:

In the page where we load a dylib/deb for injection on Feather on the + button we could have instead a dropdown menu with
[Inject in main app]
[Inject in main app plus plugins]

Or on the displayed list of dylib on the tweak page we could have checkbox for each dylib that would enable the feature

Or on longpress on a dylib we could have an option there to enable it for all plugins as well

@khcrysalis Thank you so much for everything and for checking that 👍

@castdrian
Copy link
Collaborator

castdrian commented Feb 5, 2025

to correctly inject plugins patcher you need to also insert the LC in all plugin binaries

Do you mind if we just look at whatever you do in the cyan repo and just adapt that into swift?

I've been meaning to have a look at injecting Debian packages entirely anyway, since currently you can only inject the dylib which evidently doesn't help if the tweak has a resource bundle for instance

@asdfzxcvbn
Copy link

asdfzxcvbn commented Feb 5, 2025

to correctly inject plugins patcher you need to also insert the LC in all plugin binaries

Do you mind if we just look at whatever you do in the cyan repo and just adapt that into swift?

I've been meaning to have a look at injecting Debian packages entirely anyway, since currently you can only inject the dylib which evidently doesn't help if the tweak has a resource bundle for instance

cyan is under unlicense (public domain), do whatever you'd like

anyway, cyan doesnt support injecting dylibs into plugins (in fact, i dont know any injectors that do, you have to do this yourself i guess), my own plugins patching bot only extracts the binaries from IPAs, injects the LC into them, and writes them back

@moon-cacke
Copy link
Author

Just a simple feature/function for dylib file type to enable that on plugins will be fine, may be with an option on long press on a dylib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants