Loading Makefile +12 −0 Original line number Diff line number Diff line PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin SYS := $(shell gcc -dumpmachine) GITVER := $(shell git describe --tags) ifeq ($(GITVER),) GITVER = "unknown" endif # LINUX # The automated regression tests run on Linux, so this is the one Loading Loading @@ -67,6 +72,11 @@ CFLAGS = -g -ggdb $(FLAGS2) $(INCLUDES) $(DEFINES) -Wall -O3 all: bin/masscan tmp/main-conf.o: src/main-conf.c src/*.h $(CC) $(CFLAGS) -c $< -o $@ -DGIT=\"$(GITVER)\" # just compile everything in the 'src' directory. Using this technique # means that include file dependencies are broken, so sometimes when # the program crashes unexpectedly, 'make clean' then 'make' fixes the Loading @@ -74,9 +84,11 @@ all: bin/masscan tmp/%.o: src/%.c src/*.h $(CC) $(CFLAGS) -c $< -o $@ SRC = $(wildcard src/*.c) OBJ = $(addprefix tmp/, $(notdir $(addsuffix .o, $(basename $(SRC))))) bin/masscan: $(OBJ) $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LIBS) Loading src/main-conf.c +89 −2 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ */ #include "masscan.h" #include "masscan-version.h" #include "ranges.h" #include "string_s.h" #include "logger.h" Loading Loading @@ -55,6 +56,88 @@ masscan_usage(void) exit(1); } /*************************************************************************** ***************************************************************************/ static void print_version() { const char *cpu = "unknown"; const char *compiler = "unknown"; const char *compiler_version = "unknown"; const char *os = "unknown"; printf("\n"); printf("Masscan version %s ( %s )\n", MASSCAN_VERSION, "https://github.com/robertdavidgraham/masscan" ); printf("Compiled on: %s %s\n", __DATE__, __TIME__); #if defined(_MSC_VER) #if defined(_M_AMD64) || defined(_M_X64) cpu = "x86"; #elif defined(_M_IX86) cpu = "x86"; #elif defined (_M_ARM_FP) cpu = "arm"; #endif { int msc_ver = _MSC_VER; compiler = "VisualStudio"; if (msc_ver < 1500) compiler_version = "pre2008"; else if (msc_ver == 1500) compiler_version = "2008"; else if (msc_ver == 1600) compiler_version = "2010"; else if (msc_ver == 1700) compiler_version = "2012"; else if (msc_ver == 1800) compiler_version = "2013"; else compiler_version = "post-2013"; } #elif defined(__GNUC__) compiler = "gcc"; compiler_version = __VERSION__; #if defined(i386) || defined(__i386) || defined(__i386__) cpu = "x86"; #endif #if defined(__corei7) || defined(__corei7__) cpu = "x86-Corei7"; #endif #endif #if defined(WIN32) os = "Windows"; #elif defined(__linux__) os = "Linux"; #elif defined(__APPLE__) os = "Apple"; #elif defined(__MACH__) os = "MACH"; #elif defined(__FreeBSD__) os = "FreeBSD"; #elif defined(unix) || defined(__unix) || defined(__unix__) os = "Unix"; #endif printf("Compiler: %s %s\n", compiler, compiler_version); printf("OS: %s\n", os); printf("CPU: %s (%u bits)\n", cpu, (unsigned)(sizeof(void*))*8); #if defined(GIT) printf("GIT version: %s\n", GIT); #endif } /*************************************************************************** ***************************************************************************/ static void Loading Loading @@ -1452,6 +1535,9 @@ masscan_set_parameter(struct Masscan *masscan, } else { masscan->nmap.ttl = x; } } else if (EQUALS("version", name)) { print_version(); exit(1); } else if (EQUALS("version-intensity", name)) { fprintf(stderr, "nmap(%s): unsupported\n", name); exit(1); Loading Loading @@ -1485,7 +1571,8 @@ is_singleton(const char *name) { static const char *singletons[] = { "echo", "selftest", "self-test", "regress", "system-dns", "traceroute", "version-light", "system-dns", "traceroute", "version", "version-light", "version-all", "version-trace", "osscan-limit", "osscan-guess", "badsum", "reason", "open", "open-only", Loading Loading @@ -1856,7 +1943,7 @@ masscan_command_line(struct Masscan *masscan, int argc, char *argv[]) } break; case 'V': /* print version and exit */ exit(1); masscan_set_parameter(masscan, "version", ""); break; case 'W': masscan->op = Operation_List_Adapters; Loading src/masscan-version.h +1 −1 Original line number Diff line number Diff line #ifndef MASSCAN_VERSION #define MASSCAN_VERSION "1.0.2" #define MASSCAN_VERSION "1.0.3" #endif Loading
Makefile +12 −0 Original line number Diff line number Diff line PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin SYS := $(shell gcc -dumpmachine) GITVER := $(shell git describe --tags) ifeq ($(GITVER),) GITVER = "unknown" endif # LINUX # The automated regression tests run on Linux, so this is the one Loading Loading @@ -67,6 +72,11 @@ CFLAGS = -g -ggdb $(FLAGS2) $(INCLUDES) $(DEFINES) -Wall -O3 all: bin/masscan tmp/main-conf.o: src/main-conf.c src/*.h $(CC) $(CFLAGS) -c $< -o $@ -DGIT=\"$(GITVER)\" # just compile everything in the 'src' directory. Using this technique # means that include file dependencies are broken, so sometimes when # the program crashes unexpectedly, 'make clean' then 'make' fixes the Loading @@ -74,9 +84,11 @@ all: bin/masscan tmp/%.o: src/%.c src/*.h $(CC) $(CFLAGS) -c $< -o $@ SRC = $(wildcard src/*.c) OBJ = $(addprefix tmp/, $(notdir $(addsuffix .o, $(basename $(SRC))))) bin/masscan: $(OBJ) $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LIBS) Loading
src/main-conf.c +89 −2 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ */ #include "masscan.h" #include "masscan-version.h" #include "ranges.h" #include "string_s.h" #include "logger.h" Loading Loading @@ -55,6 +56,88 @@ masscan_usage(void) exit(1); } /*************************************************************************** ***************************************************************************/ static void print_version() { const char *cpu = "unknown"; const char *compiler = "unknown"; const char *compiler_version = "unknown"; const char *os = "unknown"; printf("\n"); printf("Masscan version %s ( %s )\n", MASSCAN_VERSION, "https://github.com/robertdavidgraham/masscan" ); printf("Compiled on: %s %s\n", __DATE__, __TIME__); #if defined(_MSC_VER) #if defined(_M_AMD64) || defined(_M_X64) cpu = "x86"; #elif defined(_M_IX86) cpu = "x86"; #elif defined (_M_ARM_FP) cpu = "arm"; #endif { int msc_ver = _MSC_VER; compiler = "VisualStudio"; if (msc_ver < 1500) compiler_version = "pre2008"; else if (msc_ver == 1500) compiler_version = "2008"; else if (msc_ver == 1600) compiler_version = "2010"; else if (msc_ver == 1700) compiler_version = "2012"; else if (msc_ver == 1800) compiler_version = "2013"; else compiler_version = "post-2013"; } #elif defined(__GNUC__) compiler = "gcc"; compiler_version = __VERSION__; #if defined(i386) || defined(__i386) || defined(__i386__) cpu = "x86"; #endif #if defined(__corei7) || defined(__corei7__) cpu = "x86-Corei7"; #endif #endif #if defined(WIN32) os = "Windows"; #elif defined(__linux__) os = "Linux"; #elif defined(__APPLE__) os = "Apple"; #elif defined(__MACH__) os = "MACH"; #elif defined(__FreeBSD__) os = "FreeBSD"; #elif defined(unix) || defined(__unix) || defined(__unix__) os = "Unix"; #endif printf("Compiler: %s %s\n", compiler, compiler_version); printf("OS: %s\n", os); printf("CPU: %s (%u bits)\n", cpu, (unsigned)(sizeof(void*))*8); #if defined(GIT) printf("GIT version: %s\n", GIT); #endif } /*************************************************************************** ***************************************************************************/ static void Loading Loading @@ -1452,6 +1535,9 @@ masscan_set_parameter(struct Masscan *masscan, } else { masscan->nmap.ttl = x; } } else if (EQUALS("version", name)) { print_version(); exit(1); } else if (EQUALS("version-intensity", name)) { fprintf(stderr, "nmap(%s): unsupported\n", name); exit(1); Loading Loading @@ -1485,7 +1571,8 @@ is_singleton(const char *name) { static const char *singletons[] = { "echo", "selftest", "self-test", "regress", "system-dns", "traceroute", "version-light", "system-dns", "traceroute", "version", "version-light", "version-all", "version-trace", "osscan-limit", "osscan-guess", "badsum", "reason", "open", "open-only", Loading Loading @@ -1856,7 +1943,7 @@ masscan_command_line(struct Masscan *masscan, int argc, char *argv[]) } break; case 'V': /* print version and exit */ exit(1); masscan_set_parameter(masscan, "version", ""); break; case 'W': masscan->op = Operation_List_Adapters; Loading
src/masscan-version.h +1 −1 Original line number Diff line number Diff line #ifndef MASSCAN_VERSION #define MASSCAN_VERSION "1.0.2" #define MASSCAN_VERSION "1.0.3" #endif