dynamic-linking

How to insert a LC_LOAD_DYLIB command into a Mach-O binary or join a static library to an existing binary (IOS)

僤鯓⒐⒋嵵緔 提交于 2019-12-02 18:27:40
This is the first time I am asking on stackoverflow and I am desperate. My task is to load a dylib or join a static lib to an already existing executable for an IOS device. I will be using the static void __attribute__((constructor)) initialize(void) to start the swizzling. This executable is for in house enterprise appstore so i do not need to go thru the apple appstore (since they will reject it). The reason for this is to take an existing IPA from a customer and their signing keys and add a new functionality to their application without requiring a developer intervention. There is one

GDB “cannot open shared object file” Issue

℡╲_俬逩灬. 提交于 2019-12-02 09:22:29
I've already read gdb says "cannot open shared object file" and gdb can not open shared object file and followed the instructions. I have a binary which is linked to a shared library file ( /zzz/yyy/xxx.so ). After I set LD_LIBRARY_PATH to /zzz/yyy/ and run the binary without GDB, it executes very well. However, when I was trying to use GDB to debug this binary, GDB says: error while loading shared libraries: xxx.so: cannot open shared object file: No such file or directory I already have (set in .gdbinit): (gdb)show env LD_LIBRARY_PATH LD_LIBRARY_PATH = "/zzz/yyy/" and (gdb) show solib-search

LD_LIBRARY_PATH failing while trying to run Qt app

走远了吗. 提交于 2019-12-02 03:49:40
I want to run a Qt 5 based application usind dynamic libraries on Linux. In summary, a script will copy the executable and other relevant files, including all required .so inside a lib folder, to the desired destination and a script calling gksudo will work as caller to the app. Till now everything works fine till I call the executable script: the app doesn't run. When I ask to run with sudo , it tells me that a library (Qt5SerialPort...) is missing. Running ldd over the actual executable I discover that the app is getting the required libs not from within the lib folder, but some apparent

What is libpython3.so compared with libpython3.5m.so built from python 3.5.2 source?

旧时模样 提交于 2019-12-02 01:16:27
问题 In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14. When I built Python 3.5.2 from source with --with-shared options in Ubuntu, I got libpython3.so (7.6kB) and libpython3.5m.so (12MB). I assume the big one is the real one and the small one might be something forwarding calls to the real interfaces. As boost_python might assume the client to link against python (https://svn.boost.org/trac/boost/ticket/2615), I linked libpython3.so with my application.

undefined reference to symbol 'XF86VidModeQueryExtension' (linux, qt creator IDE)

旧街凉风 提交于 2019-12-02 01:00:14
问题 I've been trying to get some simple GL code that implements GFLW3 to compile on QT Creator (on Ubuntu 13.04). However I keep getting the same output when it tries building: undefined reference to symbol 'XF86VidModeQueryExtension' I then went to the .pro file and linked the lXxf86vm.so library file and added -lXxf86vm but it still gives the same output: g++ -m64 -o GL-Test main.o windowtest.o frametest.o -L/usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 -L/user/lib/x86_64-linux-gnu/libXxf86vm.so -L

interposers on Windows

拈花ヽ惹草 提交于 2019-12-02 00:43:17
Is it possible to substitute system functions, as is possible on Linux and Solaris using the LD_PRELOAD For example by setting the environment variable: LD_PRELOAD=/path/to/mymalloc.so I would have my replacement malloc functions instead of in the C runtime already installed in the system libraries. All other functions in the system dll's would run as normal. Microsoft Research has a library called Detours which allows you to intercept Win32 API calls. Detours is a library for instrumenting arbitrary Win32 functions on x86, x64, and IA64 machines. Detours intercepts Win32 functions by re

Marshal C++ “char**” in C#

≯℡__Kan透↙ 提交于 2019-12-02 00:14:01
问题 I'm calling C# method from C++ and passing char** as argument. It has to be char** because I need to return value through parameter. C# code: [ExportDll("test", System.Runtime.InteropServices.CallingConvention.StdCall)] public static int test([MarshalAs(UnmanagedType.AnsiBStr)] ref string p) { Console.WriteLine(p); } C++ code to invoke function: typedef int (__stdcall *MYPROC)(char **); VOID main(VOID) { HINSTANCE hinstLib; MYPROC MyProc; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;

What is libpython3.so compared with libpython3.5m.so built from python 3.5.2 source?

房东的猫 提交于 2019-12-01 22:41:53
In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14. When I built Python 3.5.2 from source with --with-shared options in Ubuntu, I got libpython3.so (7.6kB) and libpython3.5m.so (12MB). I assume the big one is the real one and the small one might be something forwarding calls to the real interfaces. As boost_python might assume the client to link against python ( https://svn.boost.org/trac/boost/ticket/2615 ), I linked libpython3.so with my application. But when I run it, I got the unresolved symbols error. ldd -r myapp or ldd -r libboost_python.so both

Linking with -R and -rpath switches on Windows

断了今生、忘了曾经 提交于 2019-12-01 21:22:13
I,m using gcc compiler(MinGW) on Windows XP.I created a .dll library libdir.dll than I tried to build a program that is using that library. I don't want to put that .dll file into System or System32 folder nor to set path to it in PATH variable, what i want is to give that information to the program itself. I know there is a -R and -rpath switches available so i was gonna link it with one of them. First -rpath: gcc -L /path/to/lib -Wl,-rpath, /path/to/lib main.o -ldir -o prog Than -R: gcc -L /path/to/lib -Wl,-R, /path/to/lib main.o -ldir -o prog This links successfully into prog but when i

Marshal C++ “char**” in C#

天大地大妈咪最大 提交于 2019-12-01 20:53:58
I'm calling C# method from C++ and passing char** as argument. It has to be char** because I need to return value through parameter. C# code: [ExportDll("test", System.Runtime.InteropServices.CallingConvention.StdCall)] public static int test([MarshalAs(UnmanagedType.AnsiBStr)] ref string p) { Console.WriteLine(p); } C++ code to invoke function: typedef int (__stdcall *MYPROC)(char **); VOID main(VOID) { HINSTANCE hinstLib; MYPROC MyProc; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; hinstLib = LoadLibrary(TEXT("mydll.dll")); if (hinstLib != NULL) { ProcAdd = (MYPROC) GetProcAddress(hinstLib,