mirror of
				https://github.com/rofl0r/proxychains-ng.git
				synced 2025-11-04 00:56:03 +00:00 
			
		
		
		
	print proxychains version on DLL init
framework to print version stolen from musl
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -8,6 +8,7 @@
 | 
				
			|||||||
*.out
 | 
					*.out
 | 
				
			||||||
*~
 | 
					*~
 | 
				
			||||||
*.patch
 | 
					*.patch
 | 
				
			||||||
 | 
					version.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Autoconf stuff 
 | 
					# Autoconf stuff 
 | 
				
			||||||
libtool
 | 
					libtool
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
									
									
									
									
								
							@@ -15,11 +15,13 @@ sysconfdir=$(prefix)/etc
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SRCS = $(sort $(wildcard src/*.c))
 | 
					SRCS = $(sort $(wildcard src/*.c))
 | 
				
			||||||
OBJS = $(SRCS:.c=.o)
 | 
					OBJS = $(SRCS:.c=.o)
 | 
				
			||||||
LOBJS = src/nameinfo.o \
 | 
					LOBJS = src/nameinfo.o src/version.o \
 | 
				
			||||||
        src/core.o src/common.o src/libproxychains.o src/shm.o \
 | 
					        src/core.o src/common.o src/libproxychains.o src/shm.o \
 | 
				
			||||||
        src/allocator_thread.o src/ip_type.o src/stringdump.o \
 | 
					        src/allocator_thread.o src/ip_type.o src/stringdump.o \
 | 
				
			||||||
        src/hostentdb.o src/hash.o src/debug.o
 | 
					        src/hostentdb.o src/hash.o src/debug.o
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GENH = src/version.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CFLAGS  += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
 | 
					CFLAGS  += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
 | 
				
			||||||
NO_AS_NEEDED = -Wl,--no-as-needed
 | 
					NO_AS_NEEDED = -Wl,--no-as-needed
 | 
				
			||||||
LIBDL   = -ldl
 | 
					LIBDL   = -ldl
 | 
				
			||||||
@@ -61,6 +63,12 @@ clean:
 | 
				
			|||||||
	rm -f $(ALL_LIBS)
 | 
						rm -f $(ALL_LIBS)
 | 
				
			||||||
	rm -f $(ALL_TOOLS)
 | 
						rm -f $(ALL_TOOLS)
 | 
				
			||||||
	rm -f $(OBJS)
 | 
						rm -f $(OBJS)
 | 
				
			||||||
 | 
						rm -f $(GENH)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					src/version.h: $(wildcard VERSION .git)
 | 
				
			||||||
 | 
						printf '#define VERSION "%s"\n' "$$(sh tools/version.sh)" > $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					src/version.o: src/version.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%.o: %.c
 | 
					%.o: %.c
 | 
				
			||||||
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
 | 
						$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,6 +98,8 @@ static void* load_sym(char* symname, void* proxyfunc) {
 | 
				
			|||||||
#include "allocator_thread.h"
 | 
					#include "allocator_thread.h"
 | 
				
			||||||
#include "stringdump.h"
 | 
					#include "stringdump.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const char *proxychains_get_version(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void do_init(void) {
 | 
					static void do_init(void) {
 | 
				
			||||||
	srand(time(NULL));
 | 
						srand(time(NULL));
 | 
				
			||||||
	dumpstring_init(); // global string garbage can
 | 
						dumpstring_init(); // global string garbage can
 | 
				
			||||||
@@ -108,7 +110,7 @@ static void do_init(void) {
 | 
				
			|||||||
	get_chain_data(proxychains_pd, &proxychains_proxy_count, &proxychains_ct);
 | 
						get_chain_data(proxychains_pd, &proxychains_proxy_count, &proxychains_ct);
 | 
				
			||||||
	DUMP_PROXY_CHAIN(proxychains_pd, proxychains_proxy_count);
 | 
						DUMP_PROXY_CHAIN(proxychains_pd, proxychains_proxy_count);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proxychains_write_log(LOG_PREFIX "DLL init\n");
 | 
						proxychains_write_log(LOG_PREFIX "DLL init: proxychains-ng %s\n", proxychains_get_version());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SETUP_SYM(connect);
 | 
						SETUP_SYM(connect);
 | 
				
			||||||
	SETUP_SYM(gethostbyname);
 | 
						SETUP_SYM(gethostbyname);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								src/version.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								src/version.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					#include "version.h"
 | 
				
			||||||
 | 
					static const char version[] = VERSION;
 | 
				
			||||||
 | 
					const char *proxychains_get_version(void) {
 | 
				
			||||||
 | 
						return version;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								tools/version.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								tools/version.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if test -d .git ; then
 | 
				
			||||||
 | 
					if type git >/dev/null 2>&1 ; then
 | 
				
			||||||
 | 
					git describe --tags --match 'v[0-9]*' 2>/dev/null \
 | 
				
			||||||
 | 
					| sed -e 's/^v//' -e 's/-/-git-/'
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					sed 's/$/-git/' < VERSION
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					cat VERSION
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Reference in New Issue
	
	Block a user