shared-libraries

.so injection under linux: how to locate address of dlopen()?

自闭症网瘾萝莉.ら 提交于 2019-12-03 20:26:35
Recently I have become interested in Linux, and am trying to create a program which is capable of injecting a shared object (i.e. .so file, 'dynamically loadable library', "DLL" under Windows.) I know this can be done by setting an environmental variable, but I want to do it on a process which is already running. I already know how to do this under Windows. There are several ways, but generally speaking you can just call LoadLibrary() by creating a remote thread using CreateRemoteThread(). Of course you need the address of LoadLibrary in the remote process, but (in my experience) it is always

How to handle shared projects in team foundation server source control structure

孤街醉人 提交于 2019-12-03 19:42:31
问题 After having read Team Foundation Server Source Control Structure which I have followed a few questions come to mind that I am wondering if anyone can comment on. I have a few components that make up a project I am working on. I have a smartclient, a webservice, a proxy for the webservice that the smartclient uses, a daemon and a common utilities library that is used in both the smartclient and the webservice. Each of the components are related to the same work project. I have structured my

How to link to shared lib from shared lib with relative path?

不打扰是莪最后的温柔 提交于 2019-12-03 18:46:12
问题 I'm working on a Firefox plugin that uses external libraries to render 3D graphics on the browser. The problem is that I want the plugin to use external libraries packed with it without changing the LD_LIBRARY_PATH variable. The libraries are installed in a position relative to the plugin (a shared library too), while the actual executable (i.e. the browser) can be located somewhere entirely else. I'm testing it on Ubuntu (no problem at Windows version of the plugin) My dependencies are

__attribute__((constructor)) call order confusion

断了今生、忘了曾经 提交于 2019-12-03 17:49:57
问题 The answer here demonstrates that __attribute__((constructor)) is not called after static initialization, it is called in the declaration order. Then, what is the purpose of it, if it is not guaranteed to be called when all data is initialized? We could as well have our ((constructor)) code in the Foo constructor. What I'm looking for is a way to have, in a shared library, a code that will be executed after all static data is initialized and static constructors are called. I saw people

Dynamic loaded libraries and shared global symbols

本小妞迷上赌 提交于 2019-12-03 17:44:16
问题 Since I observed some strange behavior of global variables in my dynamically loaded libraries, I wrote the following test. At first we need a statically linked library: The header test.hpp #ifndef __BASE_HPP #define __BASE_HPP #include <iostream> class test { private: int value; public: test(int value) : value(value) { std::cout << "test::test(int) : value = " << value << std::endl; } ~test() { std::cout << "test::~test() : value = " << value << std::endl; } int get_value() const { return

Jar mismatch error when adding library in eclipse

半城伤御伤魂 提交于 2019-12-03 17:17:58
问题 I am new to Android and I am trying to add a library for viewPagerIndicator as this tutorial instructs me to do. However, when I add the library I get an error stating: Versions found are: Path: C:\Users\Bryan\workspace\MyPager\libs\android-support-v4.jar Length: 349252 SHA-1: 612846c9857077a039b533718f72db3bc041d389 Path: C:\Users\Bryan\git\Android-ViewPagerIndicator\library\libs\android-support-v4.jar Length: 271754 SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b Jar mismatch! Fix your

how to make shared library from a static library under ubuntu using gcc

不问归期 提交于 2019-12-03 17:17:11
i have a static library libsrp.a, i want to make a shared library libsrp.so from it that contains all symbols . please tell me how to make a .so under ubuntu. thanks Jasmeet Recompile the object files contained in libsrp.a with the flag to create position independent code (fpic) as in gcc -fpic -c foo.c gcc -fpic -c bar.c Now you can combine foo.o and bar.o into a shared library as in gcc -shared -o libshared.so foo.o bar.o Use the --whole-archive flag: gcc -shared -o libsrp.so -Wl,--whole-archive -lsrp -Wl,--no-whole-archive From the ld man page (my emphasis): --whole-archive For each archive

What is the right way to deploy files for a remote debug launch in Eclipse CDT?

只谈情不闲聊 提交于 2019-12-03 16:42:41
My situation: I'm currently trying to use Eclipse CDT as a replacement for a proprietary IDE. I have an enterprise application, which consists of an executable and a lot (30+) of shared library modules. The application is targeted for an embedded non-x86 platform, with POSIX-compatible operating system (QNX or GNU/Linux, depending on the selected toolchain). Because of that, debugging can't be done on a developer's machine. It has to be done remotely. I'm using Eclipse Luna / CDT 8.5 with Remote System Explorer plugin and GDB/DSF Create Process Launcher installed. By means of those plugins

How to load a shared library without loading its dependencies?

耗尽温柔 提交于 2019-12-03 16:24:48
问题 Say I have a library libfoo.so.1 , which depends (according to ldd ) on libbar.so.1 . However, libbar.so.1 is not available at the moment. My app needs to call a function in libfoo.so.1 which doesn't require libbar.so.1 at all. Is there a way to load libfoo.so.1 , resolve the function symbol and then call it without having libbar.so.1 to satisfy the dependency? It's a case of "I know what I'm doing, just let me do it already". I tried the RTLD_LAZY flag, but it still tries to load the libbar

Extend a dynamic linked shared library?

萝らか妹 提交于 2019-12-03 16:09:36
I'm new at C, so sorry for my lack of knowledge (my C-book here is really massive :) I would like to extend a shared library (libcustomer.so) with closed source, but public known api. Is something like this possible? rename libcustomer.so to liboldcustomer.so create an extended shared library libcustomer.so (so others implicitly use the extended one) link liboldcustomer.so into my extended libcustomer.so via -loldcustomer forward any not extra-implemented methods directly to the old "liboldcustomer.so" I don't think it would work that way (the name is compiled into the .so, isn't it?). But