Insert or add new library load command in iOS binary (ipa)

I tried to embed my own library in the iOS binary (ipa). But I couldn't do it. This question may have suggestions on this site, but there is no correct solution. I have already tried implementing some of the solutions or suggestions mentioned in the links below,

Add download command to mach-o binary
Inject dynamic library into enterprise application (ipa)
I want to know the execution flow of the IPA file
http://coscolla.net/injecting-code-to-a-ipa/

I tried inserting the library load command as per the documentation mentioned in optool . which actually expects runtime arguments. So I have included the following arguments in the Arguments section of Xcode,

install -c -p '/Users/raj/Desktop/Swizzling/libSwizzling.a' -t '/Users/raj/Documents/Builds/temp/Welcome.ipa' -o = '/ Users / raj / Documents / Builds / temp / modified.ipa

But it doesn't work. Even tried some other simple command and the same result. If anyone has used optool and its commands successfully, they can help me.

dyci-main is a code injection tool through which we cannot add or insert a library. This will be useful for adding or changing some logic or debugging goals. Also, there is nothing we can do, hopefully. If any body having the idea to insert a boot command gets a great rating.

injecting-code-to-a-ipa has some kind of solution, but it's not clear. Even if you follow every step, you will not be able to succeed. The main confusing part is the command load command, which we should execute according to the screenshot and should be saved as a dynamic library. What is the input file for executing commands? If you are able to make it successful, please let me know.

Unfortunately I was unable to get it to work. I really appreciate the person who really gives a clear and correct or effective solution to this problem.

Thanks in advance.

+3


source to share


2 answers


How do I use optool?

install:

optool install -c load -p "@executable_path/RedEnvelop.dylib" -t WeChat

WeChat can download RedEnvelop.dylib



unstall:

optool uninstall -p "@executable_path/RedEnvelop.dylib" -t WeChat

find the dylib path you can use otool

to highlight it: otool -L WeChat

+2


source


I used OpTool and it worked for me. I was more interested in inserting a load command for the dynamic library, and below are the command line arguments I have set. install -c -p -t ex. install -c load -p "@ executable_path / LibraryName.dylib" -t "/Users/xxx/AppName.app/AppName"

-load: This is the variable we have to give in order to insert LC_LOAD_DYLIB -payload: it must always be in the format "@ executable_path / name of Library.dylib" as we will copy the .dylib file to the myapp.app directory. - target: here you need to specify the full path of the executable binary file. which will be contained in the myapp.app directory



The modified binary executable will be generated in the same location and replaced.

One more thing is that after that you need to re-subscribe the ipa by following below url for the same. Rewrite IPA (iPhone)

+1


source







All Articles