step 1, create
libadd.dylib
Find out more about
otool
by doingcol
helps to format the output from man
properly. I learned we can do this:I don't speak assembly, but I can get the general idea.
Step 2, create
useadd
Step 3. Use an environment variable to give output when libraries are loaded:
Notice in the second run of
./useadd
, we loaded /tmp/libadd.dylib
.Finally, let's snoop on Python:
We can see that some .so libraries can be loaded. However, there are some fundamental differences between the Unix method of shared object .so libraries and the OS X / Mach model of bundles and frameworks.
That's for the future!