mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-06 21:02:55 +08:00
Compare commits
2 Commits
86408cd806
...
b8fa2a7405
Author | SHA1 | Date | |
---|---|---|---|
|
b8fa2a7405 | ||
|
0a8663c845 |
2
Makefile
2
Makefile
@ -86,7 +86,7 @@ $(LDSO_PATHNAME): $(LOBJS)
|
||||
-shared -o $@ $(LOBJS) $(SOCKET_LIBS)
|
||||
|
||||
$(ALL_TOOLS): $(OBJS)
|
||||
$(CC) src/main.o src/common.o $(USER_LDFLAGS) -o $(PXCHAINS)
|
||||
$(CC) src/main.o src/common.o $(USER_LDFLAGS) $(LIBDL) -o $(PXCHAINS)
|
||||
|
||||
|
||||
.PHONY: all clean install install-config install-libs install-tools
|
||||
|
11
src/main.c
11
src/main.c
@ -19,6 +19,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#ifdef IS_MAC
|
||||
#define _DARWIN_C_SOURCE
|
||||
#endif
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static int usage(char **argv) {
|
||||
@ -49,7 +54,7 @@ static void set_own_dir(const char *argv0) {
|
||||
size_t l = strlen(argv0);
|
||||
while(l && argv0[l - 1] != '/')
|
||||
l--;
|
||||
if(l == 0)
|
||||
if(l == 0 || l >= sizeof(own_dir))
|
||||
#ifdef SUPER_SECURE
|
||||
memcpy(own_dir, "/dev/null/", 11);
|
||||
#else
|
||||
@ -111,7 +116,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
// search DLL
|
||||
|
||||
set_own_dir(argv[0]);
|
||||
Dl_info dli;
|
||||
dladdr(own_dir, &dli);
|
||||
set_own_dir(dli.dli_fname);
|
||||
|
||||
i = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user