complete mac support

This commit is contained in:
rofl0r 2012-01-27 20:48:24 +01:00
parent 6d25f5d89e
commit c36db11ebc
3 changed files with 16 additions and 6 deletions

View File

@ -24,6 +24,8 @@ AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
LDSO_SUFFIX = so
LD_SET_SONAME = -Wl,-soname=
INSTALL_FLAGS = -D -m
-include config.mak
@ -35,7 +37,7 @@ PXCHAINS = proxychains4
ALL_TOOLS = $(PXCHAINS)
CFLAGS+=$(USER_CFLAGS)
CFLAGS+=$(USER_CFLAGS) $(MAC_CFLAGS)
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DINSTALL_PREFIX=\"$(prefix)\" -DDLL_NAME=\"$(LDSO_PATHNAME)\"
@ -43,9 +45,9 @@ all: $(ALL_LIBS) $(ALL_TOOLS)
#install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME)
install:
install -D -m 755 $(ALL_TOOLS) $(bindir)/
install -D -m 644 $(ALL_LIBS) $(libdir)/
install -D -m 644 src/proxychains.conf $(prefix)/etc/
install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(bindir)/
install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(libdir)/
install $(INSTALL_FLAGS) 644 src/proxychains.conf $(prefix)/etc/
clean:
rm -f $(ALL_LIBS)
@ -56,7 +58,7 @@ clean:
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
$(LDSO_PATHNAME): $(LOBJS)
$(CC) $(LDFLAGS) -Wl,-soname=$(LDSO_PATHNAME) -o $@ $(LOBJS)
$(CC) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) -o $@ $(LOBJS)
$(ALL_TOOLS): $(OBJS)
$(CC) src/main.o -o $(PXCHAINS)

3
configure vendored
View File

@ -60,6 +60,9 @@ echo libdir=$libdir>>config.mak
echo includedir=$includedir>>config.mak
if ismac ; then
echo LDSO_SUFFIX=dylib>>config.mak
echo MAC_CFLAGS+=-DIS_MAC=1>>config.mak
echo LD_SET_SONAME=-Wl,-install_name,>>config.mak
echo INSTALL_FLAGS=-m>>config.mak
fi
echo done, now run make \&\& make install

View File

@ -167,9 +167,14 @@ int main(int argc, char *argv[]) {
if(!quiet)
fprintf(stderr, LOG_PREFIX "preloading %s/%s\n", prefix, dll_name);
#ifndef IS_MAC
snprintf(buf, sizeof(buf), "LD_PRELOAD=%s/%s", prefix, dll_name);
putenv(buf);
#else
snprintf(buf, sizeof(buf), "DYLD_INSERT_LIBRARIES=%s/%s", prefix, dll_name);
putenv(buf);
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
#endif
execvp(argv[start_argv], &argv[start_argv]);
perror("proxychains can't load process....");