Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1

² Link Mach-O Objects


iOSREProject_LDFLAGS = - lx

Theos use GNU Linker to link Mach-O objects, including .dylib, .a and .o files. Input “man


ld” in Terminal and locate to “-lx”, it is described as follows:


“-lx This option tells the linker to search for libx.dylib or libx.a in the library search


path. If string x is of the form y.o, then that file is searched for in the same places, but


without prepending lib' or appending.a' or `.dylib' to the filename.”


As shown in figure 3-3, all Mach-O objects are named in the formats of “libx.dylib” and


“y.o”, who’re fully compatible with GNU Linker.


Figure 3- 3 Link Mach-O Objects


So, linking Mach-O objects becomes convenient. For example, if you want to link


libsqlite3.0.dylib, libz.dylib and dylib1.o, you can do it like this:


iOSREProject_LDFLAGS = - lz – lsqlite3.0 – dylib1.o

There is still one more field to introduce later, but without it Makefile is good to work for


now. For more Makefile introductions, you can refer to


http://www.gnu.org/software/make/manual/html_node/Makefiles.html.



  • Tweak.xm


The default source file of a tweak project created by Theos is Tweak.xm. “x” in “xm”

Free download pdf