Доброго ВС! Дорабатывал proxychains и словил крайне интересную ошибку... Изолировал ее на сколько мог:
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/param.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
void *dlsy7(void *, const char *); //special load from patched libdlsy7.so
void *(*true_dlopen)(const char *filename, int flags)=NULL;
void *(*true_dlsym)(void *handle, const char *symbol)=NULL;
void *dlopen(const char *filename, int flags) {
if(true_dlopen==NULL) {
true_dlopen=dlsym(RTLD_NEXT,"dlopen");
};
void * res=true_dlopen(filename,flags);
printf("DLOPEN %s res = 0x%" PRIx64 "\n",(char *)filename,(unsigned long int)res);
return res;
}
void *dlsym(void *handle, const char *symbol) {
printf("DLSYM %s 0x%" PRIx64,symbol,(unsigned long int)handle);
if(true_dlsym==NULL) {
true_dlsym=dlsy7(RTLD_NEXT,"dlsym");
};
void *res,*res1;
//res1=true_dlsym(handle, symbol); //DECOMENT THIS AND PROG WILL WORK
res=dlsy7(handle, symbol);
printf(" res = 0x%" PRIx64 " res1 = 0x%" PRIx64 "\n",(unsigned long int)res,(unsigned long int)res1);
return res;
};
Собираю так
gcc main.c -fPIC -shared /usr/lib/x86_64-linux-gnu/libd7.so.2 -o libdltest.so && sed -i "s|libdl.so.2|libd7.so.2|g" ./libdltest.so && echo -e "\e[32mDONE\e[0m"
LD_PRELOAD=./libdltest.so xed #Работает
LD_PRELOAD=./libdltest.so chromium-browser
Using PPAPI flash.
--disable-new-tab-first-run --enable-user-scripts --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version=
DLSYM dlopen 0xffffffffffffffff res = 0x7f5270541f70 res1 = 0x7f5271cc4568
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLSYM dlopen 0xffffffffffffffff res = 0x7f588926ef70 res1 = 0x7f588a9f1568
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN /usr/lib/chromium-browser/libwidevinecdmadapter.so res = 0x5564cafc6510
DLOPEN /usr/lib/adobe-flashplugin/libpepflashplayer.so res = 0x5564cafc7640
DLOPEN /usr/lib/chromium-browser/libwidevinecdm.so res = 0x5564cafc7190
DLOPEN libgdk-3.so.0 res = 0x7f5271c92000
DLSYM gdk_set_allowed_backends 0x7f5271c92000 res = 0x7f526b3183d0 res1 = 0x0
DLOPEN (null) res = 0x7f5271cc7168
DLSYM gtk_progress_get_type 0x7f5271cc7168 res = 0x0 res1 = 0x7f5271c97000
DLSYM localtime 0xffffffffffffffff res = 0x7f5270d1f930 res1 = 0x7ffd2e955040
DLSYM localtime64 0xffffffffffffffff res = 0x0 res1 = 0x7ffd2e955040
DLSYM localtime_r 0xffffffffffffffff res = 0x7f5270d1f920 res1 = 0x7ffd2e955040
DLSYM localtime64_r 0xffffffffffffffff res = 0x0 res1 = 0x7ffd2e955040
[13398:13398:0102/154843.197714:ERROR:browser_main_loop.cc(293)] Gtk: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
LD_PRELOAD=./libdltest.so chromium-browser
Using PPAPI flash.
--disable-new-tab-first-run --enable-user-scripts --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version=
DLSYM dlopen 0xffffffffffffffff res = 0x7fb079af2f70 res1 = 0x7fb079af2f70
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLSYM dlopen 0xffffffffffffffff res = 0x7f6c2d6baf70 res1 = 0x7f6c2d6baf70
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN liblttng-ust-tracepoint.so.0 res = 0x0
DLOPEN /usr/lib/chromium-browser/libwidevinecdmadapter.so res = 0x5587d9ed3510
DLOPEN /usr/lib/adobe-flashplugin/libpepflashplayer.so res = 0x5587d9ed4640
DLOPEN /usr/lib/chromium-browser/libwidevinecdm.so res = 0x5587d9ed4190
DLOPEN libgdk-3.so.0 res = 0x7fb07b243000
DLSYM gdk_set_allowed_backends 0x7fb07b243000 res = 0x7fb0748c93d0 res1 = 0x7fb0748c93d0
DLOPEN (null) res = 0x7fb07b278168
DLSYM gtk_progress_get_type 0x7fb07b278168 res = 0x0 res1 = 0x0
DLOPEN libgail.so res = 0x0
DLSYM gtk_progress_get_type 0x7fb07b278168 res = 0x0 res1 = 0x0
DLOPEN libatk-bridge.so res = 0x0
DLSYM gtk_progress_get_type 0x7fb07b278168 res = 0x0 res1 = 0x0
DLOPEN /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so res = 0x558143a37180
DLSYM g_module_check_init 0x558143a37180 res = 0x0 res1 = 0x0
DLSYM g_module_unload 0x558143a37180 res = 0x0 res1 = 0x0
DLSYM g_io_module_load 0x558143a37180 res = 0x7fb06a1b7e20 res1 = 0x7fb06a1b7e20
DLSYM g_io_module_unload 0x558143a37180 res = 0x7fb06a1b7f70 res1 = 0x7fb06a1b7f70
DLOPEN /usr/lib/x86_64-linux-gnu/gio/modules/libgiognomeproxy.so res = 0x558143a38c00
DLSYM g_module_check_init 0x558143a38c00 res = 0x0 res1 = 0x0
#Дальше длинный лог, а за ним нормальный запуск хрома....