1
0
mirror of https://github.com/Wind4/vlmcsd.git synced 2025-07-03 09:17:57 +08:00

15 Commits

639 changed files with 110819 additions and 14755 deletions

View File

@ -1,32 +1,19 @@
################################################################################
.NOTPARALLEL:
.PHONY: clean
MAX_THREADS ?= 16
PROGRAM_NAME ?= vlmcsd
CLIENT_NAME ?= vlmcs
MULTI_NAME ?= vlmcsdmulti
OBJ_NAME ?= libkms-static.o
A_NAME ?= libkms.a
CONFIG ?= config.h
COMPILER_LANGUAGE ?= c
PROGRAM_NAME ?= bin/vlmcsd
CLIENT_NAME ?= bin/vlmcs
MULTI_NAME ?= bin/vlmcsdmulti
OBJ_NAME ?= build/libkms-static.o
A_NAME ?= lib/libkms.a
# crypto library to use for standard algos, could save ~1-2kb ;)
# can be either 'openssl', 'polarssl' or anything other for internal impl
CRYPTO ?= internal
BASE_PROGRAM_NAME=$(notdir $(PROGRAM_NAME))
BASE_CLIENT_NAME=$(notdir $(CLIENT_NAME))
BASE_MULTI_NAME=$(notdir $(MULTI_NAME))
BASE_DLL_NAME=$(notdir $(DLL_NAME))
BASE_A_NAME=$(notdir $(A_NAME))
# use DNS_PARSER=internal if your OS doesn't supply the DNS parser routines
DNS_PARSER ?= OS
# You should supply your own version string here
VLMCSD_VERSION ?= $(shell test -d .svn && echo svn`svnversion`)
FEATURES ?= full
VERBOSE ?= NO
################################################################################
CC ?= gcc
TARGETPLATFORM := $(shell LANG=en_US.UTF-8 $(CC) -v 2>&1 | grep '^Target: ' | cut -f 2 -d ' ')
ifneq (,$(findstring darwin,$(TARGETPLATFORM)))
@ -34,7 +21,7 @@ ifneq (,$(findstring darwin,$(TARGETPLATFORM)))
UNIX := 1
endif
ifneq (,$(findstring androideabi,$(TARGETPLATFORM)))
ifneq (,$(findstring android,$(TARGETPLATFORM)))
ANDROID := 1
UNIX := 1
ELF := 1
@ -106,437 +93,63 @@ endif
endif
ifeq ($(CYGWIN),1)
DLL_NAME ?= cygkms.dll
DLL_NAME ?= lib/cygkms.dll
else ifeq ($(WIN),1)
DLL_NAME ?= libkms.dll
DLL_NAME ?= lib/libkms.dll
else ifeq ($(DARWIN),1)
DLL_NAME ?= libkms.dylib
DLL_NAME ?= lib/libkms.dylib
else
DLL_NAME ?= libkms.so
DLL_NAME ?= lib/libkms.so
endif
BASECFLAGS = -DVLMCSD_COMPILER=\"$(notdir $(CC))\" -DVLMCSD_PLATFORM=\"$(TARGETPLATFORM)\" -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections
BASELDFLAGS =
STRIPFLAGS =
CLIENTLDFLAGS =
SERVERLDFLAGS =
.DEFAULT:
+@(test -d bin || mkdir bin) & (test -d lib || mkdir lib) & (test -d build || mkdir build)
+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)
ifndef SAFE_MODE
BASECFLAGS += -fvisibility=hidden -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants
ifeq ($(ELF),1)
BASELDFLAGS += -Wl,-z,norelro
endif
ifneq (,$(findstring gcc,$(notdir $(CC))))
BASECFLAGS += -flto
endif
endif
ifeq ($(NOLIBS),1)
NOLRESOLV=1
NOLPTHREAD=1
endif
ifneq ($(NO_DNS),1)
ifneq ($(ANDROID),1)
ifneq ($(NOLRESOLV),1)
ifeq ($(MINGW),1)
CLIENTLDFLAGS += -ldnsapi
endif
ifeq ($(LINUX),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(HURD),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(DARWIN),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(CYGWIN),1)
DNS_PARSER := internal
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(OPENBSD),1)
DNS_PARSER := internal
endif
ifeq ($(SOLARIS),1)
CLIENTLDFLAGS += -lresolv
endif
endif
endif
else
BASECFLAGS += -DNO_DNS
endif
ifneq ($(CAT),2)
BASECFLAGS += "-Wall"
endif
ifeq ($(DARWIN), 1)
STRIPFLAGS += -Wl,-S -Wl,-x
BASECFLAGS += -Wno-deprecated-declarations
else ifeq ($(shell uname), SunOS)
STRIPFLAGS += -s
ifeq ($(notdir $(LD_ALTEXEC)),gld)
BASELDFLAGS += -Wl,--gc-sections
endif
BASELDFLAGS += -lsocket
else
ifneq ($(CC),tcc)
BASELDFLAGS += -Wl,--gc-sections
endif
STRIPFLAGS += -s
endif
LIBRARY_CFLAGS = -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_EXTENDED_PRODUCT_LIST -DNO_BASIC_PRODUCT_LIST -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION
ifeq ($(FEATURES), embedded)
BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_BASIC_PRODUCT_LIST -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), autostart)
BASECFLAGS += -DNO_HELP -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), minimum)
BASECFLAGS += $(LIBRARY_CFLAGS)
else ifeq ($(FEATURES), most)
BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT
else ifeq ($(FEATURES), inetd)
BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), fixedepids)
BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE
endif
ifdef INI
BASECFLAGS += -DINI_FILE=\"$(INI)\"
endif
ifeq ($(THREADS), 1)
BASECFLAGS += -DUSE_THREADS
endif
ifeq ($(CHILD_HANDLER), 1)
BASECFLAGS += -DCHILD_HANDLER
endif
ifeq ($(NO_TIMEOUT), 1)
BASECFLAGS += -DNO_TIMEOUT
endif
ifdef WINDOWS
BASECFLAGS += -DEPID_WINDOWS=\"$(WINDOWS)\"
endif
ifdef OFFICE2010
BASECFLAGS += -DEPID_OFFICE2010=\"$(OFFICE2010)\"
endif
ifdef OFFICE2013
BASECFLAGS += -DEPID_OFFICE2013=\"$(OFFICE2013)\"
endif
ifdef HWID
BASECFLAGS += -DHWID=$(HWID)
endif
ifdef TERMINAL_WIDTH
BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) -DDISPLAY_WIDTH=\"$(TERMINAL_WIDTH)\"
endif
ifeq ($(NOPROCFS), 1)
BASECFLAGS += -DNO_PROCFS
endif
ifeq ($(AUXV), 1)
BASECFLAGS += -DUSE_AUXV
endif
ifneq ($(ANDROID), 1)
ifneq ($(MINIX), 1)
ifneq ($(NOLPTHREAD), 1)
ifeq ($(THREADS), 1)
SERVERLDFLAGS += -lpthread
endif
ifeq (,$(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)))
SERVERLDFLAGS += -lpthread
endif
endif
endif
endif
$(MULTI_NAME): BASECFLAGS += -DMULTI_CALL_BINARY=1
all: $(CLIENT_NAME) $(PROGRAM_NAME)
ifdef CAT
allmulti: $(CLIENT_NAME) $(PROGRAM_NAME) $(MULTI_NAME)
endif
ifneq ($(strip $(VLMCSD_VERSION)),)
BASECFLAGS += -DVERSION=\"$(VLMCSD_VERSION),\ built\ $(shell date -u '+%Y-%m-%d %H:%M:%S' | sed -e 's/ /\\ /g')\ UTC\"
endif
ifdef CAT
BASECFLAGS += -DONE_FILE
endif
SRCS = crypto.c kms.c endian.c output.c shared_globals.c helpers.c
HEADERS = $(CONFIG) types.h rpc.h vlmcsd.h endian.h crypto.h kms.h network.h output.h shared_globals.h vlmcs.h helpers.h
DEPS = $(MULTI_SRCS:.c=.d)
VLMCSD_SRCS = vlmcsd.c $(SRCS)
VLMCSD_OBJS = $(VLMCSD_SRCS:.c=.o)
VLMCS_SRCS = vlmcs.c $(SRCS)
VLMCS_OBJS = $(VLMCS_SRCS:.c=.o)
MULTI_SRCS = vlmcsd.c vlmcs.c vlmcsdmulti.c $(SRCS)
MULTI_OBJS = $(MULTI_SRCS:.c=.o)
DLL_SRCS = libkms.c $(SRCS)
DLL_OBJS = $(DLL_SRCS:.c=.o)
PDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf
HTMLDOCS = $(PDFDOCS:.pdf=.html)
UNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)
DOSDOCS = $(PDFDOCS:.pdf=.dos.txt)
ifneq ($(NO_DNS),1)
VLMCS_SRCS += dns_srv.c
MULTI_SRCS += dns_srv.c
ifeq ($(DNS_PARSER),internal)
ifneq ($(MINGW),1)
VLMCS_SRCS += ns_parse.c ns_name.c
MULTI_SRCS += ns_parse.c ns_name.c
BASECFLAGS += "-DDNS_PARSER_INTERNAL"
endif
endif
endif
ifeq ($(MSRPC),1)
VLMCSD_SRCS += msrpc-server.c
VLMCS_SRCS += msrpc-client.c
MULTI_SRCS += msrpc-server.c msrpc-client.c
DLL_SRCS += msrpc-server.c
BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas
BASELDFLAGS += -lrpcrt4
else
SRCS += network.c rpc.c
endif
ifeq "$(WIN)" "1"
VLMCSD_SRCS += ntservice.c
MULTI_SRCS += ntservice.c
endif
ifeq ($(CRYPTO), openssl_with_aes)
BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), openssl_with_aes_soft)
BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL -D_OPENSSL_SOFTWARE
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), openssl)
BASECFLAGS += -D_CRYPTO_OPENSSL
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), polarssl)
BASECFLAGS += -D_CRYPTO_POLARSSL
BASELDFLAGS += -lpolarssl
else ifeq ($(CRYPTO), windows)
BASECFLAGS += -D_CRYPTO_WINDOWS
SRCS += crypto_windows.c
else
BASECFLAGS += -D_CRYPTO_INTERNAL
SRCS += crypto_internal.c
endif
ifneq ($(STRIP),0)
BASELDFLAGS += $(STRIPFLAGS)
endif
ifeq ($(OPENSSL_HMAC),0)
BASECFLAGS += -D_OPENSSL_NO_HMAC
endif
ifeq ($(DEPENDENCIES),2)
BASECFLAGS += -MMD
endif
ifeq ($(VERBOSE),3)
COMPILER := $(shell printf "%-40s" $(notdir $(CC)))
ARCHIVER := $(shell printf "%-40s" $(notdir $(AR)))
endif
ARCMD := AR
ifdef CAT
LDCMD := CC/LD
else
LDCMD := LD
endif
-include $(MULTI_SRCS:.c=.d)
%.o: %.c
ifeq ($(VERBOSE),1)
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1)
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif
else
@echo "$(COMPILER) CC $@ <- $<"
@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1)
@echo "$(COMPILER) DEP $*.d <- $<"
@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif
endif
ifdef CAT
BUILDCOMMAND = cat $^ | $(CC) -x$(COMPILER_LANGUAGE) -o $@ -
VLMCSD_PREREQUISITES = $(VLMCSD_SRCS)
VLMCS_PREREQUISITES = $(VLMCS_SRCS)
MULTI_PREREQUISITES = $(MULTI_SRCS)
DLL_PREREQUISITES = $(DLL_SRCS)
OBJ_PREREQUISITES = $(DLL_SRCS)
else
BUILDCOMMAND = $(CC) -o $@ $^
VLMCSD_PREREQUISITES = $(VLMCSD_OBJS)
VLMCS_PREREQUISITES = $(VLMCS_OBJS)
MULTI_PREREQUISITES = $(MULTI_OBJS)
DLL_PREREQUISITES = $(DLL_OBJS)
OBJ_PREREQUISITES = $(DLL_OBJS)
endif
ifeq ($(VERBOSE),1)
BUILDCOMMANDPREFIX = +
else
BUILDCOMMANDPREFIX = +@
endif
INFOCOMMAND = +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
ARINFOCOMMAND = +@echo "$(ARCHIVER) $(ARCMD) $@ <. $^"
VLMCSD_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS)
VLMCS_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS)
MULTI_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS) $(SERVERLDFLAGS)
DLL_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -shared -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
OBJ_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(PROGRAM_NAME): $(VLMCSD_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(VLMCSD_COMMAND)
$(CLIENT_NAME): $(VLMCS_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(VLMCS_COMMAND)
$(MULTI_NAME): $(MULTI_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(MULTI_COMMAND)
$(DLL_NAME): $(DLL_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(DLL_COMMAND)
ifndef CAT
$(OBJ_NAME):
+@echo Cannot make $@ without CAT defined. Please create $(A_NAME)
else
$(OBJ_NAME): $(OBJ_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(OBJ_COMMAND)
endif
ifdef CAT
$(A_NAME): $(OBJ_NAME)
else
$(A_NAME): BASECFLAGS += -fvisibility=hidden -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(A_NAME): $(DLL_OBJS)
endif
ifneq ($(VERBOSE),1)
$(ARINFOCOMMAND)
endif
+@rm -f $@
$(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^
%.pdf : %
ifeq ($(shell uname), Darwin)
groff -Tps -mandoc -c $< | pstopdf -i -o $@
else
groff -Tpdf -mandoc -c $< > $@
endif
%.html : %
groff -Thtml -mandoc -c $< > $@
%.unix.txt : %
groff -P -c -Tutf8 -mandoc -c $< | col -bx > $@
%.dos.txt : %.unix.txt
# unix2dos -n $< $@
# sed -e 's/$$/\r/' $< > $@
awk 'sub("$$", "\r")' $< > $@
pdfdocs : $(PDFDOCS)
dosdocs : $(DOSDOCS)
unixdocs : $(UNIXDOCS)
htmldocs : $(HTMLDOCS)
alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)
all:
+@(test -d bin || mkdir bin) & (test -d lib || mkdir lib) & (test -d build || mkdir build)
+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)
clean:
rm -f *.o *.d *_all.c libkms_all_*.c $(PROGRAM_NAME) $(MULTI_NAME) $(DLL_NAME) $(CLIENT_NAME) $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS) $(OBJ_NAME) $(A_NAME) *.a
+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)
+@$(MAKE) -j$(MAX_THREADS) -C man $@
alldocs:
+@$(MAKE) -j$(MAX_THREADS) -C man $@
dosdocs:
+@$(MAKE) -j$(MAX_THREADS) -C man $@
unixdocs:
+@$(MAKE) -j$(MAX_THREADS) -C man $@
htmldocs:
+@$(MAKE) -j$(MAX_THREADS) -C man $@
pdfdocs:
+@$(MAKE) -j$(MAX_THREADS) -C man $@
GNUmakefile:
help:
@echo "Type"
@echo " ${MAKE} - to build $(PROGRAM_NAME) and $(CLIENT_NAME)"
@echo " ${MAKE} clean - to remove $(PROGRAM_NAME) and $(CLIENT_NAME)"
@echo " ${MAKE} help - to see this help"
@echo " ${MAKE} - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME)"
@echo " ${MAKE} clean - to remove all targets and temporary files"
@echo " ${MAKE} pdfdocs - Create PDF versions of the documentation (Requires groff with PDF support)."
@echo " ${MAKE} htmldocs - Create HTML versions of the documentation."
@echo " ${MAKE} unixdocs - Create Unix TXT versions of the documentation."
@echo " ${MAKE} dosdocs - Create DOS/Windows TXT versions of the documentation."
@echo " ${MAKE} alldocs - Create all versions of the documentation."
@echo " ${MAKE} -j <x> - Use <x> parallel tasks (SMP support) when compiling $(PROGRAM_NAME) and $(CLIENT_NAME)"
@echo ""
@echo " ${MAKE} $(PROGRAM_NAME) - to build the server only."
@echo " ${MAKE} $(CLIENT_NAME) - to build the client only."
@echo " ${MAKE} $(MULTI_NAME) - to build $(PROGRAM_NAME) and $(CLIENT_NAME) in a single multi-call binary"
@echo " ${MAKE} $(DLL_NAME) - to build the shared library $(DLL_NAME)"
@echo " ${MAKE} $(A_NAME) - to build the static library $(A_NAME)"
@echo " ${MAKE} vlmcsd - to build KMS server $(PROGRAM_NAME)"
@echo " ${MAKE} vlmcs - to build KMS client $(CLIENT_NAME)"
@echo " ${MAKE} vlmcsdmulti - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) in a single multi-call binary $(MULTI_NAME)"
@echo " ${MAKE} libkms - to build the shared library $(DLL_NAME)"
@echo " ${MAKE} libkms-static - to build the static library $(A_NAME)"
@echo ""
@echo "Options"
@echo " CONFIG=<x> Compile <x> as instead of config.h."
@echo " INI=<x> Compile $(PROGRAM_NAME) with default ini file <x>"
@echo " INI=<x> Compile $(BASE_PROGRAM_NAME) with default ini file <x>"
@echo " DATA=<x> Compile $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) with default KMS data file <x>"
@echo " PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd."
@echo " CLIENT_NAME=<x> Use <x> as output file name for the KMS client. Defaults to vlmcs."
@echo " MULTI_NAME=<x> Use <x> as output file name for the multi-call binary. Defaults to vlmcsdmulti."
@ -548,7 +161,7 @@ help:
@echo " CRYPTO=windows Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations."
@echo " MSRPC=1 Use Microsoft RPC instead of vlmcsd's internal RPC. Only works with Windows and Cygwin targets."
@echo " CC=<x> Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work."
@echo " AR=<x> Use <x> instead of ar to build $(A_NAME). Set to gcc-ar if you want to use gcc's LTO feature."
@echo " AR=<x> Use <x> instead of ar to build $(BASE_A_NAME). Set to gcc-ar if you want to use gcc's LTO feature."
@echo " COMPILER_LANGUAGE=<x> May be c or c++."
@echo " TERMINAL_WIDTH=<x> Assume a fixed terminal width of <x> columns. Use in case of problems only."
@echo " VLMCSD_VERSION=<x> Sets <x> as your version identifier. Defaults to \"private build\"."
@ -557,27 +170,24 @@ help:
@echo " PLATFORMFLAGS=<x> Pass <x> as additional arguments to the compiler and the linker."
@echo " BASECFLAGS=<x> Pass only <x> as arguments to the compiler (advanced users only)."
@echo " BASELDFLAGS=<x> Pass only <x> as arguments to the linker (advanced users only)."
@echo " STRIP=0 Don't strip debug information from $(PROGRAM_NAME) and $(CLIENT_NAME) (for developers)."
@echo " STRIP=0 Don't strip debug information from $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) (for developers)."
@echo " VERBOSE=1 Be verbose when making targets."
@echo " VERBOSE=3 Show name of compiler."
@echo " THREADS=1 Use threads instead of fork(). Automatically set for native Windows. Recommended for Cygwin."
@echo " WINDOWS=<x> Use <x> as the default ePID for Windows (when using $(PROGRAM_NAME) with -r 0)."
@echo " OFFICE2010=<x> Use <x> as the default ePID for Office2010 (when using $(PROGRAM_NAME) with -r 0)."
@echo " OFFICE2013=<x> Use <x> as the default ePID for Office2013 (when using $(PROGRAM_NAME) with -r 0)."
@echo " HWID=<x> Use <x> as the default HWID (when it can't be found in an ini file)."
@echo " FEATURES=full Compile $(PROGRAM_NAME) with all features (default)."
@echo " FEATURES=most Compile $(PROGRAM_NAME) without rarely used features."
@echo " FEATURES=embedded Compile $(PROGRAM_NAME) with typical features for embedded systems."
@echo " FEATURES=autostart Removes features typically not needed if you place $(PROGRAM_NAME) in an autostart script."
@echo " FEATURES=inetd Compile $(PROGRAM_NAME) for running through an internet superserver only."
@echo " FEATURES=minimum Compiles only basic features of $(PROGRAM_NAME)."
@echo " FEATURES=fixedepids $(PROGRAM_NAME) only uses bultin internal ePIDs."
@echo " FEATURES=full Compile $(BASE_PROGRAM_NAME) with all features (default)."
@echo " FEATURES=most Compile $(BASE_PROGRAM_NAME) without rarely used features."
@echo " FEATURES=embedded Compile $(BASE_PROGRAM_NAME) with typical features for embedded systems."
@echo " FEATURES=autostart Removes features typically not needed if you place $(BASE_PROGRAM_NAME) in an autostart script."
@echo " FEATURES=inetd Compile $(BASE_PROGRAM_NAME) for running through an internet superserver only."
@echo " FEATURES=minimum Compiles only basic features of $(BASE_PROGRAM_NAME)."
@echo " FEATURES=fixedepids $(BASE_PROGRAM_NAME) only uses bultin internal ePIDs."
@echo ""
@echo "Useful CFLAGS to save memory when running $(PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=)"
@echo " -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list."
@echo " -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list."
@echo "Useful CFLAGS to save memory when running $(BASE_PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=)"
@echo " -DNO_STRICT_MODES Don't support enhanced emulator detection prevention."
@echo " -DNO_CLIENT_LIST Don't support maintaining a client list (CMIDs)."
@echo " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option."
@echo " -DNO_LOG Don't add support for logging. Implies -DNO_VERBOSE_LOG -DNO_EXTENDED_PRODUCT_LIST and -DNO_BASIC_PRODUCT_LIST."
@echo " -DNO_LOG Don't add support for logging. Implies -DNO_VERBOSE_LOG."
@echo " -DNO_RANDOM_EPID Don't support random ePIDs."
@echo " -DNO_INI_FILE Don't support reading ePIDs/HWIDs from a file."
@echo " -DNO_PID_FILE Don't support writing a PID file. Removes -p option."
@ -585,13 +195,19 @@ help:
@echo " -DNO_HELP Don't support command line help."
@echo " -DNO_CUSTOM_INTERVALS Don't support custom intervals for retry and refresh activation. Removes -A and -R options."
@echo " -DNO_FREEBIND Don't support binding to foreign IP addresses. Removes -F0 and -F1 options. Only affects FreeBSD and Linux."
@echo " -DSIMPLE_SOCKETS Compile $(PROGRAM_NAME) with basic socket support only. Removes -L option."
@echo " -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(PROGRAM_NAME)."
@echo " -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(PROGRAM_NAME)."
@echo " -DNO_LIMIT Don't support limiting concurrent clients in $(PROGRAM_NAME)."
@echo " -DNO_SIGHUP Don't support SIGHUP handling in $(PROGRAM_NAME)."
@echo " -DNO_VERSION_INFORMATION Don't support displaying version information in $(PROGRAM_NAME) and $(CLIENT_NAME). Removes -V option."
@echo " -DENABLE_DEPRECATED_OPTIONS Enable command line options that provide compatibility with previous versions of $(PROGRAM_NAME)."
@echo " -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(BASE_PROGRAM_NAME)."
@echo " -DSIMPLE_SOCKETS Compile $(BASE_PROGRAM_NAME) with basic socket support only. Removes -L option."
@echo " -DSIMPLE_RPC Don't support RPC with NDR64 and BTFN in $(BASE_PROGRAM_NAME) (but do in $(BASE_CLIENT_NAME)). Makes emulator detection easy."
@echo " -DNO_TAP Compile $(BASE_PROGRAM_NAME) without VPN support (Windows and Cygwin only)."
@echo " -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(BASE_PROGRAM_NAME)."
@echo " -DNO_LIMIT Don't support limiting concurrent clients in $(BASE_PROGRAM_NAME)."
@echo " -DNO_SIGHUP Don't support SIGHUP handling in $(BASE_PROGRAM_NAME)."
@echo " -DNO_VERSION_INFORMATION Don't support displaying version information in $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME). Removes -V option."
@echo " -DNO_PRIVATE_IP_DETECT Don't support protection against clients with public IP addresses in $(BASE_PROGRAM_NAME)"
@echo " -DSMALL_AES Use a smaller (saves about 200 bytes) but slower implementation of AES."
@echo " -DNO_EXTERNAL_DATA Don't support loading an external database. Mutually exclusive with -DNO_INTERNAL_DATA"
@echo " -DNO_INTERNAL_DATA Don't compile an internal database. Mutually exclusive with -DNO_EXTERNAL_DATA"
@echo " -DUNSAFE_DATA_LOAD Don't check the KMS data file for integrity. Saves some bytes but is dangerous."
@echo ""
@echo "Troubleshooting options"
@echo " CAT=1 Combine all sources in a single in-memory file and compile directly to target."
@ -603,15 +219,15 @@ help:
@echo " OPENSSL_HMAC=0 Compile for openssl versions that don't have HMAC support (required on some embedded devices)."
@echo " NO_TIMEOUT=1 Do not set timeouts for sockets (for systems that don't support it)."
@echo " CHILD_HANDLER=1 Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT)."
@echo " NO_DNS=1 Compile $(CLIENT_NAME) without support for detecting KMS servers via DNS."
@echo " DNS_PARSER=internal Use $(CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
@echo " NO_DNS=1 Compile $(BASE_CLIENT_NAME) without support for detecting KMS servers via DNS."
@echo " NO_GETIFADDRS=1 Compile $(BASE_PROGRAM_NAME) without using getifaddrs()."
@echo " GETIFADDRS=musl Compile $(BASE_PROGRAM_NAME) with its own implementation of getifaddrs() based on musl."
@echo " DNS_PARSER=internal Use $(BASE_CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
@echo ""
@echo "Other useful CFLAGS"
@echo " -DSUPPORT_WINE Add code that the Windows version of $(PROGRAM_NAME) runs on Wine if MSRPC=1"
@echo " -DFULL_INTERNAL_DATA Embed full internal KMS data in $(BASE_PROGRAM_NAME)."
@echo " -DSUPPORT_WINE Add code that the Windows version of $(BASE_PROGRAM_NAME) runs on Wine if MSRPC=1"
@echo " -D_PEDANTIC Report rare error/warning conditions instead of silently ignoring them."
@echo " -DINCLUDE_BETAS Include SKU / activation IDs for obsolete beta/preview products."
@echo " -DFD_SETSIZE=<x> Allow <x> -L statements in $(PROGRAM_NAME) (default: 64 on Windows, 1024 on most Unixes)."
@echo " -flto Use link time optimization. Not supported by old compilers (gcc < 4.7). Use whenever supported."
@echo " -flto=jobserver Utilize all CPUs during link time optimization. Requires ${MAKE} -j <cpus>"
@echo " -fno-stack-protector No stack checking. Smaller binaries."
@echo " -pipe Use pipes instead of temporary files (faster compilation, extends the life of your SSD)."
@echo " -DFD_SETSIZE=<x> Allow <x> -L statements in $(BASE_PROGRAM_NAME) (default: 64 on Windows, 1024 on most Unixes)."

7
README
View File

@ -1,13 +1,14 @@
To view the documentation cd to the directory containing the distribution
files and type
man ./vlmcsd.8
man man/vlmcsd.8
to see documentation for vlmcsd
man ./vlmcs.1
man man/vlmcs.1
to see documentation for vlmcs
man ./vlmcsd.7
man man/vlmcsd.7
to see general documentation for kms
If you don't have man, you may also use the .txt, .html and .pdf files
in the man directory

View File

@ -0,0 +1,328 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2A0FC04D-C3C0-43E2-8812-53AE901C5395}</ProjectGuid>
<RootNamespace>vlmcsdmulti-Windows</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>libkms-Windows</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>libkms32</TargetName>
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<TargetName>libkms32</TargetName>
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>libkms64</TargetName>
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<TargetName>$(ProjectName)64</TargetName>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
<TargetName>$(ProjectName)32</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
<TargetName>$(ProjectName)32</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>NotSet</SubSystem>
<MinimumRequiredVersion />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>NotSet</SubSystem>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>NotSet</SubSystem>
<MinimumRequiredVersion />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>NotSet</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>
</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<MinimumRequiredVersion />
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>NotSet</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>
</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;SIMPLE_SOCKETS;NO_TIMEOUT;NO_SIGHUP;NO_CL_PIDS;NO_EXTENDED_PRODUCT_LIST;NO_BASIC_PRODUCT_LIST;NO_LOG;NO_RANDOM_EPID;NO_INI_FILE;NO_HELP;NO_CUSTOM_INTERVALS;NO_PID_FILE;NO_USER_SWITCH;NO_VERBOSE_LOG;NO_LIMIT;NO_VERSION_INFORMATION;NO_PRIVATE_IP_DETECT;IS_LIBRARY=1</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<TreatWarningAsError>false</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt64.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>NotSet</SubSystem>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>
</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<MinimumRequiredVersion />
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c" />
<ClCompile Include="..\..\src\crypto_windows.c" />
<ClCompile Include="..\..\src\endian.c" />
<ClCompile Include="..\..\src\helpers.c" />
<ClCompile Include="..\..\src\kms.c" />
<ClCompile Include="..\..\src\libkms.c" />
<ClCompile Include="..\..\src\network.c" />
<ClCompile Include="..\..\src\output.c" />
<ClCompile Include="..\..\src\rpc.c" />
<ClCompile Include="..\..\src\shared_globals.c" />
<ClCompile Include="..\..\src\vlmcs.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\crypto.h" />
<ClInclude Include="..\..\src\crypto_windows.h" />
<ClInclude Include="..\..\src\endian.h" />
<ClInclude Include="..\..\src\helpers.h" />
<ClInclude Include="..\..\src\kms.h" />
<ClInclude Include="..\..\src\libkms.h" />
<ClInclude Include="..\..\src\network.h" />
<ClInclude Include="..\..\src\output.h" />
<ClInclude Include="..\..\src\rpc.h" />
<ClInclude Include="..\..\src\shared_globals.h" />
<ClInclude Include="..\..\src\types.h" />
<ClInclude Include="..\..\src\vlmcs.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\libkms.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\libkms.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

BIN
VisualStudio/msvcrt.lib Normal file

Binary file not shown.

BIN
VisualStudio/msvcrt64.lib Normal file

Binary file not shown.

View File

@ -0,0 +1,315 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}</ProjectGuid>
<RootNamespace>vlmcs-Windows</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>vlmcs-Windows</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>vlmcs-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<TargetName>vlmcs-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>vlmcs-Windows-x64</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<TreatWarningAsError>false</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
<OmitFramePointers>true</OmitFramePointers>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt64.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c" />
<ClCompile Include="..\..\src\crypto_windows.c" />
<ClCompile Include="..\..\src\dns_srv.c" />
<ClCompile Include="..\..\src\endian.c" />
<ClCompile Include="..\..\src\helpers.c" />
<ClCompile Include="..\..\src\kms.c" />
<ClCompile Include="..\..\src\kmsdata-full.c" />
<ClCompile Include="..\..\src\network.c" />
<ClCompile Include="..\..\src\output.c" />
<ClCompile Include="..\..\src\rpc.c" />
<ClCompile Include="..\..\src\shared_globals.c" />
<ClCompile Include="..\..\src\vlmcs.c" />
<ClCompile Include="..\..\src\wingetopt.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\crypto.h" />
<ClInclude Include="..\..\src\crypto_internal.h" />
<ClInclude Include="..\..\src\crypto_windows.h" />
<ClInclude Include="..\..\src\dns_srv.h" />
<ClInclude Include="..\..\src\endian.h" />
<ClInclude Include="..\..\src\helpers.h" />
<ClInclude Include="..\..\src\kms.h" />
<ClInclude Include="..\..\src\kmsdata.h" />
<ClInclude Include="..\..\src\network.h" />
<ClInclude Include="..\..\src\output.h" />
<ClInclude Include="..\..\src\rpc.h" />
<ClInclude Include="..\..\src\shared_globals.h" />
<ClInclude Include="..\..\src\types.h" />
<ClInclude Include="..\..\src\vlmcs.h" />
<ClInclude Include="..\..\src\wingetopt.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\dns_srv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kmsdata-full.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\dns_srv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kmsdata.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

100
VisualStudio/vlmcsd.sln Normal file
View File

@ -0,0 +1,100 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcsd-Windows", "vlmcsd\vlmcsd.vcxproj", "{918B4F5B-6356-451E-998C-5FCB29988170}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcs-Windows", "vlmcs\vlmcs.vcxproj", "{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcsdmulti-Windows", "vlmcsdmulti\vlmcsdmulti.vcxproj", "{7F07671D-1432-43E9-9D72-08435F216B5E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libkms-Windows", "libkms\libkms.vcxproj", "{2A0FC04D-C3C0-43E2-8812-53AE901C5395}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcsd-gcc5", "..\src\vlmcsd-linux-remote.vcxproj", "{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcs-gcc5", "..\src\vlmcs-linux-remote.vcxproj", "{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
publish|x64 = publish|x64
publish|x86 = publish|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{918B4F5B-6356-451E-998C-5FCB29988170}.Debug|x64.ActiveCfg = Debug|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.Debug|x64.Build.0 = Debug|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.Debug|x86.ActiveCfg = Debug|Win32
{918B4F5B-6356-451E-998C-5FCB29988170}.Debug|x86.Build.0 = Debug|Win32
{918B4F5B-6356-451E-998C-5FCB29988170}.publish|x64.ActiveCfg = Release|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.publish|x64.Build.0 = Release|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.publish|x86.ActiveCfg = Release|Win32
{918B4F5B-6356-451E-998C-5FCB29988170}.publish|x86.Build.0 = Release|Win32
{918B4F5B-6356-451E-998C-5FCB29988170}.Release|x64.ActiveCfg = Release|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.Release|x64.Build.0 = Release|x64
{918B4F5B-6356-451E-998C-5FCB29988170}.Release|x86.ActiveCfg = Release|Win32
{918B4F5B-6356-451E-998C-5FCB29988170}.Release|x86.Build.0 = Release|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Debug|x64.ActiveCfg = Debug|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Debug|x64.Build.0 = Debug|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Debug|x86.ActiveCfg = Debug|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Debug|x86.Build.0 = Debug|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.publish|x64.ActiveCfg = Release|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.publish|x64.Build.0 = Release|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.publish|x86.ActiveCfg = Release|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.publish|x86.Build.0 = Release|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Release|x64.ActiveCfg = Release|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Release|x64.Build.0 = Release|x64
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Release|x86.ActiveCfg = Release|Win32
{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}.Release|x86.Build.0 = Release|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.Debug|x64.ActiveCfg = Debug|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.Debug|x64.Build.0 = Debug|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.Debug|x86.ActiveCfg = Debug|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.Debug|x86.Build.0 = Debug|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.publish|x64.ActiveCfg = Release|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.publish|x64.Build.0 = Release|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.publish|x86.ActiveCfg = Release|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.publish|x86.Build.0 = Release|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.Release|x64.ActiveCfg = Release|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.Release|x64.Build.0 = Release|x64
{7F07671D-1432-43E9-9D72-08435F216B5E}.Release|x86.ActiveCfg = Release|Win32
{7F07671D-1432-43E9-9D72-08435F216B5E}.Release|x86.Build.0 = Release|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Debug|x64.ActiveCfg = Debug|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Debug|x64.Build.0 = Debug|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Debug|x86.ActiveCfg = Debug|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Debug|x86.Build.0 = Debug|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.publish|x64.ActiveCfg = Release|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.publish|x64.Build.0 = Release|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.publish|x86.ActiveCfg = Release|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.publish|x86.Build.0 = Release|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Release|x64.ActiveCfg = Release|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Release|x64.Build.0 = Release|x64
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Release|x86.ActiveCfg = Release|Win32
{2A0FC04D-C3C0-43E2-8812-53AE901C5395}.Release|x86.Build.0 = Release|Win32
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Debug|x64.ActiveCfg = Debug|x64
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Debug|x64.Build.0 = Debug|x64
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Debug|x86.ActiveCfg = Debug|x86
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Debug|x86.Build.0 = Debug|x86
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.publish|x64.ActiveCfg = Release|x64
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.publish|x86.ActiveCfg = Release|x86
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Release|x64.ActiveCfg = Release|x64
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Release|x64.Build.0 = Release|x64
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Release|x86.ActiveCfg = Release|x86
{CC2FBE0B-B9DF-4306-88A1-20706BBD2B0C}.Release|x86.Build.0 = Release|x86
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Debug|x64.ActiveCfg = Debug|x64
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Debug|x64.Build.0 = Debug|x64
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Debug|x86.ActiveCfg = Debug|x86
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Debug|x86.Build.0 = Debug|x86
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.publish|x64.ActiveCfg = Release|x64
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.publish|x86.ActiveCfg = Release|x86
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Release|x64.ActiveCfg = Release|x64
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Release|x64.Build.0 = Release|x64
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Release|x86.ActiveCfg = Release|x86
{1ED83566-8AE1-4EE8-9B62-37188A7AC7CA}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,334 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{918B4F5B-6356-451E-998C-5FCB29988170}</ProjectGuid>
<RootNamespace>vlmcsd-Windows</RootNamespace>
<WindowsTargetPlatformVersion>
</WindowsTargetPlatformVersion>
<ProjectName>vlmcsd-Windows</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>vlmcsd-Windows-x64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>vlmcsd-Windows-x86</TargetName>
<OutDir>$(SolutionDir)..\bin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>vlmcsd-Windows-x86</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<ControlFlowGuard>false</ControlFlowGuard>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<CallingConvention>Cdecl</CallingConvention>
<CompileAs>Default</CompileAs>
<DebugInformationFormat>None</DebugInformationFormat>
<CompileAsManaged>false</CompileAsManaged>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWarningAsError>false</TreatWarningAsError>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
<CompileAsWinRT>false</CompileAsWinRT>
<AssemblerOutput>All</AssemblerOutput>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile />
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<ControlFlowGuard>false</ControlFlowGuard>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<CallingConvention>Cdecl</CallingConvention>
<CompileAs>Default</CompileAs>
<DebugInformationFormat>None</DebugInformationFormat>
<CompileAsManaged>false</CompileAsManaged>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWarningAsError>false</TreatWarningAsError>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
<CompileAsWinRT>false</CompileAsWinRT>
<AssemblerOutput>All</AssemblerOutput>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>
</ProgramDatabaseFile>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<DebugInformationFormat>None</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<ControlFlowGuard>false</ControlFlowGuard>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<CompileAsManaged>false</CompileAsManaged>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
<AssemblerOutput>All</AssemblerOutput>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>$(SolutionDir)\msvcrt64.lib;Shlwapi.lib;Iphlpapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<ProgramDatabaseFile />
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\crypto.h" />
<ClInclude Include="..\..\src\crypto_internal.h" />
<ClInclude Include="..\..\src\crypto_windows.h" />
<ClInclude Include="..\..\src\endian.h" />
<ClInclude Include="..\..\src\helpers.h" />
<ClInclude Include="..\..\src\kms.h" />
<ClInclude Include="..\..\src\kmsdata.h" />
<ClInclude Include="..\..\src\network.h" />
<ClInclude Include="..\..\src\ntservice.h" />
<ClInclude Include="..\..\src\output.h" />
<ClInclude Include="..\..\src\rpc.h" />
<ClInclude Include="..\..\src\shared_globals.h" />
<ClInclude Include="..\..\src\tap-windows.h" />
<ClInclude Include="..\..\src\types.h" />
<ClInclude Include="..\..\src\vlmcsd.h" />
<ClInclude Include="..\..\src\wingetopt.h" />
<ClInclude Include="..\..\src\wintap.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c" />
<ClCompile Include="..\..\src\crypto_windows.c" />
<ClCompile Include="..\..\src\endian.c" />
<ClCompile Include="..\..\src\helpers.c" />
<ClCompile Include="..\..\src\kms.c" />
<ClCompile Include="..\..\src\kmsdata.c" />
<ClCompile Include="..\..\src\network.c" />
<ClCompile Include="..\..\src\ntservice.c" />
<ClCompile Include="..\..\src\output.c" />
<ClCompile Include="..\..\src\rpc.c" />
<ClCompile Include="..\..\src\shared_globals.c" />
<ClCompile Include="..\..\src\vlmcsd.c" />
<ClCompile Include="..\..\src\wingetopt.c" />
<ClCompile Include="..\..\src\wintap.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ntservice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\vlmcsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kmsdata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\tap-windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\wintap.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ntservice.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcsd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kmsdata.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\wintap.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,321 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F07671D-1432-43E9-9D72-08435F216B5E}</ProjectGuid>
<RootNamespace>vlmcsdmulti-Windows</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>vlmcsdmulti-Windows</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>vlmcsdmulti-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<TargetName>vlmcsdmulti-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>vlmcsdmulti-Windows-x64</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_USING_V110_SDK71_;_MBCS;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;_PEDANTIC;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<CallingConvention>Cdecl</CallingConvention>
<DebugInformationFormat>None</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions);_CRYPTO_WINDOWS;MULTI_CALL_BINARY=1</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<TreatWarningAsError>false</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<FloatingPointExceptions>false</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<AdditionalOptions>$(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)\msvcrt64.lib;Shlwapi.lib;Iphlpapi.lib;Dnsapi.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<LargeAddressAware>true</LargeAddressAware>
<TerminalServerAware>true</TerminalServerAware>
<SwapRunFromCD>true</SwapRunFromCD>
<SwapRunFromNET>true</SwapRunFromNET>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<EntryPointSymbol>WinStartUp</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c" />
<ClCompile Include="..\..\src\crypto_windows.c" />
<ClCompile Include="..\..\src\dns_srv.c" />
<ClCompile Include="..\..\src\endian.c" />
<ClCompile Include="..\..\src\helpers.c" />
<ClCompile Include="..\..\src\kms.c" />
<ClCompile Include="..\..\src\kmsdata-full.c" />
<ClCompile Include="..\..\src\network.c" />
<ClCompile Include="..\..\src\ntservice.c" />
<ClCompile Include="..\..\src\output.c" />
<ClCompile Include="..\..\src\rpc.c" />
<ClCompile Include="..\..\src\shared_globals.c" />
<ClCompile Include="..\..\src\vlmcs.c" />
<ClCompile Include="..\..\src\vlmcsd.c" />
<ClCompile Include="..\..\src\vlmcsdmulti.c" />
<ClCompile Include="..\..\src\wingetopt.c" />
<ClCompile Include="..\..\src\wintap.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\crypto.h" />
<ClInclude Include="..\..\src\crypto_windows.h" />
<ClInclude Include="..\..\src\dns_srv.h" />
<ClInclude Include="..\..\src\endian.h" />
<ClInclude Include="..\..\src\helpers.h" />
<ClInclude Include="..\..\src\kms.h" />
<ClInclude Include="..\..\src\kmsdata.h" />
<ClInclude Include="..\..\src\network.h" />
<ClInclude Include="..\..\src\ntservice.h" />
<ClInclude Include="..\..\src\output.h" />
<ClInclude Include="..\..\src\rpc.h" />
<ClInclude Include="..\..\src\shared_globals.h" />
<ClInclude Include="..\..\src\tap-windows.h" />
<ClInclude Include="..\..\src\types.h" />
<ClInclude Include="..\..\src\vlmcs.h" />
<ClInclude Include="..\..\src\vlmcsd.h" />
<ClInclude Include="..\..\src\wingetopt.h" />
<ClInclude Include="..\..\src\wintap.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\dns_srv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ntservice.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcsd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\vlmcsdmulti.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\kmsdata-full.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\wintap.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\dns_srv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ntservice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\vlmcsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kmsdata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\tap-windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\wintap.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

4
bin/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
build/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,22 @@
#
# Set ePID/HwId for Windows explicitly
;55c92734-d682-4d71-983e-d6ec3f16059f = 06401-00206-271-392041-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
;Windows = 06401-00206-471-111111-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
# Set ePID for Office 2010 (including Visio and Project) explicitly
;59a52881-a989-479d-af46-f275c6370663 = 06401-00096-199-496023-03-1033-9600.0000-3622014
;Office2010 = 06401-00096-199-222222-03-1033-9600.0000-3622014
# Set ePID for Office 2013 (including Visio and Project) explicitly
;0ff1ce15-a989-479d-af46-f275c6370663 = 06401-00206-234-409313-03-1033-9600.0000-3622014
# Set ePID/HwId for Office 2013 (including Visio and Project) explicitly
;Office2013 = 06401-00206-234-333333-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
# Set ePID/HwId for Office 2016 (including Visio and Project) explicitly
;Office2016 = 06401-00206-437-444444-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
# Use a compatible VPN device to create a hidden local IPv4 address
# Command line: -O
# VPN = <VPN adapter name>[=<IPv4 address>][/<CIDR mask>][:<DHCP lease duration>]
# Use VPN adapter "KMS Mirror" give it IP address 192.168.123.100 with a lease duration of one day and make entire 192.168.128.x a hidden local IPv4 address.
;VPN = KMS Mirror=192.168.123.100/24:1d
# Use custom TCP port
# Command line: -P
@ -35,6 +44,10 @@
# Command line: -L
;Listen = [::]:1688
# Listen on all private IP addresses and reject incoming requests from public IP addresses
# Command line: -o
# PublicIPProtectionLevel = 3
# Allow binding to foreign IP addresses
# Command line: -F0 and -F1
;FreeBind = true
@ -63,14 +76,38 @@
# Command line: -p
;PidFile = /var/run/vlmcsd.pid
# Load a KMS data file
# Command line: -j
;KmsData = /etc/vlmcsd.kmd
# Write log to /var/log/vlmcsd.log
# Command line: -l (-e and -f also override this directive)
;LogFile = /var/log/vlmcsd.log
# Don't include date and time in logs (default is true)
# Command line: -T0 and -T1
;LogDateAndTime = false
# Create a verbose log
# Command line: -v and -q
;LogVerbose = true
# Whitelist known products
# Command line: -K0, -K1, -K2, -K3
;WhiteListingLevel = 0
# Check that the client time is within +/- 4 hours of the system time
# Command line: -c0, -c1
;CheckClientTime = false
# Maintain a list of CMIDs
# Command line: -M0, -M1
;MaintainClients = false
# Start with empty CMID list (Requires MaintainClients = true)
# Command line: -E0, -E1
;StartEmpty = false
# Set activation interval to 2 hours
# Command line: -A
;ActivationInterval = 2h
@ -79,6 +116,12 @@
# Command line: -R
;RenewalInterval = 7d
# Exit vlmcsd if warning of certain level has been reached
# Command line: -x
# 0 = Never
# 1 = Exit, if any listening socket could not be established or TAP error occurs
;ExitLevel = 0
# Run program as user vlmcsduser
# Command line: -u
;user = vlmcsduser
@ -88,7 +131,7 @@
;group = vlmcsdgroup
# Disable or enable the NDR64 transfer syntax in RPC (default enabled)
# Command line: -N0 and -B1
# Command line: -N0 and -N1
;UseNDR64 = true
# Disable or enable bind time feature negotiation in RPC (default enabled)

BIN
etc/vlmcsd.kmd Normal file

Binary file not shown.

1070
floppy/.config-busybox Normal file

File diff suppressed because it is too large Load Diff

1528
floppy/.config-linux-kernel Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

254
floppy/.config-uClibc-ng Normal file
View File

@ -0,0 +1,254 @@
#
# Automatically generated file; DO NOT EDIT.
# uClibc-ng 1.0.15 C Library Configuration
#
# TARGET_alpha is not set
# TARGET_arc is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_c6x is not set
# TARGET_cris is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
TARGET_i386=y
# TARGET_ia64 is not set
# TARGET_lm32 is not set
# TARGET_m68k is not set
# TARGET_metag is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios2 is not set
# TARGET_or1k is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sparc is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set
#
# Target Architecture Features and Options
#
TARGET_ARCH="i386"
FORCE_OPTIONS_FOR_ARCH=y
# CONFIG_386 is not set
CONFIG_486=y
# CONFIG_586 is not set
# CONFIG_686 is not set
TARGET_SUBARCH="i486"
#
# Using ELF file format
#
ARCH_HAS_DEPRECATED_SYSCALLS=y
ARCH_LITTLE_ENDIAN=y
#
# Using Little Endian
#
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
DO_XSI_MATH=y
# UCLIBC_HAS_FENV is not set
# UCLIBC_HAS_LONG_DOUBLE_MATH is not set
KERNEL_HEADERS="/root/openadk/target_generic-x86_uclibc-ng/usr/include"
HAVE_DOT_CONFIG=y
#
# General Library Settings
#
DOPIC=y
ARCH_HAS_UCONTEXT=y
HAVE_SHARED=y
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
# LDSO_PRELOAD_ENV_SUPPORT is not set
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
# LDSO_STANDALONE_SUPPORT is not set
# LDSO_PRELINK_SUPPORT is not set
# UCLIBC_STATIC_LDCONFIG is not set
LDSO_RUNPATH=y
LDSO_RUNPATH_OF_EXECUTABLE=y
LDSO_SAFE_RUNPATH=y
LDSO_SEARCH_INTERP_PATH=y
LDSO_LD_LIBRARY_PATH=y
LDSO_NO_CLEANUP=y
UCLIBC_CTOR_DTOR=y
# LDSO_GNU_HASH_SUPPORT is not set
# HAS_NO_THREADS is not set
UCLIBC_HAS_THREADS_NATIVE=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_TLS=y
PTHREADS_DEBUG_SUPPORT=y
UCLIBC_HAS_SYSLOG=y
UCLIBC_HAS_LFS=y
MALLOC=y
# MALLOC_SIMPLE is not set
# MALLOC_STANDARD is not set
MALLOC_GLIBC_COMPAT=y
# UCLIBC_HAS_OBSTACK is not set
UCLIBC_DYNAMIC_ATEXIT=y
COMPAT_ATEXIT=y
UCLIBC_HAS_UTMPX=y
UCLIBC_HAS_UTMP=y
UCLIBC_SUSV2_LEGACY=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_HAS_CONTEXT_FUNCS=y
# UCLIBC_SUSV3_LEGACY_MACROS is not set
UCLIBC_SUSV4_LEGACY=y
# UCLIBC_STRICT_HEADERS is not set
# UCLIBC_HAS_STUBS is not set
UCLIBC_HAS_SHADOW=y
UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
UCLIBC_HAS___PROGNAME=y
UCLIBC_HAS_PTY=y
ASSUME_DEVPTS=y
UNIX98PTY_ONLY=y
UCLIBC_HAS_GETPT=y
UCLIBC_HAS_LIBUTIL=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
#
# Advanced Library Settings
#
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256
#
# Support various families of functions
#
UCLIBC_LINUX_MODULE_26=y
# UCLIBC_LINUX_MODULE_24 is not set
UCLIBC_LINUX_SPECIFIC=y
UCLIBC_HAS_GNU_ERROR=y
UCLIBC_BSD_SPECIFIC=y
UCLIBC_HAS_BSD_ERR=y
UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
# UCLIBC_NTP_LEGACY is not set
UCLIBC_SV4_DEPRECATED=y
UCLIBC_HAS_REALTIME=y
UCLIBC_HAS_ADVANCED_REALTIME=y
UCLIBC_HAS_EPOLL=y
UCLIBC_HAS_XATTR=y
# UCLIBC_HAS_PROFILING is not set
UCLIBC_HAS_CRYPT_IMPL=y
UCLIBC_HAS_SHA256_CRYPT_IMPL=y
# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
UCLIBC_HAS_CRYPT=y
UCLIBC_HAS_NETWORK_SUPPORT=y
UCLIBC_HAS_SOCKET=y
UCLIBC_HAS_IPV4=y
UCLIBC_HAS_IPV6=y
# UCLIBC_HAS_RPC is not set
UCLIBC_USE_NETLINK=y
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
UCLIBC_HAS_BSD_RES_CLOSE=y
UCLIBC_HAS_COMPAT_RES_STATE=y
# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
UCLIBC_HAS_RESOLVER_SUPPORT=y
UCLIBC_HAS_LIBRESOLV_STUB=y
UCLIBC_HAS_LIBNSL_STUB=y
#
# String and Stdio Support
#
UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_STDIO_FUTEXES=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
# UCLIBC_HAS_CTYPE_UNSAFE is not set
UCLIBC_HAS_CTYPE_CHECKED=y
# UCLIBC_HAS_CTYPE_ENFORCED is not set
UCLIBC_HAS_WCHAR=y
# UCLIBC_HAS_LOCALE is not set
UCLIBC_HAS_HEXADECIMAL_FLOATS=y
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
UCLIBC_HAS_STDIO_BUFSIZ_4096=y
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
UCLIBC_HAS_PRINTF_M_SPEC=y
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
UCLIBC_HAS_GETOPT_LONG=y
UCLIBC_HAS_GNU_GETSUBOPT=y
UCLIBC_HAS_ARGP=y
#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
# UCLIBC_HAS_REGEX_OLD is not set
UCLIBC_HAS_FNMATCH=y
# UCLIBC_HAS_FNMATCH_OLD is not set
UCLIBC_HAS_WORDEXP=y
UCLIBC_HAS_NFTW=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_FTS=y
UCLIBC_HAS_GLOB=y
UCLIBC_HAS_GNU_GLOB=y
#
# Library Installation Options
#
RUNTIME_PREFIX="/"
DEVEL_PREFIX="/usr/"
MULTILIB_DIR="lib"
HARDWIRED_ABSPATH=y
#
# Security options
#
# UCLIBC_BUILD_PIE is not set
UCLIBC_HAS_ARC4RANDOM=y
# ARC4RANDOM_USES_NODEV is not set
# UCLIBC_HAS_SSP is not set
UCLIBC_BUILD_RELRO=y
UCLIBC_BUILD_NOW=y
UCLIBC_BUILD_NOEXECSTACK=y
#
# Development/debugging options
#
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DOSTRIP is not set
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MALLOC_DEBUGGING is not set
# UCLIBC_HAS_BACKTRACE is not set
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set
# DOMULTI is not set

BIN
floppy/floppy144.vfd Normal file

Binary file not shown.

Binary file not shown.

369
helpers.c
View File

@ -1,369 +0,0 @@
/*
* Helper functions used by other modules
*/
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
#include CONFIG
#ifndef _WIN32
#include <errno.h>
#endif // _WIN32
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "helpers.h"
#include "output.h"
#include "endian.h"
#include "shared_globals.h"
/*
* UCS2 <-> UTF-8 functions
* All functions use little endian UCS2 since we only need it to communicate with Windows via RPC
*/
// Convert one character from UTF-8 to UCS2
// Returns 0xffff, if utf-8 evaluates to > 0xfffe (outside basic multilingual pane)
WCHAR utf8_to_ucs2_char (const unsigned char *input, const unsigned char **end_ptr)
{
*end_ptr = input;
if (input[0] == 0)
return ~0;
if (input[0] < 0x80) {
*end_ptr = input + 1;
return LE16(input[0]);
}
if ((input[0] & 0xE0) == 0xE0) {
if (input[1] == 0 || input[2] == 0)
return ~0;
*end_ptr = input + 3;
return
LE16((input[0] & 0x0F)<<12 |
(input[1] & 0x3F)<<6 |
(input[2] & 0x3F));
}
if ((input[0] & 0xC0) == 0xC0) {
if (input[1] == 0)
return ~0;
*end_ptr = input + 2;
return
LE16((input[0] & 0x1F)<<6 |
(input[1] & 0x3F));
}
return ~0;
}
// Convert one character from UCS2 to UTF-8
// Returns length of UTF-8 char (1, 2 or 3) or -1 on error (UTF-16 outside UCS2)
// char *utf8 must be large enough to hold 3 bytes
int ucs2_to_utf8_char (const WCHAR ucs2_le, char *utf8)
{
const WCHAR ucs2 = LE16(ucs2_le);
if (ucs2 < 0x80) {
utf8[0] = ucs2;
utf8[1] = '\0';
return 1;
}
if (ucs2 >= 0x80 && ucs2 < 0x800) {
utf8[0] = (ucs2 >> 6) | 0xC0;
utf8[1] = (ucs2 & 0x3F) | 0x80;
utf8[2] = '\0';
return 2;
}
if (ucs2 >= 0x800 && ucs2 < 0xFFFF) {
if (ucs2 >= 0xD800 && ucs2 <= 0xDFFF) {
/* Ill-formed (UTF-16 ouside of BMP) */
return -1;
}
utf8[0] = ((ucs2 >> 12) ) | 0xE0;
utf8[1] = ((ucs2 >> 6 ) & 0x3F) | 0x80;
utf8[2] = ((ucs2 ) & 0x3F) | 0x80;
utf8[3] = '\0';
return 3;
}
return -1;
}
// Converts UTF8 to UCS2. Returns size in bytes of the converted string or -1 on error
size_t utf8_to_ucs2(WCHAR* const ucs2_le, const char* const utf8, const size_t maxucs2, const size_t maxutf8)
{
const unsigned char* current_utf8 = (unsigned char*)utf8;
WCHAR* current_ucs2_le = ucs2_le;
for (; *current_utf8; current_ucs2_le++)
{
size_t size = (char*)current_utf8 - utf8;
if (size >= maxutf8) return (size_t)-1;
if (((*current_utf8 & 0xc0) == 0xc0) && (size >= maxutf8 - 1)) return (size_t)-1;
if (((*current_utf8 & 0xe0) == 0xe0) && (size >= maxutf8 - 2)) return (size_t)-1;
if (current_ucs2_le - ucs2_le >= (intptr_t)maxucs2 - 1) return (size_t)-1;
*current_ucs2_le = utf8_to_ucs2_char(current_utf8, &current_utf8);
current_ucs2_le[1] = 0;
if (*current_ucs2_le == (WCHAR)-1) return (size_t)-1;
}
return current_ucs2_le - ucs2_le;
}
// Converts UCS2 to UTF-8. Return TRUE or FALSE
BOOL ucs2_to_utf8(const WCHAR* const ucs2_le, char* utf8, size_t maxucs2, size_t maxutf8)
{
char utf8_char[4];
const WCHAR* current_ucs2 = ucs2_le;
unsigned int index_utf8 = 0;
for(*utf8 = 0; *current_ucs2; current_ucs2++)
{
if (current_ucs2 - ucs2_le > (intptr_t)maxucs2) return FALSE;
int len = ucs2_to_utf8_char(*current_ucs2, utf8_char);
if (index_utf8 + len > maxutf8) return FALSE;
strncat(utf8, utf8_char, len);
index_utf8+=len;
}
return TRUE;
}
/* End of UTF-8 <-> UCS2 conversion */
// Checks, whether a string is a valid integer number between min and max. Returns TRUE or FALSE. Puts int value in *value
BOOL stringToInt(const char *const szValue, const unsigned int min, const unsigned int max, unsigned int *const value)
{
char *nextchar;
errno = 0;
long long result = strtoll(szValue, &nextchar, 10);
if (errno || result < (long long)min || result > (long long)max || *nextchar)
{
return FALSE;
}
*value = (unsigned int)result;
return TRUE;
}
//Converts a String Guid to a host binary guid in host endianess
int_fast8_t string2Uuid(const char *const restrict input, GUID *const restrict guid)
{
int i;
if (strlen(input) < GUID_STRING_LENGTH) return FALSE;
if (input[8] != '-' || input[13] != '-' || input[18] != '-' || input[23] != '-') return FALSE;
for (i = 0; i < GUID_STRING_LENGTH; i++)
{
if (i == 8 || i == 13 || i == 18 || i == 23) continue;
const char c = toupper((int)input[i]);
if (c < '0' || c > 'F' || (c > '9' && c < 'A')) return FALSE;
}
char inputCopy[GUID_STRING_LENGTH + 1];
strncpy(inputCopy, input, GUID_STRING_LENGTH + 1);
inputCopy[8] = inputCopy[13] = inputCopy[18] = 0;
hex2bin((BYTE*)&guid->Data1, inputCopy, 8);
hex2bin((BYTE*)&guid->Data2, inputCopy + 9, 4);
hex2bin((BYTE*)&guid->Data3, inputCopy + 14, 4);
hex2bin(guid->Data4, input + 19, 16);
guid->Data1 = BE32(guid->Data1);
guid->Data2 = BE16(guid->Data2);
guid->Data3 = BE16(guid->Data3);
return TRUE;
}
// convert GUID to little-endian
void LEGUID(GUID *const restrict out, const GUID* const restrict in)
{
#if __BYTE_ORDER != __LITTLE_ENDIAN
out->Data1 = LE32(in->Data1);
out->Data2 = LE16(in->Data2);
out->Data3 = LE16(in->Data3);
memcpy(out->Data4, in->Data4, sizeof(out->Data4));
#else
memcpy(out, in, sizeof(GUID));
#endif
}
//Checks a command line argument if it is numeric and between min and max. Returns the numeric value or exits on error
__pure unsigned int getOptionArgumentInt(const char o, const unsigned int min, const unsigned int max)
{
unsigned int result;
if (!stringToInt(optarg, min, max, &result))
{
printerrorf("Fatal: Option \"-%c\" must be numeric between %u and %u.\n", o, min, max);
exit(!0);
}
return result;
}
// Resets getopt() to start parsing from the beginning
void optReset(void)
{
#if __minix__ || defined(__BSD__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
optind = 1;
optreset = 1; // Makes newer BSD getopt happy
#elif defined(__UCLIBC__) // uClibc headers also define __GLIBC__ so be careful here
optind = 0; // uClibc seeks compatibility with GLIBC
#elif defined(__GLIBC__)
optind = 0; // Makes GLIBC getopt happy
#else // Standard for most systems
optind = 1;
#endif
}
#if defined(_WIN32) || defined(USE_MSRPC)
// Returns a static message buffer containing text for a given Win32 error. Not thread safe (same as strerror)
char* win_strerror(const int message)
{
#define STRERROR_BUFFER_SIZE 256
static char buffer[STRERROR_BUFFER_SIZE];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, message, 0, buffer, STRERROR_BUFFER_SIZE, NULL);
return buffer;
}
#endif // defined(_WIN32) || defined(USE_MSRPC)
/*
* parses an address in the form host:[port] in addr
* returns host and port in seperate strings
*/
void parseAddress(char *const addr, char** szHost, char** szPort)
{
*szHost = addr;
# ifndef NO_SOCKETS
*szPort = (char*)defaultport;
# else // NO_SOCKETS
*szPort = "1688";
# endif // NO_SOCKETS
char *lastcolon = strrchr(addr, ':');
char *firstcolon = strchr(addr, ':');
char *closingbracket = strrchr(addr, ']');
if (*addr == '[' && closingbracket) //Address in brackets
{
*closingbracket = 0;
(*szHost)++;
if (closingbracket[1] == ':')
*szPort = closingbracket + 2;
}
else if (firstcolon && firstcolon == lastcolon) //IPv4 address or hostname with port
{
*firstcolon = 0;
*szPort = firstcolon + 1;
}
}
// Initialize random generator (needs to be done in each thread)
void randomNumberInit()
{
struct timeval tv;
gettimeofday(&tv, NULL);
srand((unsigned int)(tv.tv_sec ^ tv.tv_usec));
}
// We always exit immediately if any OOM condition occurs
__noreturn void OutOfMemory(void)
{
errorout("Fatal: Out of memory");
exit(!0);
}
void* vlmcsd_malloc(size_t len)
{
void* buf = malloc(len);
if (!buf) OutOfMemory();
return buf;
}
/*
* Converts hex digits to bytes in big-endian order.
* Ignores any non-hex characters
*/
void hex2bin(BYTE *const bin, const char *hex, const size_t maxbin)
{
static const char *const hexdigits = "0123456789ABCDEF";
char* nextchar;
size_t i;
for (i = 0; (i < 16) && utf8_to_ucs2_char((const unsigned char*)hex, (const unsigned char**)&nextchar) != (WCHAR)-1; hex = nextchar)
{
const char* pos = strchr(hexdigits, toupper((int)*hex));
if (!pos) continue;
if (!(i & 1)) bin[i >> 1] = 0;
bin[i >> 1] |= (char)(pos - hexdigits);
if (!(i & 1)) bin[i >> 1] <<= 4;
i++;
if (i >> 1 > maxbin) break;
}
}
__pure BOOL getArgumentBool(int_fast8_t *result, const char *const argument)
{
if (
!strncasecmp(argument, "true", 4) ||
!strncasecmp(argument, "on", 2) ||
!strncasecmp(argument, "yes", 3) ||
!strncasecmp(argument, "1", 1)
)
{
*result = TRUE;
return TRUE;
}
else if (
!strncasecmp(argument, "false", 5) ||
!strncasecmp(argument, "off", 3) ||
!strncasecmp(argument, "no", 2) ||
!strncasecmp(argument, "0", 1)
)
{
*result = FALSE;
return TRUE;
}
return FALSE;
}

View File

@ -1,11 +1,16 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION=$(git describe)
cd "$( dirname "$0" )"
gmake -C .. clean
cd ../src
BINDIR="../bin"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
@ -14,19 +19,18 @@ CF45="-static-libgcc -pipe -fno-common -fno-exceptions -fno-stack-protector -fno
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv"
export CC=gcc5
export CC=gcc6
gmake $MAKEFLAGS PROGRAM_NAME=vlmcsd-DragonFly-x64 CLIENT_NAME=vlmcs-DragonFly-x64 CFLAGS="$CF" LDFLAGS="$LF"
rm vlmcsd.o vlmcs.o
gmake vlmcsdmulti-DragonFly-x64 $REUSEOBJFLAGS CFLAGS="$CF" LDFLAGS="$LF" MULTI_NAME=vlmcsdmulti-DragonFly-x64
gmake $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-DragonFly-x64 PROGRAM_NAME=$BINDIR/vlmcsd-DragonFly-x64 CLIENT_NAME=$BINDIR/vlmcs-DragonFly-x64 CFLAGS="$CF" LDFLAGS="$LF" allmulti
rm *.o
cd $BINDIR
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af ../etc/vlmcsd.kmd /usr/local/sbin
cp -af vlmcsd-DragonFly-x64 /usr/local/sbin/vlmcsd
cp -af vlmcs-DragonFly-x64 /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/DragonFly/intel/
scp -p vlmcsdmulti-* vlmcsd-Dragon* vlmcs-* root@ubuntu64:x/binaries/DragonFly/intel/

View File

@ -0,0 +1,46 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
cd "$( dirname "$0" )"
gmake -C .. clean
cd ../src
VERSION="$(uname -r | sed -e 's/-.*//')"
MAKE="gmake"
BINDIR="../bin"
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
CF="-flto=12 -static-libgcc -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=gnu"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-gcc CC=gcc6 CFLAGS="$CF" LDFLAGS="$LF"
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF" allmulti
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-gcc CC=gcc6 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads-gcc THREADS=1 CC=gcc6 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads-gcc THREADS=1 CC=gcc6 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
cd ../bin
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
sudo cp -af ../etc/vlmcsd.kmd /usr/local/sbin
sudo cp -af vlmcsd-FreeBSD-$VERSION-x64-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-$VERSION-x64-gcc /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p * root@ubuntu64:x/binaries/FreeBSD/intel/

View File

@ -1,10 +1,15 @@
#!/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
cd "$( dirname "$0" )"
make -C .. clean
BINDIR="../bin"
MANDIR="../man"
cd ../src
MAKEFLAGS="-B -j1"
@ -12,16 +17,18 @@ export CC=gcc
CF="-flto=jobserver -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-fuse-ld=gold -lresolv -Wl,-z,norelro,--hash-style=gnu,--build-id=none"
make $MAKEFLAGS PROGRAM_NAME=vlmcsd-hurd-x86-glibc CLIENT_NAME=vlmcs-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS MULTI_NAME=vlmcsdmulti-hurd-x86-glibc vlmcsdmulti-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" CAT=2 AUXV=1
make $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-hurd-x86-glibc PROGRAM_NAME=$BINDIR/vlmcsd-hurd-x86-glibc CLIENT_NAME=$BINDIR/vlmcs-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" allmulti
make clean
cd $BINDIR
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af ../etc/vlmcsd.kmd /usr/local/sbin
cp -af vlmcsd-hurd-x86-glibc /usr/local/sbin/vlmcsd
cp -af vlmcs-hurd-x86-glibc /usr/local/bin/vlmcs
cd $MANDIR
# Copy man pages
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
@ -30,9 +37,12 @@ mkdir -p /usr/local/man/man7 2>/dev/null
cp -af vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -af vlmcsd.7 /usr/local/man/man7/
cp -af vlmcsd.8 /usr/local/man/man8/
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
cp -af vlmcsd.ini.5 /usr/local/man/man5/
bzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64.internal:x/binaries/Hurd/intel/
cd $BINDIR
# Copy everything to distribution server
scp -p * root@ubuntu64.internal:x/binaries/Hurd/intel/

View File

@ -1,10 +1,15 @@
#!/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
cd "$( dirname "$0" )"
make -C .. clean
BINDIR="../bin"
MANDIR="../man"
cd ../src
MAKEFLAGS="-B -j`nproc`"
@ -12,25 +17,28 @@ export CC=gcc
CF="-flto=jobserver -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-lresolv -Wl,-z,norelro,--hash-style=gnu,--build-id=none"
export PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-glibc
export CLIENT_NAME=vlmcs-FreeBSD-10.1-x64-glibc
export MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x64-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-10.1-x64-glibc
export CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-10.1-x64-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-10.1-x64-glibc
make $MAKEFLAGS CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS $MULTI_NAME CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2 AUXV=1
export PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-glibc
export CLIENT_NAME=vlmcs-FreeBSD-10.1-x86-glibc
export MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x86-glibc
make $MAKEFLAGS CFLAGS="$CF -m32" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS $MULTI_NAME CFLAGS="$CF -m32" LDFLAGS="$LF" CAT=2 AUXV=1
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
make $MAKEFLAGS CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2 allmulti
cp -af ../etc/vlmcsd.kmd /usr/local/sbin
cp -af $PROGRAM_NAME /usr/local/sbin/vlmcsd
cp -af $CLIENT_NAME /usr/local/bin/vlmcs
export PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-10.1-x86-glibc
export CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-10.1-x86-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-10.1-x86-glibc
make $MAKEFLAGS CFLAGS="$CF -m32" LDFLAGS="$LF" CAT=2 allmulti
cd $BINDIR
sstrip -z *
cd $MANDIR
# Copy man pages
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
@ -42,6 +50,8 @@ cp -af vlmcsd.8 /usr/local/man/man8/
cp -af vlmcsd.ini.5 /usr/local/man/man5/
bzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64.internal:x/binaries/FreeBSD/intel/
cd $BINDIR
# Copy everything to distribution server
scp -p * root@ubuntu64.internal:x/binaries/FreeBSD/intel/

File diff suppressed because it is too large Load Diff

25
hotbird64-mass-build/make_minix Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
cd ~/vlmcsd/hotbird64-mass-build
export VLMCSD_VERSION=$(git describe)
BINDIR="bin"
cd ..
# Compile vlmcsd binaries for Minix 3
SUFFIX=-minix-$(uname -r)-x86
export CC=clang
export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
export LDFLAGS="-Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none"
export PROGRAM_NAME=$BINDIR/vlmcsd$SUFFIX
export CLIENT_NAME=$BINDIR/vlmcs$SUFFIX
export MULTI_NAME=$BINDIR/vlmcsdmulti$SUFFIX
gmake clean
gmake -B allmulti
#strip -s --strip-unneeded --remove-section .eh_frame_hdr --remove-section .eh_frame --remove-section .ident --remove-section .note.minix.ident --remove-section .note.netbsd.pax --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag $BINDIR/*$SUFFIX
scp -p $BINDIR/* root@ubuntu64.internal:x/binaries/Minix/intel/

View File

@ -1,10 +1,16 @@
#!/bin/bash
export VLMCSD_VERSION=$(git describe)
SMALLCC="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
SMALLLD="-pipe -Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none"
SMALL="$SMALLCC $SMALLLD"
rm -f vlmcsd vlmcs vlmcsdmulti vlmcsd-* vlmcs-* vlmcsdmulti-*
cd "$( dirname "$0" )"
gmake -C .. clean
BINDIR="../bin"
MANDIR="../man"
cd ../src
## IBM S/390
@ -16,29 +22,20 @@ export FEATURES=full
export CC=s390x-linux-gnu-gcc
export VERBOSE=3
export MULTI_NAME=vlmcsdmulti-s390-glibc
export CLIENT_NAME=vlmcs-s390-glibc
export PROGRAM_NAME=vlmcsd-s390-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-s390-glibc
export CLIENT_NAME=$BINDIR/vlmcs-s390-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-s390-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
make -B -j`nproc` allmulti
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
export MULTI_NAME=vlmcsdmulti-s390x-glibc
export CLIENT_NAME=vlmcs-s390x-glibc
export PROGRAM_NAME=vlmcsd-s390x-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-s390x-glibc
export CLIENT_NAME=$BINDIR/vlmcs-s390x-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-s390x-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
make -B -j`nproc` allmulti
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## SPARC64
@ -47,15 +44,13 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mcpu=v7"
export LDFLAGS="$SMALLLD"
export CC=sparc64-linux-gnu-gcc
export MULTI_NAME=vlmcsdmulti-sparc64v9-glibc
export CLIENT_NAME=vlmcs-sparc64v9-glibc
export PROGRAM_NAME=vlmcsd-sparc64v9-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-sparc64v9-glibc
export CLIENT_NAME=$BINDIR/vlmcs-sparc64v9-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-sparc64v9-glibc
make -B -j`nproc` allmulti
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 BIG-ENDIAN
@ -64,26 +59,19 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64-linux-gnuabi64-gcc
export MULTI_NAME=vlmcsdmulti-mips64-glibc
export CLIENT_NAME=vlmcs-mips64-glibc
export PROGRAM_NAME=vlmcsd-mips64-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
make -B -j`nproc` allmulti
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=vlmcsdmulti-mips64mm-glibc
export CLIENT_NAME=vlmcs-mips64mm-glibc
export PROGRAM_NAME=vlmcsd-mips64mm-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64mm-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64mm-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64mm-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
make -B -j`nproc` allmulti
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 LITTLE-ENDIAN
@ -92,26 +80,21 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64el-linux-gnuabi64-gcc
export MULTI_NAME=vlmcsdmulti-mips64el-glibc
export CLIENT_NAME=vlmcs-mips64el-glibc
export PROGRAM_NAME=vlmcsd-mips64el-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64el-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64el-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64el-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
make -B -j`nproc` allmulti
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=vlmcsdmulti-mips64elmm-glibc
export CLIENT_NAME=vlmcs-mips64elmm-glibc
export PROGRAM_NAME=vlmcsd-mips64elmm-glibc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64elmm-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64elmm-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64elmm-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
make -B -j`nproc` allmulti
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
cd $BINDIR
sstrip -z *
@ -119,6 +102,8 @@ if [ "$1" == "nocopy" ]; then
exit 0
fi
cd $MANDIR
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
@ -129,6 +114,8 @@ cp -a vlmcsd.8 /usr/local/man/man8/
cp -a vlmcsd.ini.5 /usr/local/man/man5/
pbzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
cd $BINDIR
scp -p vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc ubuntu64.internal:x/binaries/Linux/s390/glibc
scp -p vlmcsdmulti-sparc64v9-glibc vlmcs-sparc64v9-glibc vlmcsd-sparc64v9-glibc ubuntu64.internal:x/binaries/Linux/sparc/glibc
scp -p vlmcsdmulti-mips64-glibc vlmcs-mips64-glibc vlmcsd-mips64-glibc vlmcsdmulti-mips64mm-glibc vlmcs-mips64mm-glibc vlmcsd-mips64mm-glibc ubuntu64.internal:x/binaries/Linux/mips/big-endian/glibc

View File

@ -1,29 +1,31 @@
#!/usr/pkg/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
gmake clean
cd "$( dirname "$0" )"
gmake -C .. clean
BINDIR="../bin"
cd ../src
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
CF="-flto=12 -static-libgcc -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CF45="-static-libgcc -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CF45="-flto=12 -static-libgcc -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv"
gmake $MAKEFLAGS CC=/usr/pkg/gcc5/bin/gcc PROGRAM_NAME=vlmcsd-NetBSD-x64 CLIENT_NAME=vlmcs-NetBSD-x64 CFLAGS="$CF" LDFLAGS="$LF"
rm vlmcsd.o vlmcs.o
gmake vlmcsdmulti-NetBSD-x64 $REUSEOBJFLAGS CC=/usr/pkg/gcc5/bin/gcc CFLAGS="$CF" LDFLAGS="$LF" MULTI_NAME=vlmcsdmulti-NetBSD-x64
gmake $MAKEFLAGS CC=/usr/pkg/gcc6/bin/gcc PROGRAM_NAME=$BINDIR/vlmcsd-NetBSD-x64 CLIENT_NAME=$BINDIR/vlmcs-NetBSD-x64 MULTI_NAME=$BINDIR/vlmcsdmulti-NetBSD-x64 allmulti CFLAGS="$CF" LDFLAGS="$LF"
gmake allmulti CC=gcc $MAKEFLAGS CAT=2 MULTI_NAME=vlmcsdmulti-NetBSD-x86 PROGRAM_NAME=vlmcsd-NetBSD-x86 CLIENT_NAME=vlmcs-NetBSD-x86 CFLAGS="$CF45 -m32" LDFLAGS="$LF"
gmake allmulti CC=gcc $MAKEFLAGS CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-NetBSD-x86 PROGRAM_NAME=$BINDIR/vlmcsd-NetBSD-x86 CLIENT_NAME=$BINDIR/vlmcs-NetBSD-x86 CFLAGS="$CF45 -m32" LDFLAGS="$LF"
#gmake $MAKEFLAGS CC=clang PROGRAM_NAME=vlmcsd-NetBSD-x64-clang CLIENT_NAME=vlmcs-NetBSD-x64-clang CFLAGS="$CFCLANG" LDFLAGS="$LFCLANG"
rm *.o
cd $BINDIR
strip -s --strip-unneeded -R .ident -R .got -R .note.netbsd.pax -R .gnu.version -R .eh_frame -R .note.gnu.gold-version -R .comment -R .note -R .note.gnu.build-id -R .note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
#sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
@ -32,4 +34,4 @@ cp -af vlmcsd-NetBSD-x86 /usr/local/sbin/vlmcsd
cp -af vlmcs-NetBSD-x86 /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/NetBSD/intel/
scp -p vlmcsdmulti-* vlmcsd-Net* vlmcs-* root@ubuntu64:x/binaries/NetBSD/intel/

View File

@ -1,10 +1,14 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
cd "$( dirname "$0" )"
gmake -C .. clean
cd ../src
BINDIR="../bin"
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
@ -12,22 +16,23 @@ REUSEOBJFLAGS="-j12"
CF="-static-libgcc -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CF45="-static-libgcc -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro"
LFCLANG="-Wl,-z,norelro"
LF="-lpthread -Wl,-z,norelro"
LFCLANG="-lpthread -Wl,-z,norelro"
gmake allmulti CAT=2 $MAKEFLAGS CC=egcc MULTI_NAME=vlmcsdmulti-OpenBSD-x64 PROGRAM_NAME=vlmcsd-OpenBSD-x64 CLIENT_NAME=vlmcs-OpenBSD-x64 CFLAGS="$CF" LDFLAGS="$LF"
gmake -Bj12 allmulti $MAKEFLAGS CC=egcc THREADS=1 MULTI_NAME=$BINDIR/vlmcsdmulti-OpenBSD-x64 PROGRAM_NAME=$BINDIR/vlmcsd-OpenBSD-x64 CLIENT_NAME=$BINDIR/vlmcs-OpenBSD-x64 CFLAGS="$CF" LDFLAGS="$LF"
#gmake allmulti $MAKEFLAGS CAT=2 MULTI_NAME=vlmcsdmulti-OpenBSD-x86 PROGRAM_NAME=vlmcsd-OpenBSD-x86 CLIENT_NAME=vlmcs-OpenBSD-x86 CFLAGS="$CF45 -m32" LDFLAGS="$LF"
#gmake $MAKEFLAGS CC=clang PROGRAM_NAME=vlmcsd-OpenBSD-x64-clang CLIENT_NAME=vlmcs-OpenBSD-x64-clang CFLAGS="$CFCLANG" LDFLAGS="$LFCLANG"
rm *.o
cd $BINDIR
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
#sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -f ../etc/vlmcsd.kmd /etc
cp -f vlmcsd-OpenBSD-x64 /usr/local/sbin/vlmcsd
cp -f vlmcs-OpenBSD-x64 /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/OpenBSD/intel/
scp -p vlmcsdmulti-* vlmcsd-Open* vlmcs-* root@ubuntu64:x/binaries/OpenBSD/intel/

84
hotbird64-mass-build/make_osx Executable file
View File

@ -0,0 +1,84 @@
#!/bin/bash
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=OS
cd "$( dirname "$0" )"
make -C .. clean
MAKEFLAGS="-Bj"
REUSEOBJFLAGS="-j"
CFGCC="-static-libgcc -mdynamic-no-pic -Os -flto=jobserver -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-mdynamic-no-pic -Os -flto -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFGCC42="-static-libgcc -mdynamic-no-pic -Os -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
cd ../src
BINDIR="../bin"
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x86 CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x86 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-threads CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x64 CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x64 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-threads CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.0" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86-openssl-EXPERIMENTAL PROGRAM_NAME=vlmcsd-MacOSX-x86-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes_soft CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.4" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x64-openssl-EXPERIMENTAL PROGRAM_NAME=vlmcsd-MacOSX-x64-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes_soft CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.4" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-7.1-armv7 PROGRAM_NAME=vlmcsd-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \
#rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
#make $REUSEOBJFLAGS vlmcsdmulti-iOS-7.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-iOS-armv7 CLIENT_NAME=$BINDIR/vlmcs-iOS-armv7 PROGRAM_NAME=$BINDIR/vlmcsd-iOS-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-iOS-armv8-aarch64 CLIENT_NAME=$BINDIR/vlmcs-iOS-armv8-aarch64 PROGRAM_NAME=$BINDIR/vlmcsd-iOS-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-iOS-6.1-armv7 CLIENT_NAME=$BINDIR/vlmcs-iOS-6.1-armv7 PROGRAM_NAME=$BINDIR/vlmcsd-iOS-6.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS6.1.sdk -isysroot ~/toolchains/iPhoneOS6.1.sdk" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-iOS-5.1-armv7-clang3.4 CLIENT_NAME=$BINDIR/vlmcs-iOS-5.1-armv7-clang3.4 PROGRAM_NAME=$BINDIR/vlmcsd-iOS-5.1-armv7-clang3.4 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
#PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH clang --version
PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-iOS-5.1-armv6-clang3.1 CLIENT_NAME=$BINDIR/vlmcs-iOS-5.1-armv6-clang3.1 PROGRAM_NAME=$BINDIR/vlmcsd-iOS-5.1-armv6-clang3.1 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
#PATH=~/toolchains/gcc4.2/usr/bin/bin:$PATH make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-4.1-armv6-llvm-gcc4.2 PROGRAM_NAME=vlmcsd-iOS-4.1-armv6-llvm-gcc4.2 CC=llvm-g++-4.2 CFLAGS="$CFGCC42" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS4.1.sdk -isysroot ~/toolchains/iPhoneOS4.1.sdk" && \
#rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
#PATH=~/toolchains/gcc4.2/usr/bin/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv6-llvm-gcc4.2 MULTI_NAME=vlmcsdmulti-iOS-4.1-armv6-llvm-gcc4.2 CC=llvm-g++-4.2 CFLAGS="$CFGCC42" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS4.1.sdk -isysroot ~/toolchains/iPhoneOS4.1.sdk" && \
#PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-4.1-armv7-clang PROGRAM_NAME=vlmcsd-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \
#rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o && \
#PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv7-llvm-clang MULTI_NAME=vlmcsdmulti-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj allmulti SAFE_MODE=1 MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-ppc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-ppc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-threads-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-threads-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
# Sign the iOS binaries
#ldid -S *iOS*
#strip vlmcs-* vlmcsd-* vlmcsdmulti-*
cd $BINDIR
MANDIR="../man"
rm -fr *.dSYM
sudo cp -p ../etc/vlmcsd.kmd /usr/local/bin
sudo cp -p vlmcs-MacOSX-x86-gcc /usr/local/bin/vlmcs
sudo cp -p vlmcsd-MacOSX-x86-gcc /usr/local/bin/vlmcsd
sudo mkdir -p /usr/local/share/man/man8
sudo mkdir -p /usr/local/share/man/man1
sudo mkdir -p /usr/local/share/man/man7
sudo mkdir -p /usr/local/share/man/man5
sudo cp -p $MANDIR/vlmcsd.8 /usr/local/share/man/man8
sudo cp -p $MANDIR/vlmcs.1 $MANDIR/vlmcsdmulti.1 /usr/local/share/man/man1
sudo cp -p $MANDIR/vlmcsd-floppy.7 $MANDIR/vlmcsd.7 /usr/local/share/man/man7
sudo cp -p $MANDIR/vlmcsd.ini.5 //usr/local/share/man/man5
# Copy the stuff to distribution server
scp -p vlmcsd-MacOSX-x* vlmcs-MacOSX-x* vlmcsdmulti-MacOSX-x* root@ubuntu64:x/binaries/MacOSX/intel
scp -p vlmcsd-MacOSX-ppc* vlmcs-MacOSX-ppc* vlmcsdmulti-MacOSX-ppc* root@ubuntu64:x/binaries/MacOSX/ppc
scp -p vlmcsd-iOS* vlmcs-iOS* vlmcsdmulti-iOS* root@ubuntu64:x/binaries/iOS/arm

View File

@ -0,0 +1,61 @@
#!/bin/sh
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export CAT=2
if [ `uname -s` != "SunOS" ]; then
echo "This is no SunOS operating system."
exit 3
fi
cd "$( dirname "$0" )"
make -C .. clean
SOLARIS_VERSION=`uname -v`
MAKEFLAGS="-Bj"
REUSEOBJFLAGS="-j"
cd ../src
BINDIR="../bin"
MANDIR="../man"
CF="-fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants -Wno-char-subscripts"
LF="-fwhole-program -Wl,--hash-style=sysv -Wl,--build-id=none"
# 32 bit
if [ "$CAT" != "" ]; then
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld allmulti CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x86 PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x86 MULTI_NAME=$BINDIR/vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
else
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld MULTI_NAME=$BINDIR/vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x86 PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" allmulti
fi
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x86-threads CC=gcc THREADS=1 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x86-openssl1.0-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x86-openssl1.0-EXPERIMENTAL CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
# 64 bit
LF="$LF -Wl,-melf_x86_64_sol2"
if [ "$CAT" != "" ]; then
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x64 PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x64 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
else
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x64 PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x64 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64" allmulti
fi
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x64-threads CC=gcc THREADS=1 CFLAGS="$CF" LDFLAGS="$LF -lpthread" PLATFORMFLAGS="-m64"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=$BINDIR/vlmcs-Solaris$SOLARIS_VERSION-x64-openssl1.0-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=$BINDIR/vlmcsd-Solaris$SOLARIS_VERSION-x64-openssl1.0-EXPERIMENTAL CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
rm -f *.o *_all.*
cd $BINDIR
gstrip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-*
#gstrip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-*
#sstrip -z vlmcs-* vlmcsd-*
# Copy stuff to distribution server
scp -p vlmcsd-Sola* vlmcs-* vlmcsdmulti-* root@ubuntu64:x/binaries/Solaris/intel

View File

@ -0,0 +1,99 @@
#!/bin/bash
cd "$( dirname "$0" )"
export VLMCSD_VERSION=$(git describe)
msbuild='/cygdrive/c/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe'
version="$VLMCSD_VERSION, built $(date -u '+%Y-%m-%d %H:%M:%S') UTC"
make -C .. clean
export ExternalCompilerOptions="/D VERSION=\"\\\"$version\\\"\" /D BUILD_TIME=$(date '+%s')"
"$msbuild" ../VisualStudio/vlmcsd.sln /t:Rebuild /p:Configuration=publish /p:Platform=x86 /m /v:m
"$msbuild" ../VisualStudio/vlmcsd.sln /t:Rebuild /p:Configuration=publish /p:Platform=x64 /m /v:m
export CAT=2
export VERBOSE=3
NUMCPU=`cat /proc/cpuinfo | grep "processor" | wc -l`
CF="-Wno-missing-braces -fno-common -fno-exceptions -fno-non-call-exceptions -fno-stack-protector -fmerge-all-constants -fno-unwind-tables -fno-asynchronous-unwind-tables -pipe"
CFMSRPC="-Wno-missing-braces -Wno-unused-variable $CF" # -fno-common -fno-stack-protector -fmerge-all-constants -pipe"
PF32=""
PF64="-mpreferred-stack-boundary=4 -march=nocona -mtune=generic"
LFCYG32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
LFWIN32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names,--no-seh"
LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
LFWIN64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va,--no-seh"
MAKEFLAGS="-j$NUMCPU -B"
REUSEFLAGS="-j$NUMCPU"
cd ../src
make $MAKEFLAGS libkms FEATURES=minimum THREADS=1 DLL_NAME=../bin/cygkms32.dll DNS_PARSER=internal CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS libkms FEATURES=minimum THREADS=1 DLL_NAME=../bin/cygkms64.dll DNS_PARSER=internal CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS allmulti THREADS=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-x86 PROGRAM_NAME=../bin/vlmcsd-cygwin-x86 MULTI_NAME=../bin/vlmcsdmulti-cygwin-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS allmulti THREADS=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-x64 PROGRAM_NAME=../bin/vlmcsd-cygwin-x64 MULTI_NAME=../bin/vlmcsdmulti-cygwin-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-msrpc-x86 PROGRAM_NAME=../bin/vlmcsd-cygwin-msrpc-x86 MULTI_NAME=../bin/vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -fasynchronous-unwind-tables" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-msrpc-x64 PROGRAM_NAME=../bin/vlmcsd-cygwin-msrpc-x64 MULTI_NAME=../bin/vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
make $MAKEFLAGS vlmcsdmulti MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=../bin/vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
make $MAKEFLAGS vlmcsdmulti MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=../bin/vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-msrpc-x86-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=../bin/vlmcsd-cygwin-x86-openssl-EXPERIMENTAL CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=../bin/vlmcs-cygwin-msrpc-x64-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=../bin/vlmcsd-cygwin-x64-openssl-EXPERIMENTAL CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
export CAT=2
#unset CAT
make $MAKEFLAGS libkms CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=../bin/libkms32-gcc.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32"
make $MAKEFLAGS libkms CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=../bin/libkms64-gcc.dll CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="-static-libgcc $LFWIN64"
make $MAKEFLAGS allmulti THREADS=1 CRYPTO=internal CLIENT_NAME=../bin/vlmcs-Windows-x86-gcc PROGRAM_NAME=../bin/vlmcsd-Windows-x86-gcc MULTI_NAME=../bin/vlmcsdmulti-Windows-x86-gcc CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
make $MAKEFLAGS allmulti THREADS=1 CRYPTO=internal CLIENT_NAME=../bin/vlmcs-Windows-x64-gcc PROGRAM_NAME=../bin/vlmcsd-Windows-x64-gcc MULTI_NAME=../bin/vlmcsdmulti-Windows-x64-gcc CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
unset CAT
make -Bj allmulti CAT=2 MSRPC=1 CRYPTO=windows CLIENT_NAME=../bin/vlmcs-Windows-msrpc-x86 PROGRAM_NAME=../bin/vlmcsd-Windows-msrpc-x86 MULTI_NAME=../bin/vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
make $MAKEFLAGS allmulti CAT=2 THREADS=1 MSRPC=1 CRYPTO=windows CLIENT_NAME=../bin/vlmcs-Windows-msrpc-x64 PROGRAM_NAME=../bin/vlmcsd-Windows-msrpc-x64 MULTI_NAME=../bin/vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
#unset CAT
#make $MAKEFLAGS CAT=2 vlmcsdmulti-Windows-msrpc-x86 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
#make $MAKEFLAGS CAT=2 vlmcsdmulti-Windows-msrpc-x64 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
export CAT=2
#echo ""
#echo "Copying MingW binaries from distribution server"
#scp -p root@ubuntu64:x/binaries/Windows/intel/*Windows* root@ubuntu64:x/binaries/Windows/intel/libkms* .
cd ..
echo ""
echo "Installing binaries"
cp -p bin/vlmcs-cygwin-x64.exe /usr/local/bin/vlmcs &
cp -p bin/vlmcsd-cygwin-x64.exe /usr/local/bin/vlmcsd &
cp -p etc/vlmcsd.kmd /usr/local/bin &
cp -p bin/cygkms64.dll /usr/local/bin/cygkms.dll &
cp -p bin/libkms32.dll /cygdrive/c/nttools/x86 &
cp -p bin/libkms64.dll /cygdrive/c/nttools/x64 &
cp -p bin/vlmcsd-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcsd.exe &
cp -p bin/vlmcs-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcs.exe &
cp -p etc/vlmcsd.kmd /cygdrive/c/nttools/x86
#cmd /C mklink c:\\nttools\\x86\\vlmcsd.exe vlmcsdmulti.exe 2> /dev/null &
#cmd /C mklink c:\\nttools\\x86\\vlmcs.exe vlmcsdmulti.exe 2> /dev/null &
echo "Installing man pages"
mkdir -p /usr/share/man/man8
mkdir -p /usr/share/man/man1
mkdir -p /usr/share/man/man7
mkdir -p /usr/share/man/man5
cp -p man/vlmcsd.7 man/vlmcsd-floppy.7 /usr/share/man/man7
cp -p man/vlmcsd.8 /usr/share/man/man8
cp -p man/vlmcsd.ini.5 /usr/share/man/man5
cp -p man/vlmcs.1 man/vlmcsdmulti.1 /usr/share/man/man1
bzip2 -f /usr/share/man/man7/vlmcsd-floppy.7 /usr/share/man/man5/vlmcsd.ini.5 /usr/share/man/man7/vlmcsd.7 /usr/share/man/man8/vlmcsd.8 /usr/share/man/man1/vlmcs.1 /usr/share/man/man1/vlmcsdmulti.1 &
# Copy stuff to distribution server
scp -p bin/*.exe bin/*.dll root@ubuntu64:x/binaries/Windows/intel

View File

@ -0,0 +1,5 @@
#!/bin/bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
find ../binaries/ -xdev -name 'vlmcs*' ! -name '*-NetBSD-*' ! -name '*-Windows-*' ! -name '*-cygwin-*' ! -name '*-MacOSX-*' ! -name '*-iOS-*' -exec sstrip -z {} \;

1130
kms.c

File diff suppressed because it is too large Load Diff

4
lib/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

169
libkms.c
View File

@ -1,169 +0,0 @@
/*
* libkms.c
*/
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
#include CONFIG
#ifdef EXTERNAL
#undef EXTERNAL
#endif
#define EXTERNAL dllexport
#define DLLVERSION 0x30001
#include "libkms.h"
#include "shared_globals.h"
#include "network.h"
#include "helpers.h"
#ifndef _WIN32
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <netinet/in.h>
#endif // WIN32
#ifdef IS_LIBRARY
char ErrorMessage[MESSAGE_BUFFER_SIZE];
#endif // IS_LIBRARY
static int_fast8_t IsServerStarted = FALSE;
EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest
(
const char* const hostname,
const int port,
RESPONSE* baseResponse,
const REQUEST* const baseRequest,
RESPONSE_RESULT* result, BYTE *hwid
)
{
return !0; // not yet implemented
}
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback)
{
#ifndef SIMPLE_SOCKETS
char listenAddress[64];
if (IsServerStarted) return !0;
# ifdef _WIN32
# ifndef USE_MSRPC
// Windows Sockets must be initialized
WSADATA wsadata;
int error;
if ((error = WSAStartup(0x0202, &wsadata)))
{
return error;
}
# endif // USE_MSRPC
# endif // _WIN32
CreateResponseBase = requestCallback;
int maxsockets = 0;
int_fast8_t haveIPv4 = FALSE;
int_fast8_t haveIPv6 = FALSE;
if (checkProtocolStack(AF_INET)) { haveIPv4 = TRUE; maxsockets++; }
if (checkProtocolStack(AF_INET6)) { haveIPv6 = TRUE; maxsockets++; }
if(!maxsockets) return !0;
SocketList = (SOCKET*)vlmcsd_malloc(sizeof(SOCKET) * (size_t)maxsockets);
numsockets = 0;
if (haveIPv4)
{
snprintf(listenAddress, 64, "0.0.0.0:%u", (unsigned int)port);
addListeningSocket(listenAddress);
}
if (haveIPv6)
{
snprintf(listenAddress, 64, "[::]:%u", (unsigned int)port);
addListeningSocket(listenAddress);
}
if (!numsockets)
{
free(SocketList);
return !0;
}
IsServerStarted = TRUE;
runServer();
IsServerStarted = FALSE;
return 0;
# else // SIMPLE_SOCKETS
if (IsServerStarted) return !0;
int error;
# ifdef _WIN32
# ifndef USE_MSRPC
// Windows Sockets must be initialized
WSADATA wsadata;
if ((error = WSAStartup(0x0202, &wsadata)))
{
return error;
}
# endif // USE_MSRPC
# endif // _WIN32
defaultport = vlmcsd_malloc(16);
snprintf((char*)defaultport, (size_t)16, "%i", port);
CreateResponseBase = requestCallback;
error = listenOnAllAddresses();
if (error) return error;
IsServerStarted = TRUE;
runServer();
IsServerStarted = FALSE;
return 0;
# endif // SIMPLE_SOCKETS
}
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer()
{
if (!IsServerStarted) return !0;
closeAllListeningSockets();
# ifndef SIMPLE_SOCKETS
if (SocketList) free(SocketList);
# endif
return 0;
}
EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion()
{
return DLLVERSION;
}
EXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion()
{
return VERSION;
}

View File

@ -1,28 +0,0 @@
/*
* libkms.h
*/
#ifndef LIBKMS_H_
#define LIBKMS_H_
#include "types.h"
#include "kms.h"
#include "rpc.h"
#ifndef EXTERNC
#ifdef __cplusplus
#define EXTERNC EXTERN "C"
#else
#define EXTERNC
#endif
#endif
EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest(const char* const hostname, const int port, RESPONSE* baseResponse, const REQUEST* const baseRequest, RESPONSE_RESULT* result, BYTE *hwid);
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback);
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer();
EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion();
EXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion();
//EXTERN_C __declspec(EXTERNAL) unsigned int __cdecl GetRandom32();
#endif /* LIBKMS_H_ */

View File

@ -1,46 +0,0 @@
#!/usr/local/bin/bash
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
CF="-flto=12 -static-libgcc -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=gnu"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x64-gcc CLIENT_NAME=vlmcs-FreeBSD-10.3-x64-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-gcc CC=gcc5 CFLAGS="$CF" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.3-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.3-x64 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.3-x86 PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.3-x86 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x86-gcc CLIENT_NAME=vlmcs-FreeBSD-10.3-x86-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-gcc CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.3-x64-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.3-x64-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.3-x86-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.3-x86-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.3-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.3-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm *.o
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
sudo cp -af vlmcsd-FreeBSD-10.3-x86-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-10.3-x86-gcc /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/

3507
make_lxss

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
#!/bin/sh
export VLMCSD_VERSION=svn$(ssh root@ubuntu64.internal "cd x; svnversion")
scp -p make_minix root@ubuntu64.internal:x
scp -pr root@ubuntu64.internal:x/* .
# Compile vlmcsd binaries for Minix 3
SUFFIX=-minix-$(uname -r)-x86
export CC=clang
export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
export LDFLAGS="-Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none"
export PROGRAM_NAME=vlmcsd$SUFFIX
export CLIENT_NAME=vlmcs$SUFFIX
export MULTI_NAME=vlmcsdmulti$SUFFIX
gmake clean
gmake -B
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
gmake $MULTI_NAME
strip -s --strip-unneeded --remove-section .eh_frame_hdr --remove-section .eh_frame --remove-section .ident --remove-section .note.minix.ident --remove-section .note.netbsd.pax --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag *$SUFFIX
scp -p *$SUFFIX root@ubuntu64.internal:x/binaries/Minix/intel/

View File

@ -1,97 +0,0 @@
#!/bin/bash
export VERBOSE=3
export DNS_PARSER=OS
rm vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm vlmcsd vlmcs vlmcsdmulti 2>/dev/null
MAKEFLAGS="-Bj"
REUSEOBJFLAGS="-j"
CFGCC="-static-libgcc -mdynamic-no-pic -Os -flto=jobserver -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-mdynamic-no-pic -Os -flto -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFGCC42="-static-libgcc -mdynamic-no-pic -Os -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86 PROGRAM_NAME=vlmcsd-MacOSX-x86 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.0" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-MacOSX-x86 MULTI_NAME=vlmcsdmulti-MacOSX-x86 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS vlmcsd-MacOSX-x86-threads THREADS=1 PROGRAM_NAME=vlmcsd-MacOSX-x86-threads CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x64 PROGRAM_NAME=vlmcsd-MacOSX-x64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.0" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-MacOSX-x64 MULTI_NAME=vlmcsdmulti-MacOSX-x64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.0" && \
make $MAKEFLAGS vlmcsd-MacOSX-x64-threads THREADS=1 PROGRAM_NAME=vlmcsd-MacOSX-x64-threads CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.0" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86-openssl-EXPERIMENTAL PROGRAM_NAME=vlmcsd-MacOSX-x86-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes_soft CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.4" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x64-openssl-EXPERIMENTAL PROGRAM_NAME=vlmcsd-MacOSX-x64-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes_soft CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.4" && \
#make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-7.1-armv7 PROGRAM_NAME=vlmcsd-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
#make $REUSEOBJFLAGS vlmcsdmulti-iOS-7.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-armv7 PROGRAM_NAME=vlmcsd-iOS-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-armv7 MULTI_NAME=vlmcsdmulti-iOS-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-armv8-aarch64 PROGRAM_NAME=vlmcsd-iOS-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-armv8-aarch64 MULTI_NAME=vlmcsdmulti-iOS-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-6.1-armv7 PROGRAM_NAME=vlmcsd-iOS-6.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS6.1.sdk -isysroot ~/toolchains/iPhoneOS6.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-6.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-6.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS6.1.sdk -isysroot ~/toolchains/iPhoneOS6.1.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-5.1-armv7-clang3.4 PROGRAM_NAME=vlmcsd-iOS-5.1-armv7-clang3.4 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-5.1-armv7-clang3.4 MULTI_NAME=vlmcsdmulti-iOS-5.1-armv7-clang3.4 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
#PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH clang --version
PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-5.1-armv6-clang3.1 PROGRAM_NAME=vlmcsd-iOS-5.1-armv6-clang3.1 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-5.1-armv6-clang3.1 MULTI_NAME=vlmcsdmulti-iOS-5.1-armv6-clang3.1 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS5.1.sdk -isysroot ~/toolchains/iPhoneOS5.1.sdk" && \
#PATH=~/toolchains/gcc4.2/usr/bin/bin:$PATH make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-4.1-armv6-llvm-gcc4.2 PROGRAM_NAME=vlmcsd-iOS-4.1-armv6-llvm-gcc4.2 CC=llvm-g++-4.2 CFLAGS="$CFGCC42" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS4.1.sdk -isysroot ~/toolchains/iPhoneOS4.1.sdk" && \
#rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
#PATH=~/toolchains/gcc4.2/usr/bin/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv6-llvm-gcc4.2 MULTI_NAME=vlmcsdmulti-iOS-4.1-armv6-llvm-gcc4.2 CC=llvm-g++-4.2 CFLAGS="$CFGCC42" PLATFORMFLAGS="-arch armv6 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS4.1.sdk -isysroot ~/toolchains/iPhoneOS4.1.sdk" && \
#PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-4.1-armv7-clang PROGRAM_NAME=vlmcsd-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \
#rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o && \
#PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv7-llvm-clang MULTI_NAME=vlmcsdmulti-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj SAFE_MODE=1 PROGRAM_NAME=vlmcsd-MacOSX-ppc CLIENT_NAME=vlmcs-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -j SAFE_MODE=1 vlmcsdmulti-MacOSX-ppc MULTI_NAME=vlmcsdmulti-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0"
make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86-gcc PROGRAM_NAME=vlmcsd-MacOSX-x86-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-MacOSX-x86-gcc MULTI_NAME=vlmcsdmulti-MacOSX-x86-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd-MacOSX-x86-threads-gcc THREADS=1 PROGRAM_NAME=vlmcsd-MacOSX-x86-threads-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x64-gcc PROGRAM_NAME=vlmcsd-MacOSX-x64-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-MacOSX-x64-gcc MULTI_NAME=vlmcsdmulti-MacOSX-x64-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd-MacOSX-x64-threads-gcc THREADS=1 PROGRAM_NAME=vlmcsd-MacOSX-x64-threads-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
# Sign the iOS binaries
#ldid -S *iOS*
#strip vlmcs-* vlmcsd-* vlmcsdmulti-*
rm -f *.o *_all.*
rm -fr *.dSYM
sudo cp -p vlmcs-MacOSX-x86-gcc /usr/local/bin/vlmcs
sudo cp -p vlmcsd-MacOSX-x86-gcc /usr/local/bin/vlmcsd
sudo mkdir -p /usr/local/share/man/man8
sudo mkdir -p /usr/local/share/man/man1
sudo mkdir -p /usr/local/share/man/man7
sudo mkdir -p /usr/local/share/man/man5
sudo cp -p vlmcsd.8 /usr/local/share/man/man8
sudo cp -p vlmcs.1 vlmcsdmulti.1 /usr/local/share/man/man1
sudo cp -p vlmcsd.7 /usr/local/share/man/man7
sudo cp -p vlmcsd.ini.5 //usr/local/share/man/man5
# Copy the stuff to distribution server
scp -p vlmcsd-MacOSX-x* vlmcs-MacOSX-x* vlmcsdmulti-MacOSX-x* root@ubuntu64:x/binaries/MacOSX/intel
scp -p vlmcsd-MacOSX-ppc* vlmcs-MacOSX-ppc* vlmcsdmulti-MacOSX-ppc* root@ubuntu64:x/binaries/MacOSX/ppc
scp -p vlmcsd-iOS* vlmcs-iOS* vlmcsdmulti-iOS* root@ubuntu64:x/binaries/iOS/arm

View File

@ -1,57 +0,0 @@
#!/bin/sh
export VERBOSE=3
export CAT=2
if [ `uname -s` != "SunOS" ]; then
echo "This is no SunOS operating system."
exit 3
fi
SOLARIS_VERSION=`uname -v`
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j`nproc`"
REUSEOBJFLAGS="-j`nproc`"
CF="-fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants -Wno-char-subscripts"
LF="-fwhole-program -Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
# 32 bit
if [ "$CAT" != "" ]; then
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcs-Solaris$SOLARIS_VERSION-x86 vlmcsd-Solaris$SOLARIS_VERSION-x86 vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x86 PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x86 MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
else
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x86 PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
fi
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsd-Solaris$SOLARIS_VERSION-x86-threads PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x86-threads CC=gcc THREADS=1 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x86-openssl1.0-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x86-openssl1.0-EXPERIMENTAL CC=gcc CFLAGS="$CF" LDFLAGS="$LF"
# 64 bit
LF="$LF -Wl,-melf_x86_64_sol2"
if [ "$CAT" != "" ]; then
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 vlmcs-Solaris$SOLARIS_VERSION-x64 vlmcsd-Solaris$SOLARIS_VERSION-x64 MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x64 PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x64 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
else
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x64 PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x64 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x64 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
fi
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld vlmcsd-Solaris$SOLARIS_VERSION-x64-threads PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x64-threads CC=gcc THREADS=1 CFLAGS="$CF" LDFLAGS="$LF -lpthread" PLATFORMFLAGS="-m64"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x64-openssl1.0-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x64-openssl1.0-EXPERIMENTAL CC=gcc CFLAGS="$CF" LDFLAGS="$LF" PLATFORMFLAGS="-m64"
rm -f *.o *_all.*
gstrip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-*
#gstrip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-*
#sstrip -z vlmcs-* vlmcsd-*
# Copy stuff to distribution server
scp -p vlmcsd-* vlmcs-* vlmcsdmulti-* root@ubuntu64:x/binaries/Solaris/intel

View File

@ -1,84 +0,0 @@
#!/bin/bash
rm -f cygkms*.dll libkms*.dll vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* vlmcsd.exe vlmcs.exe vlmcsdmulti.exe 2> /dev/null
export CAT=2
export VERBOSE=3
NUMCPU=`cat /proc/cpuinfo | grep "processor" | wc -l`
CF="-Wno-missing-braces -fno-common -fno-exceptions -fno-non-call-exceptions -fno-stack-protector -fmerge-all-constants -fno-unwind-tables -fno-asynchronous-unwind-tables -pipe"
CFMSRPC="-Wno-missing-braces -Wno-unused-variable $CF" # -fno-common -fno-stack-protector -fmerge-all-constants -pipe"
PF32=""
PF64="-mpreferred-stack-boundary=4 -march=nocona -mtune=generic"
LFCYG32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
LFWIN32="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
LFWIN64="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
MAKEFLAGS="-j$NUMCPU -B"
REUSEFLAGS="-j$NUMCPU"
make $MAKEFLAGS cygkms32.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms32.dll DNS_PARSER=internal CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS cygkms64.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms64.dll DNS_PARSER=internal CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS all vlmcsdmulti-cygwin-x86 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x86 PROGRAM_NAME=vlmcsd-cygwin-x86 MULTI_NAME=vlmcsdmulti-cygwin-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS all vlmcsdmulti-cygwin-x64 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x64 PROGRAM_NAME=vlmcsd-cygwin-x64 MULTI_NAME=vlmcsdmulti-cygwin-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x86 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -fasynchronous-unwind-tables" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x64 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
unset CAT
make $MAKEFLAGS vlmcsdmulti-cygwin-msrpc-x64 MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
make $MAKEFLAGS vlmcsdmulti-cygwin-msrpc-x86 MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
export CAT=2
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-cygwin-x86-openssl-EXPERIMENTAL CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-cygwin-x64-openssl-EXPERIMENTAL CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
export CAT=2
#make $MAKEFLAGS libkms32.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms32.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32"
#make $MAKEFLAGS libkms64.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms64.dll CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="-static-libgcc $LFWIN64"
#make $MAKEFLAGS all vlmcsdmulti-Windows-x86 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x86 PROGRAM_NAME=vlmcsd-Windows-x86 MULTI_NAME=vlmcsdmulti-Windows-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
#make $MAKEFLAGS all vlmcsdmulti-Windows-x64 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x64 PROGRAM_NAME=vlmcsd-Windows-x64 MULTI_NAME=vlmcsdmulti-Windows-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
#make -Bj MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x86 PROGRAM_NAME=vlmcsd-Windows-msrpc-x86 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
#make $MAKEFLAGS THREADS=1 MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x64 PROGRAM_NAME=vlmcsd-Windows-msrpc-x64 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
#unset CAT
#make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x86 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
#make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x64 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
export CAT=2
rm -f *_all.* *.o 2> /dev/null &
echo ""
echo "Copying MingW binaries from distribution server"
scp -p root@ubuntu64:x/binaries/Windows/intel/* .
echo ""
echo "Installing binaries"
cp -p vlmcs-cygwin-x64.exe /usr/local/bin/vlmcs &
cp -p vlmcsd-cygwin-x64.exe /usr/local/bin/vlmcsd &
cp -p cygkms64.dll /usr/local/bin/cygkms.dll &
cp -p libkms32.dll /cygdrive/c/nttools/x86 &
cp -p libkms64.dll /cygdrive/c/nttools/x64 &
cp -p vlmcsdmulti-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcsdmulti.exe
cmd /C mklink c:\\nttools\\x86\\vlmcsd.exe vlmcsdmulti.exe 2> /dev/null &
cmd /C mklink c:\\nttools\\x86\\vlmcs.exe vlmcsdmulti.exe 2> /dev/null &
echo "Installing man pages"
mkdir -p /usr/share/man/man8
mkdir -p /usr/share/man/man1
mkdir -p /usr/share/man/man7
mkdir -p /usr/share/man/man5
cp -p vlmcsd.7 /usr/share/man/man7
cp -p vlmcsd.8 /usr/share/man/man8
cp -p vlmcsd.ini.5 /usr/share/man/man5
cp -p vlmcs.1 vlmcsdmulti.1 /usr/share/man/man1
bzip2 -f /usr/share/man/man5/vlmcsd.ini.5 /usr/share/man/man7/vlmcsd.7 /usr/share/man/man8/vlmcsd.8 /usr/share/man/man1/vlmcs.1 /usr/share/man/man1/vlmcsdmulti.1 &
# Copy stuff to distribution server
scp -p vlmcsd-* vlmcs-* vlmcsdmulti-* *.dll root@ubuntu64:x/binaries/Windows/intel

View File

@ -1,17 +0,0 @@
#!/bin/bash
#
# To use on x64 hosted native multilib compiler toolchain
#
rm vlmcsd-*
rm vlmcsd
MAKEFLAGS="-j -B"
make $MAKEFLAGS PROGRAM_NAME=vlmcsd-mingw64-x86 CC=x86_64-w64-mingw32-gcc.exe CFLAGS="-flto -m32" "PLATFORMFLAGS=-march=i686 -mtune=generic" "LDFLAGS=-lcrypto -lz -lkernel32 -ladvapi32 -lws2_32 -lgdi32"
make $MAKEFLAGS PROGRAM_NAME=vlmcsd-mingw64-x64 CC=x86_64-w64-mingw32-gcc.exe CFLAGS="-flto" "PLATFORMFLAGS=-mtune=generic" "LDFLAGS=-lcrypto -lz -lkernel32 -ladvapi32 -lws2_32 -lgdi32"
make $MAKEFLAGS CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-mingw64-x86-openssl CC=x86_64-w64-mingw32-gcc.exe CFLAGS="-flto -m32" "PLATFORMFLAGS=-march=i686 -mtune=generic" "LDFLAGS=-lcrypto -lz -lkernel32 -ladvapi32 -lws2_32 -lgdi32"
make $MAKEFLAGS CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-mingw64-x64-openssl CC=x86_64-w64-mingw32-gcc.exe CFLAGS="-flto" "PLATFORMFLAGS=-mtune=generic" "LDFLAGS=-lcrypto -lz -lkernel32 -ladvapi32 -lws2_32 -lgdi32"
rm *.o

44
man/GNUmakefile Normal file
View File

@ -0,0 +1,44 @@
################################################################################
.PHONY: clean
PDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf vlmcsd-floppy.7.pdf
HTMLDOCS = $(PDFDOCS:.pdf=.html)
UNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)
DOSDOCS = $(PDFDOCS:.pdf=.dos.txt)
%.pdf : %
ifeq ($(shell uname), Darwin)
groff -Tps -mandoc -c $< | pstopdf -i -o $@
else
groff -Tpdf -mandoc -c $< > $@
endif
%.html : %
groff -Thtml -mandoc -c $< > $@
%.unix.txt : %
groff -P -c -Tutf8 -mandoc -c $< | col -bx > $@
%.dos.txt : %.unix.txt
# unix2dos -n $< $@
# sed -e 's/$$/\r/' $< > $@
awk 'sub("$$", "\r")' $< > $@
alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)
pdfdocs : $(PDFDOCS)
dosdocs : $(DOSDOCS)
unixdocs : $(UNIXDOCS)
htmldocs : $(HTMLDOCS)
clean:
rm -f $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS)
help:
@echo "Help is available by typing 'make help' in directory $(shell realpath `pwd`/..). Use 'cd ..' to get there."

View File

@ -1,5 +1,5 @@
.mso www.tmac
.TH VLMCS 1 "May 2016" "Hotbird64" "KMS Activation Manual"
.TH VLMCS 1 "November 2016" "Hotbird64" "KMS Activation Manual"
.LO 1
.SH NAME
@ -75,11 +75,16 @@ to specify applications that are not listed with \fB-x\fR. The
.B -l
option is used as a shortcut for the most common applications.
.IP "\fB-K\fR \fIprotocol-version\fR"
Force a specific version of the KMS protocol. Valid versions are 4.0, 5.0 and 6.0. The default is to select a suitable version according to the \fIapplication\fR selected. You may use \fB-K\fR to send an incorrect protocol version to the KMS server and see how it behaves. Genuine KMS servers return HRESULT 0x8007000D if the KMS protocol is not 4.0, 5.0 or 6.0. Emulators should do the same. When sending a request with an incorrect protocol number, vlmcs ignores the minor protocol number (e.g. sends a v4 request for version 4.1). If the major version number is less then 4, it sends a v4 request. If the major version is greater then 6, it sends a v6 request. In any case the \fIprotocol-version\fR as specified by \fB-K\fR is put in the version fields of the request.
.IP "\fB-4\fR, \fB-5\fR and \fB-6"
Force version 4, 5 or 6 of the KMS protocol. The default is to select a suitable
version according to the
.IR "application"
selected. Plese note that some products (e.g. Office 2013) may use different protocols with different versions of Windows.
Force version 4, 5 or 6 of the KMS protocol. These options are actually shortcuts of \fB-K 4.0\fR, \fB-K 5.0\fR and \fB-K 6.0\fR.
.IP "\fB-j\fR \fIfilename\fR"
Use KMS data file \fIfilename\fR. By default vlmcs contains product data that is recent when vlmcs was compiled. You may use a more recent KMS data file that contains additional products.
If vlmcsd has been compiled to use a default KMS data file, you may use \fB-j-\fR to ignore the default configuration file.
.IP "\fB-m"
Let the client pretend to be a virtual machine. Early versions of Microsoft's

View File

@ -80,11 +80,33 @@ OPTIONS
as a shortcut for the most common applications.
-K protocol-version
Force a specific version of the KMS protocol. Valid versions are
4.0, 5.0 and 6.0. The default is to select a suitable version
according to the application selected. You may use -K to send an
incorrect protocol version to the KMS server and see how it
behaves. Genuine KMS servers return HRESULT 0x8007000D if the
KMS protocol is not 4.0, 5.0 or 6.0. Emulators should do the
same. When sending a request with an incorrect protocol number,
vlmcs ignores the minor protocol number (e.g. sends a v4 request
for version 4.1). If the major version number is less then 4, it
sends a v4 request. If the major version is greater then 6, it
sends a v6 request. In any case the protocol-version as speci
fied by -K is put in the version fields of the request.
-4, -5 and -6
Force version 4, 5 or 6 of the KMS protocol. The default is to
select a suitable version according to the application selected.
Plese note that some products (e.g. Office 2013) may use differ
ent protocols with different versions of Windows.
Force version 4, 5 or 6 of the KMS protocol. These options are
actually shortcuts of -K 4.0, -K 5.0 and -K 6.0.
-j filename
Use KMS data file filename. By default vlmcs contains product
data that is recent when vlmcs was compiled. You may use a more
recent KMS data file that contains additional products.
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
-m Let the client pretend to be a virtual machine. Early versions
@ -310,4 +332,4 @@ SEE ALSO
Hotbird64 May 2016 VLMCS(1)
Hotbird64 November 2016 VLMCS(1)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -39,7 +39,7 @@
</h2>
<p style="margin-left:11%; margin-top: 1em">vlmcs &minus; a
<p style="margin-left:11%; margin-top: 1em">vlmcs - a
client for testing and/or charging KMS servers</p>
<h2>SYNOPSIS
@ -183,14 +183,41 @@ applications is not complete. You may supply GUIDs with
that are not listed with <b>-x</b>. The <b>-l</b> option is
used as a shortcut for the most common applications.</p>
<p style="margin-left:11%;"><b>-K</b>
<i>protocol-version</i></p>
<p style="margin-left:22%;">Force a specific version of the
KMS protocol. Valid versions are 4.0, 5.0 and 6.0. The
default is to select a suitable version according to the
<i>application</i> selected. You may use <b>-K</b> to send
an incorrect protocol version to the KMS server and see how
it behaves. Genuine KMS servers return HRESULT 0x8007000D if
the KMS protocol is not 4.0, 5.0 or 6.0. Emulators should do
the same. When sending a request with an incorrect protocol
number, vlmcs ignores the minor protocol number (e.g. sends
a v4 request for version 4.1). If the major version number
is less then 4, it sends a v4 request. If the major version
is greater then 6, it sends a v6 request. In any case the
<i>protocol-version</i> as specified by <b>-K</b> is put in
the version fields of the request.</p>
<p style="margin-left:11%;"><b>-4</b>, <b>-5</b> and
<b>-6</b></p>
<p style="margin-left:22%;">Force version 4, 5 or 6 of the
KMS protocol. The default is to select a suitable version
according to the <i>application</i> selected. Plese note
that some products (e.g. Office 2013) may use different
protocols with different versions of Windows.</p>
KMS protocol. These options are actually shortcuts of <b>-K
4.0</b>, <b>-K 5.0</b> and <b>-K 6.0</b>.</p>
<p style="margin-left:11%;"><b>-j</b> <i>filename</i></p>
<p style="margin-left:22%;">Use KMS data file
<i>filename</i>. By default vlmcs contains product data that
is recent when vlmcs was compiled. You may use a more recent
KMS data file that contains additional products.</p>
<p style="margin-left:22%; margin-top: 1em">If vlmcsd has
been compiled to use a default KMS data file, you may use
<b>-j-</b> to ignore the default configuration file.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
@ -276,7 +303,7 @@ ExtendedProductList).</p>
<p style="margin-left:22%;">Send <i>requests</i> requests
to the server. The default is to send at least one request
and enough subsequent requests that the server is fully
charged afterwards for the <i>application&minus;guid</i> you
charged afterwards for the <i>application-guid</i> you
selected (explicitly with <b>-a</b> or implicitly by using
<b>-l</b>).</p>
@ -368,7 +395,7 @@ what was specified with <b>-r</b>. This option can be used
to &quot;overcharge&quot; a Microsoft KMS server.</p>
<p style="margin-left:11%;"><b>&minus;t&nbsp;</b><i>status</i></p>
<p style="margin-left:11%;"><b>-t&nbsp;</b><i>status</i></p>
<p style="margin-left:22%;">Reports a specific license
status to the KMS server. <i>status</i> is a number that can

Binary file not shown.

View File

@ -80,11 +80,33 @@ OPTIONS
as a shortcut for the most common applications.
-K protocol-version
Force a specific version of the KMS protocol. Valid versions are
4.0, 5.0 and 6.0. The default is to select a suitable version
according to the application selected. You may use -K to send an
incorrect protocol version to the KMS server and see how it
behaves. Genuine KMS servers return HRESULT 0x8007000D if the
KMS protocol is not 4.0, 5.0 or 6.0. Emulators should do the
same. When sending a request with an incorrect protocol number,
vlmcs ignores the minor protocol number (e.g. sends a v4 request
for version 4.1). If the major version number is less then 4, it
sends a v4 request. If the major version is greater then 6, it
sends a v6 request. In any case the protocol-version as speci
fied by -K is put in the version fields of the request.
-4, -5 and -6
Force version 4, 5 or 6 of the KMS protocol. The default is to
select a suitable version according to the application selected.
Plese note that some products (e.g. Office 2013) may use differ
ent protocols with different versions of Windows.
Force version 4, 5 or 6 of the KMS protocol. These options are
actually shortcuts of -K 4.0, -K 5.0 and -K 6.0.
-j filename
Use KMS data file filename. By default vlmcs contains product
data that is recent when vlmcs was compiled. You may use a more
recent KMS data file that contains additional products.
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
-m Let the client pretend to be a virtual machine. Early versions
@ -310,4 +332,4 @@ SEE ALSO
Hotbird64 May 2016 VLMCS(1)
Hotbird64 November 2016 VLMCS(1)

295
man/vlmcsd-floppy.7 Normal file
View File

@ -0,0 +1,295 @@
.mso www.tmac
.TH "VLMCSD-FLOPPY" 7 "October 2016" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
floppy144.vfd \- a bootable floppy disk with Linux and \fBvlmcsd\fR(8)
.SH DESCRIPTION
\fBfloppy144.vfd\fR is an image of a bootable floppy that contains a minimal version of Linux and \fBvlmcsd\fR(8). It requires only 16 MB of RAM. Its primary purpose is to run \fBvlmcsd\fR(8) in a small virtual machine which makes it easy to use \fBvlmcsd\fR(8) to activate the virtual machine's host computer which is not possible in Windows 8.1 and up. The floppy image is a standard 3,5" floppy with 1.44 MB storage. It is formatted with a FAT12 filesystem. The floppy can be mounted to apply several customizations.
.SH SUPPORTED HYPERVISORS
The floppy image has been tested with the following hypervisors:
.IP
VMWare, VirtualBox, Hyper-V and QEMU
.RE
Others are likely to work.
.SH SETUP
Create a new virtual machine. Assign 16 MB of RAM. Add a floppy drive and attach \fBfloppy144.vfd\fR to this drive. Do not create a virtual hard disk. Setup the virtual machine to boot from a floppy drive (VirtualBox has floppy boot disabled by default). If possible, setup a virtual machine with plain old BIOS (not UEFI). If you created an UEFI virtual machine, enable the compatibility support mode (CSM) to allow a BIOS compatible boot. Set number of CPUs to 1. The Linux kernel is not capable of SMP. Remove IDE, SATA, SCSI and USB support if possible. The Linux kernel can't handle this and ignores any devices connected to these buses.
Setup an ethernet card. The following models are supported:
.IP
Intel PRO/1000
.br
AMD PCNET III
.br
AMD PCNET32
.br
VMWare vmxnet3 (paravirtualized driver used by VMWare)
.br
virtio (paravirtualized driver used by VirtualBox, QEMU, KVM and lguest)
.RE
Most hypervisors emulate an Intel PRO/1000 or AMD PCNET32 by default. Selecting a paravirtualized driver slightly improves performance. In VirtualBox you can simply select virtio in the network configuration dialog. VMWare requires that you add or change the VMX file. Use 'ethernet0.virtualDev\ =\ "vmxnet3"' in your VMWare config file.
If you are using QEMU, you must also setup a TAP adapter. Port redirection does not work to activate your own computer.
.SH CONFIGURATION
\fBfloppy144.vfd\fR can be customized to fit your needs. This is done by editing the file syslinux.cfg on the floppy image. The floppy image must be mounted. Under Linux you can simply attach \fBfloppy144.vfd\fR to a loop device which is mountable like any other block device. For Windows you must use some software that allows mounting a floppy image, e.g.
.URL http://www.osforensics.com/tools/mount-disk-images.html OSFMount ""
OSFMount works under all Windows versions beginning with Windows XP up to Windows 10 (32- and 64-bit).
The default syslinux.cfg file looks like this:
.IP
.br
.SM
prompt 0
.br
.SM
TIMEOUT 50
.br
.SM
default dhcp
.br
.SM
LABEL dhcp
.br
.SM
\0\0KERNEL bzImage
.br
.SM
\0\0APPEND vga=773 quiet initrd=initrd KBD=us LISTEN=[::]:1688,0.0.0.0:1688 TZ=UTC0 IPV4_CONFIG=DHCP NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd INETD=Y WINDOWS=06401-00206-271-395032-03-1033-9600.0000-1652016 OFFICE2010=06401-00096-199-204970-03-1033-9600.0000-1652016 OFFICE2013=06401-00206-234-921934-03-1033-9600.0000-1652016 HWID=36:4F:46:3A:88:63:D3:5F
.SM
LABEL static
.br
.SM
\0\0KERNEL bzImage
.br
.SM
\0\0APPEND vga=773 quiet initrd=initrd KBD=fr LISTEN=[::]:1688,0.0.0.0:1688 TZ=CET-1CEST,M3.5.0,M10.5.0/3 IPV4_CONFIG=STATIC IPV4_ADDRESS=192.168.20.123/24 IPV4_GATEWAY=192.168.20.2 IPV4_DNS1=192.168.20.2 IPV4_DNS2=NONE NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd INETD=Y
.PP
There are two configurations in this files: \fIdhcp\fR (for configuring the IPv4 network via DHCP) and \fIstatic\fR (for a static IPv4 configuration). The kernel always boots the \fIdhcp\fR configuration without asking (lines 'prompt 0' and 'default dhcp'). You can simply change the default configuration to \fIstatic\fR and then customize the APPEND line in the \fIstatic\fR configuration. For more details how to customize the syslinux.cfg file see \fBsyslinux\fR(1).
Each APPPEND line contains one or more items seperated by spaces. \fBAll items are case-sensitive\fR. The following parameters can be customized:
.IP \fBvga=\fIvesa-video-mode\fR
Sets the VESA display mode for the virtual machine. The parameter is not optional. If you ommit it, you will not see anything on the screen. 773 means 1024x768 with 256 colors. See
.URL https://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers Wikipedia ""
for more video modes. Note that all 16 color (4-bit) modes will not work. Use 8-bit (256 colors), 16-bit (65536 colors), 24-bit and 32-bit (> 16 Million colors) only. All modes above 1280x1024 are non-VESA-standard and vary for all (virtual) graphic cards.
.IP \fBquiet\fR
This causes the kernel not display the its log during boot. You may omit \fBquiet\fR but it doesn't make much sense. The boot log is actually very verbose and scrolls away from screen quickly. If any errors occur during boot, they will be displayed even if \fBquiet\fR is present in the APPEND line. You may evaluate the complete boot log later by using the dmesg command or the menu on /dev/tty8.
.IP "\fBinitrd=\fIinitial-ram-disk-file\fR"
This defines the initial ram disk that the kernel will read. There is only one initial ram disk on the floppy thus leave \fIinitrd=initrd\fR as it is.
.IP "\fBKBD=\fIkeyboard-layout-name\fR"
This allows you to select the keyboard layout. \fIkeyboard-layout-name\fR is usually the ISO 3166-1 (top level domain) code for a country. A list of valid \fIkeyboard-layout-name\fRs can be accessed via the menu system on /dev/tty8 (press ALT-F8). Note, that this is a keyboard driver only. There is no Unicode font support in \fBfloppy144.vfd\fR (due to the fact that the kernel uses a generic VESA framebuffer device only). Characters beyond ASCII work for Western European languages only but not Eastern European, Greek, Cyrillic, Arabic, Hebrew, CJK and other languages. There is no need in \fBfloppy144.vfd\fR to enter any characters outside ASCII. The purpose of the keyboard maps are that you will find characters like dash, backslash, brackets, braces, etc. at the usual place on your keyboard.
.IP "\fBLISTEN=\fRPRIVATE[:\fItcp-port\fR] | \fIip-address\fR[:\fItcp-port\fR][,\fIip-address\fR[:\fItcp-port\fR]][,...]"
One or more combinations of IP addresses and optional TCP port seperated by commas that \fBvlmcsd\fR(8) should listen on or PRIVATE to listen on all private IP addresses only. The default port is 1688. If you use an explicit port number, append it to the IP address seperated by a colon. If you use a port number and the IP address contains colons, you must enclose the IP address in brackets. For example \fI192.168.0.2,[fd00::dead:beef]:5678\fR causes \fBvlmcsd\fR(8) to listen on 192.168.0.2 port 1688 and fd00::dead:beef port 5678.
.IP "\fBWINDOWS=\fIepid\fR"
Defines the ePID that is used for Windows activations. If you ommit this parameter, vlmcsd generates a random ePID when it is started.
.IP "\fBOFFICE2010=\fIepid\fR"
Defines the ePID that is used for Office 2010 activations. If you ommit this parameter, \fBvlmcsd\fR(8) generates a random ePID when it is started.
.IP "\fBOFFICE2013=\fIepid\fR"
Defines the ePID that is used for Office (versions 2013 and greater) activations. If you ommit this parameter, \fBvlmcsd\fR(8) generates a random ePID when it is started.
.IP "\fBHWID=\fIhwid\fR"
Defines the HwId that is sent to clients. \fIhwid\fR must be specified as 16 hex digits that are interpreted as a series of 8 bytes (big endian). Any character that is not a hex digit will be ignored. This is for better readability.
.IP "\fBTZ=\fIposix-time-zone-string\fR"
Set the time zone to \fIposix-time-zone-string\fR. It must conform to the
.URL http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html POSIX
specification. Simplified time zone strings like "Europe/London" or "America/Detroit" are not allowed. This has the very simple reason that there is no space on the floppy to store the time zone database.
The string \fICET-1CEST,M3.5.0,M10.5.0/3\fR (most countries in Europe) reads as follows:
.RS 7
.IP \fICET\fR 10
The standard (winter) time zone has the name CET.
.IP \fI-1\fR 10
The standard time zone is one hour east of UTC. Negative numbers are east of UTC. Positive numbers are west of UTC.
.IP \fICEST\fR 10
The daylight saving (summer) time zone has the name CEST.
.IP \fIM3.5.0\fR 10
Daylight saving time starts in the 3rd month (March) on the 5th (=last) occurence of weekday 0 (Sunday) at 2 o'clock (2 o'clock is a default value).
.IP \fIM10.5.0/3\fR 10
Daylight saving time ends in the 10th month (October) on the 5th (=last) occurence of weekday 0 (Sunday) at 3 o'clock.
.RE
.IP
If you don't have daylight saving time, things are easier. For Chinese Standard Time for example, just use \fICST-8\fR as the time zone string.
On a Linux desktop system, you can use a command like \fBstrings\ /usr/share/zoneinfo/America/New_York\ |\ tail\ -n1\fR. This should return \fIEST5EDT,M3.2.0,M11.1.0\fR. You can use the returned string for the \fBTZ=\fIposix-time-zone-string\fR parameter.
.IP "\fBIPV4_CONFIG=\fRDHCP | STATIC\fR"
This determines how you want to configure IPv4 networking. If you use \fBIPV4_CONFIG=\fRSTATIC, you must supply additional paramaters to the APPEND command line.
.IP "\fBIPV4_ADDRESS=\fIipv4-address\fR/\fICIDR-mask\fR"
Use \fIipv4-address\fR with netmask \fICIDR-mask\fR for static IPv4 configuration. The netmask must not be ommitted. For IPv4 address 192.168.12.17 with a netmask of 255.255.255.0 use \fI192.168.12.17/24\fR. For IPv4 address 10.4.0.8 with a netmask of 255.255.0.0 use 10.4.0.8/16. This paramater is ignored, if you used \fBIPV4_CONFIG=\fRDHCP.
.IP "\fBIPV4_GATEWAY=\fIipv4-address\fR | NONE"
Use \fIipv4-address\fR as the default gateway. This is usually the IPv4 address of your router. You may specify NONE explicitly for no gateway. In this case your virtual machine is only visible on its local LAN. This paramater is ignored, if you used \fBIPV4_CONFIG=\fRDHCP.
.IP "\fBIPV4_DNS1=\fIipv4-address\fR | NONE"
Use \fIipv4-address\fR as the primary name server. In home networks this is often the IPv4 address of your router. You may specify NONE explicitly. If you specified NONE for both \fBIPV4_DNS1=\fR and \fBIPV4_DNS2=\fR, your virtual machine cannot resolve host names to IP addresses. While \fBvlmcsd\fR(8) works perfectly without DNS servers, you must use IP addresses when referring to a host, e.g. for specifying an NTP server. This paramater is ignored, if you used \fBIPV4_CONFIG=\fRDHCP.
.IP "\fBIPV4_DNS2=\fIipv4-address\fR | NONE"
Use \fIipv4-address\fR as the secondary name server. It serves as a backup if the primary name server is not available. Home networks often don't have a secondary name server. In this case set this to NONE. This paramater is ignored, if you used \fBIPV4_CONFIG=\fRDHCP.
.IP "\fBNTP_SERVER=\fIhost-name\fR | \fIipv4-address\fR | NONE"
This sets the name of a time server using the NTP protocol. If your virtualization environment reliably provides time, you can set this to NONE. Don't use a public time service like pool.ntp.org or time.nist.gov if you have a (at least somewhat reliable) NTP server in your LAN.
.IP "\fBHOST_NAME=\fIhost-name\fR"
Sets the local host name for your virtual machine. It can be a single name or a fully-qualified domain name FQDN. If you used \fBIPV4_CONFIG=\fRDHCP and your DHCP server returns a domain name, the domain part of an FQDN will be replaced by that name. This host name or host part of an FQDN will not replaced by a host name returned via DHCP. The host name is not important for the operation of \fBfloppy144.vfd\fR.
.IP "\fBROOT_PASSWORD=\fIpassword\fR"
Sets the password of the root user.
.IP "\fBUSER_NAME=\fIusername\fR"
Sets the name of for a general user with no special privileges. This user can login but can't do much.
.IP "\fBUSER_PASSWORD=\fIpassword\fR"
Sets the password for the user defined by \fBUSER_NAME=\fIusername\fR.
.IP "\fBGUEST_PASSWORD=\fIpassword\fR"
Sets the password for the pre-defined guest user. This user has the same priviliges (none) as the user defined by \fBUSER_NAME=\fIusername\fR.
.IP "\fBINETD=\fRY | N"
\fBINETD=\fRY specifies that \fBinetd\fR(8) should automatically be started. That means you can telnet and ftp to your virtual machine.
.IP "\fBVLMCSD_EXTRA_ARGS=\fR\fIcomma-seperated-argument-list\fR"
Allows you to specify additional command line options that will be passed to \fBvlmcsd\fR(8). Instead of spaces you use commas between arguments. Example: \fBVLMCSD_EXTRA_ARGS=\fR\-c1,-K3,-M1
.SH OPERATION
.SS Diskless System
The \fBfloppy144.vfd\fR virtual machine is a diskless system that works entirely from RAM. The file system is actually a RAM disk that is created from the \fBinitrd\fR(4) file on the floppy image.
Anything you'll do from inside the virtual machine, for instance editing a config file, will be lost when you reboot the machine. So, if you ever asked yourself if \fBrm -fr /\fR (root privileges required) really deletes all files from all mounted partitions, the \fBfloppy144.vfd\fR VM is the right place to test it (Yes, it does).
The VM uses a RAM disk, because the Linux kernel had to be stripped down to essential features to fit on a 1.44 MB floppy. It has no floppy driver, no disk file system drivers and no block layer (cannot use disks of any type).
.SS System startup
The kernel boots up very quickly and the init script (/sbin/init) waits 5 seconds. In these 5 seconds you can:
.IP
Press 'm' to manually enter the time zone and the IPv4 parameters. These will be queried interactively.
.br
Press 't' to manually enter the time zone only.
.br
Press 's' to escape to a shell.
.RE
If you don't want to 5 seconds for continuing the init process, you can press any other key to speed things up. At the end of the init script you should see that\fBvlmcsd\fR(8) has started. You should also see the IP addresses and all user names and passwords.
.SS Logging into the system
There are 5 local logins provided on /dev/tty2 to /dev/tty6. To switch to these logins, simply press ALT\-F2 to ALT\-F6. To return to the console on /dev/tty1, press ALT\-F1. If \fBinetd\fR(8) is running you can also use \fBtelnet\fR(1). This allows you use a terminal program (e.g. putty) that can utilize your keyboard layout, can be resized and has full UTF-8 support. The local terminals support US keyboard layout only. Please be aware that \fBtelnet\fR(1) is unencrypted and everything including passwords is transmitted in clear text. There is not enough space for an ssh server like \fBsshd\fR(8) or \fBdropbear\fR(8).
The floppy image only provides basic Unix commands. Type \fIbusybox\fR or \fIll /bin\fR to get a list. The only editor available is \fBvi\fR(1). If you don't like vi, you may transfer config files via \fBftp\fR(1) edit them with the editor of your choice and transfer them back to the \fBfloppy144.vfd\fR VM.
.SS The menu system
You'll find a menu system on /dev/tty8 (press ALT\-F8 to see it). It allows you performing some administrative tasks and to view various system information. It is mainly for users that do not have much experience with Unix commands.
.IP "\fB1) (Re)start vlmcsd\fR"
Starts or restarts \fBvlmcsd\fR(8). This is useful if you changed \fB/etc/vlmcsd.ini\fR(5).
.IP "\fB2) Stop vlmcsd\fR"
Stops \fBvlmcsd\fR(8).
.IP "\fB3) (Re)start inetd\fR"
Starts or restarts \fBinetd\fR(8). If \fBinetd\fR(8) is restarted, current clients connected via \fBtelnet\fR(1) or \fBftp\fR(1) will \fBnot\fR be dropped. They can continue their sessions. This is useful if you changed \fB/etc/inetd.conf\fR(5).
.IP "\fB4) Stop inet\fR"
Stops \fBinetd\fR(8). All clients connected via \fBtelnet\fR(1) or \fBftp\fR(1) will be dropped immediately.
.IP "\fB5) Change the time zone\fR"
Just in case you missed pressing 't' during system startup. This also restarts \fBvlmcsd\fR(8) if it was running to notify it that the time zone has changed. Restarting \fBvlmcsd\fR(8) allows currently connected clients to finish their activation.
.IP "\fBk) Change keyboard layout\fR"
This allows you to select a different keyboard layout.
.IP "\fB6) Show all kernel boot parameters\fR"
Shows all parameters passed to the kernel via syslinux.cfg. If you experience any unexpected behavior, you can use this to check if your APPEND line in syslinux.cfg is correct. The output is piped through \fBless(1)\fR. So press 'q' to return to the menu.
.IP "\fB7) Show boot log (dmesg)\fR"
Shows the boot log of the kernel. The output is piped through \fBless(1)\fR. So press 'q' to return to the menu.
.IP "\fB8) Show TCP/IP configuration\fR"
Shows the TCP/IP configuration, listening sockets and current TCP and UDP connections. Useful, if you problems with net connectivity. The output is piped through \fBless(1)\fR. So press 'q' to return to the menu.
.IP "\fB9) Show running processes\fR"
Shows all processes including memory and CPU usage. Display will updated every second. Press 'q' or CTRL-C to return to the menu.
.IP "\fBs) Shutdown\fR"
Shuts down the \fBfloppy144.vfd\fR virtual machine. Proper shutdown is not required. It is ok to use a hard power off in your virtualization program.
.IP "\fBr) Reboot\fR"
Reboots the \fBfloppy144.vfd\fR virtual machine. Proper reboot is not required. It is ok to use a hard reset in your virtualization program.
.SH PERMANENT CHANGES OF INITRD
If you want to change any file or script of the file system (e.g. the init script /sbin/init or /etc/vlmcsd.ini), you'll need to mount the floppy image, unpack the \fBinitrd\fR(4) file, make any modfications you like, create a new \fBinitrd\fR(4) file and copy it to the mounted floppy.
To unpack the \fBinitrd\fR(4) file you'll need \fBxz\fR(1) (or \fBlzma\fR(1) on older unix-like OSses) and \fBcpio\fR(1). These can be installed using your package manager on all major distros. It is ok to use the BSD version of \fBcpio\fR(1). No need to get the GNU version for BSD users.
Provided the floppy is mounted in /mnt/floppy do the following:
.IP "Create an empty directory"
mkdir ~/vlmcsd-floppy-initrd
.IP "cd into that directory"
cd ~/vlmcsd-floppy-initrd
.IP "Unpack initrd"
cat /mnt/floppy/initrd | unlzma | cpio -i
.RE
After applying your changes build a new \fBinitrd\fR(4) file:
.IP "cd into your directory"
cd ~/vlmcsd-floppy-initrd
.IP "Create the packed file"
find . | cpio -o -H newc | lzma > /mnt/floppy/initrd
.RE
Do not try to use 'lzma -9' to achive better compression. The kernel can't read the resulting file. While customizing the \fBinitrd\fR(4) file works on almost any unix-like OS, it does not work on Windows even not with Cygwin. The reason is that the NTFS file system can't handle uids and gids. These cannot be preserved when unpacking the \fBcpio\fR(1) archive to NTFS. If you use the WSL subsystem of Windows 10 Redstone (Anniversary Update) and later, you must make sure to unpack the \fBinitrd\fR(4) file to a directory on VolFs (normally everything that is \fBnot\fR mounted under /mnt). The \fBinitrd\fR(4) file can be on a VolFs or DriveFs.
.SH FAQ
.SS On what distro is the floppy image based?
None. Besides the boot loader \fBldlinux.sys\fR, there are only three binaries: The Linux kernel \fBbzImage\fR, \fBbusybox\fR(1) and \fBvlmcsdmulti-x86-musl-static\fR. \fBbzImage\fR and \fBbusybox\fR(1) have been compiled with carefully selected configuration parameters not found in any distro. This was neccesary to fit everything on a 1.44 MB floppy.
.SS Why is a rather old Linux kernel (3.12) used?
Linux 3.12 is the last kernel that can be booted with 16 MB of RAM. Beginning with Linux 3.13 it requires much more memory (about 80 MB) to boot. The floppy image is regularly tested with newer kernels. Everything works except that you need to assign much more main memory to the virtual machine.
.SS Can the floppy be booted on bare metal?
Basically yes. However, only Intel Pro/1000 and AMD PCNET32 ethernet cards are supported by the kernel. In addition there is no USB support compiled into the kernel. That means you can only use an IBM AT or IBM PS/2 keyboard which are not available on newer hardware.
.SH FILES
\fBsyslinux.cfg\fR, \fBvlmcsd.ini\fR(5)
.SH BUGS
IPv6 cannot be configured with static or manual parameters.
.br
DHCPv6 is not supported.
.br
\'ip route add ...' does not work. Use 'route add ...' instead.
.SH AUTHOR
\fBfloppy144.vfd\fR has been created by Hotbird64
.SH CREDITS
Linus Torvalds et al. for the Linux kernel
.br
Erik Andersen et al. for the original uClibc
.br
Waldemar Brodkorb et al. for uClibc-ng
.br
Denys Vlasenko et al. for BusyBox
.br
H. Peter Anvin et al. for SYSLINUX
.SH SEE ALSO
\fBvlmcsd\fR(8), \fBvlmcsd.ini\fR(5), \fBinitrd\fR(4), \fBbusybox\fR(1), \fBsyslinux(1)\fR

536
man/vlmcsd-floppy.7.dos.txt Normal file
View File

@ -0,0 +1,536 @@
VLMCSD-FLOPPY(7) KMS Activation Manual VLMCSD-FLOPPY(7)
NAME
floppy144.vfd - a bootable floppy disk with Linux and vlmcsd(8)
DESCRIPTION
floppy144.vfd is an image of a bootable floppy that contains a minimal
version of Linux and vlmcsd(8). It requires only 16 MB of RAM. Its pri
mary purpose is to run vlmcsd(8) in a small virtual machine which makes
it easy to use vlmcsd(8) to activate the virtual machine's host com
puter which is not possible in Windows 8.1 and up. The floppy image is
a standard 3,5" floppy with 1.44 MB storage. It is formatted with a
FAT12 filesystem. The floppy can be mounted to apply several customiza
tions.
SUPPORTED HYPERVISORS
The floppy image has been tested with the following hypervisors:
VMWare, VirtualBox, Hyper-V and QEMU
Others are likely to work.
SETUP
Create a new virtual machine. Assign 16 MB of RAM. Add a floppy drive
and attach floppy144.vfd to this drive. Do not create a virtual hard
disk. Setup the virtual machine to boot from a floppy drive (VirtualBox
has floppy boot disabled by default). If possible, setup a virtual
machine with plain old BIOS (not UEFI). If you created an UEFI virtual
machine, enable the compatibility support mode (CSM) to allow a BIOS
compatible boot. Set number of CPUs to 1. The Linux kernel is not capa
ble of SMP. Remove IDE, SATA, SCSI and USB support if possible. The
Linux kernel can't handle this and ignores any devices connected to
these buses.
Setup an ethernet card. The following models are supported:
Intel PRO/1000
AMD PCNET III
AMD PCNET32
VMWare vmxnet3 (paravirtualized driver used by VMWare)
virtio (paravirtualized driver used by VirtualBox, QEMU, KVM and
lguest)
Most hypervisors emulate an Intel PRO/1000 or AMD PCNET32 by default.
Selecting a paravirtualized driver slightly improves performance. In
VirtualBox you can simply select virtio in the network configuration
dialog. VMWare requires that you add or change the VMX file. Use 'eth
ernet0.virtualDev = "vmxnet3"' in your VMWare config file.
If you are using QEMU, you must also setup a TAP adapter. Port redi
rection does not work to activate your own computer.
CONFIGURATION
floppy144.vfd can be customized to fit your needs. This is done by
editing the file syslinux.cfg on the floppy image. The floppy image
must be mounted. Under Linux you can simply attach floppy144.vfd to a
loop device which is mountable like any other block device. For Windows
you must use some software that allows mounting a floppy image, e.g.
OSFMount ⟨http://www.osforensics.com/tools/mount-disk-images.html⟩
OSFMount works under all Windows versions beginning with Windows XP up
to Windows 10 (32- and 64-bit).
The default syslinux.cfg file looks like this:
prompt 0
TIMEOUT 50
default dhcp
LABEL dhcp
KERNEL bzImage
APPEND vga=773 quiet initrd=initrd KBD=us LIS
TEN=[::]:1688,0.0.0.0:1688 TZ=UTC0 IPV4_CONFIG=DHCP
NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd
USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd
INETD=Y WINDOWS=06401-00206-271-395032-03-1033-9600.0000-1652016
OFFICE2010=06401-00096-199-204970-03-1033-9600.0000-1652016
OFFICE2013=06401-00206-234-921934-03-1033-9600.0000-1652016
HWID=36:4F:46:3A:88:63:D3:5F
LABEL static
KERNEL bzImage
APPEND vga=773 quiet initrd=initrd KBD=fr LIS
TEN=[::]:1688,0.0.0.0:1688 TZ=CET-1CEST,M3.5.0,M10.5.0/3
IPV4_CONFIG=STATIC IPV4_ADDRESS=192.168.20.123/24 IPV4_GATE
WAY=192.168.20.2 IPV4_DNS1=192.168.20.2 IPV4_DNS2=NONE
NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd
USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd
INETD=Y
There are two configurations in this files: dhcp (for configuring the
IPv4 network via DHCP) and static (for a static IPv4 configuration).
The kernel always boots the dhcp configuration without asking (lines
'prompt 0' and 'default dhcp'). You can simply change the default con
figuration to static and then customize the APPEND line in the static
configuration. For more details how to customize the syslinux.cfg file
see syslinux(1).
Each APPPEND line contains one or more items seperated by spaces. All
items are case-sensitive. The following parameters can be customized:
vga=vesa-video-mode
Sets the VESA display mode for the virtual machine. The parame
ter is not optional. If you ommit it, you will not see anything
on the screen. 773 means 1024x768 with 256 colors. See Wikipedia
⟨https://en.wikipedia.org/wiki/
VESA_BIOS_Extensions#Linux_video_mode_numbers⟩ for more video
modes. Note that all 16 color (4-bit) modes will not work. Use
8-bit (256 colors), 16-bit (65536 colors), 24-bit and 32-bit (>
16 Million colors) only. All modes above 1280x1024 are non-VESA-
standard and vary for all (virtual) graphic cards.
quiet This causes the kernel not display the its log during boot. You
may omit quiet but it doesn't make much sense. The boot log is
actually very verbose and scrolls away from screen quickly. If
any errors occur during boot, they will be displayed even if
quiet is present in the APPEND line. You may evaluate the com
plete boot log later by using the dmesg command or the menu on
/dev/tty8.
initrd=initial-ram-disk-file
This defines the initial ram disk that the kernel will read.
There is only one initial ram disk on the floppy thus leave ini
trd=initrd as it is.
KBD=keyboard-layout-name
This allows you to select the keyboard layout. keyboard-layout-
name is usually the ISO 3166-1 (top level domain) code for a
country. A list of valid keyboard-layout-names can be accessed
via the menu system on /dev/tty8 (press ALT-F8). Note, that this
is a keyboard driver only. There is no Unicode font support in
floppy144.vfd (due to the fact that the kernel uses a generic
VESA framebuffer device only). Characters beyond ASCII work for
Western European languages only but not Eastern European, Greek,
Cyrillic, Arabic, Hebrew, CJK and other languages. There is no
need in floppy144.vfd to enter any characters outside ASCII. The
purpose of the keyboard maps are that you will find characters
like dash, backslash, brackets, braces, etc. at the usual place
on your keyboard.
LISTEN=PRIVATE[:tcp-port] | ip-address[:tcp-port][,ip-address[:tcp-
port]][,...]
One or more combinations of IP addresses and optional TCP port
seperated by commas that vlmcsd(8) should listen on or PRIVATE
to listen on all private IP addresses only. The default port is
1688. If you use an explicit port number, append it to the IP
address seperated by a colon. If you use a port number and the
IP address contains colons, you must enclose the IP address in
brackets. For example 192.168.0.2,[fd00::dead:beef]:5678 causes
vlmcsd(8) to listen on 192.168.0.2 port 1688 and fd00::dead:beef
port 5678.
WINDOWS=epid
Defines the ePID that is used for Windows activations. If you
ommit this parameter, vlmcsd generates a random ePID when it is
started.
OFFICE2010=epid
Defines the ePID that is used for Office 2010 activations. If
you ommit this parameter, vlmcsd(8) generates a random ePID when
it is started.
OFFICE2013=epid
Defines the ePID that is used for Office (versions 2013 and
greater) activations. If you ommit this parameter, vlmcsd(8)
generates a random ePID when it is started.
HWID=hwid
Defines the HwId that is sent to clients. hwid must be specified
as 16 hex digits that are interpreted as a series of 8 bytes
(big endian). Any character that is not a hex digit will be
ignored. This is for better readability.
TZ=posix-time-zone-string
Set the time zone to posix-time-zone-string. It must conform to
the POSIX ⟨http://pubs.opengroup.org/onlinepubs/009695399/
basedefs/xbd_chap08.html⟩ specification. Simplified time zone
strings like "Europe/London" or "America/Detroit" are not
allowed. This has the very simple reason that there is no space
on the floppy to store the time zone database.
The string CET-1CEST,M3.5.0,M10.5.0/3 (most countries in Europe)
reads as follows:
CET The standard (winter) time zone has the name CET.
-1 The standard time zone is one hour east of UTC. Nega
tive numbers are east of UTC. Positive numbers are
west of UTC.
CEST The daylight saving (summer) time zone has the name
CEST.
M3.5.0 Daylight saving time starts in the 3rd month (March)
on the 5th (=last) occurence of weekday 0 (Sunday) at
2 o'clock (2 o'clock is a default value).
M10.5.0/3 Daylight saving time ends in the 10th month (October)
on the 5th (=last) occurence of weekday 0 (Sunday) at
3 o'clock.
If you don't have daylight saving time, things are easier. For
Chinese Standard Time for example, just use CST-8 as the time
zone string.
On a Linux desktop system, you can use a command like
strings /usr/share/zoneinfo/America/New_York | tail -n1. This
should return EST5EDT,M3.2.0,M11.1.0. You can use the returned
string for the TZ=posix-time-zone-string parameter.
IPV4_CONFIG=DHCP | STATIC
This determines how you want to configure IPv4 networking. If
you use IPV4_CONFIG=STATIC, you must supply additional para
maters to the APPEND command line.
IPV4_ADDRESS=ipv4-address/CIDR-mask
Use ipv4-address with netmask CIDR-mask for static IPv4 configu
ration. The netmask must not be ommitted. For IPv4 address
192.168.12.17 with a netmask of 255.255.255.0 use
192.168.12.17/24. For IPv4 address 10.4.0.8 with a netmask of
255.255.0.0 use 10.4.0.8/16. This paramater is ignored, if you
used IPV4_CONFIG=DHCP.
IPV4_GATEWAY=ipv4-address | NONE
Use ipv4-address as the default gateway. This is usually the
IPv4 address of your router. You may specify NONE explicitly for
no gateway. In this case your virtual machine is only visible on
its local LAN. This paramater is ignored, if you used IPV4_CON
FIG=DHCP.
IPV4_DNS1=ipv4-address | NONE
Use ipv4-address as the primary name server. In home networks
this is often the IPv4 address of your router. You may specify
NONE explicitly. If you specified NONE for both IPV4_DNS1= and
IPV4_DNS2=, your virtual machine cannot resolve host names to IP
addresses. While vlmcsd(8) works perfectly without DNS servers,
you must use IP addresses when referring to a host, e.g. for
specifying an NTP server. This paramater is ignored, if you used
IPV4_CONFIG=DHCP.
IPV4_DNS2=ipv4-address | NONE
Use ipv4-address as the secondary name server. It serves as a
backup if the primary name server is not available. Home net
works often don't have a secondary name server. In this case set
this to NONE. This paramater is ignored, if you used IPV4_CON
FIG=DHCP.
NTP_SERVER=host-name | ipv4-address | NONE
This sets the name of a time server using the NTP protocol. If
your virtualization environment reliably provides time, you can
set this to NONE. Don't use a public time service like
pool.ntp.org or time.nist.gov if you have a (at least somewhat
reliable) NTP server in your LAN.
HOST_NAME=host-name
Sets the local host name for your virtual machine. It can be a
single name or a fully-qualified domain name FQDN. If you used
IPV4_CONFIG=DHCP and your DHCP server returns a domain name, the
domain part of an FQDN will be replaced by that name. This host
name or host part of an FQDN will not replaced by a host name
returned via DHCP. The host name is not important for the opera
tion of floppy144.vfd.
ROOT_PASSWORD=password
Sets the password of the root user.
USER_NAME=username
Sets the name of for a general user with no special privileges.
This user can login but can't do much.
USER_PASSWORD=password
Sets the password for the user defined by USER_NAME=username.
GUEST_PASSWORD=password
Sets the password for the pre-defined guest user. This user has
the same priviliges (none) as the user defined by
USER_NAME=username.
INETD=Y | N
INETD=Y specifies that inetd(8) should automatically be started.
That means you can telnet and ftp to your virtual machine.
VLMCSD_EXTRA_ARGS=comma-seperated-argument-list
Allows you to specify additional command line options that will
be passed to vlmcsd(8). Instead of spaces you use commas between
arguments. Example: VLMCSD_EXTRA_ARGS=-c1,-K3,-M1
OPERATION
Diskless System
The floppy144.vfd virtual machine is a diskless system that works
entirely from RAM. The file system is actually a RAM disk that is cre
ated from the initrd(4) file on the floppy image.
Anything you'll do from inside the virtual machine, for instance edit
ing a config file, will be lost when you reboot the machine. So, if you
ever asked yourself if rm -fr / (root privileges required) really
deletes all files from all mounted partitions, the floppy144.vfd VM is
the right place to test it (Yes, it does).
The VM uses a RAM disk, because the Linux kernel had to be stripped
down to essential features to fit on a 1.44 MB floppy. It has no floppy
driver, no disk file system drivers and no block layer (cannot use
disks of any type).
System startup
The kernel boots up very quickly and the init script (/sbin/init) waits
5 seconds. In these 5 seconds you can:
Press 'm' to manually enter the time zone and the IPv4 parame
ters. These will be queried interactively.
Press 't' to manually enter the time zone only.
Press 's' to escape to a shell.
If you don't want to 5 seconds for continuing the init process, you can
press any other key to speed things up. At the end of the init script
you should see thatvlmcsd(8) has started. You should also see the IP
addresses and all user names and passwords.
Logging into the system
There are 5 local logins provided on /dev/tty2 to /dev/tty6. To switch
to these logins, simply press ALT-F2 to ALT-F6. To return to the con
sole on /dev/tty1, press ALT-F1. If inetd(8) is running you can also
use telnet(1). This allows you use a terminal program (e.g. putty) that
can utilize your keyboard layout, can be resized and has full UTF-8
support. The local terminals support US keyboard layout only. Please be
aware that telnet(1) is unencrypted and everything including passwords
is transmitted in clear text. There is not enough space for an ssh
server like sshd(8) or dropbear(8).
The floppy image only provides basic Unix commands. Type busybox or ll
/bin to get a list. The only editor available is vi(1). If you don't
like vi, you may transfer config files via ftp(1) edit them with the
editor of your choice and transfer them back to the floppy144.vfd VM.
The menu system
You'll find a menu system on /dev/tty8 (press ALT-F8 to see it). It
allows you performing some administrative tasks and to view various
system information. It is mainly for users that do not have much expe
rience with Unix commands.
1) (Re)start vlmcsd
Starts or restarts vlmcsd(8). This is useful if you changed
/etc/vlmcsd.ini(5).
2) Stop vlmcsd
Stops vlmcsd(8).
3) (Re)start inetd
Starts or restarts inetd(8). If inetd(8) is restarted, current
clients connected via telnet(1) or ftp(1) will not be dropped.
They can continue their sessions. This is useful if you changed
/etc/inetd.conf(5).
4) Stop inet
Stops inetd(8). All clients connected via telnet(1) or ftp(1)
will be dropped immediately.
5) Change the time zone
Just in case you missed pressing 't' during system startup. This
also restarts vlmcsd(8) if it was running to notify it that the
time zone has changed. Restarting vlmcsd(8) allows currently
connected clients to finish their activation.
k) Change keyboard layout
This allows you to select a different keyboard layout.
6) Show all kernel boot parameters
Shows all parameters passed to the kernel via syslinux.cfg. If
you experience any unexpected behavior, you can use this to
check if your APPEND line in syslinux.cfg is correct. The output
is piped through less(1). So press 'q' to return to the menu.
7) Show boot log (dmesg)
Shows the boot log of the kernel. The output is piped through
less(1). So press 'q' to return to the menu.
8) Show TCP/IP configuration
Shows the TCP/IP configuration, listening sockets and current
TCP and UDP connections. Useful, if you problems with net con
nectivity. The output is piped through less(1). So press 'q' to
return to the menu.
9) Show running processes
Shows all processes including memory and CPU usage. Display will
updated every second. Press 'q' or CTRL-C to return to the menu.
s) Shutdown
Shuts down the floppy144.vfd virtual machine. Proper shutdown is
not required. It is ok to use a hard power off in your virtual
ization program.
r) Reboot
Reboots the floppy144.vfd virtual machine. Proper reboot is not
required. It is ok to use a hard reset in your virtualization
program.
PERMANENT CHANGES OF INITRD
If you want to change any file or script of the file system (e.g. the
init script /sbin/init or /etc/vlmcsd.ini), you'll need to mount the
floppy image, unpack the initrd(4) file, make any modfications you
like, create a new initrd(4) file and copy it to the mounted floppy.
To unpack the initrd(4) file you'll need xz(1) (or lzma(1) on older
unix-like OSses) and cpio(1). These can be installed using your package
manager on all major distros. It is ok to use the BSD version of
cpio(1). No need to get the GNU version for BSD users. Provided the
floppy is mounted in /mnt/floppy do the following:
Create an empty directory
mkdir ~/vlmcsd-floppy-initrd
cd into that directory
cd ~/vlmcsd-floppy-initrd
Unpack initrd
cat /mnt/floppy/initrd | unlzma | cpio -i
After applying your changes build a new initrd(4) file:
cd into your directory
cd ~/vlmcsd-floppy-initrd
Create the packed file
find . | cpio -o -H newc | lzma > /mnt/floppy/initrd
Do not try to use 'lzma -9' to achive better compression. The kernel
can't read the resulting file. While customizing the initrd(4) file
works on almost any unix-like OS, it does not work on Windows even not
with Cygwin. The reason is that the NTFS file system can't handle uids
and gids. These cannot be preserved when unpacking the cpio(1) archive
to NTFS. If you use the WSL subsystem of Windows 10 Redstone (Anniver
sary Update) and later, you must make sure to unpack the initrd(4) file
to a directory on VolFs (normally everything that is not mounted under
/mnt). The initrd(4) file can be on a VolFs or DriveFs.
FAQ
On what distro is the floppy image based?
None. Besides the boot loader ldlinux.sys, there are only three bina
ries: The Linux kernel bzImage, busybox(1) and vlmcsdmulti-x86-musl-
static. bzImage and busybox(1) have been compiled with carefully
selected configuration parameters not found in any distro. This was
neccesary to fit everything on a 1.44 MB floppy.
Why is a rather old Linux kernel (3.12) used?
Linux 3.12 is the last kernel that can be booted with 16 MB of RAM.
Beginning with Linux 3.13 it requires much more memory (about 80 MB) to
boot. The floppy image is regularly tested with newer kernels. Every
thing works except that you need to assign much more main memory to the
virtual machine.
Can the floppy be booted on bare metal?
Basically yes. However, only Intel Pro/1000 and AMD PCNET32 ethernet
cards are supported by the kernel. In addition there is no USB support
compiled into the kernel. That means you can only use an IBM AT or IBM
PS/2 keyboard which are not available on newer hardware.
FILES
syslinux.cfg, vlmcsd.ini(5)
BUGS
IPv6 cannot be configured with static or manual parameters.
DHCPv6 is not supported.
´ip route add ...' does not work. Use 'route add ...' instead.
AUTHOR
floppy144.vfd has been created by Hotbird64
CREDITS
Linus Torvalds et al. for the Linux kernel
Erik Andersen et al. for the original uClibc
Waldemar Brodkorb et al. for uClibc-ng
Denys Vlasenko et al. for BusyBox
H. Peter Anvin et al. for SYSLINUX
SEE ALSO
vlmcsd(8), vlmcsd.ini(5), initrd(4), busybox(1), syslinux(1)
Hotbird64 October 2016 VLMCSD-FLOPPY(7)

816
man/vlmcsd-floppy.7.html Normal file
View File

@ -0,0 +1,816 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>VLMCSD-FLOPPY</title>
</head>
<body>
<h1 align="center">VLMCSD-FLOPPY</h1>
<a href="#NAME">NAME</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#SUPPORTED HYPERVISORS">SUPPORTED HYPERVISORS</a><br>
<a href="#SETUP">SETUP</a><br>
<a href="#CONFIGURATION">CONFIGURATION</a><br>
<a href="#OPERATION">OPERATION</a><br>
<a href="#PERMANENT CHANGES OF INITRD">PERMANENT CHANGES OF INITRD</a><br>
<a href="#FAQ">FAQ</a><br>
<a href="#FILES">FILES</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#CREDITS">CREDITS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">floppy144.vfd -
a bootable floppy disk with Linux and <b>vlmcsd</b>(8)</p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>floppy144.vfd</b>
is an image of a bootable floppy that contains a minimal
version of Linux and <b>vlmcsd</b>(8). It requires only 16
MB of RAM. Its primary purpose is to run <b>vlmcsd</b>(8) in
a small virtual machine which makes it easy to use
<b>vlmcsd</b>(8) to activate the virtual machine&rsquo;s
host computer which is not possible in Windows 8.1 and up.
The floppy image is a standard 3,5&quot; floppy with 1.44 MB
storage. It is formatted with a FAT12 filesystem. The floppy
can be mounted to apply several customizations.</p>
<h2>SUPPORTED HYPERVISORS
<a name="SUPPORTED HYPERVISORS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The floppy
image has been tested with the following hypervisors:</p>
<p style="margin-left:22%; margin-top: 1em">VMWare,
VirtualBox, Hyper-V and QEMU</p>
<p style="margin-left:11%; margin-top: 1em">Others are
likely to work.</p>
<h2>SETUP
<a name="SETUP"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Create a new
virtual machine. Assign 16 MB of RAM. Add a floppy drive and
attach <b>floppy144.vfd</b> to this drive. Do not create a
virtual hard disk. Setup the virtual machine to boot from a
floppy drive (VirtualBox has floppy boot disabled by
default). If possible, setup a virtual machine with plain
old BIOS (not UEFI). If you created an UEFI virtual machine,
enable the compatibility support mode (CSM) to allow a BIOS
compatible boot. Set number of CPUs to 1. The Linux kernel
is not capable of SMP. Remove IDE, SATA, SCSI and USB
support if possible. The Linux kernel can&rsquo;t handle
this and ignores any devices connected to these buses.</p>
<p style="margin-left:11%; margin-top: 1em">Setup an
ethernet card. The following models are supported:</p>
<p style="margin-left:22%; margin-top: 1em">Intel PRO/1000
<br>
AMD PCNET III <br>
AMD PCNET32 <br>
VMWare vmxnet3 (paravirtualized driver used by VMWare) <br>
virtio (paravirtualized driver used by VirtualBox, QEMU, KVM
and lguest)</p>
<p style="margin-left:11%; margin-top: 1em">Most
hypervisors emulate an Intel PRO/1000 or AMD PCNET32 by
default. Selecting a paravirtualized driver slightly
improves performance. In VirtualBox you can simply select
virtio in the network configuration dialog. VMWare requires
that you add or change the VMX file. Use
&rsquo;ethernet0.virtualDev&nbsp;=&nbsp;&quot;vmxnet3&quot;&rsquo;
in your VMWare config file.</p>
<p style="margin-left:11%; margin-top: 1em">If you are
using QEMU, you must also setup a TAP adapter. Port
redirection does not work to activate your own computer.</p>
<h2>CONFIGURATION
<a name="CONFIGURATION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>floppy144.vfd</b>
can be customized to fit your needs. This is done by editing
the file syslinux.cfg on the floppy image. The floppy image
must be mounted. Under Linux you can simply attach
<b>floppy144.vfd</b> to a loop device which is mountable
like any other block device. For Windows you must use some
software that allows mounting a floppy image, e.g.
<a href="http://www.osforensics.com/tools/mount-disk-images.html">OSFMount</a></p>
<p style="margin-left:11%; margin-top: 1em">OSFMount works
under all Windows versions beginning with Windows XP up to
Windows 10 (32- and 64-bit).</p>
<p style="margin-left:11%; margin-top: 1em">The default
syslinux.cfg file looks like this:</p>
<p style="margin-left:22%; margin-top: 1em"><small>prompt 0
<br>
TIMEOUT 50 <br>
default dhcp</small></p>
<p style="margin-left:22%; margin-top: 1em"><small>LABEL
dhcp <br>
KERNEL bzImage <br>
APPEND vga=773 quiet initrd=initrd KBD=us
LISTEN=[::]:1688,0.0.0.0:1688 TZ=UTC0 IPV4_CONFIG=DHCP
NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd
ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd
GUEST_PASSWORD=vlmcsd INETD=Y
WINDOWS=06401-00206-271-395032-03-1033-9600.0000-1652016
OFFICE2010=06401-00096-199-204970-03-1033-9600.0000-1652016
OFFICE2013=06401-00206-234-921934-03-1033-9600.0000-1652016
HWID=36:4F:46:3A:88:63:D3:5F</small></p>
<p style="margin-left:22%; margin-top: 1em"><small>LABEL
static <br>
KERNEL bzImage <br>
APPEND vga=773 quiet initrd=initrd KBD=fr
LISTEN=[::]:1688,0.0.0.0:1688 TZ=CET-1CEST,M3.5.0,M10.5.0/3
IPV4_CONFIG=STATIC IPV4_ADDRESS=192.168.20.123/24
IPV4_GATEWAY=192.168.20.2 IPV4_DNS1=192.168.20.2
IPV4_DNS2=NONE NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd
ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd
GUEST_PASSWORD=vlmcsd INETD=Y</small></p>
<p style="margin-left:11%; margin-top: 1em">There are two
configurations in this files: <i>dhcp</i> (for configuring
the IPv4 network via DHCP) and <i>static</i> (for a static
IPv4 configuration). The kernel always boots the <i>dhcp</i>
configuration without asking (lines &rsquo;prompt 0&rsquo;
and &rsquo;default dhcp&rsquo;). You can simply change the
default configuration to <i>static</i> and then customize
the APPEND line in the <i>static</i> configuration. For more
details how to customize the syslinux.cfg file see
<b>syslinux</b>(1).</p>
<p style="margin-left:11%; margin-top: 1em">Each APPPEND
line contains one or more items seperated by spaces. <b>All
items are case-sensitive</b>. The following parameters can
be customized: <b><br>
vga=</b><i>vesa-video-mode</i></p>
<p style="margin-left:22%;">Sets the VESA display mode for
the virtual machine. The parameter is not optional. If you
ommit it, you will not see anything on the screen. 773 means
1024x768 with 256 colors. See
<a href="https://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers">Wikipedia</a>
for more video modes. Note that all 16 color (4-bit) modes
will not work. Use 8-bit (256 colors), 16-bit (65536
colors), 24-bit and 32-bit (&gt; 16 Million colors) only.
All modes above 1280x1024 are non-VESA-standard and vary for
all (virtual) graphic cards.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p><b>quiet</b></p></td>
<td width="4%"></td>
<td width="78%">
<p>This causes the kernel not display the its log during
boot. You may omit <b>quiet</b> but it doesn&rsquo;t make
much sense. The boot log is actually very verbose and
scrolls away from screen quickly. If any errors occur during
boot, they will be displayed even if <b>quiet</b> is present
in the APPEND line. You may evaluate the complete boot log
later by using the dmesg command or the menu on
/dev/tty8.</p> </td></tr>
</table>
<p style="margin-left:11%;"><b>initrd=</b><i>initial-ram-disk-file</i></p>
<p style="margin-left:22%;">This defines the initial ram
disk that the kernel will read. There is only one initial
ram disk on the floppy thus leave <i>initrd=initrd</i> as it
is.</p>
<p style="margin-left:11%;"><b>KBD=</b><i>keyboard-layout-name</i></p>
<p style="margin-left:22%;">This allows you to select the
keyboard layout. <i>keyboard-layout-name</i> is usually the
ISO 3166-1 (top level domain) code for a country. A list of
valid <i>keyboard-layout-name</i>s can be accessed via the
menu system on /dev/tty8 (press ALT-F8). Note, that this is
a keyboard driver only. There is no Unicode font support in
<b>floppy144.vfd</b> (due to the fact that the kernel uses a
generic VESA framebuffer device only). Characters beyond
ASCII work for Western European languages only but not
Eastern European, Greek, Cyrillic, Arabic, Hebrew, CJK and
other languages. There is no need in <b>floppy144.vfd</b> to
enter any characters outside ASCII. The purpose of the
keyboard maps are that you will find characters like dash,
backslash, brackets, braces, etc. at the usual place on your
keyboard.</p>
<p style="margin-left:11%;"><b>LISTEN=</b>PRIVATE[:<i>tcp-port</i>]
| <i><br>
ip-address</i>[:<i>tcp-port</i>][,<i>ip-address</i>[:<i>tcp-port</i>]][,...]</p>
<p style="margin-left:22%;">One or more combinations of IP
addresses and optional TCP port seperated by commas that
<b>vlmcsd</b>(8) should listen on or PRIVATE to listen on
all private IP addresses only. The default port is 1688. If
you use an explicit port number, append it to the IP address
seperated by a colon. If you use a port number and the IP
address contains colons, you must enclose the IP address in
brackets. For example
<i>192.168.0.2,[fd00::dead:beef]:5678</i> causes
<b>vlmcsd</b>(8) to listen on 192.168.0.2 port 1688 and
fd00::dead:beef port 5678.</p>
<p style="margin-left:11%;"><b>WINDOWS=</b><i>epid</i></p>
<p style="margin-left:22%;">Defines the ePID that is used
for Windows activations. If you ommit this parameter, vlmcsd
generates a random ePID when it is started.</p>
<p style="margin-left:11%;"><b>OFFICE2010=</b><i>epid</i></p>
<p style="margin-left:22%;">Defines the ePID that is used
for Office 2010 activations. If you ommit this parameter,
<b>vlmcsd</b>(8) generates a random ePID when it is
started.</p>
<p style="margin-left:11%;"><b>OFFICE2013=</b><i>epid</i></p>
<p style="margin-left:22%;">Defines the ePID that is used
for Office (versions 2013 and greater) activations. If you
ommit this parameter, <b>vlmcsd</b>(8) generates a random
ePID when it is started.</p>
<p style="margin-left:11%;"><b>HWID=</b><i>hwid</i></p>
<p style="margin-left:22%;">Defines the HwId that is sent
to clients. <i>hwid</i> must be specified as 16 hex digits
that are interpreted as a series of 8 bytes (big endian).
Any character that is not a hex digit will be ignored. This
is for better readability.</p>
<p style="margin-left:11%;"><b>TZ=</b><i>posix-time-zone-string</i></p>
<p style="margin-left:22%;">Set the time zone to
<i>posix-time-zone-string</i>. It must conform to the
<a href="http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html">POSIX</a>
specification. Simplified time zone strings like
&quot;Europe/London&quot; or &quot;America/Detroit&quot; are
not allowed. This has the very simple reason that there is
no space on the floppy to store the time zone database.</p>
<p style="margin-left:22%; margin-top: 1em">The string
<i>CET-1CEST,M3.5.0,M10.5.0/3</i> (most countries in Europe)
reads as follows:</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="22%"></td>
<td width="13%">
<p><i>CET</i></p></td>
<td width="2%"></td>
<td width="63%">
<p>The standard (winter) time zone has the name CET.</p></td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="13%">
<p><i>-1</i></p></td>
<td width="2%"></td>
<td width="63%">
<p>The standard time zone is one hour east of UTC. Negative
numbers are east of UTC. Positive numbers are west of
UTC.</p> </td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="13%">
<p><i>CEST</i></p></td>
<td width="2%"></td>
<td width="63%">
<p>The daylight saving (summer) time zone has the name
CEST.</p> </td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="13%">
<p><i>M3.5.0</i></p></td>
<td width="2%"></td>
<td width="63%">
<p>Daylight saving time starts in the 3rd month (March) on
the 5th (=last) occurence of weekday 0 (Sunday) at 2
o&rsquo;clock (2 o&rsquo;clock is a default value).</p></td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="13%">
<p><i>M10.5.0/3</i></p></td>
<td width="2%"></td>
<td width="63%">
<p>Daylight saving time ends in the 10th month (October) on
the 5th (=last) occurence of weekday 0 (Sunday) at 3
o&rsquo;clock.</p> </td></tr>
</table>
<p style="margin-left:22%; margin-top: 1em">If you
don&rsquo;t have daylight saving time, things are easier.
For Chinese Standard Time for example, just use <i>CST-8</i>
as the time zone string.</p>
<p style="margin-left:22%; margin-top: 1em">On a Linux
desktop system, you can use a command like
<b>strings&nbsp;/usr/share/zoneinfo/America/New_York&nbsp;|&nbsp;tail&nbsp;-n1</b>.
This should return <i>EST5EDT,M3.2.0,M11.1.0</i>. You can
use the returned string for the
<b>TZ=</b><i>posix-time-zone-string</i> parameter.</p>
<p style="margin-left:11%;"><b>IPV4_CONFIG=</b>DHCP |
STATIC</p>
<p style="margin-left:22%;">This determines how you want to
configure IPv4 networking. If you use
<b>IPV4_CONFIG=</b>STATIC, you must supply additional
paramaters to the APPEND command line.</p>
<p style="margin-left:11%;"><b>IPV4_ADDRESS=</b><i>ipv4-address</i>/<i>CIDR-mask</i></p>
<p style="margin-left:22%;">Use <i>ipv4-address</i> with
netmask <i>CIDR-mask</i> for static IPv4 configuration. The
netmask must not be ommitted. For IPv4 address 192.168.12.17
with a netmask of 255.255.255.0 use <i>192.168.12.17/24</i>.
For IPv4 address 10.4.0.8 with a netmask of 255.255.0.0 use
10.4.0.8/16. This paramater is ignored, if you used
<b>IPV4_CONFIG=</b>DHCP.</p>
<p style="margin-left:11%;"><b>IPV4_GATEWAY=</b><i>ipv4-address</i>
| NONE</p>
<p style="margin-left:22%;">Use <i>ipv4-address</i> as the
default gateway. This is usually the IPv4 address of your
router. You may specify NONE explicitly for no gateway. In
this case your virtual machine is only visible on its local
LAN. This paramater is ignored, if you used
<b>IPV4_CONFIG=</b>DHCP.</p>
<p style="margin-left:11%;"><b>IPV4_DNS1=</b><i>ipv4-address</i>
| NONE</p>
<p style="margin-left:22%;">Use <i>ipv4-address</i> as the
primary name server. In home networks this is often the IPv4
address of your router. You may specify NONE explicitly. If
you specified NONE for both <b>IPV4_DNS1=</b> and
<b>IPV4_DNS2=</b>, your virtual machine cannot resolve host
names to IP addresses. While <b>vlmcsd</b>(8) works
perfectly without DNS servers, you must use IP addresses
when referring to a host, e.g. for specifying an NTP server.
This paramater is ignored, if you used
<b>IPV4_CONFIG=</b>DHCP.</p>
<p style="margin-left:11%;"><b>IPV4_DNS2=</b><i>ipv4-address</i>
| NONE</p>
<p style="margin-left:22%;">Use <i>ipv4-address</i> as the
secondary name server. It serves as a backup if the primary
name server is not available. Home networks often
don&rsquo;t have a secondary name server. In this case set
this to NONE. This paramater is ignored, if you used
<b>IPV4_CONFIG=</b>DHCP.</p>
<p style="margin-left:11%;"><b>NTP_SERVER=</b><i>host-name</i>
| <i>ipv4-address</i> | NONE</p>
<p style="margin-left:22%;">This sets the name of a time
server using the NTP protocol. If your virtualization
environment reliably provides time, you can set this to
NONE. Don&rsquo;t use a public time service like
pool.ntp.org or time.nist.gov if you have a (at least
somewhat reliable) NTP server in your LAN.</p>
<p style="margin-left:11%;"><b>HOST_NAME=</b><i>host-name</i></p>
<p style="margin-left:22%;">Sets the local host name for
your virtual machine. It can be a single name or a
fully-qualified domain name FQDN. If you used
<b>IPV4_CONFIG=</b>DHCP and your DHCP server returns a
domain name, the domain part of an FQDN will be replaced by
that name. This host name or host part of an FQDN will not
replaced by a host name returned via DHCP. The host name is
not important for the operation of <b>floppy144.vfd</b>.</p>
<p style="margin-left:11%;"><b>ROOT_PASSWORD=</b><i>password</i></p>
<p style="margin-left:22%;">Sets the password of the root
user.</p>
<p style="margin-left:11%;"><b>USER_NAME=</b><i>username</i></p>
<p style="margin-left:22%;">Sets the name of for a general
user with no special privileges. This user can login but
can&rsquo;t do much.</p>
<p style="margin-left:11%;"><b>USER_PASSWORD=</b><i>password</i></p>
<p style="margin-left:22%;">Sets the password for the user
defined by <b>USER_NAME=</b><i>username</i>.</p>
<p style="margin-left:11%;"><b>GUEST_PASSWORD=</b><i>password</i></p>
<p style="margin-left:22%;">Sets the password for the
pre-defined guest user. This user has the same priviliges
(none) as the user defined by
<b>USER_NAME=</b><i>username</i>.</p>
<p style="margin-left:11%;"><b>INETD=</b>Y | N</p>
<p style="margin-left:22%;"><b>INETD=</b>Y specifies that
<b>inetd</b>(8) should automatically be started. That means
you can telnet and ftp to your virtual machine.</p>
<p style="margin-left:11%;"><b>VLMCSD_EXTRA_ARGS=</b><i>comma-seperated-argument-list</i></p>
<p style="margin-left:22%;">Allows you to specify
additional command line options that will be passed to
<b>vlmcsd</b>(8). Instead of spaces you use commas between
arguments. Example: <b>VLMCSD_EXTRA_ARGS=</b>-c1,-K3,-M1</p>
<h2>OPERATION
<a name="OPERATION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>Diskless
System</b> <br>
The <b>floppy144.vfd</b> virtual machine is a diskless
system that works entirely from RAM. The file system is
actually a RAM disk that is created from the
<b>initrd</b>(4) file on the floppy image.</p>
<p style="margin-left:11%; margin-top: 1em">Anything
you&rsquo;ll do from inside the virtual machine, for
instance editing a config file, will be lost when you reboot
the machine. So, if you ever asked yourself if <b>rm -fr
/</b> (root privileges required) really deletes all files
from all mounted partitions, the <b>floppy144.vfd</b> VM is
the right place to test it (Yes, it does).</p>
<p style="margin-left:11%; margin-top: 1em">The VM uses a
RAM disk, because the Linux kernel had to be stripped down
to essential features to fit on a 1.44 MB floppy. It has no
floppy driver, no disk file system drivers and no block
layer (cannot use disks of any type).</p>
<p style="margin-left:11%; margin-top: 1em"><b>System
startup</b> <br>
The kernel boots up very quickly and the init script
(/sbin/init) waits 5 seconds. In these 5 seconds you
can:</p>
<p style="margin-left:22%; margin-top: 1em">Press
&rsquo;m&rsquo; to manually enter the time zone and the IPv4
parameters. These will be queried interactively. <br>
Press &rsquo;t&rsquo; to manually enter the time zone only.
<br>
Press &rsquo;s&rsquo; to escape to a shell.</p>
<p style="margin-left:11%; margin-top: 1em">If you
don&rsquo;t want to 5 seconds for continuing the init
process, you can press any other key to speed things up. At
the end of the init script you should see
that<b>vlmcsd</b>(8) has started. You should also see the IP
addresses and all user names and passwords.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Logging into
the system</b> <br>
There are 5 local logins provided on /dev/tty2 to /dev/tty6.
To switch to these logins, simply press ALT-F2 to ALT-F6. To
return to the console on /dev/tty1, press ALT-F1. If
<b>inetd</b>(8) is running you can also use
<b>telnet</b>(1). This allows you use a terminal program
(e.g. putty) that can utilize your keyboard layout, can be
resized and has full UTF-8 support. The local terminals
support US keyboard layout only. Please be aware that
<b>telnet</b>(1) is unencrypted and everything including
passwords is transmitted in clear text. There is not enough
space for an ssh server like <b>sshd</b>(8) or
<b>dropbear</b>(8).</p>
<p style="margin-left:11%; margin-top: 1em">The floppy
image only provides basic Unix commands. Type <i>busybox</i>
or <i>ll /bin</i> to get a list. The only editor available
is <b>vi</b>(1). If you don&rsquo;t like vi, you may
transfer config files via <b>ftp</b>(1) edit them with the
editor of your choice and transfer them back to the
<b>floppy144.vfd</b> VM.</p>
<p style="margin-left:11%; margin-top: 1em"><b>The menu
system</b> <br>
You&rsquo;ll find a menu system on /dev/tty8 (press ALT-F8
to see it). It allows you performing some administrative
tasks and to view various system information. It is mainly
for users that do not have much experience with Unix
commands. <b><br>
1) (Re)start vlmcsd</b></p>
<p style="margin-left:22%;">Starts or restarts
<b>vlmcsd</b>(8). This is useful if you changed
<b>/etc/vlmcsd.ini</b>(5).</p>
<p style="margin-left:11%;"><b>2) Stop vlmcsd</b></p>
<p style="margin-left:22%;">Stops <b>vlmcsd</b>(8).</p>
<p style="margin-left:11%;"><b>3) (Re)start inetd</b></p>
<p style="margin-left:22%;">Starts or restarts
<b>inetd</b>(8). If <b>inetd</b>(8) is restarted, current
clients connected via <b>telnet</b>(1) or <b>ftp</b>(1) will
<b>not</b> be dropped. They can continue their sessions.
This is useful if you changed <b>/etc/inetd.conf</b>(5).</p>
<p style="margin-left:11%;"><b>4) Stop inet</b></p>
<p style="margin-left:22%;">Stops <b>inetd</b>(8). All
clients connected via <b>telnet</b>(1) or <b>ftp</b>(1) will
be dropped immediately.</p>
<p style="margin-left:11%;"><b>5) Change the time
zone</b></p>
<p style="margin-left:22%;">Just in case you missed
pressing &rsquo;t&rsquo; during system startup. This also
restarts <b>vlmcsd</b>(8) if it was running to notify it
that the time zone has changed. Restarting <b>vlmcsd</b>(8)
allows currently connected clients to finish their
activation.</p>
<p style="margin-left:11%;"><b>k) Change keyboard
layout</b></p>
<p style="margin-left:22%;">This allows you to select a
different keyboard layout.</p>
<p style="margin-left:11%;"><b>6) Show all kernel boot
parameters</b></p>
<p style="margin-left:22%;">Shows all parameters passed to
the kernel via syslinux.cfg. If you experience any
unexpected behavior, you can use this to check if your
APPEND line in syslinux.cfg is correct. The output is piped
through <b>less(1)</b>. So press &rsquo;q&rsquo; to return
to the menu.</p>
<p style="margin-left:11%;"><b>7) Show boot log
(dmesg)</b></p>
<p style="margin-left:22%;">Shows the boot log of the
kernel. The output is piped through <b>less(1)</b>. So press
&rsquo;q&rsquo; to return to the menu.</p>
<p style="margin-left:11%;"><b>8) Show TCP/IP
configuration</b></p>
<p style="margin-left:22%;">Shows the TCP/IP configuration,
listening sockets and current TCP and UDP connections.
Useful, if you problems with net connectivity. The output is
piped through <b>less(1)</b>. So press &rsquo;q&rsquo; to
return to the menu.</p>
<p style="margin-left:11%;"><b>9) Show running
processes</b></p>
<p style="margin-left:22%;">Shows all processes including
memory and CPU usage. Display will updated every second.
Press &rsquo;q&rsquo; or CTRL-C to return to the menu.</p>
<p style="margin-left:11%;"><b>s) Shutdown</b></p>
<p style="margin-left:22%;">Shuts down the
<b>floppy144.vfd</b> virtual machine. Proper shutdown is not
required. It is ok to use a hard power off in your
virtualization program.</p>
<p style="margin-left:11%;"><b>r) Reboot</b></p>
<p style="margin-left:22%;">Reboots the
<b>floppy144.vfd</b> virtual machine. Proper reboot is not
required. It is ok to use a hard reset in your
virtualization program.</p>
<h2>PERMANENT CHANGES OF INITRD
<a name="PERMANENT CHANGES OF INITRD"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">If you want to
change any file or script of the file system (e.g. the init
script /sbin/init or /etc/vlmcsd.ini), you&rsquo;ll need to
mount the floppy image, unpack the <b>initrd</b>(4) file,
make any modfications you like, create a new
<b>initrd</b>(4) file and copy it to the mounted floppy.</p>
<p style="margin-left:11%; margin-top: 1em">To unpack the
<b>initrd</b>(4) file you&rsquo;ll need <b>xz</b>(1) (or
<b>lzma</b>(1) on older unix-like OSses) and <b>cpio</b>(1).
These can be installed using your package manager on all
major distros. It is ok to use the BSD version of
<b>cpio</b>(1). No need to get the GNU version for BSD
users. Provided the floppy is mounted in /mnt/floppy do the
following: <br>
Create an empty directory</p>
<p style="margin-left:22%;">mkdir
~/vlmcsd-floppy-initrd</p>
<p style="margin-left:11%;">cd into that directory</p>
<p style="margin-left:22%;">cd ~/vlmcsd-floppy-initrd</p>
<p style="margin-left:11%;">Unpack initrd</p>
<p style="margin-left:22%;">cat /mnt/floppy/initrd | unlzma
| cpio -i</p>
<p style="margin-left:11%; margin-top: 1em">After applying
your changes build a new <b>initrd</b>(4) file: <br>
cd into your directory</p>
<p style="margin-left:22%;">cd ~/vlmcsd-floppy-initrd</p>
<p style="margin-left:11%;">Create the packed file</p>
<p style="margin-left:22%;">find . | cpio -o -H newc | lzma
&gt; /mnt/floppy/initrd</p>
<p style="margin-left:11%; margin-top: 1em">Do not try to
use &rsquo;lzma -9&rsquo; to achive better compression. The
kernel can&rsquo;t read the resulting file. While
customizing the <b>initrd</b>(4) file works on almost any
unix-like OS, it does not work on Windows even not with
Cygwin. The reason is that the NTFS file system can&rsquo;t
handle uids and gids. These cannot be preserved when
unpacking the <b>cpio</b>(1) archive to NTFS. If you use the
WSL subsystem of Windows 10 Redstone (Anniversary Update)
and later, you must make sure to unpack the <b>initrd</b>(4)
file to a directory on VolFs (normally everything that is
<b>not</b> mounted under /mnt). The <b>initrd</b>(4) file
can be on a VolFs or DriveFs.</p>
<h2>FAQ
<a name="FAQ"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>On what
distro is the floppy image based?</b> <br>
None. Besides the boot loader <b>ldlinux.sys</b>, there are
only three binaries: The Linux kernel <b>bzImage</b>,
<b>busybox</b>(1) and <b>vlmcsdmulti-x86-musl-static</b>.
<b>bzImage</b> and <b>busybox</b>(1) have been compiled with
carefully selected configuration parameters not found in any
distro. This was neccesary to fit everything on a 1.44 MB
floppy.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Why is a
rather old Linux kernel (3.12) used?</b> <br>
Linux 3.12 is the last kernel that can be booted with 16 MB
of RAM. Beginning with Linux 3.13 it requires much more
memory (about 80 MB) to boot. The floppy image is regularly
tested with newer kernels. Everything works except that you
need to assign much more main memory to the virtual
machine.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Can the
floppy be booted on bare metal?</b> <br>
Basically yes. However, only Intel Pro/1000 and AMD PCNET32
ethernet cards are supported by the kernel. In addition
there is no USB support compiled into the kernel. That means
you can only use an IBM AT or IBM PS/2 keyboard which are
not available on newer hardware.</p>
<h2>FILES
<a name="FILES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>syslinux.cfg</b>,
<b>vlmcsd.ini</b>(5)</p>
<h2>BUGS
<a name="BUGS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">IPv6 cannot be
configured with static or manual parameters. <br>
DHCPv6 is not supported. <br>
&acute;ip route add ...&rsquo; does not work. Use
&rsquo;route add ...&rsquo; instead.</p>
<h2>AUTHOR
<a name="AUTHOR"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>floppy144.vfd</b>
has been created by Hotbird64</p>
<h2>CREDITS
<a name="CREDITS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Linus Torvalds
et al. for the Linux kernel <br>
Erik Andersen et al. for the original uClibc <br>
Waldemar Brodkorb et al. for uClibc-ng <br>
Denys Vlasenko et al. for BusyBox <br>
H. Peter Anvin et al. for SYSLINUX</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>vlmcsd</b>(8),
<b>vlmcsd.ini</b>(5), <b>initrd</b>(4), <b>busybox</b>(1),
<b>syslinux(1)</b></p>
<hr>
</body>
</html>

BIN
man/vlmcsd-floppy.7.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,536 @@
VLMCSD-FLOPPY(7) KMS Activation Manual VLMCSD-FLOPPY(7)
NAME
floppy144.vfd - a bootable floppy disk with Linux and vlmcsd(8)
DESCRIPTION
floppy144.vfd is an image of a bootable floppy that contains a minimal
version of Linux and vlmcsd(8). It requires only 16 MB of RAM. Its pri
mary purpose is to run vlmcsd(8) in a small virtual machine which makes
it easy to use vlmcsd(8) to activate the virtual machine's host com
puter which is not possible in Windows 8.1 and up. The floppy image is
a standard 3,5" floppy with 1.44 MB storage. It is formatted with a
FAT12 filesystem. The floppy can be mounted to apply several customiza
tions.
SUPPORTED HYPERVISORS
The floppy image has been tested with the following hypervisors:
VMWare, VirtualBox, Hyper-V and QEMU
Others are likely to work.
SETUP
Create a new virtual machine. Assign 16 MB of RAM. Add a floppy drive
and attach floppy144.vfd to this drive. Do not create a virtual hard
disk. Setup the virtual machine to boot from a floppy drive (VirtualBox
has floppy boot disabled by default). If possible, setup a virtual
machine with plain old BIOS (not UEFI). If you created an UEFI virtual
machine, enable the compatibility support mode (CSM) to allow a BIOS
compatible boot. Set number of CPUs to 1. The Linux kernel is not capa
ble of SMP. Remove IDE, SATA, SCSI and USB support if possible. The
Linux kernel can't handle this and ignores any devices connected to
these buses.
Setup an ethernet card. The following models are supported:
Intel PRO/1000
AMD PCNET III
AMD PCNET32
VMWare vmxnet3 (paravirtualized driver used by VMWare)
virtio (paravirtualized driver used by VirtualBox, QEMU, KVM and
lguest)
Most hypervisors emulate an Intel PRO/1000 or AMD PCNET32 by default.
Selecting a paravirtualized driver slightly improves performance. In
VirtualBox you can simply select virtio in the network configuration
dialog. VMWare requires that you add or change the VMX file. Use 'eth
ernet0.virtualDev = "vmxnet3"' in your VMWare config file.
If you are using QEMU, you must also setup a TAP adapter. Port redi
rection does not work to activate your own computer.
CONFIGURATION
floppy144.vfd can be customized to fit your needs. This is done by
editing the file syslinux.cfg on the floppy image. The floppy image
must be mounted. Under Linux you can simply attach floppy144.vfd to a
loop device which is mountable like any other block device. For Windows
you must use some software that allows mounting a floppy image, e.g.
OSFMount ⟨http://www.osforensics.com/tools/mount-disk-images.html⟩
OSFMount works under all Windows versions beginning with Windows XP up
to Windows 10 (32- and 64-bit).
The default syslinux.cfg file looks like this:
prompt 0
TIMEOUT 50
default dhcp
LABEL dhcp
KERNEL bzImage
APPEND vga=773 quiet initrd=initrd KBD=us LIS
TEN=[::]:1688,0.0.0.0:1688 TZ=UTC0 IPV4_CONFIG=DHCP
NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd
USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd
INETD=Y WINDOWS=06401-00206-271-395032-03-1033-9600.0000-1652016
OFFICE2010=06401-00096-199-204970-03-1033-9600.0000-1652016
OFFICE2013=06401-00206-234-921934-03-1033-9600.0000-1652016
HWID=36:4F:46:3A:88:63:D3:5F
LABEL static
KERNEL bzImage
APPEND vga=773 quiet initrd=initrd KBD=fr LIS
TEN=[::]:1688,0.0.0.0:1688 TZ=CET-1CEST,M3.5.0,M10.5.0/3
IPV4_CONFIG=STATIC IPV4_ADDRESS=192.168.20.123/24 IPV4_GATE
WAY=192.168.20.2 IPV4_DNS1=192.168.20.2 IPV4_DNS2=NONE
NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd
USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd
INETD=Y
There are two configurations in this files: dhcp (for configuring the
IPv4 network via DHCP) and static (for a static IPv4 configuration).
The kernel always boots the dhcp configuration without asking (lines
'prompt 0' and 'default dhcp'). You can simply change the default con
figuration to static and then customize the APPEND line in the static
configuration. For more details how to customize the syslinux.cfg file
see syslinux(1).
Each APPPEND line contains one or more items seperated by spaces. All
items are case-sensitive. The following parameters can be customized:
vga=vesa-video-mode
Sets the VESA display mode for the virtual machine. The parame
ter is not optional. If you ommit it, you will not see anything
on the screen. 773 means 1024x768 with 256 colors. See Wikipedia
⟨https://en.wikipedia.org/wiki/
VESA_BIOS_Extensions#Linux_video_mode_numbers⟩ for more video
modes. Note that all 16 color (4-bit) modes will not work. Use
8-bit (256 colors), 16-bit (65536 colors), 24-bit and 32-bit (>
16 Million colors) only. All modes above 1280x1024 are non-VESA-
standard and vary for all (virtual) graphic cards.
quiet This causes the kernel not display the its log during boot. You
may omit quiet but it doesn't make much sense. The boot log is
actually very verbose and scrolls away from screen quickly. If
any errors occur during boot, they will be displayed even if
quiet is present in the APPEND line. You may evaluate the com
plete boot log later by using the dmesg command or the menu on
/dev/tty8.
initrd=initial-ram-disk-file
This defines the initial ram disk that the kernel will read.
There is only one initial ram disk on the floppy thus leave ini
trd=initrd as it is.
KBD=keyboard-layout-name
This allows you to select the keyboard layout. keyboard-layout-
name is usually the ISO 3166-1 (top level domain) code for a
country. A list of valid keyboard-layout-names can be accessed
via the menu system on /dev/tty8 (press ALT-F8). Note, that this
is a keyboard driver only. There is no Unicode font support in
floppy144.vfd (due to the fact that the kernel uses a generic
VESA framebuffer device only). Characters beyond ASCII work for
Western European languages only but not Eastern European, Greek,
Cyrillic, Arabic, Hebrew, CJK and other languages. There is no
need in floppy144.vfd to enter any characters outside ASCII. The
purpose of the keyboard maps are that you will find characters
like dash, backslash, brackets, braces, etc. at the usual place
on your keyboard.
LISTEN=PRIVATE[:tcp-port] | ip-address[:tcp-port][,ip-address[:tcp-
port]][,...]
One or more combinations of IP addresses and optional TCP port
seperated by commas that vlmcsd(8) should listen on or PRIVATE
to listen on all private IP addresses only. The default port is
1688. If you use an explicit port number, append it to the IP
address seperated by a colon. If you use a port number and the
IP address contains colons, you must enclose the IP address in
brackets. For example 192.168.0.2,[fd00::dead:beef]:5678 causes
vlmcsd(8) to listen on 192.168.0.2 port 1688 and fd00::dead:beef
port 5678.
WINDOWS=epid
Defines the ePID that is used for Windows activations. If you
ommit this parameter, vlmcsd generates a random ePID when it is
started.
OFFICE2010=epid
Defines the ePID that is used for Office 2010 activations. If
you ommit this parameter, vlmcsd(8) generates a random ePID when
it is started.
OFFICE2013=epid
Defines the ePID that is used for Office (versions 2013 and
greater) activations. If you ommit this parameter, vlmcsd(8)
generates a random ePID when it is started.
HWID=hwid
Defines the HwId that is sent to clients. hwid must be specified
as 16 hex digits that are interpreted as a series of 8 bytes
(big endian). Any character that is not a hex digit will be
ignored. This is for better readability.
TZ=posix-time-zone-string
Set the time zone to posix-time-zone-string. It must conform to
the POSIX ⟨http://pubs.opengroup.org/onlinepubs/009695399/
basedefs/xbd_chap08.html⟩ specification. Simplified time zone
strings like "Europe/London" or "America/Detroit" are not
allowed. This has the very simple reason that there is no space
on the floppy to store the time zone database.
The string CET-1CEST,M3.5.0,M10.5.0/3 (most countries in Europe)
reads as follows:
CET The standard (winter) time zone has the name CET.
-1 The standard time zone is one hour east of UTC. Nega
tive numbers are east of UTC. Positive numbers are
west of UTC.
CEST The daylight saving (summer) time zone has the name
CEST.
M3.5.0 Daylight saving time starts in the 3rd month (March)
on the 5th (=last) occurence of weekday 0 (Sunday) at
2 o'clock (2 o'clock is a default value).
M10.5.0/3 Daylight saving time ends in the 10th month (October)
on the 5th (=last) occurence of weekday 0 (Sunday) at
3 o'clock.
If you don't have daylight saving time, things are easier. For
Chinese Standard Time for example, just use CST-8 as the time
zone string.
On a Linux desktop system, you can use a command like
strings /usr/share/zoneinfo/America/New_York | tail -n1. This
should return EST5EDT,M3.2.0,M11.1.0. You can use the returned
string for the TZ=posix-time-zone-string parameter.
IPV4_CONFIG=DHCP | STATIC
This determines how you want to configure IPv4 networking. If
you use IPV4_CONFIG=STATIC, you must supply additional para
maters to the APPEND command line.
IPV4_ADDRESS=ipv4-address/CIDR-mask
Use ipv4-address with netmask CIDR-mask for static IPv4 configu
ration. The netmask must not be ommitted. For IPv4 address
192.168.12.17 with a netmask of 255.255.255.0 use
192.168.12.17/24. For IPv4 address 10.4.0.8 with a netmask of
255.255.0.0 use 10.4.0.8/16. This paramater is ignored, if you
used IPV4_CONFIG=DHCP.
IPV4_GATEWAY=ipv4-address | NONE
Use ipv4-address as the default gateway. This is usually the
IPv4 address of your router. You may specify NONE explicitly for
no gateway. In this case your virtual machine is only visible on
its local LAN. This paramater is ignored, if you used IPV4_CON
FIG=DHCP.
IPV4_DNS1=ipv4-address | NONE
Use ipv4-address as the primary name server. In home networks
this is often the IPv4 address of your router. You may specify
NONE explicitly. If you specified NONE for both IPV4_DNS1= and
IPV4_DNS2=, your virtual machine cannot resolve host names to IP
addresses. While vlmcsd(8) works perfectly without DNS servers,
you must use IP addresses when referring to a host, e.g. for
specifying an NTP server. This paramater is ignored, if you used
IPV4_CONFIG=DHCP.
IPV4_DNS2=ipv4-address | NONE
Use ipv4-address as the secondary name server. It serves as a
backup if the primary name server is not available. Home net
works often don't have a secondary name server. In this case set
this to NONE. This paramater is ignored, if you used IPV4_CON
FIG=DHCP.
NTP_SERVER=host-name | ipv4-address | NONE
This sets the name of a time server using the NTP protocol. If
your virtualization environment reliably provides time, you can
set this to NONE. Don't use a public time service like
pool.ntp.org or time.nist.gov if you have a (at least somewhat
reliable) NTP server in your LAN.
HOST_NAME=host-name
Sets the local host name for your virtual machine. It can be a
single name or a fully-qualified domain name FQDN. If you used
IPV4_CONFIG=DHCP and your DHCP server returns a domain name, the
domain part of an FQDN will be replaced by that name. This host
name or host part of an FQDN will not replaced by a host name
returned via DHCP. The host name is not important for the opera
tion of floppy144.vfd.
ROOT_PASSWORD=password
Sets the password of the root user.
USER_NAME=username
Sets the name of for a general user with no special privileges.
This user can login but can't do much.
USER_PASSWORD=password
Sets the password for the user defined by USER_NAME=username.
GUEST_PASSWORD=password
Sets the password for the pre-defined guest user. This user has
the same priviliges (none) as the user defined by
USER_NAME=username.
INETD=Y | N
INETD=Y specifies that inetd(8) should automatically be started.
That means you can telnet and ftp to your virtual machine.
VLMCSD_EXTRA_ARGS=comma-seperated-argument-list
Allows you to specify additional command line options that will
be passed to vlmcsd(8). Instead of spaces you use commas between
arguments. Example: VLMCSD_EXTRA_ARGS=-c1,-K3,-M1
OPERATION
Diskless System
The floppy144.vfd virtual machine is a diskless system that works
entirely from RAM. The file system is actually a RAM disk that is cre
ated from the initrd(4) file on the floppy image.
Anything you'll do from inside the virtual machine, for instance edit
ing a config file, will be lost when you reboot the machine. So, if you
ever asked yourself if rm -fr / (root privileges required) really
deletes all files from all mounted partitions, the floppy144.vfd VM is
the right place to test it (Yes, it does).
The VM uses a RAM disk, because the Linux kernel had to be stripped
down to essential features to fit on a 1.44 MB floppy. It has no floppy
driver, no disk file system drivers and no block layer (cannot use
disks of any type).
System startup
The kernel boots up very quickly and the init script (/sbin/init) waits
5 seconds. In these 5 seconds you can:
Press 'm' to manually enter the time zone and the IPv4 parame
ters. These will be queried interactively.
Press 't' to manually enter the time zone only.
Press 's' to escape to a shell.
If you don't want to 5 seconds for continuing the init process, you can
press any other key to speed things up. At the end of the init script
you should see thatvlmcsd(8) has started. You should also see the IP
addresses and all user names and passwords.
Logging into the system
There are 5 local logins provided on /dev/tty2 to /dev/tty6. To switch
to these logins, simply press ALT-F2 to ALT-F6. To return to the con
sole on /dev/tty1, press ALT-F1. If inetd(8) is running you can also
use telnet(1). This allows you use a terminal program (e.g. putty) that
can utilize your keyboard layout, can be resized and has full UTF-8
support. The local terminals support US keyboard layout only. Please be
aware that telnet(1) is unencrypted and everything including passwords
is transmitted in clear text. There is not enough space for an ssh
server like sshd(8) or dropbear(8).
The floppy image only provides basic Unix commands. Type busybox or ll
/bin to get a list. The only editor available is vi(1). If you don't
like vi, you may transfer config files via ftp(1) edit them with the
editor of your choice and transfer them back to the floppy144.vfd VM.
The menu system
You'll find a menu system on /dev/tty8 (press ALT-F8 to see it). It
allows you performing some administrative tasks and to view various
system information. It is mainly for users that do not have much expe
rience with Unix commands.
1) (Re)start vlmcsd
Starts or restarts vlmcsd(8). This is useful if you changed
/etc/vlmcsd.ini(5).
2) Stop vlmcsd
Stops vlmcsd(8).
3) (Re)start inetd
Starts or restarts inetd(8). If inetd(8) is restarted, current
clients connected via telnet(1) or ftp(1) will not be dropped.
They can continue their sessions. This is useful if you changed
/etc/inetd.conf(5).
4) Stop inet
Stops inetd(8). All clients connected via telnet(1) or ftp(1)
will be dropped immediately.
5) Change the time zone
Just in case you missed pressing 't' during system startup. This
also restarts vlmcsd(8) if it was running to notify it that the
time zone has changed. Restarting vlmcsd(8) allows currently
connected clients to finish their activation.
k) Change keyboard layout
This allows you to select a different keyboard layout.
6) Show all kernel boot parameters
Shows all parameters passed to the kernel via syslinux.cfg. If
you experience any unexpected behavior, you can use this to
check if your APPEND line in syslinux.cfg is correct. The output
is piped through less(1). So press 'q' to return to the menu.
7) Show boot log (dmesg)
Shows the boot log of the kernel. The output is piped through
less(1). So press 'q' to return to the menu.
8) Show TCP/IP configuration
Shows the TCP/IP configuration, listening sockets and current
TCP and UDP connections. Useful, if you problems with net con
nectivity. The output is piped through less(1). So press 'q' to
return to the menu.
9) Show running processes
Shows all processes including memory and CPU usage. Display will
updated every second. Press 'q' or CTRL-C to return to the menu.
s) Shutdown
Shuts down the floppy144.vfd virtual machine. Proper shutdown is
not required. It is ok to use a hard power off in your virtual
ization program.
r) Reboot
Reboots the floppy144.vfd virtual machine. Proper reboot is not
required. It is ok to use a hard reset in your virtualization
program.
PERMANENT CHANGES OF INITRD
If you want to change any file or script of the file system (e.g. the
init script /sbin/init or /etc/vlmcsd.ini), you'll need to mount the
floppy image, unpack the initrd(4) file, make any modfications you
like, create a new initrd(4) file and copy it to the mounted floppy.
To unpack the initrd(4) file you'll need xz(1) (or lzma(1) on older
unix-like OSses) and cpio(1). These can be installed using your package
manager on all major distros. It is ok to use the BSD version of
cpio(1). No need to get the GNU version for BSD users. Provided the
floppy is mounted in /mnt/floppy do the following:
Create an empty directory
mkdir ~/vlmcsd-floppy-initrd
cd into that directory
cd ~/vlmcsd-floppy-initrd
Unpack initrd
cat /mnt/floppy/initrd | unlzma | cpio -i
After applying your changes build a new initrd(4) file:
cd into your directory
cd ~/vlmcsd-floppy-initrd
Create the packed file
find . | cpio -o -H newc | lzma > /mnt/floppy/initrd
Do not try to use 'lzma -9' to achive better compression. The kernel
can't read the resulting file. While customizing the initrd(4) file
works on almost any unix-like OS, it does not work on Windows even not
with Cygwin. The reason is that the NTFS file system can't handle uids
and gids. These cannot be preserved when unpacking the cpio(1) archive
to NTFS. If you use the WSL subsystem of Windows 10 Redstone (Anniver
sary Update) and later, you must make sure to unpack the initrd(4) file
to a directory on VolFs (normally everything that is not mounted under
/mnt). The initrd(4) file can be on a VolFs or DriveFs.
FAQ
On what distro is the floppy image based?
None. Besides the boot loader ldlinux.sys, there are only three bina
ries: The Linux kernel bzImage, busybox(1) and vlmcsdmulti-x86-musl-
static. bzImage and busybox(1) have been compiled with carefully
selected configuration parameters not found in any distro. This was
neccesary to fit everything on a 1.44 MB floppy.
Why is a rather old Linux kernel (3.12) used?
Linux 3.12 is the last kernel that can be booted with 16 MB of RAM.
Beginning with Linux 3.13 it requires much more memory (about 80 MB) to
boot. The floppy image is regularly tested with newer kernels. Every
thing works except that you need to assign much more main memory to the
virtual machine.
Can the floppy be booted on bare metal?
Basically yes. However, only Intel Pro/1000 and AMD PCNET32 ethernet
cards are supported by the kernel. In addition there is no USB support
compiled into the kernel. That means you can only use an IBM AT or IBM
PS/2 keyboard which are not available on newer hardware.
FILES
syslinux.cfg, vlmcsd.ini(5)
BUGS
IPv6 cannot be configured with static or manual parameters.
DHCPv6 is not supported.
´ip route add ...' does not work. Use 'route add ...' instead.
AUTHOR
floppy144.vfd has been created by Hotbird64
CREDITS
Linus Torvalds et al. for the Linux kernel
Erik Andersen et al. for the original uClibc
Waldemar Brodkorb et al. for uClibc-ng
Denys Vlasenko et al. for BusyBox
H. Peter Anvin et al. for SYSLINUX
SEE ALSO
vlmcsd(8), vlmcsd.ini(5), initrd(4), busybox(1), syslinux(1)
Hotbird64 October 2016 VLMCSD-FLOPPY(7)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -35,7 +35,7 @@
<p style="margin-left:11%; margin-top: 1em">vlmcsd&nbsp;&minus;&nbsp;a
<p style="margin-left:11%; margin-top: 1em">vlmcsd&nbsp;-&nbsp;a
guide to KMS activation using vlmcsd</p>
<h2>SYNOPSIS
@ -169,34 +169,29 @@ inofficial GVLKs that work with consumer-only versions of
Windows. Here is a list:</p>
<p style="margin-left:11%; margin-top: 1em">TX9XD&minus;98N7V&minus;6WMQ6&minus;BX7FG&minus;H8Q99
<p style="margin-left:11%; margin-top: 1em">TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
- Windows 10 Home <br>
3KHY7&minus;WNT83&minus;DGQKR&minus;F7HPR&minus;844BM -
Windows 10 Home N <br>
7HNRX&minus;D7KGG&minus;3K4RQ&minus;4WPJ4&minus;YTDFH -
Windows 10 Home Single Language <br>
PVMJN&minus;6DFY6&minus;9CCP6&minus;7BKTT&minus;D3WVR -
Windows 10 Home Country Specific <br>
789NJ&minus;TQK6T&minus;6XTH8&minus;J39CJ&minus;J8D3P -
Windows 8.1 Professional with Media Center <br>
M9Q9P&minus;WNJJT&minus;6PXPY&minus;DWX8H&minus;6XWKK -
Windows 8.1 Core <br>
7B9N3&minus;D94CG&minus;YTVHR&minus;QBPX3&minus;RJP64 -
Windows 8.1 Core N <br>
BB6NG&minus;PQ82V&minus;VRDPW&minus;8XVD2&minus;V8P66 -
Windows 8.1 Core Single Language <br>
NCTT7&minus;2RGK8&minus;WMHRF&minus;RY7YQ&minus;JTXG3 -
Windows 8.1 Core Country Specific <br>
GNBB8&minus;YVD74&minus;QJHX6&minus;27H4K&minus;8QHDG -
Windows 8 Professional with Media Center <br>
BN3D2&minus;R7TKB&minus;3YPBD&minus;8DRP2&minus;27GG4 -
Windows 8 Core <br>
8N2M2&minus;HWPGY&minus;7PGT9&minus;HGDD8&minus;GVGGY -
Windows 8 Core N <br>
2WN2H&minus;YGCQR&minus;KFX6K&minus;CD6TF&minus;84YXQ -
Windows 8 Core Single Language <br>
4K36P&minus;JN4VD&minus;GDC6V&minus;KDT89&minus;DYFKP -
Windows 8 Core Country Specific</p>
3KHY7-WNT83-DGQKR-F7HPR-844BM - Windows 10 Home N <br>
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH - Windows 10 Home Single
Language <br>
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR - Windows 10 Home Country
Specific <br>
789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional
with Media Center <br>
M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core <br>
7B9N3-D94CG-YTVHR-QBPX3-RJP64 - Windows 8.1 Core N <br>
BB6NG-PQ82V-VRDPW-8XVD2-V8P66 - Windows 8.1 Core Single
Language <br>
NCTT7-2RGK8-WMHRF-RY7YQ-JTXG3 - Windows 8.1 Core Country
Specific <br>
GNBB8-YVD74-QJHX6-27H4K-8QHDG - Windows 8 Professional with
Media Center <br>
BN3D2-R7TKB-3YPBD-8DRP2-27GG4 - Windows 8 Core <br>
8N2M2-HWPGY-7PGT9-HGDD8-GVGGY - Windows 8 Core N <br>
2WN2H-YGCQR-KFX6K-CD6TF-84YXQ - Windows 8 Core Single
Language <br>
4K36P-JN4VD-GDC6V-KDT89-DYFKP - Windows 8 Core Country
Specific</p>
<p style="margin-left:11%; margin-top: 1em">The above keys
require activation renewal every 45 days (Win 8.1) or 30
@ -240,9 +235,9 @@ turned out to be non-working, you can use
Examples</b></p>
<p style="margin-left:22%;">slmgr&nbsp;/ipk
GCRJD&minus;8NW9H&minus;F2CDX&minus;CCM8D&minus;9D6T9 <br>
GCRJD-8NW9H-F2CDX-CCM8D-9D6T9 <br>
cscript
ospp.vbs&nbsp;/inpkey:YC7DK&minus;G2NP3&minus;2QQC3&minus;J6H88&minus;GVGXT</p>
ospp.vbs&nbsp;/inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT</p>
<p style="margin-left:11%; margin-top: 1em"><b>Why
doesn&rsquo;t Office accpet a GVLK?</b> <br>
@ -306,7 +301,7 @@ automatically. This may take a while. <br>
You may type</p>
<p style="margin-left:22%;">slmgr&nbsp;/ato <br>
&minus;or&minus; <br>
-or- <br>
cscript ospp.vbs&nbsp;/act</p>
<p style="margin-left:11%; margin-top: 1em">at any time to
@ -325,8 +320,8 @@ like this:</p>
<p style="margin-left:22%; margin-top: 1em">Connecting to
127.0.0.1:1688 ... successful <br>
Sending&nbsp;activation&nbsp;request&nbsp;(KMS&nbsp;V4)&nbsp;1&nbsp;of&nbsp;1&nbsp;&minus;&gt;
06401&minus;00206&minus;296&minus;206344&minus;03&minus;5179&minus;9600.0000&minus;3432013</p>
Sending&nbsp;activation&nbsp;request&nbsp;(KMS&nbsp;V4)&nbsp;1&nbsp;of&nbsp;1&nbsp;-&gt;
06401-00206-296-206344-03-5179-9600.0000-3432013</p>
<p style="margin-left:11%; margin-top: 1em">If anything
goes wrong, you&rsquo;ll see an error message. Next try

Binary file not shown.

View File

@ -1,5 +1,5 @@
.mso www.tmac
.TH VLMCSD 8 "June 2016" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD 8 "January 2017" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
@ -17,7 +17,17 @@ vlmcsd \- a fully Microsoft compatible KMS server
.PP
Although \fBvlmcsd\fR does neither require an activation key nor a payment to anyone, it is not meant to run illegal copies of Windows. Its purpose is to ensure that owners of legal copies can use their software without restrictions, e.g. if you buy a new computer or motherboard and your key will be refused activation from Microsoft servers due to hardware changes.
.PP
\fBvlmcsd\fR may be started via an internet superserver like \fBinetd\fR(8) or \fBxinetd\fR(8) as well as an advanced init system like \fBsystemd\fR(8) or \fBlaunchd\fR(8) using socket based activation. If \fBvlmcsd\fR detects that \fBstdin\fR(3) is a socket, it assumes that there is already a connected client on stdin that wants to be activated. All options that control setting up listening sockets will be ignored when in inetd mode.
\fBvlmcsd\fR may be started via an internet superserver like \fBinetd\fR(8) or \fBxinetd\fR(8) as well as an advanced init system like \fBsystemd\fR(8) or \fBlaunchd\fR(8) using socket based activation. If \fBvlmcsd\fR detects that \fBstdin\fR(3) is a socket, it assumes that there is already a connected client on stdin that wants to be activated.
All options that control setting up listening sockets will be ignored when in inetd mode. The sockets will be set up by your internet superserver. You also cannot limit the number of simultanous clients (option \fB-m\fR). You need to configure the limit in your internet superserver.
The followong features that require that vlmcsd is permanently loaded will not work if started from an internet superserver:
.IP
You cannot maintain a client list (option \fB-M1\fR)
.IP
EPID Randomization Level 1 (option \fB-r1\fR) works like Level 2 (\fB-r2\fR). You may want to use Level 0 (\fB-r0\fR) or custom EPIDs (options \fB-w\fR, \fB-0\fR, \fB-3\fR and \fB-6\fR) instead.
.SH OPTIONS
Since vlmcsd can be configured at compile time, some options may not be available on your system.
@ -39,10 +49,72 @@ If no port is specified, vlmcsd uses the default port according to a preceding \
.IP
If you specify a link local IPv6 address (fe80::/10, usually starting with fe80::), it must be followed by a percent sign (%) and a scope id (=network interface name or number) on most unixoid OSses including Linux, Android, MacOS X and iOS, e.g. fe80::1234:56ff:fe78:9abc\fB%eth0\fR or [fe80::1234:56ff:fe78:9abc\fB%2\fR]:1688. Windows (including cygwin) does not require a scope id unless the same link local address is used on more than one network interface. Windows does not accept a name and the scope id must be a number.
.IP "\fB-P\fR \fIport"
.IP "\fB-o \fIlevel\fR"
Sets the \fIlevel\fR of protection against activations from public IP addresses. The default is \fB-o0\fR for no protection.
\fB-o1\fR causes vlmcsd not to listen on all IP addresses but on private IP addresses only. IPv4 addresses in the 100.64.0.0/10 range (see RFC6598) are not treated as private since they can be reached from other users of your ISP. Private IPv4 addresses are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 and 127.0.0.0/8. vlmcsd treats all IPv6 addresses not within 2000::/3 as private addresses.
If \fB-o1\fR is combined with \fB-L\fR, it will listen on all private IP addresses plus the ones specified by one or more \fB-L\fR statements. If \fB-o1\fR is combined with \fB-P\fR, only the last \fB-P\fR statement will be used.
Using \fB-o1\fR does not protect you if you enable NAT port forwarding on your router to your vlmcsd machine. It is identical to using multiple -L statements with all of your private IP addresses. What \fB-o1\fR does for you, is automatically enumerating your private IP addresses.
\fB-o2\fR does not affect the interfaces, vlmcsd is listening on. When a clients connects, vlmcsd immediately drops the connection if the client has a public IP address. Unlike \fB-o1\fR clients will be able to establish a TCP connection but it will be closed without a single byte sent over the connection. This protects against clients with public IP addresses even if NAT port forwarding is used. While \fB-o2\fR offers a higher level of protection than \fB-o1\fR, the client sees that the KMS TCP port (1688 by default) is actually accepting connections.
If vlmcsd is compiled to use MS RPC, \fB-o2\fR can only offer very poor protection. Control is passed from MS RPC to vlmcsd after the KMS protocol has already been negotiated. Thus a client can always verify that the KMS protocol is available even though it receives an RPC_S_ACCESS_DENIED error message. vlmcsd will issue a warning if \fB-o2\fR is used with MS RPC. \fBFor adaequate protection do not use a MS RPC build of vlmcsd with -o2\fR.
\fB-o3\fR combines \fB-o1\fR and \fB-o2\fR. vlmcsd listens on private interfaces only and if a public client manages to connect anyway due to NAT port forwarding, it will be immediately dropped.
If you use any form of TCP level port forwarding (e.g. \fBnc\fR(1), \fBnetcat\fR(1), \fBssh\fR(1) port forwarding or similar) to redirect KMS requests to vlmcsd, there will be no protection even if you use \fB-o2\fR or \fB-o3\fR. This is due to the simple fact that vlmcsd sees the IP address of the redirector and not the IP address of the client.
\fB-o1\fR (and thus \fB-o3\fR) is not (yet) available in some scenarios:
.RS 12
FreeBSD: There is a longtime unfixed
.URL https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881 bug ""
in the 32-bit ABI of the 64-bit kernel. If you have a 64-bit FreeBSD kernel, you must run the 64-bit version of vlmcsd if you use \fB-o1\fR or \fB-o3\fR. The 32-bit version causes undefined behavior up to crashing vlmcsd. Other BSDs (NetBSD, OpenBSD, Dragonfly and Mac OS X) work correctly.
If vlmcsd was started by an internet superserver or was compiled to use Microsoft RPC (Windows only) or simple sockets, \fB-o1\fR and \fB-o3\fR are not available by design.
.RE
.IP "\fB-P\fR \fIport\fR"
Use TCP \fIport\fR for all subsequent \fB-L\fR statements that do not include an optional port. If you use \fB-P\fR and \fB-L\fR, \fB-P\fR must be specified before \fB-L\fR.
.IP "\fB-F0\fR and \fB-F1\fR
.IP "\fB-O\fR \fIvpn-adapter-name\fR[=\fIipv4-address\fR][/\fIcidr-mask\fR][:\fIdhcp-lease-duration\fR]"
Enables a compatible VPN adapter to create additional local IPv4 addresses (like 127.0.0.1) that appear as remote IPv4 addresses to the system. This allows product activation using a local instance of vlmcsd. This feature is only available in Windows and Cygwin builds of vlmcsd since it is not of any use on other operating systems. Compatible VPN adapters are Tap-windows version 8.2 or higher (from OpenVPN) and the TeamViewer VPN adapter. There are two special \fIvpn-adapter-name\fRs. A single period (.) instructs vlmcsd to use the first available compatible VPN adapter. A single dash (\-) disables the use of a VPN adapter if one has been configured in \fBvlmcsd.ini\fR(5). The \fIvpn-adapter-name\fR is \fBnot\fR case-sensitive. If the \fIvpn-adapter-name\fR contains spaces (e.g. Ethernet 3), you must enclose it in quotes.
The default \fIipv4-address\fR is 10.10.10.9 and the default \fIcidr-mask\fR is 30. If you are using the default values, your VPN adapter uses an IPv4 address of 10.10.10.9 and you can set your activation client to use the easy to remember address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs /sethst:10.10.10.10).
The \fIdhcp-lease-duration\fR is a number optionally followed by s, m, h, d or w to indicate seconds, minutes, hours, days or weeks. The default \fIdhcp-lease-duration\fR is 1d (one day). It is normally not required to change this value.
It is advised not to manually configure your OpenVPN TAP or TeamViewer VPN adapter in "Network Connections". If you set the IPv4 configuration manually anyway, the IPv4 address and the subnet mask must match the \fB-O\fR parameter. It is safe leave the IPv4 configuration to automatic (DHCP). vlmcsd will wait up to four seconds for the DHCP configuration to complete before binding to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter at a time. If you use the TeamViewer VPN adapter for example, you will not be able to use the VPN feature of TeamViewer as long as vlmcsd is running. The same applies to OpenVPN TAP adapters that are in use by other programs (for example OpenVPN, QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid conflicts is to install Tap-Windows from OpenVPN, cd to C:\\Program Files\\TAP-Windows\\bin and run addtap.bat to install an additional TAP adapter. Go to "Network Connections" and rename the new adapter to "vlmcsd" and specify \fB-O vlmcsd\fR to use it.
Example: \fB-O "Ethernet 7"=192.168.123.1/24\fR (uses VPN adapter Ethernet 7 with IPv4 address 192.168.123.1 and have 192.168.123.2 to 192.168.123.254 as additional local (but apparently remote) IPv4 addresses.
.IP "\fB-x0\fR and \fB-x1\fR"
Controls under what circumstances vlmcsd will exit. Using the default of \fB-x0\fR vlmcsd stays active as long as it can perform some useful operations. If vlmcsd is run by any form of a watchdog, e.g. NT service manager (Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be desirable to end vlmcsd and let the watchdog restart it. This is especially true if some pre-requisites are not yet met but will be some time later, e.g. network is not yet fully setup.
By using \fB-x0\fR vlmcsd will
.RS 12
exit if none of the listening sockets specified with \fB-L\fR can be used. It continues if at least one socket can be setup for listening.
exit any TAP mirror thread (Windows version only) if there is an error condition while reading or writing from or to the VPN adapter but continue to work without utilizing a VPN adapter.
.RE
.IP
By using \fB-x1\fR vlmcsd will
.RS 12
exit if not all listening sockets specified with \fB-L\fR can be used.
exit completely if there is a problem with a VPN adapter it is using. This can happen for instance if the VPN adapter has been disabled using "Control Panel - Network - Adapter Settings" while vlmcsd is using it.
.RE
.IP
Please note that \fB-x1\fR is kind of a workaround option. While it may help under some circumstances, it is better to solve the problem at its origin, e.g. properly implementing dependencies in your startup script to ensure all network interfaces and the VPN adapter you will use are completely setup before you start vlmcsd.
.IP "\fB-F0\fR and \fB-F1\fR"
Allow (\fB-F1\fR) or disallow (\fB-F0\fR) binding to IP addresses that are currently not configured on your system. The default is \fB-F0\fR. \fB-F1\fR allows you to bind to an IP address that may be configured after you started \fBvlmcsd\fR. \fBvlmcsd\fR will listen on that address as soon as it becomes available. This feature is only available under Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows this feature only for the root user (more correctly: processes that have the PRIV_NETINET_BINDANY privilege). Linux does not require a capability for this.
.IP "\fB-t\fR \fIseconds\fR"
@ -70,6 +142,9 @@ type tail -f \fIfile\fR.
.IP
If you use the special \fIfilename\fR "syslog", vlmcsd uses \fBsyslog\fR(3) for logging. If your system has no syslog service (/dev/log) installed, logging output will go to /dev/console. Syslog logging is not available in the native Windows version. The Cygwin version does support syslog logging.
.IP "\fB-T0\fR and \fB-T1\fR"
Disable (\fB-T0\fR) or enable (\fB-T1\fR) the inclusion of date and time in each line of the log. The default is \fB-T1\fR. \fB-T0\fR is useful if you log to \fBstdout\fR(3) which is redirected to another logging mechanism that already includes date and time in its output, for instance \fBsystemd-journald\fR(8). If you log to \fBsyslog\fR(3), \fB-T1\fR is ignored and date and time will never be included in the output sent to \fBsyslog\fR(3).
.IP "\fB-D\fR"
Normally vlmcsd daemonizes and runs in background (except the native Windows version). If \fB-D\fR is specified, vlmcsd does not daemonize and runs in foreground. This is useful for testing and allows you to simply press <Ctrl-C> to exit vlmcsd.
.PP
@ -105,7 +180,10 @@ Use \fIePID\fR as Windows ePID. If specified, \fB-r\fR is disregarded for Window
Use \fIePID\fR as Office 2010 ePID (including Project and Visio). If specified, \fB-r\fR is disregarded for Office 2010.
.IP "\fB-3\fR \fIePID\fR"
Use \fIePID\fR as Office 2013/2016 ePID (including Project and Visio). If specified, \fB-r\fR is disregarded for Office 2013/2016.
Use \fIePID\fR as Office 2013 ePID (including Project and Visio). If specified, \fB-r\fR is disregarded for Office 2013.
.IP "\fB-6\fR \fIePID\fR"
Use \fIePID\fR as Office 2016 ePID (including Project and Visio). If specified, \fB-r\fR is disregarded for Office 2016.
.IP "\fB-H\fR \fIHwId\fR"
Use \fIHwId\fR for all products. All HWIDs in the ini file (see \fB-i\fR) will not be used. In an ini file you can specify a seperate HWID for each \fIapplication-guid\fR. This is not possible when entering a HWID from the command line.
@ -123,6 +201,11 @@ Use configuration file (aka ini file) \fIfilename\fR. Most configuration paramet
If vlmcsd has been compiled to use a default configuration file (often /etc/vlmcsd.ini), you may use \fB-i-\fR to ignore the default configuration file.
.IP "\fB-j\fR \fIfilename\fR"
Use KMS data file \fIfilename\fR. By default vlmcsd only contains the minimum product data that is required to perform all operations correctly. You may use a more complete KMS data file that contains all detailed product names. This is especially useful if you are logging KMS requests. If you don't log, there is no need to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you may use \fB-j-\fR to ignore the default configuration file.
.IP "\fB-r0\fR, \fB-r1\fR (default) and \fB-r2\fR"
These options determine how ePIDs are generated if
@ -132,15 +215,15 @@ These options determine how ePIDs are generated if
.br
- the file specified by \fB-i\fR cannot be opened or
.br
- the file specified by \fB-i\fR does not contain the \fIapplication-guid\fR for the KMS request
- the file specified by \fB-i\fR does not contain an ePID for the KMS request
\fB-r0\fR means there are no random ePIDs. vlmcsd simply issues default ePIDs that are built into the binary at compile time. \fBPro:\fR behaves like real KMS server that also always issues the same ePID. \fBCon\fR: Microsoft may start blacklisting again and the default ePID may not work any longer.
\fB-r0\fR means there are no random ePIDs. vlmcsd simply issues default ePIDs that are built into the binary at compile time. \fBPro:\fR behaves like real KMS server that also always issues the same ePID. \fBCon:\fR Microsoft may start blacklisting again and the default ePID may not work any longer.
\fB-r1\fR instructs vlmcsd to generate random ePIDs when the program starts or receives a SIGHUP signal and uses these ePIDs until it is stopped or receives another SIGHUP. Most other KMS emulators generate a new ePID on every KMS request. This is easily detectable. Microsoft could just modify sppsvc.exe in a way that it always sends two identical KMS requests in two RPC requests but over the same TCP connection. If both KMS responses contain the different ePIDs, the KMS server is not genuine. \fB-r1\fR is the default mode. \fB-r1\fR also ensures that all three ePIDs (Windows, Office 2010 and Office 2013) use the same OS build number and LCID (language id).
If vlmcsd has been started by an internet superserver, \fB-r1\fR works identically to \fB-r2\fR. This is simply due to the fact that vlmcsd is started upon a connection request and does not stay in memory after servicing a KMS request.
If vlmcsd has been started by an internet superserver, \fB-r1\fR works almost identically to \fB-r2\fR. The only exception occurs if you send more than one activation request over the same TCP connection. This is simply due to the fact that vlmcsd is started upon a connection request and does not stay in memory after servicing a KMS request. Consider using \fB-r0\fR or \fB-w\fR, \fB-0\fR, \fB-3\fR and \fB-6\fB when starting vlmcsd by an internet superserver.
\fB-r2\fR behaves like most other KMS server emulators with random support and generates a new random ePID on every request. Use this mode with "care". However since Microsoft currently does not seem to do any verification of the ePID, you currently don't need to pay attention to ePIDs at all.
\fB-r2\fR behaves like most other KMS server emulators with random support and generates a new random ePID on every request. \fB-r2\fR should be treated as debugging option only because it allows very easy emulator detection.
.IP "\fB-C\fR \fILCID\fR"
Do not randomize the locale id part of the ePID and use \fILCID\fR instead. The \fILCID\fR must be specified as a decimal number, e.g. 1049 for "Russian - Russia". This option has no effect if the ePID is not randomized at all, e.g. if it is selected from the command line or an ini file.
@ -151,6 +234,33 @@ for a list of valid \fILCID\fRs. Please note that some of them are not recognize
Most other KMS emulators use a fixed \fILCID\fR of 1033 (English - US). To achive the same behavior in vlmcsd use \fB-C 1033\fR.
.IP "\fB-K0\fR, \fB-K1\fR, \fB-K2\fR and \fB-K3\fR"
Sets the whitelisting level to determine which products vlmcsd activates or refuses. The default is \fB-K0\fR.
.RS 12
\fB-K0\fR: activate all products with an unknown, retail or beta/preview KMS ID.
.br
\fB-K1\fR: activate products with a retail or beta/preview KMS ID but refuse to activate products with an unknown KMS ID.
.br
\fB-K2\fR: activate products with an unknown KMS ID but refuse products with a retail or beta/preview KMS ID.
.br
\fB-K3\fR: activate only products with a known volume license RTM KMS ID and refuse all others.
.RE
.IP ""
The SKU ID is not checked. Like a genuine KMS server vlmcsd activates a product that has a random or unknown SKU ID. If you select \fB-K1\fR or \fB-K3\fR, vlmcsd also checks the Application ID for correctness. If Microsoft introduces a new KMS ID for a new product, you cannot activate it if you used \fB-K1\fR or \fB-K3\fR until a new version of vlmcsd is available.
.IP "\fB-c0\fR and \fB-c1\fR"
\fB-c1\fR causes vlmcsd to check if the client time differs no more than four hours from the system time. \fB-c0\fR (the default) disables this check. \fB-c1\fR is useful to prevent emulator detection. A client that tries to detect an emulator could simply send two subsequent request with two time stamps that differ more than four hours from each other. If both requests succeed, the server is an emulator. If you specify \fB-c1\fR on a system with no reliable time source, activations will fail. It is ok to set the correct system time after you started vlmcsd.
.IP "\fB-M0\fR and \fB-M1\fR"
Disables (\fB-M0\fR) or enables (\fB-M1\fR) maintaining a list of client machine IDs (CMIDs). The default is \fB-M0\fR. \fB-M1\fR is useful to prevent emulator detection. By maintaing a CMID list, vlmcsd reports current active clients exactly like a genuine KMS emulator. This includes bug compatibility to the extent that you can permanently kill a genuine KMS emulator by sending an "overcharge request" with a required client count of 376 or more and then request activation for 671 clients. vlmcsd can be reset from this condition by restarting it. If \fB-M0\fR is used, vlmcsd reports current active clients as good as possible. If no client sends an "overcharge request", it is not possible to detect vlmcsd as an emulator with \fB-M0\fR. \fB-M1\fR requires the allocation of a buffer that is about 50 kB in size. On hardware with few memory resources use it only if you really need it.
If you start vlmcsd from an internet superserver, \fB-M1\fR cannot be used. Since vlmcsd exits after each activation, it cannot maintain any state in memory.
.IP "\fB-E0\fR and \fB-E1\fR"
These options are ignored if you do not also specify \fB-M1\fR. If you use \fB-E0\fR (the default), vlmcsd starts up as a fully "charged" KMS server. Clients activate immediately. \fB-E1\fR lets you start up vlmcsd with an empty CMID list. Activation will start when the required minimum clients (25 for Windows Client OSses, 5 for Windows Server OSses and Office) have registered with the KMS server. As long as the minimum client count has not been reached, clients end up in HRESULT 0xC004F038 "The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator". You may use \fBvlmcs\fR(1) or another KMS client emulator to "charge" vlmcsd. \fB-E1\fR does not improve emulator detection prevention. It's primary purpose is to help developers of KMS clients to test "charging" a KMS server.
.IP "\fB-R\fR \fIrenewal-interval\fR"
Instructs clients to renew activation every \fIrenewal-interval\fR. The \fIrenewal-interval\fR is a number optionally immediately followed by a letter indicating the unit. Valid unit letters are s (seconds), m (minutes), h (hours), d (days) and w (weeks). If you do not specify a letter, minutes is assumed.
@ -217,7 +327,7 @@ Signaling is not available in the native Windows version and in the Cygwin versi
\fBvlmcsd\fR compiles and runs on Linux, Windows (no Cygwin required but explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or unixoid OSses may work with unmodified sources or may require minor porting efforts.
.SH SUPPORTED PRODUCTS
\fBvlmcsd\fR can answer activation requests for the following products: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Office 2010, Project 2010, Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016.
\fBvlmcsd\fR can answer activation requests for the following products: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1607), Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010, Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016. Newer version may work as long as the KMS protocol does not change. A complete list of fully supported products can be obtained using the \fB-x\fR option of \fBvlmcs\fR(1).
.PP
Office, Project and Visio must be volume license versions.
@ -225,7 +335,7 @@ Office, Project and Visio must be volume license versions.
.IP "\fBvlmcsd.ini\fR(5)"
.SH EXAMPLES
.IP "\fBvlmcsd -f\fR"
.IP "\fBvlmcsd -De\fR"
Starts \fBvlmcsd\fR in foreground. Useful if you use it for the first time and want to see what's happening when a client requests activation.
.IP "\fBvlmcsd -l /var/log/vlmcsd.log\fR"
@ -240,8 +350,6 @@ Installs \fBvlmcsd\fR as a Windows service with low privileges and logs everythi
.SH BUGS
An ePID specified in an ini file must not contain spaces.
The maximum number of \fB-L\fR options in the command line or listen statements in the inifile is the platform default for \fIFD_SETSIZE\fR. This is 64 on Windows and 1024 on most Unixes.
.SH AUTHOR
Written by crony12, Hotbird64 and vityan666.
With contributions from DougQaid.

800
man/vlmcsd.8.dos.txt Normal file
View File

@ -0,0 +1,800 @@
VLMCSD(8) KMS Activation Manual VLMCSD(8)
NAME
vlmcsd - a fully Microsoft compatible KMS server
SYNOPSIS
vlmcsd [ options ]
DESCRIPTION
vlmcsd is a fully Microsoft compatible KMS server that provides product
activation services to clients. It is meant as a drop-in replacement
for a Microsoft KMS server (Windows computer with KMS key entered). It
currently supports KMS protocol versions 4, 5 and 6.
vlmcsd is designed to run on POSIX compatible operating systens. It
only requires a basic C library with a BSD-style sockets API and either
fork(2) or pthreads(7). That allows it to run on most embedded systems
like routers, NASes, mobile phones, tablets, TVs, settop boxes, etc.
Some efforts have been made that it also runs on Windows.
Although vlmcsd does neither require an activation key nor a payment to
anyone, it is not meant to run illegal copies of Windows. Its purpose
is to ensure that owners of legal copies can use their software without
restrictions, e.g. if you buy a new computer or motherboard and your
key will be refused activation from Microsoft servers due to hardware
changes.
vlmcsd may be started via an internet superserver like inetd(8) or
xinetd(8) as well as an advanced init system like systemd(8) or
launchd(8) using socket based activation. If vlmcsd detects that
stdin(3) is a socket, it assumes that there is already a connected
client on stdin that wants to be activated.
All options that control setting up listening sockets will be ignored
when in inetd mode. The sockets will be set up by your internet super
server. You also cannot limit the number of simultanous clients (option
-m). You need to configure the limit in your internet superserver.
The followong features that require that vlmcsd is permanently loaded
will not work if started from an internet superserver:
You cannot maintain a client list (option -M1)
EPID Randomization Level 1 (option -r1) works like Level 2
(-r2). You may want to use Level 0 (-r0) or custom EPIDs
(options -w, -0, -3 and -6) instead.
OPTIONS
Since vlmcsd can be configured at compile time, some options may not be
available on your system.
All options that do no require an argument may be combined with a sin
gle dash, for instance "vlmcsd -D -e" is identical to "vlmcsd -De". For
all options that require an argument a space between the option and the
option argument is optional. Thus "vlmcsd -r 2" and "vlmcsd -r2" are
identical too.
-h or -?
Displays help.
-V Displays extended version information. This includes the com
piler used to build vlmcsd, the intended platform and flags
(compile time options) to build vlmcsd. If you have the source
code of vlmcsd, you can type make help (or gmake help on systems
that do not use the GNU version of make(1) by default) to see
the meaning of those flags.
-L ipaddress[:port]
Instructs vlmcsd to listen on ipaddress with optional port
(default 1688). You can use this option more than once. If you
do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and
:: (IPv6) are used. If the IP address contains colons (IPv6) you
must enclose the IP address in brackets if you specify the
optional port, e.g. [2001:db8::dead:beef]:1688.
If no port is specified, vlmcsd uses the default port according
to a preceding -P option. If you specify a port, it can be a
number (1-65535) or a name (usually found in /etc/services if
not provided via LDAP, NIS+ or another name service).
If you specify a link local IPv6 address (fe80::/10, usually
starting with fe80::), it must be followed by a percent sign (%)
and a scope id (=network interface name or number) on most
unixoid OSses including Linux, Android, MacOS X and iOS, e.g.
fe80::1234:56ff:fe78:9abc%eth0 or
[fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin)
does not require a scope id unless the same link local address
is used on more than one network interface. Windows does not
accept a name and the scope id must be a number.
-o level
Sets the level of protection against activations from public IP
addresses. The default is -o0 for no protection.
-o1 causes vlmcsd not to listen on all IP addresses but on pri
vate IP addresses only. IPv4 addresses in the 100.64.0.0/10
range (see RFC6598) are not treated as private since they can be
reached from other users of your ISP. Private IPv4 addresses are
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 and
127.0.0.0/8. vlmcsd treats all IPv6 addresses not within
2000::/3 as private addresses.
If -o1 is combined with -L, it will listen on all private IP
addresses plus the ones specified by one or more -L statements.
If -o1 is combined with -P, only the last -P statement will be
used.
Using -o1 does not protect you if you enable NAT port forwarding
on your router to your vlmcsd machine. It is identical to using
multiple -L statements with all of your private IP addresses.
What -o1 does for you, is automatically enumerating your private
IP addresses.
-o2 does not affect the interfaces, vlmcsd is listening on. When
a clients connects, vlmcsd immediately drops the connection if
the client has a public IP address. Unlike -o1 clients will be
able to establish a TCP connection but it will be closed without
a single byte sent over the connection. This protects against
clients with public IP addresses even if NAT port forwarding is
used. While -o2 offers a higher level of protection than -o1,
the client sees that the KMS TCP port (1688 by default) is actu
ally accepting connections.
If vlmcsd is compiled to use MS RPC, -o2 can only offer very
poor protection. Control is passed from MS RPC to vlmcsd after
the KMS protocol has already been negotiated. Thus a client can
always verify that the KMS protocol is available even though it
receives an RPC_S_ACCESS_DENIED error message. vlmcsd will issue
a warning if -o2 is used with MS RPC. For adaequate protection
do not use a MS RPC build of vlmcsd with -o2.
-o3 combines -o1 and -o2. vlmcsd listens on private interfaces
only and if a public client manages to connect anyway due to NAT
port forwarding, it will be immediately dropped.
If you use any form of TCP level port forwarding (e.g. nc(1),
netcat(1), ssh(1) port forwarding or similar) to redirect KMS
requests to vlmcsd, there will be no protection even if you use
-o2 or -o3. This is due to the simple fact that vlmcsd sees the
IP address of the redirector and not the IP address of the
client.
-o1 (and thus -o3) is not (yet) available in some scenarios:
FreeBSD: There is a longtime unfixed bug ⟨https://
bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881⟩ in the
32-bit ABI of the 64-bit kernel. If you have a 64-bit Free
BSD kernel, you must run the 64-bit version of vlmcsd if
you use -o1 or -o3. The 32-bit version causes undefined
behavior up to crashing vlmcsd. Other BSDs (NetBSD, Open
BSD, Dragonfly and Mac OS X) work correctly.
If vlmcsd was started by an internet superserver or was
compiled to use Microsoft RPC (Windows only) or simple
sockets, -o1 and -o3 are not available by design.
-P port
Use TCP port for all subsequent -L statements that do not
include an optional port. If you use -P and -L, -P must be spec
ified before -L.
-O vpn-adapter-name[=ipv4-address][/cidr-mask][:dhcp-lease-duration]
Enables a compatible VPN adapter to create additional local IPv4
addresses (like 127.0.0.1) that appear as remote IPv4 addresses
to the system. This allows product activation using a local
instance of vlmcsd. This feature is only available in Windows
and Cygwin builds of vlmcsd since it is not of any use on other
operating systems. Compatible VPN adapters are Tap-windows ver
sion 8.2 or higher (from OpenVPN) and the TeamViewer VPN
adapter. There are two special vpn-adapter-names. A single
period (.) instructs vlmcsd to use the first available compati
ble VPN adapter. A single dash (-) disables the use of a VPN
adapter if one has been configured in vlmcsd.ini(5). The vpn-
adapter-name is not case-sensitive. If the vpn-adapter-name con
tains spaces (e.g. Ethernet 3), you must enclose it in quotes.
The default ipv4-address is 10.10.10.9 and the default cidr-mask
is 30. If you are using the default values, your VPN adapter
uses an IPv4 address of 10.10.10.9 and you can set your activa
tion client to use the easy to remember address 10.10.10.10
(e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs
/sethst:10.10.10.10).
The dhcp-lease-duration is a number optionally followed by s, m,
h, d or w to indicate seconds, minutes, hours, days or weeks.
The default dhcp-lease-duration is 1d (one day). It is normally
not required to change this value.
It is advised not to manually configure your OpenVPN TAP or
TeamViewer VPN adapter in "Network Connections". If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the -O parameter. It is safe leave the
IPv4 configuration to automatic (DHCP). vlmcsd will wait up to
four seconds for the DHCP configuration to complete before bind
ing to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter
at a time. If you use the TeamViewer VPN adapter for example,
you will not be able to use the VPN feature of TeamViewer as
long as vlmcsd is running. The same applies to OpenVPN TAP
adapters that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid con
flicts is to install Tap-Windows from OpenVPN, cd to C:\Program
Files\TAP-Windows\bin and run addtap.bat to install an addi
tional TAP adapter. Go to "Network Connections" and rename the
new adapter to "vlmcsd" and specify -O vlmcsd to use it.
Example: -O "Ethernet 7"=192.168.123.1/24 (uses VPN adapter Eth
ernet 7 with IPv4 address 192.168.123.1 and have 192.168.123.2
to 192.168.123.254 as additional local (but apparently remote)
IPv4 addresses.
-x0 and -x1
Controls under what circumstances vlmcsd will exit. Using the
default of -x0 vlmcsd stays active as long as it can perform
some useful operations. If vlmcsd is run by any form of a watch
dog, e.g. NT service manager (Windows), systemd (Linux) or
launchd (Mac OS / iOS), it may be desirable to end vlmcsd and
let the watchdog restart it. This is especially true if some
pre-requisites are not yet met but will be some time later, e.g.
network is not yet fully setup.
By using -x0 vlmcsd will
exit if none of the listening sockets specified with -L can
be used. It continues if at least one socket can be setup
for listening.
exit any TAP mirror thread (Windows version only) if there
is an error condition while reading or writing from or to
the VPN adapter but continue to work without utilizing a
VPN adapter.
By using -x1 vlmcsd will
exit if not all listening sockets specified with -L can be
used.
exit completely if there is a problem with a VPN adapter it
is using. This can happen for instance if the VPN adapter
has been disabled using "Control Panel - Network - Adapter
Settings" while vlmcsd is using it.
Please note that -x1 is kind of a workaround option. While it
may help under some circumstances, it is better to solve the
problem at its origin, e.g. properly implementing dependencies
in your startup script to ensure all network interfaces and the
VPN adapter you will use are completely setup before you start
vlmcsd.
-F0 and -F1
Allow (-F1) or disallow (-F0) binding to IP addresses that are
currently not configured on your system. The default is -F0. -F1
allows you to bind to an IP address that may be configured after
you started vlmcsd. vlmcsd will listen on that address as soon
as it becomes available. This feature is only available under
Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows
this feature only for the root user (more correctly: processes
that have the PRIV_NETINET_BINDANY privilege). Linux does not
require a capability for this.
-t seconds
Timeout the TCP connection with the client after seconds sec
onds. After sending an activation request. RPC keeps the TCP
connection for a while. The default is 30 seconds. You may spec
ify a shorter period to free ressources on your device faster.
This is useful for devices with limited main memory or if you
used -m to limit the concurrent clients that may request activa
tion. Microsoft RPC clients disconnect after 30 seconds by
default. Setting seconds to a greater value does not make much
sense.
-m concurrent-clients
Limit the number of clients that will be handled concurrently.
This is useful for devices with limited ressources or if you are
experiencing DoS attacks that spawn thousands of threads or
forked processes. If additional clients connect to vlmcsd, they
need to wait until another client disconnects. If you set con
current-clients to a small value ( <10 ), you should also select
a reasonable timeout of 2 or 3 seconds with -t. The default is
no limit.
-d Disconnect each client after processing one activation request.
This is a direct violation of DCE RPC but may help if you
receive malicous fake RPC requests that block your threads or
forked processes. Some other KMS emulators (e.g. py-kms) behave
this way.
-k Do not disconnect clients after processing an activation
request. This selects the default behavior. -k is useful only if
you used an ini file (see vlmcsd.ini(5) and -i). If the ini file
contains the line "DisconnectClientsImmediately = true", you can
use this switch to restore the default behavior.
-N0 and -N1
Disables (-N0) or enables (-N1) the use of the NDR64 transfer
syntax in the RPC protocol. Unlike Microsoft vlmcsd supports
NDR64 on 32-bit operating systems. Microsoft introduced NDR64 in
Windows Vista but their KMS servers started using it with Win
dows 8. Thus if you choose random ePIDs, vlmcsd will select
ePIDs with build numbers 9200 and 9600 if you enable NDR64 and
build numbers 6002 and 7601 if you disable NDR64. The default is
to enable NDR64.
-B0 and -B1
Disables (-B0) or enables (-B1) bind time feature negotiation
(BTFN) in the RPC protocol. All Windows operating systems start
ing with Vista support BTFN and try to negotiate it when initi
ating an RPC connection. Thus consider turning it off as a debug
/ troubleshooting feature only. Some older firewalls that selec
tively block or redirect RPC traffic may get confused when they
detect NDR64 or BTFN.
-l filename
Use filename as a log file. The log file records all activations
with IP address, Windows workstation name (no reverse DNS
lookup), activated product, KMS protocol, time and date. If you
do not specify a log file, no log is created. For a live view of
the log file type tail -f file.
If you use the special filename "syslog", vlmcsd uses syslog(3)
for logging. If your system has no syslog service (/dev/log)
installed, logging output will go to /dev/console. Syslog log
ging is not available in the native Windows version. The Cygwin
version does support syslog logging.
-T0 and -T1
Disable (-T0) or enable (-T1) the inclusion of date and time in
each line of the log. The default is -T1. -T0 is useful if you
log to stdout(3) which is redirected to another logging mecha
nism that already includes date and time in its output, for
instance systemd-journald(8). If you log to syslog(3), -T1 is
ignored and date and time will never be included in the output
sent to syslog(3).
-D Normally vlmcsd daemonizes and runs in background (except the
native Windows version). If -D is specified, vlmcsd does not
daemonize and runs in foreground. This is useful for testing and
allows you to simply press <Ctrl-C> to exit vlmcsd.
The native Windows version never daemonizes and always behaves
as if -D had been specified. You may want to install vlmcsd as a
service instead. See -s.
-e If specified, vlmcsd ignores -l and writes all logging output to
stdout(3). This is mainly useful for testing and debugging and
often combined with -D.
-v Use verbose logging. Logs every parameter of the base request
and the base response. It also logs the HWID of the KMS server
if KMS protocol version 6 is used. This option is mainly for
debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-e or -f.
-q Do not use verbose logging. This is actually the default behav
ior. It only makes sense if you use vlmcsd with an ini file (see
-i and vlmcsd.ini(5)). If the ini file contains the line
"LogVerbose = true" you can use -q to restore the default behav
ior.
-p filename
Create pid file filename. This has nothing to do with KMS ePIDs.
A pid file is a file where vlmcsd writes its own process id.
This is used by standard init scripts (typically found in
/etc/init.d). The default is not to write a pid file.
-u user and -g group
Causes vlmcsd to run in the specified user and group security
context. The main purpose for this is to drop root privileges
after it has been started from the root account. To use this
feature from cygwin you must run cyglsa-config and the account
from which vlmcsd is started must have the rights "Act as part
of the operating system" and "Replace a process level token".
The native Windows version does not support these options.
The actual security context switch is performed after the TCP
sockets have been created. This allows you to use privileged
ports (< 1024) when you start vlmcsd from the root account.
However if you use an ini, pid or log file, you must ensure that
the unprivileged user has access to these files. You can always
log to syslog(3) from an unprivileged account on most platforms
(see -l).
-w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for
Windows.
-0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010.
-3 ePID
Use ePID as Office 2013 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2013.
-6 ePID
Use ePID as Office 2016 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2016.
-H HwId
Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a
HWID from the command line.
HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The
following commands are identical:
vlmcsd -H 0123456789ABCDEF
vlmcsd -H 01:23:45:67:89:ab:cd:ef
vlmcsd -H "01 23 45 67 89 AB CD EF"
-i filename
Use configuration file (aka ini file) filename. Most configura
tion parameters can be set either via the command line or an ini
file. The command line always has precedence over configuration
items in the ini file. See vlmcsd.ini(5) for the format of the
configuration file.
If vlmcsd has been compiled to use a default configuration file
(often /etc/vlmcsd.ini), you may use -i- to ignore the default
configuration file.
-j filename
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con
tains all detailed product names. This is especially useful if
you are logging KMS requests. If you don't log, there is no need
to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
-r0, -r1 (default) and -r2
These options determine how ePIDs are generated if
- you did not sprecify an ePID in the command line and
- you haven't used -i or
- the file specified by -i cannot be opened or
- the file specified by -i does not contain an ePID for the KMS
request
-r0 means there are no random ePIDs. vlmcsd simply issues
default ePIDs that are built into the binary at compile time.
Pro: behaves like real KMS server that also always issues the
same ePID. Con: Microsoft may start blacklisting again and the
default ePID may not work any longer.
-r1 instructs vlmcsd to generate random ePIDs when the program
starts or receives a SIGHUP signal and uses these ePIDs until it
is stopped or receives another SIGHUP. Most other KMS emulators
generate a new ePID on every KMS request. This is easily
detectable. Microsoft could just modify sppsvc.exe in a way that
it always sends two identical KMS requests in two RPC requests
but over the same TCP connection. If both KMS responses contain
the different ePIDs, the KMS server is not genuine. -r1 is the
default mode. -r1 also ensures that all three ePIDs (Windows,
Office 2010 and Office 2013) use the same OS build number and
LCID (language id).
If vlmcsd has been started by an internet superserver, -r1 works
almost identically to -r2. The only exception occurs if you send
more than one activation request over the same TCP connection.
This is simply due to the fact that vlmcsd is started upon a
connection request and does not stay in memory after servicing a
KMS request. Consider using -r0 or -w, -0, -3 and -6 when start
ing vlmcsd by an internet superserver.
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
very easy emulator detection.
-C LCID
Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the
command line or an ini file.
By default vlmcsd generates a valid locale id that is recognized
by .NET Framework 4.0. This may lead to a locale id which is
unlikely to occur in your country, for instance 2155 for "Quecha
- Ecuador". You may want to select the locale id of your country
instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/
bb964664.aspx⟩ for a list of valid LCIDs. Please note that some
of them are not recognized by .NET Framework 4.0.
Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033.
-K0, -K1, -K2 and -K3
Sets the whitelisting level to determine which products vlmcsd
activates or refuses. The default is -K0.
-K0: activate all products with an unknown, retail or
beta/preview KMS ID.
-K1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
-K2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
-K3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
new version of vlmcsd is available.
-c0 and -c1
-c1 causes vlmcsd to check if the client time differs no more
than four hours from the system time. -c0 (the default) disables
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
four hours from each other. If both requests succeed, the server
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
system time after you started vlmcsd.
-M0 and -M1
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre
vent emulator detection. By maintaing a CMID list, vlmcsd
reports current active clients exactly like a genuine KMS emula
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
reports current active clients as good as possible. If no client
sends an "overcharge request", it is not possible to detect vlm
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
resources use it only if you really need it.
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main
tain any state in memory.
-E0 and -E1
These options are ignored if you do not also specify -M1. If you
use -E0 (the default), vlmcsd starts up as a fully "charged" KMS
server. Clients activate immediately. -E1 lets you start up vlm
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
reached, clients end up in HRESULT 0xC004F038 "The count
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
-R renewal-interval
Instructs clients to renew activation every renewal-interval.
The renewal-interval is a number optionally immediately followed
by a letter indicating the unit. Valid unit letters are s (sec
onds), m (minutes), h (hours), d (days) and w (weeks). If you do
not specify a letter, minutes is assumed.
-R3d for instance instructs clients to renew activation every 3
days. The default renewal-interval is 10080 (identical to 7d and
1w).
Due to poor implementation of Microsofts KMS Client it cannot be
guaranteed that activation is renewed on time as specfied by the
-R option. Don't care about that. Renewal will happen well
before your activation expires (usually 180 days).
Even though you can specify seconds, the granularity of this
option is 1 minute. Seconds are rounded down to the next multi
ple of 60.
-A activation-interval
Instructs clients to retry activation every activation-interval
if it was unsuccessful, e.g. because it could not reach the
server. The default is 120 (identical to 2h). activation-inter
val follows the same syntax as renewal-interval in the -R
option.
-s Installs vlmcsd as a Windows service. This option only works
with the native Windows version and Cygwin. Combine -s with
other command line options. These will be in effect when you
start the service. The service automatically starts when you
reboot your machine. To start it manually, type "net start vlm
csd".
If you use Cygwin, you must include your Cygwin system DLL
directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the
PATH environment variable or the service will not start.
You can reinstall the service anytime using vlmcsd -s again,
e.g. with a different command line. If the service is running,
it will be restarted with the new command line.
When using -s the command line is checked for basic syntax
errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error
but the service will not start if 1.2.3.4 is not an IP address
on your system.
-S Uninstalls the vlmcsd service. Works only with the native Win
dows version and Cygwin. All other options will be ignored if
you include -S in the command line.
-U [domain\]username
Can only be used together with -s. Starts the service as a dif
ferent user than the local SYSTEM account. This is used to run
the service under an account with low privileges. If you omit
the domain, an account from the local computer will be used.
You may use "NT AUTHORITY\NetworkService". This is a pseudo user
with low privileges. You may also use "NT AUTHORITY\LocalSer
vice" which has more privileges but these are of no use for run
ning vlmcsd.
Make sure that the user you specify has at least execute permis
sion for your executable. "NT AUTHORITY\NetworkService" normally
has no permission to run binaries from your home directory.
For your convenience you can use the special username "/l" as a
shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT
AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser
vice to run as "NT AUTHORITY\NetworkService".
-W password
Can only be used together with -s. Specifies a password for the
corresponding username you use with -U. SYSTEM, "NT AUTHOR
ITY\NetworkService", "NT AUTHORITY\LocalService" do not require
a password.
If you specify a user with even lower privileges than "NT
AUTHORITY\NetworkService", you must specify its password. You
also have to grant the "Log on as a service" right to that user.
SIGNALS
The following signals differ from the default behavior:
SIGTERM, SIGINT
These signals cause vlmcsd to exit gracefully. All global sema
phores and shared memory pages will be released, the pid file
will be unlinked (deleted) and a shutdown message will be
logged.
SIGHUP Causes vlmcsd to be restarted completely. This is useful if you
started vlmcsd with an ini file. You can modify the ini file
while vlmcsd is running and then sending SIGHUP, e.g. by typing
"killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm
csd.pid`".
The SIGHUP handler has been implemented relatively simple. It is
virtually the same as stopping vlmcsd and starting it again
immediately with the following exceptions:
— The new process does not get a new process id.
— If you used a pid file, it is not deleted and recreated
because the process id stays the same.
— If you used the 'user' and/or 'group' directive in an ini
file these are ignored. This is because once you switched to
lower privileged users and groups, there is no way back. Any
thing else would be a severe security flaw in the OS.
Signaling is not available in the native Windows version and in the
Cygwin version when it runs as Windows service.
SUPPORTED OPERATING SYSTEMS
vlmcsd compiles and runs on Linux, Windows (no Cygwin required but
explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly
BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or
unixoid OSses may work with unmodified sources or may require minor
porting efforts.
SUPPORTED PRODUCTS
vlmcsd can answer activation requests for the following products: Win
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1607),
Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Win
dows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010,
Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project
2016, Visio 2016. Newer version may work as long as the KMS protocol
does not change. A complete list of fully supported products can be
obtained using the -x option of vlmcs(1).
Office, Project and Visio must be volume license versions.
FILES
vlmcsd.ini(5)
EXAMPLES
vlmcsd -De
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
activation.
vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm
csd.log.
vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri
vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd".
BUGS
An ePID specified in an ini file must not contain spaces.
AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
SEE ALSO
vlmcsd.ini(5), vlmcsd(7), vlmcs(1), vlmcsdmulti(1)
Hotbird64 January 2017 VLMCSD(8)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -42,8 +42,8 @@
</h2>
<p style="margin-left:11%; margin-top: 1em">vlmcsd &minus;
a fully Microsoft compatible KMS server</p>
<p style="margin-left:11%; margin-top: 1em">vlmcsd - a
fully Microsoft compatible KMS server</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
@ -89,8 +89,27 @@ init system like <b>systemd</b>(8) or <b>launchd</b>(8)
using socket based activation. If <b>vlmcsd</b> detects that
<b>stdin</b>(3) is a socket, it assumes that there is
already a connected client on stdin that wants to be
activated. All options that control setting up listening
sockets will be ignored when in inetd mode.</p>
activated.</p>
<p style="margin-left:11%; margin-top: 1em">All options
that control setting up listening sockets will be ignored
when in inetd mode. The sockets will be set up by your
internet superserver. You also cannot limit the number of
simultanous clients (option <b>-m</b>). You need to
configure the limit in your internet superserver.</p>
<p style="margin-left:11%; margin-top: 1em">The followong
features that require that vlmcsd is permanently loaded will
not work if started from an internet superserver:</p>
<p style="margin-left:22%; margin-top: 1em">You cannot
maintain a client list (option <b>-M1</b>)</p>
<p style="margin-left:22%; margin-top: 1em">EPID
Randomization Level 1 (option <b>-r1</b>) works like Level 2
(<b>-r2</b>). You may want to use Level 0 (<b>-r0</b>) or
custom EPIDs (options <b>-w</b>, <b>-0</b>, <b>-3</b> and
<b>-6</b>) instead.</p>
<h2>OPTIONS
<a name="OPTIONS"></a>
@ -163,6 +182,90 @@ same link local address is used on more than one network
interface. Windows does not accept a name and the scope id
must be a number.</p>
<p style="margin-left:11%;"><b>-o</b> <i>level</i></p>
<p style="margin-left:22%;">Sets the <i>level</i> of
protection against activations from public IP addresses. The
default is <b>-o0</b> for no protection.</p>
<p style="margin-left:22%; margin-top: 1em"><b>-o1</b>
causes vlmcsd not to listen on all IP addresses but on
private IP addresses only. IPv4 addresses in the
100.64.0.0/10 range (see RFC6598) are not treated as private
since they can be reached from other users of your ISP.
Private IPv4 addresses are 10.0.0.0/8, 172.16.0.0/12,
192.168.0.0/16, 169.254.0.0/16 and 127.0.0.0/8. vlmcsd
treats all IPv6 addresses not within 2000::/3 as private
addresses.</p>
<p style="margin-left:22%; margin-top: 1em">If <b>-o1</b>
is combined with <b>-L</b>, it will listen on all private IP
addresses plus the ones specified by one or more <b>-L</b>
statements. If <b>-o1</b> is combined with <b>-P</b>, only
the last <b>-P</b> statement will be used.</p>
<p style="margin-left:22%; margin-top: 1em">Using
<b>-o1</b> does not protect you if you enable NAT port
forwarding on your router to your vlmcsd machine. It is
identical to using multiple -L statements with all of your
private IP addresses. What <b>-o1</b> does for you, is
automatically enumerating your private IP addresses.</p>
<p style="margin-left:22%; margin-top: 1em"><b>-o2</b> does
not affect the interfaces, vlmcsd is listening on. When a
clients connects, vlmcsd immediately drops the connection if
the client has a public IP address. Unlike <b>-o1</b>
clients will be able to establish a TCP connection but it
will be closed without a single byte sent over the
connection. This protects against clients with public IP
addresses even if NAT port forwarding is used. While
<b>-o2</b> offers a higher level of protection than
<b>-o1</b>, the client sees that the KMS TCP port (1688 by
default) is actually accepting connections.</p>
<p style="margin-left:22%; margin-top: 1em">If vlmcsd is
compiled to use MS RPC, <b>-o2</b> can only offer very poor
protection. Control is passed from MS RPC to vlmcsd after
the KMS protocol has already been negotiated. Thus a client
can always verify that the KMS protocol is available even
though it receives an RPC_S_ACCESS_DENIED error message.
vlmcsd will issue a warning if <b>-o2</b> is used with MS
RPC. <b>For adaequate protection do not use a MS RPC build
of vlmcsd with -o2</b>.</p>
<p style="margin-left:22%; margin-top: 1em"><b>-o3</b>
combines <b>-o1</b> and <b>-o2</b>. vlmcsd listens on
private interfaces only and if a public client manages to
connect anyway due to NAT port forwarding, it will be
immediately dropped.</p>
<p style="margin-left:22%; margin-top: 1em">If you use any
form of TCP level port forwarding (e.g. <b>nc</b>(1),
<b>netcat</b>(1), <b>ssh</b>(1) port forwarding or similar)
to redirect KMS requests to vlmcsd, there will be no
protection even if you use <b>-o2</b> or <b>-o3</b>. This is
due to the simple fact that vlmcsd sees the IP address of
the redirector and not the IP address of the client.</p>
<p style="margin-left:22%; margin-top: 1em"><b>-o1</b> (and
thus <b>-o3</b>) is not (yet) available in some
scenarios:</p>
<p style="margin-left:29%; margin-top: 1em">FreeBSD: There
is a longtime unfixed
<a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881">bug</a>
in the 32-bit ABI of the 64-bit kernel. If you have a 64-bit
FreeBSD kernel, you must run the 64-bit version of vlmcsd if
you use <b>-o1</b> or <b>-o3</b>. The 32-bit version causes
undefined behavior up to crashing vlmcsd. Other BSDs
(NetBSD, OpenBSD, Dragonfly and Mac OS X) work
correctly.</p>
<p style="margin-left:29%; margin-top: 1em">If vlmcsd was
started by an internet superserver or was compiled to use
Microsoft RPC (Windows only) or simple sockets, <b>-o1</b>
and <b>-o3</b> are not available by design.</p>
<p style="margin-left:11%;"><b>-P</b> <i>port</i></p>
<p style="margin-left:22%;">Use TCP <i>port</i> for all
@ -170,6 +273,116 @@ subsequent <b>-L</b> statements that do not include an
optional port. If you use <b>-P</b> and <b>-L</b>, <b>-P</b>
must be specified before <b>-L</b>.</p>
<p style="margin-left:11%;"><b>-O</b>
<i>vpn-adapter-name</i>[=<i>ipv4-address</i>][/<i>cidr-mask</i>][:<i>dhcp-lease-duration</i>]</p>
<p style="margin-left:22%;">Enables a compatible VPN
adapter to create additional local IPv4 addresses (like
127.0.0.1) that appear as remote IPv4 addresses to the
system. This allows product activation using a local
instance of vlmcsd. This feature is only available in
Windows and Cygwin builds of vlmcsd since it is not of any
use on other operating systems. Compatible VPN adapters are
Tap-windows version 8.2 or higher (from OpenVPN) and the
TeamViewer VPN adapter. There are two special
<i>vpn-adapter-name</i>s. A single period (.) instructs
vlmcsd to use the first available compatible VPN adapter. A
single dash (-) disables the use of a VPN adapter if one has
been configured in <b>vlmcsd.ini</b>(5). The
<i>vpn-adapter-name</i> is <b>not</b> case-sensitive. If the
<i>vpn-adapter-name</i> contains spaces (e.g. Ethernet 3),
you must enclose it in quotes.</p>
<p style="margin-left:22%; margin-top: 1em">The default
<i>ipv4-address</i> is 10.10.10.9 and the default
<i>cidr-mask</i> is 30. If you are using the default values,
your VPN adapter uses an IPv4 address of 10.10.10.9 and you
can set your activation client to use the easy to remember
address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript
ospp.vbs /sethst:10.10.10.10).</p>
<p style="margin-left:22%; margin-top: 1em">The
<i>dhcp-lease-duration</i> is a number optionally followed
by s, m, h, d or w to indicate seconds, minutes, hours, days
or weeks. The default <i>dhcp-lease-duration</i> is 1d (one
day). It is normally not required to change this value.</p>
<p style="margin-left:22%; margin-top: 1em">It is advised
not to manually configure your OpenVPN TAP or TeamViewer VPN
adapter in &quot;Network Connections&quot;. If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the <b>-O</b> parameter. It is safe
leave the IPv4 configuration to automatic (DHCP). vlmcsd
will wait up to four seconds for the DHCP configuration to
complete before binding to and listenin on any
interfaces.</p>
<p style="margin-left:22%; margin-top: 1em">You should be
aware that only one program can use a VPN adapter at a time.
If you use the TeamViewer VPN adapter for example, you will
not be able to use the VPN feature of TeamViewer as long as
vlmcsd is running. The same applies to OpenVPN TAP adapters
that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid
conflicts is to install Tap-Windows from OpenVPN, cd to
C:\Program Files\TAP-Windows\bin and run addtap.bat to
install an additional TAP adapter. Go to &quot;Network
Connections&quot; and rename the new adapter to
&quot;vlmcsd&quot; and specify <b>-O vlmcsd</b> to use
it.</p>
<p style="margin-left:22%; margin-top: 1em">Example: <b>-O
&quot;Ethernet 7&quot;=192.168.123.1/24</b> (uses VPN
adapter Ethernet 7 with IPv4 address 192.168.123.1 and have
192.168.123.2 to 192.168.123.254 as additional local (but
apparently remote) IPv4 addresses.</p>
<p style="margin-left:11%;"><b>-x0</b> and <b>-x1</b></p>
<p style="margin-left:22%;">Controls under what
circumstances vlmcsd will exit. Using the default of
<b>-x0</b> vlmcsd stays active as long as it can perform
some useful operations. If vlmcsd is run by any form of a
watchdog, e.g. NT service manager (Windows), systemd (Linux)
or launchd (Mac OS / iOS), it may be desirable to end vlmcsd
and let the watchdog restart it. This is especially true if
some pre-requisites are not yet met but will be some time
later, e.g. network is not yet fully setup.</p>
<p style="margin-left:22%; margin-top: 1em">By using
<b>-x0</b> vlmcsd will</p>
<p style="margin-left:29%; margin-top: 1em">exit if none of
the listening sockets specified with <b>-L</b> can be used.
It continues if at least one socket can be setup for
listening.</p>
<p style="margin-left:29%; margin-top: 1em">exit any TAP
mirror thread (Windows version only) if there is an error
condition while reading or writing from or to the VPN
adapter but continue to work without utilizing a VPN
adapter.</p>
<p style="margin-left:22%; margin-top: 1em">By using
<b>-x1</b> vlmcsd will</p>
<p style="margin-left:29%; margin-top: 1em">exit if not all
listening sockets specified with <b>-L</b> can be used.</p>
<p style="margin-left:29%; margin-top: 1em">exit completely
if there is a problem with a VPN adapter it is using. This
can happen for instance if the VPN adapter has been disabled
using &quot;Control Panel - Network - Adapter Settings&quot;
while vlmcsd is using it.</p>
<p style="margin-left:22%; margin-top: 1em">Please note
that <b>-x1</b> is kind of a workaround option. While it may
help under some circumstances, it is better to solve the
problem at its origin, e.g. properly implementing
dependencies in your startup script to ensure all network
interfaces and the VPN adapter you will use are completely
setup before you start vlmcsd.</p>
<p style="margin-left:11%;"><b>-F0</b> and <b>-F1</b></p>
<p style="margin-left:22%;">Allow (<b>-F1</b>) or disallow
@ -286,6 +499,18 @@ service (/dev/log) installed, logging output will go to
Windows version. The Cygwin version does support syslog
logging.</p>
<p style="margin-left:11%;"><b>-T0</b> and <b>-T1</b></p>
<p style="margin-left:22%;">Disable (<b>-T0</b>) or enable
(<b>-T1</b>) the inclusion of date and time in each line of
the log. The default is <b>-T1</b>. <b>-T0</b> is useful if
you log to <b>stdout</b>(3) which is redirected to another
logging mechanism that already includes date and time in its
output, for instance <b>systemd-journald</b>(8). If you log
to <b>syslog</b>(3), <b>-T1</b> is ignored and date and time
will never be included in the output sent to
<b>syslog</b>(3).</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
@ -405,9 +630,15 @@ is disregarded for Office 2010.</p>
<p style="margin-left:11%;"><b>-3</b> <i>ePID</i></p>
<p style="margin-left:22%;">Use <i>ePID</i> as Office
2013/2016 ePID (including Project and Visio). If specified,
<b>-r</b> is disregarded for Office 2013/2016.</p>
<p style="margin-left:22%;">Use <i>ePID</i> as Office 2013
ePID (including Project and Visio). If specified, <b>-r</b>
is disregarded for Office 2013.</p>
<p style="margin-left:11%;"><b>-6</b> <i>ePID</i></p>
<p style="margin-left:22%;">Use <i>ePID</i> as Office 2016
ePID (including Project and Visio). If specified, <b>-r</b>
is disregarded for Office 2016.</p>
<p style="margin-left:11%;"><b>-H</b> <i>HwId</i></p>
@ -442,6 +673,20 @@ been compiled to use a default configuration file (often
/etc/vlmcsd.ini), you may use <b>-i-</b> to ignore the
default configuration file.</p>
<p style="margin-left:11%;"><b>-j</b> <i>filename</i></p>
<p style="margin-left:22%;">Use KMS data file
<i>filename</i>. By default vlmcsd only contains the minimum
product data that is required to perform all operations
correctly. You may use a more complete KMS data file that
contains all detailed product names. This is especially
useful if you are logging KMS requests. If you don&rsquo;t
log, there is no need to load an external KMS data file.</p>
<p style="margin-left:22%; margin-top: 1em">If vlmcsd has
been compiled to use a default KMS data file, you may use
<b>-j-</b> to ignore the default configuration file.</p>
<p style="margin-left:11%;"><b>-r0</b>, <b>-r1</b>
(default) and <b>-r2</b></p>
@ -452,14 +697,14 @@ ePIDs are generated if</p>
sprecify an ePID in the command line and <br>
- you haven&rsquo;t used <b>-i</b> or <br>
- the file specified by <b>-i</b> cannot be opened or <br>
- the file specified by <b>-i</b> does not contain the
<i>application-guid</i> for the KMS request</p>
- the file specified by <b>-i</b> does not contain an ePID
for the KMS request</p>
<p style="margin-left:22%; margin-top: 1em"><b>-r0</b>
means there are no random ePIDs. vlmcsd simply issues
default ePIDs that are built into the binary at compile
time. <b>Pro:</b> behaves like real KMS server that also
always issues the same ePID. <b>Con</b>: Microsoft may start
always issues the same ePID. <b>Con:</b> Microsoft may start
blacklisting again and the default ePID may not work any
longer.</p>
@ -479,17 +724,19 @@ id).</p>
<p style="margin-left:22%; margin-top: 1em">If vlmcsd has
been started by an internet superserver, <b>-r1</b> works
identically to <b>-r2</b>. This is simply due to the fact
that vlmcsd is started upon a connection request and does
not stay in memory after servicing a KMS request.</p>
almost identically to <b>-r2</b>. The only exception occurs
if you send more than one activation request over the same
TCP connection. This is simply due to the fact that vlmcsd
is started upon a connection request and does not stay in
memory after servicing a KMS request. Consider using
<b>-r0</b> or <b>-w</b>, <b>-0</b>, <b>-3</b> and <b>-6 when
starting vlmcsd by an internet superserver.</b></p>
<p style="margin-left:22%; margin-top: 1em"><b>-r2</b>
behaves like most other KMS server emulators with random
support and generates a new random ePID on every request.
Use this mode with &quot;care&quot;. However since Microsoft
currently does not seem to do any verification of the ePID,
you currently don&rsquo;t need to pay attention to ePIDs at
all.</p>
<b>-r2</b> should be treated as debugging option only
because it allows very easy emulator detection.</p>
<p style="margin-left:11%;"><b>-C</b> <i>LCID</i></p>
@ -514,6 +761,99 @@ them are not recognized by .NET Framework 4.0.</p>
emulators use a fixed <i>LCID</i> of 1033 (English - US). To
achive the same behavior in vlmcsd use <b>-C 1033</b>.</p>
<p style="margin-left:11%;"><b>-K0</b>, <b>-K1</b>,
<b>-K2</b> and <b>-K3</b></p>
<p style="margin-left:22%;">Sets the whitelisting level to
determine which products vlmcsd activates or refuses. The
default is <b>-K0</b>.</p>
<p style="margin-left:29%; margin-top: 1em"><b>-K0</b>:
activate all products with an unknown, retail or
beta/preview KMS ID. <b><br>
-K1</b>: activate products with a retail or beta/preview KMS
ID but refuse to activate products with an unknown KMS ID.
<b><br>
-K2</b>: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID. <b><br>
-K3</b>: activate only products with a known volume license
RTM KMS ID and refuse all others.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="22%"></td>
<td width="78%">
<p>The SKU ID is not checked. Like a genuine KMS server
vlmcsd activates a product that has a random or unknown SKU
ID. If you select <b>-K1</b> or <b>-K3</b>, vlmcsd also
checks the Application ID for correctness. If Microsoft
introduces a new KMS ID for a new product, you cannot
activate it if you used <b>-K1</b> or <b>-K3</b> until a new
version of vlmcsd is available.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>-c0</b> and <b>-c1</b></p>
<p style="margin-left:22%;"><b>-c1</b> causes vlmcsd to
check if the client time differs no more than four hours
from the system time. <b>-c0</b> (the default) disables this
check. <b>-c1</b> is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send
two subsequent request with two time stamps that differ more
than four hours from each other. If both requests succeed,
the server is an emulator. If you specify <b>-c1</b> on a
system with no reliable time source, activations will fail.
It is ok to set the correct system time after you started
vlmcsd.</p>
<p style="margin-left:11%;"><b>-M0</b> and <b>-M1</b></p>
<p style="margin-left:22%;">Disables (<b>-M0</b>) or
enables (<b>-M1</b>) maintaining a list of client machine
IDs (CMIDs). The default is <b>-M0</b>. <b>-M1</b> is useful
to prevent emulator detection. By maintaing a CMID list,
vlmcsd reports current active clients exactly like a genuine
KMS emulator. This includes bug compatibility to the extent
that you can permanently kill a genuine KMS emulator by
sending an &quot;overcharge request&quot; with a required
client count of 376 or more and then request activation for
671 clients. vlmcsd can be reset from this condition by
restarting it. If <b>-M0</b> is used, vlmcsd reports current
active clients as good as possible. If no client sends an
&quot;overcharge request&quot;, it is not possible to detect
vlmcsd as an emulator with <b>-M0</b>. <b>-M1</b> requires
the allocation of a buffer that is about 50 kB in size. On
hardware with few memory resources use it only if you really
need it.</p>
<p style="margin-left:22%; margin-top: 1em">If you start
vlmcsd from an internet superserver, <b>-M1</b> cannot be
used. Since vlmcsd exits after each activation, it cannot
maintain any state in memory.</p>
<p style="margin-left:11%;"><b>-E0</b> and <b>-E1</b></p>
<p style="margin-left:22%;">These options are ignored if
you do not also specify <b>-M1</b>. If you use <b>-E0</b>
(the default), vlmcsd starts up as a fully
&quot;charged&quot; KMS server. Clients activate
immediately. <b>-E1</b> lets you start up vlmcsd with an
empty CMID list. Activation will start when the required
minimum clients (25 for Windows Client OSses, 5 for Windows
Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
reached, clients end up in HRESULT 0xC004F038 &quot;The
count reported by your Key Management Service (KMS) is
insufficient. Please contact your system
administrator&quot;. You may use <b>vlmcs</b>(1) or another
KMS client emulator to &quot;charge&quot; vlmcsd. <b>-E1</b>
does not improve emulator detection prevention. It&rsquo;s
primary purpose is to help developers of KMS clients to test
&quot;charging&quot; a KMS server.</p>
<p style="margin-left:11%;"><b>-R</b>
<i>renewal-interval</i></p>
@ -631,8 +971,8 @@ directory.</p>
convenience you can use the special username &quot;/l&quot;
as a shortcut for &quot;NT AUTHORITY\LocalService&quot; and
&quot;/n&quot; for &quot;NT AUTHORITY\NetworkService&quot;.
&quot;vlmcsd&nbsp;&minus;s&nbsp;&minus;U&nbsp;/n&quot;
installs the service to run as &quot;NT
&quot;vlmcsd&nbsp;-s&nbsp;-U&nbsp;/n&quot; installs the
service to run as &quot;NT
AUTHORITY\NetworkService&quot;.</p>
<p style="margin-left:11%;"><b>-W</b> <i>password</i></p>
@ -754,11 +1094,15 @@ sources or may require minor porting efforts.</p>
<p style="margin-left:11%; margin-top: 1em"><b>vlmcsd</b>
can answer activation requests for the following products:
Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows
10, Windows Server 2008, Windows Server 2008 R2, Windows
Server 2012, Windows Server 2012 R2, Office 2010, Project
2010, Visio 2010, Office 2013, Project 2013, Visio 2013,
Office 2016, Project 2016, Visio 2016.</p>
Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10
(up to 1607), Windows Server 2008, Windows Server 2008 R2,
Windows Server 2012, Windows Server 2012 R2, Windows Server
2016, Office 2010, Project 2010, Visio 2010, Office 2013,
Project 2013, Visio 2013, Office 2016, Project 2016, Visio
2016. Newer version may work as long as the KMS protocol
does not change. A complete list of fully supported products
can be obtained using the <b>-x</b> option of
<b>vlmcs</b>(1).</p>
<p style="margin-left:11%; margin-top: 1em">Office, Project
and Visio must be volume license versions.</p>
@ -777,7 +1121,7 @@ and Visio must be volume license versions.</p>
<p style="margin-left:11%; margin-top: 1em"><b>vlmcsd
-f</b></p>
-De</b></p>
<p style="margin-left:22%;">Starts <b>vlmcsd</b> in
foreground. Useful if you use it for the first time and want
@ -814,12 +1158,6 @@ C:\logs\vlmcsd.log when the service is started with
<p style="margin-left:11%; margin-top: 1em">An ePID
specified in an ini file must not contain spaces.</p>
<p style="margin-left:11%; margin-top: 1em">The maximum
number of <b>-L</b> options in the command line or listen
statements in the inifile is the platform default for
<i>FD_SETSIZE</i>. This is 64 on Windows and 1024 on most
Unixes.</p>
<h2>AUTHOR
<a name="AUTHOR"></a>
</h2>

BIN
man/vlmcsd.8.pdf Normal file

Binary file not shown.

800
man/vlmcsd.8.unix.txt Normal file
View File

@ -0,0 +1,800 @@
VLMCSD(8) KMS Activation Manual VLMCSD(8)
NAME
vlmcsd - a fully Microsoft compatible KMS server
SYNOPSIS
vlmcsd [ options ]
DESCRIPTION
vlmcsd is a fully Microsoft compatible KMS server that provides product
activation services to clients. It is meant as a drop-in replacement
for a Microsoft KMS server (Windows computer with KMS key entered). It
currently supports KMS protocol versions 4, 5 and 6.
vlmcsd is designed to run on POSIX compatible operating systens. It
only requires a basic C library with a BSD-style sockets API and either
fork(2) or pthreads(7). That allows it to run on most embedded systems
like routers, NASes, mobile phones, tablets, TVs, settop boxes, etc.
Some efforts have been made that it also runs on Windows.
Although vlmcsd does neither require an activation key nor a payment to
anyone, it is not meant to run illegal copies of Windows. Its purpose
is to ensure that owners of legal copies can use their software without
restrictions, e.g. if you buy a new computer or motherboard and your
key will be refused activation from Microsoft servers due to hardware
changes.
vlmcsd may be started via an internet superserver like inetd(8) or
xinetd(8) as well as an advanced init system like systemd(8) or
launchd(8) using socket based activation. If vlmcsd detects that
stdin(3) is a socket, it assumes that there is already a connected
client on stdin that wants to be activated.
All options that control setting up listening sockets will be ignored
when in inetd mode. The sockets will be set up by your internet super
server. You also cannot limit the number of simultanous clients (option
-m). You need to configure the limit in your internet superserver.
The followong features that require that vlmcsd is permanently loaded
will not work if started from an internet superserver:
You cannot maintain a client list (option -M1)
EPID Randomization Level 1 (option -r1) works like Level 2
(-r2). You may want to use Level 0 (-r0) or custom EPIDs
(options -w, -0, -3 and -6) instead.
OPTIONS
Since vlmcsd can be configured at compile time, some options may not be
available on your system.
All options that do no require an argument may be combined with a sin
gle dash, for instance "vlmcsd -D -e" is identical to "vlmcsd -De". For
all options that require an argument a space between the option and the
option argument is optional. Thus "vlmcsd -r 2" and "vlmcsd -r2" are
identical too.
-h or -?
Displays help.
-V Displays extended version information. This includes the com
piler used to build vlmcsd, the intended platform and flags
(compile time options) to build vlmcsd. If you have the source
code of vlmcsd, you can type make help (or gmake help on systems
that do not use the GNU version of make(1) by default) to see
the meaning of those flags.
-L ipaddress[:port]
Instructs vlmcsd to listen on ipaddress with optional port
(default 1688). You can use this option more than once. If you
do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and
:: (IPv6) are used. If the IP address contains colons (IPv6) you
must enclose the IP address in brackets if you specify the
optional port, e.g. [2001:db8::dead:beef]:1688.
If no port is specified, vlmcsd uses the default port according
to a preceding -P option. If you specify a port, it can be a
number (1-65535) or a name (usually found in /etc/services if
not provided via LDAP, NIS+ or another name service).
If you specify a link local IPv6 address (fe80::/10, usually
starting with fe80::), it must be followed by a percent sign (%)
and a scope id (=network interface name or number) on most
unixoid OSses including Linux, Android, MacOS X and iOS, e.g.
fe80::1234:56ff:fe78:9abc%eth0 or
[fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin)
does not require a scope id unless the same link local address
is used on more than one network interface. Windows does not
accept a name and the scope id must be a number.
-o level
Sets the level of protection against activations from public IP
addresses. The default is -o0 for no protection.
-o1 causes vlmcsd not to listen on all IP addresses but on pri
vate IP addresses only. IPv4 addresses in the 100.64.0.0/10
range (see RFC6598) are not treated as private since they can be
reached from other users of your ISP. Private IPv4 addresses are
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 and
127.0.0.0/8. vlmcsd treats all IPv6 addresses not within
2000::/3 as private addresses.
If -o1 is combined with -L, it will listen on all private IP
addresses plus the ones specified by one or more -L statements.
If -o1 is combined with -P, only the last -P statement will be
used.
Using -o1 does not protect you if you enable NAT port forwarding
on your router to your vlmcsd machine. It is identical to using
multiple -L statements with all of your private IP addresses.
What -o1 does for you, is automatically enumerating your private
IP addresses.
-o2 does not affect the interfaces, vlmcsd is listening on. When
a clients connects, vlmcsd immediately drops the connection if
the client has a public IP address. Unlike -o1 clients will be
able to establish a TCP connection but it will be closed without
a single byte sent over the connection. This protects against
clients with public IP addresses even if NAT port forwarding is
used. While -o2 offers a higher level of protection than -o1,
the client sees that the KMS TCP port (1688 by default) is actu
ally accepting connections.
If vlmcsd is compiled to use MS RPC, -o2 can only offer very
poor protection. Control is passed from MS RPC to vlmcsd after
the KMS protocol has already been negotiated. Thus a client can
always verify that the KMS protocol is available even though it
receives an RPC_S_ACCESS_DENIED error message. vlmcsd will issue
a warning if -o2 is used with MS RPC. For adaequate protection
do not use a MS RPC build of vlmcsd with -o2.
-o3 combines -o1 and -o2. vlmcsd listens on private interfaces
only and if a public client manages to connect anyway due to NAT
port forwarding, it will be immediately dropped.
If you use any form of TCP level port forwarding (e.g. nc(1),
netcat(1), ssh(1) port forwarding or similar) to redirect KMS
requests to vlmcsd, there will be no protection even if you use
-o2 or -o3. This is due to the simple fact that vlmcsd sees the
IP address of the redirector and not the IP address of the
client.
-o1 (and thus -o3) is not (yet) available in some scenarios:
FreeBSD: There is a longtime unfixed bug ⟨https://
bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881⟩ in the
32-bit ABI of the 64-bit kernel. If you have a 64-bit Free
BSD kernel, you must run the 64-bit version of vlmcsd if
you use -o1 or -o3. The 32-bit version causes undefined
behavior up to crashing vlmcsd. Other BSDs (NetBSD, Open
BSD, Dragonfly and Mac OS X) work correctly.
If vlmcsd was started by an internet superserver or was
compiled to use Microsoft RPC (Windows only) or simple
sockets, -o1 and -o3 are not available by design.
-P port
Use TCP port for all subsequent -L statements that do not
include an optional port. If you use -P and -L, -P must be spec
ified before -L.
-O vpn-adapter-name[=ipv4-address][/cidr-mask][:dhcp-lease-duration]
Enables a compatible VPN adapter to create additional local IPv4
addresses (like 127.0.0.1) that appear as remote IPv4 addresses
to the system. This allows product activation using a local
instance of vlmcsd. This feature is only available in Windows
and Cygwin builds of vlmcsd since it is not of any use on other
operating systems. Compatible VPN adapters are Tap-windows ver
sion 8.2 or higher (from OpenVPN) and the TeamViewer VPN
adapter. There are two special vpn-adapter-names. A single
period (.) instructs vlmcsd to use the first available compati
ble VPN adapter. A single dash (-) disables the use of a VPN
adapter if one has been configured in vlmcsd.ini(5). The vpn-
adapter-name is not case-sensitive. If the vpn-adapter-name con
tains spaces (e.g. Ethernet 3), you must enclose it in quotes.
The default ipv4-address is 10.10.10.9 and the default cidr-mask
is 30. If you are using the default values, your VPN adapter
uses an IPv4 address of 10.10.10.9 and you can set your activa
tion client to use the easy to remember address 10.10.10.10
(e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs
/sethst:10.10.10.10).
The dhcp-lease-duration is a number optionally followed by s, m,
h, d or w to indicate seconds, minutes, hours, days or weeks.
The default dhcp-lease-duration is 1d (one day). It is normally
not required to change this value.
It is advised not to manually configure your OpenVPN TAP or
TeamViewer VPN adapter in "Network Connections". If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the -O parameter. It is safe leave the
IPv4 configuration to automatic (DHCP). vlmcsd will wait up to
four seconds for the DHCP configuration to complete before bind
ing to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter
at a time. If you use the TeamViewer VPN adapter for example,
you will not be able to use the VPN feature of TeamViewer as
long as vlmcsd is running. The same applies to OpenVPN TAP
adapters that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid con
flicts is to install Tap-Windows from OpenVPN, cd to C:\Program
Files\TAP-Windows\bin and run addtap.bat to install an addi
tional TAP adapter. Go to "Network Connections" and rename the
new adapter to "vlmcsd" and specify -O vlmcsd to use it.
Example: -O "Ethernet 7"=192.168.123.1/24 (uses VPN adapter Eth
ernet 7 with IPv4 address 192.168.123.1 and have 192.168.123.2
to 192.168.123.254 as additional local (but apparently remote)
IPv4 addresses.
-x0 and -x1
Controls under what circumstances vlmcsd will exit. Using the
default of -x0 vlmcsd stays active as long as it can perform
some useful operations. If vlmcsd is run by any form of a watch
dog, e.g. NT service manager (Windows), systemd (Linux) or
launchd (Mac OS / iOS), it may be desirable to end vlmcsd and
let the watchdog restart it. This is especially true if some
pre-requisites are not yet met but will be some time later, e.g.
network is not yet fully setup.
By using -x0 vlmcsd will
exit if none of the listening sockets specified with -L can
be used. It continues if at least one socket can be setup
for listening.
exit any TAP mirror thread (Windows version only) if there
is an error condition while reading or writing from or to
the VPN adapter but continue to work without utilizing a
VPN adapter.
By using -x1 vlmcsd will
exit if not all listening sockets specified with -L can be
used.
exit completely if there is a problem with a VPN adapter it
is using. This can happen for instance if the VPN adapter
has been disabled using "Control Panel - Network - Adapter
Settings" while vlmcsd is using it.
Please note that -x1 is kind of a workaround option. While it
may help under some circumstances, it is better to solve the
problem at its origin, e.g. properly implementing dependencies
in your startup script to ensure all network interfaces and the
VPN adapter you will use are completely setup before you start
vlmcsd.
-F0 and -F1
Allow (-F1) or disallow (-F0) binding to IP addresses that are
currently not configured on your system. The default is -F0. -F1
allows you to bind to an IP address that may be configured after
you started vlmcsd. vlmcsd will listen on that address as soon
as it becomes available. This feature is only available under
Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows
this feature only for the root user (more correctly: processes
that have the PRIV_NETINET_BINDANY privilege). Linux does not
require a capability for this.
-t seconds
Timeout the TCP connection with the client after seconds sec
onds. After sending an activation request. RPC keeps the TCP
connection for a while. The default is 30 seconds. You may spec
ify a shorter period to free ressources on your device faster.
This is useful for devices with limited main memory or if you
used -m to limit the concurrent clients that may request activa
tion. Microsoft RPC clients disconnect after 30 seconds by
default. Setting seconds to a greater value does not make much
sense.
-m concurrent-clients
Limit the number of clients that will be handled concurrently.
This is useful for devices with limited ressources or if you are
experiencing DoS attacks that spawn thousands of threads or
forked processes. If additional clients connect to vlmcsd, they
need to wait until another client disconnects. If you set con
current-clients to a small value ( <10 ), you should also select
a reasonable timeout of 2 or 3 seconds with -t. The default is
no limit.
-d Disconnect each client after processing one activation request.
This is a direct violation of DCE RPC but may help if you
receive malicous fake RPC requests that block your threads or
forked processes. Some other KMS emulators (e.g. py-kms) behave
this way.
-k Do not disconnect clients after processing an activation
request. This selects the default behavior. -k is useful only if
you used an ini file (see vlmcsd.ini(5) and -i). If the ini file
contains the line "DisconnectClientsImmediately = true", you can
use this switch to restore the default behavior.
-N0 and -N1
Disables (-N0) or enables (-N1) the use of the NDR64 transfer
syntax in the RPC protocol. Unlike Microsoft vlmcsd supports
NDR64 on 32-bit operating systems. Microsoft introduced NDR64 in
Windows Vista but their KMS servers started using it with Win
dows 8. Thus if you choose random ePIDs, vlmcsd will select
ePIDs with build numbers 9200 and 9600 if you enable NDR64 and
build numbers 6002 and 7601 if you disable NDR64. The default is
to enable NDR64.
-B0 and -B1
Disables (-B0) or enables (-B1) bind time feature negotiation
(BTFN) in the RPC protocol. All Windows operating systems start
ing with Vista support BTFN and try to negotiate it when initi
ating an RPC connection. Thus consider turning it off as a debug
/ troubleshooting feature only. Some older firewalls that selec
tively block or redirect RPC traffic may get confused when they
detect NDR64 or BTFN.
-l filename
Use filename as a log file. The log file records all activations
with IP address, Windows workstation name (no reverse DNS
lookup), activated product, KMS protocol, time and date. If you
do not specify a log file, no log is created. For a live view of
the log file type tail -f file.
If you use the special filename "syslog", vlmcsd uses syslog(3)
for logging. If your system has no syslog service (/dev/log)
installed, logging output will go to /dev/console. Syslog log
ging is not available in the native Windows version. The Cygwin
version does support syslog logging.
-T0 and -T1
Disable (-T0) or enable (-T1) the inclusion of date and time in
each line of the log. The default is -T1. -T0 is useful if you
log to stdout(3) which is redirected to another logging mecha
nism that already includes date and time in its output, for
instance systemd-journald(8). If you log to syslog(3), -T1 is
ignored and date and time will never be included in the output
sent to syslog(3).
-D Normally vlmcsd daemonizes and runs in background (except the
native Windows version). If -D is specified, vlmcsd does not
daemonize and runs in foreground. This is useful for testing and
allows you to simply press <Ctrl-C> to exit vlmcsd.
The native Windows version never daemonizes and always behaves
as if -D had been specified. You may want to install vlmcsd as a
service instead. See -s.
-e If specified, vlmcsd ignores -l and writes all logging output to
stdout(3). This is mainly useful for testing and debugging and
often combined with -D.
-v Use verbose logging. Logs every parameter of the base request
and the base response. It also logs the HWID of the KMS server
if KMS protocol version 6 is used. This option is mainly for
debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-e or -f.
-q Do not use verbose logging. This is actually the default behav
ior. It only makes sense if you use vlmcsd with an ini file (see
-i and vlmcsd.ini(5)). If the ini file contains the line
"LogVerbose = true" you can use -q to restore the default behav
ior.
-p filename
Create pid file filename. This has nothing to do with KMS ePIDs.
A pid file is a file where vlmcsd writes its own process id.
This is used by standard init scripts (typically found in
/etc/init.d). The default is not to write a pid file.
-u user and -g group
Causes vlmcsd to run in the specified user and group security
context. The main purpose for this is to drop root privileges
after it has been started from the root account. To use this
feature from cygwin you must run cyglsa-config and the account
from which vlmcsd is started must have the rights "Act as part
of the operating system" and "Replace a process level token".
The native Windows version does not support these options.
The actual security context switch is performed after the TCP
sockets have been created. This allows you to use privileged
ports (< 1024) when you start vlmcsd from the root account.
However if you use an ini, pid or log file, you must ensure that
the unprivileged user has access to these files. You can always
log to syslog(3) from an unprivileged account on most platforms
(see -l).
-w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for
Windows.
-0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010.
-3 ePID
Use ePID as Office 2013 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2013.
-6 ePID
Use ePID as Office 2016 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2016.
-H HwId
Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a
HWID from the command line.
HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The
following commands are identical:
vlmcsd -H 0123456789ABCDEF
vlmcsd -H 01:23:45:67:89:ab:cd:ef
vlmcsd -H "01 23 45 67 89 AB CD EF"
-i filename
Use configuration file (aka ini file) filename. Most configura
tion parameters can be set either via the command line or an ini
file. The command line always has precedence over configuration
items in the ini file. See vlmcsd.ini(5) for the format of the
configuration file.
If vlmcsd has been compiled to use a default configuration file
(often /etc/vlmcsd.ini), you may use -i- to ignore the default
configuration file.
-j filename
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con
tains all detailed product names. This is especially useful if
you are logging KMS requests. If you don't log, there is no need
to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
-r0, -r1 (default) and -r2
These options determine how ePIDs are generated if
- you did not sprecify an ePID in the command line and
- you haven't used -i or
- the file specified by -i cannot be opened or
- the file specified by -i does not contain an ePID for the KMS
request
-r0 means there are no random ePIDs. vlmcsd simply issues
default ePIDs that are built into the binary at compile time.
Pro: behaves like real KMS server that also always issues the
same ePID. Con: Microsoft may start blacklisting again and the
default ePID may not work any longer.
-r1 instructs vlmcsd to generate random ePIDs when the program
starts or receives a SIGHUP signal and uses these ePIDs until it
is stopped or receives another SIGHUP. Most other KMS emulators
generate a new ePID on every KMS request. This is easily
detectable. Microsoft could just modify sppsvc.exe in a way that
it always sends two identical KMS requests in two RPC requests
but over the same TCP connection. If both KMS responses contain
the different ePIDs, the KMS server is not genuine. -r1 is the
default mode. -r1 also ensures that all three ePIDs (Windows,
Office 2010 and Office 2013) use the same OS build number and
LCID (language id).
If vlmcsd has been started by an internet superserver, -r1 works
almost identically to -r2. The only exception occurs if you send
more than one activation request over the same TCP connection.
This is simply due to the fact that vlmcsd is started upon a
connection request and does not stay in memory after servicing a
KMS request. Consider using -r0 or -w, -0, -3 and -6 when start
ing vlmcsd by an internet superserver.
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
very easy emulator detection.
-C LCID
Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the
command line or an ini file.
By default vlmcsd generates a valid locale id that is recognized
by .NET Framework 4.0. This may lead to a locale id which is
unlikely to occur in your country, for instance 2155 for "Quecha
- Ecuador". You may want to select the locale id of your country
instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/
bb964664.aspx⟩ for a list of valid LCIDs. Please note that some
of them are not recognized by .NET Framework 4.0.
Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033.
-K0, -K1, -K2 and -K3
Sets the whitelisting level to determine which products vlmcsd
activates or refuses. The default is -K0.
-K0: activate all products with an unknown, retail or
beta/preview KMS ID.
-K1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
-K2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
-K3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
new version of vlmcsd is available.
-c0 and -c1
-c1 causes vlmcsd to check if the client time differs no more
than four hours from the system time. -c0 (the default) disables
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
four hours from each other. If both requests succeed, the server
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
system time after you started vlmcsd.
-M0 and -M1
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre
vent emulator detection. By maintaing a CMID list, vlmcsd
reports current active clients exactly like a genuine KMS emula
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
reports current active clients as good as possible. If no client
sends an "overcharge request", it is not possible to detect vlm
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
resources use it only if you really need it.
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main
tain any state in memory.
-E0 and -E1
These options are ignored if you do not also specify -M1. If you
use -E0 (the default), vlmcsd starts up as a fully "charged" KMS
server. Clients activate immediately. -E1 lets you start up vlm
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
reached, clients end up in HRESULT 0xC004F038 "The count
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
-R renewal-interval
Instructs clients to renew activation every renewal-interval.
The renewal-interval is a number optionally immediately followed
by a letter indicating the unit. Valid unit letters are s (sec
onds), m (minutes), h (hours), d (days) and w (weeks). If you do
not specify a letter, minutes is assumed.
-R3d for instance instructs clients to renew activation every 3
days. The default renewal-interval is 10080 (identical to 7d and
1w).
Due to poor implementation of Microsofts KMS Client it cannot be
guaranteed that activation is renewed on time as specfied by the
-R option. Don't care about that. Renewal will happen well
before your activation expires (usually 180 days).
Even though you can specify seconds, the granularity of this
option is 1 minute. Seconds are rounded down to the next multi
ple of 60.
-A activation-interval
Instructs clients to retry activation every activation-interval
if it was unsuccessful, e.g. because it could not reach the
server. The default is 120 (identical to 2h). activation-inter
val follows the same syntax as renewal-interval in the -R
option.
-s Installs vlmcsd as a Windows service. This option only works
with the native Windows version and Cygwin. Combine -s with
other command line options. These will be in effect when you
start the service. The service automatically starts when you
reboot your machine. To start it manually, type "net start vlm
csd".
If you use Cygwin, you must include your Cygwin system DLL
directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the
PATH environment variable or the service will not start.
You can reinstall the service anytime using vlmcsd -s again,
e.g. with a different command line. If the service is running,
it will be restarted with the new command line.
When using -s the command line is checked for basic syntax
errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error
but the service will not start if 1.2.3.4 is not an IP address
on your system.
-S Uninstalls the vlmcsd service. Works only with the native Win
dows version and Cygwin. All other options will be ignored if
you include -S in the command line.
-U [domain\]username
Can only be used together with -s. Starts the service as a dif
ferent user than the local SYSTEM account. This is used to run
the service under an account with low privileges. If you omit
the domain, an account from the local computer will be used.
You may use "NT AUTHORITY\NetworkService". This is a pseudo user
with low privileges. You may also use "NT AUTHORITY\LocalSer
vice" which has more privileges but these are of no use for run
ning vlmcsd.
Make sure that the user you specify has at least execute permis
sion for your executable. "NT AUTHORITY\NetworkService" normally
has no permission to run binaries from your home directory.
For your convenience you can use the special username "/l" as a
shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT
AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser
vice to run as "NT AUTHORITY\NetworkService".
-W password
Can only be used together with -s. Specifies a password for the
corresponding username you use with -U. SYSTEM, "NT AUTHOR
ITY\NetworkService", "NT AUTHORITY\LocalService" do not require
a password.
If you specify a user with even lower privileges than "NT
AUTHORITY\NetworkService", you must specify its password. You
also have to grant the "Log on as a service" right to that user.
SIGNALS
The following signals differ from the default behavior:
SIGTERM, SIGINT
These signals cause vlmcsd to exit gracefully. All global sema
phores and shared memory pages will be released, the pid file
will be unlinked (deleted) and a shutdown message will be
logged.
SIGHUP Causes vlmcsd to be restarted completely. This is useful if you
started vlmcsd with an ini file. You can modify the ini file
while vlmcsd is running and then sending SIGHUP, e.g. by typing
"killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm
csd.pid`".
The SIGHUP handler has been implemented relatively simple. It is
virtually the same as stopping vlmcsd and starting it again
immediately with the following exceptions:
— The new process does not get a new process id.
— If you used a pid file, it is not deleted and recreated
because the process id stays the same.
— If you used the 'user' and/or 'group' directive in an ini
file these are ignored. This is because once you switched to
lower privileged users and groups, there is no way back. Any
thing else would be a severe security flaw in the OS.
Signaling is not available in the native Windows version and in the
Cygwin version when it runs as Windows service.
SUPPORTED OPERATING SYSTEMS
vlmcsd compiles and runs on Linux, Windows (no Cygwin required but
explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly
BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or
unixoid OSses may work with unmodified sources or may require minor
porting efforts.
SUPPORTED PRODUCTS
vlmcsd can answer activation requests for the following products: Win
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1607),
Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Win
dows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010,
Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project
2016, Visio 2016. Newer version may work as long as the KMS protocol
does not change. A complete list of fully supported products can be
obtained using the -x option of vlmcs(1).
Office, Project and Visio must be volume license versions.
FILES
vlmcsd.ini(5)
EXAMPLES
vlmcsd -De
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
activation.
vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm
csd.log.
vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri
vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd".
BUGS
An ePID specified in an ini file must not contain spaces.
AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
SEE ALSO
vlmcsd.ini(5), vlmcsd(7), vlmcs(1), vlmcsdmulti(1)
Hotbird64 January 2017 VLMCSD(8)

212
man/vlmcsd.ini.5 Normal file
View File

@ -0,0 +1,212 @@
.TH VLMCSD.INI 5 "January 2017" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
\fBvlmcsd.ini\fR \- vlmcsd KMS emulator configuration file
.SH SYNOPSIS
.B vlmcsd.ini
.SH DESCRIPTION
\fBvlmcsd.ini\fR (or simply called the "ini file") is a configuration file for \fBvlmcsd\fR(8). By default vlmcsd does not use a configuration file. It is completely optional and for advanced users only. You must use the \fB-i\fR option on the vlmcsd command line to use an ini file. There is no default name or default location for the ini file.
.PP
Everything, that can be configured in the ini file, may also be specified on the command line. Any configuration option specified on the command line takes precedence over the respective configuration line in the ini file.
.PP
\fBBenefits of a configuration file\fR
.PP
While you can use the configuration file to simply modify the default behavior of vlmcsd, it can also be used to change the configuration of vlmcsd after you sent a HUP \fBsignal\fR(7). Whenever you send SIGHUP, the configuration file will be re-read. Any changes you made to the ini file will be reflected after vlmcsd received the hangup signal.
.PP
\fBDifferences between command line and configuration file\fR
.PP
If you specify an illegal option or option argument on the command line, vlmcsd displays help and exits. If you specify an incorrect \fIkeyword\fR or \fIargument\fR in the ini file, vlmcsd displays a warning with some information, ignores the respective line and continues. This is intentional and prevents vlmcsd from aborting after a SIGHUP if the configuration was modified incorrectly.
.SH SYNTAX
vlmcsd.ini is a UTF-8 encoded text file with each line being in the format \fIkeyword\fR = \fIargument\fR. The \fIkeyword\fR is not case-sensitive. The \fIargument\fR is treated literally. It is neither required nor allowed to enclose the \fIargument\fR in any form of quote characters except when quote characters are part of the argument itself. Whitespace characters are ignored only
- at the beginning of a line
.br
- between the \fIkeyword\fR and '='
.br
- between '=' and the \fIargument\fR
Lines, that start with '#' or ';' are treated as comments. Empty lines are ignored as well. If a \fIkeyword\fR is repeated in another line, vlmcsd will use the \fIargument\fR of the last occurence of the \fIkeyword\fR. An exception to this is the Listen \fIkeyword\fR which can be specified multiple times and causes vlmcsd to listen on more than one IP address and/or port.
.PP
Some \fIargument\fRs are binary arguments that need to be either TRUE or FALSE. You can use "Yes", "On" or "1" as an alias for TRUE and "No", "Off" or "0" as an alias for FALSE. Binary arguments are case-insensitive.
.SH KEYWORDS
The following \fIkeyword\fRs are defined (not all keywords may be available depending on the operating system and the options used when \fBvlmcsd\fR(8) was compiled):
.IP "\fBListen\fR"
This defines on what combinations of IP addresses and ports vlmcsd should listen. \fBListen\fR can be specified more than once. The \fIargument\fR has the form \fIipaddress\fR[:\fIport\fR]. If you omit the \fIport\fR, the default port of 1688 is used. If the \fIipaddress\fR contains colons and a \fIport\fR is used, you must enclose the \fIipaddress\fR in brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4 and all IPv6 addresses. See the \fB-L\fR option in \fBvlmcsd\fR(8) for more info about the syntax. If you use \fB-L\fR or \fB-P\fR on the command line, all \fBListen\fR keywords in the ini file will be ignored. The \fBListen\fR keyword cannot be used if vlmcsd has been compiled to use Microsoft RPC (Windows and Cygwin only) or simple sockets.
Examples:
Listen = 192.168.1.123:1688
.br
Listen = 0.0.0.0:1234
.br
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
.IP "\fBPort\fR"
Can only be used if vlmcsd has been compiled to use simple sockets or on Windows and Cygwin if \fBvlmcsd\fR(8) has been compiled to use Microsoft RPC. Otherwise you must use \fBListen\fR instead. Causes vlmcsd to listen on that port instead of 1688.
.IP "\fBFreeBind\fR"
Can be TRUE or FALSE. If TRUE, you can use the \fBListen\fR keyword with IP addresses that are currently not defined on your system. \fBvlmcsd\fR(8) will start listening on these IP addresses as soon as they become available. This keyword is only available under Linux and FreeBSD because no other OS currently supports that feature. FreeBSD supports this only for IPv4 and requires the PRIV_NETINET_BINDANY privilege which is normally assigned to proccesses of the root user.
.IP "\fBPublicIPProtectionLevel\fR"
Set the level of protection against KMS activations from public IP addresses.
0 = No protection (default)
.br
1\ =\ Listen on private IP addresses only (plus those specified by one or more \fBListen\fR statements)
.br
2\ =\ Disconnect clients with public IP addresses without activating
.br
3\ =\ Combines 1 and 2
For details on public IP protection levels see \fBvlmcsd\fR(8) command line option \fB-o\fR.
.IP "\fBVPN\fR"
Has to be in the form \fIvpn-adapter-name\fR[=\fIipv4-address\fR][/\fIcidr-mask\fR][:\fIdhcp-lease-duration\fR].
Enables a compatible VPN adapter to create additional local IPv4 addresses (like 127.0.0.1) that appear as remote IPv4 addresses to the system. This allows product activation using a local instance of vlmcsd. This feature is only available in Windows and Cygwin builds of vlmcsd since it is not of any use on other operating systems. Compatible VPN adapters are Tap-windows version 8.2 or higher (from OpenVPN) and the TeamViewer VPN adapter. There is a special \fIvpn-adapter-name\fR. A single period (.) instructs vlmcsd to use the first available compatible VPN adapter. The \fIvpn-adapter-name\fR is \fBnot\fR case-sensitive. If the \fIvpn-adapter-name\fR contains spaces (e.g. Ethernet 3), do \fBnot\fR enclose it in quotes.
The default \fIipv4-address\fR is 10.10.10.9 and the default \fIcidr-mask\fR is 30. If you are using the default values, your VPN adapter uses an IPv4 address of 10.10.10.9 and you can set your activation client to use the easy to remember address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs /sethst:10.10.10.10).
The \fIdhcp-lease-duration\fR is a number optionally followed by s, m, h, d or w to indicate seconds, minutes, hours, days or weeks. The default \fIdhcp-lease-duration\fR is 1d (one day). It is normally not required to change this value.
It is advised not to manually configure your OpenVPN TAP or TeamViewer VPN adapter in "Network Connections". If you set the IPv4 configuration manually anyway, the IPv4 address and the subnet mask must match the \fBVPN=\fR directive. It is safe leave the IPv4 configuration to automatic (DHCP). vlmcsd will wait up to four seconds for the DHCP configuration to complete before binding to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter at a time. If you use the TeamViewer VPN adapter for example, you will not be able to use the VPN feature of TeamViewer as long as vlmcsd is running. The same applies to OpenVPN TAP adapters that are in use by other programs (for example OpenVPN, QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid conflicts is to install Tap-Windows from OpenVPN, cd to C:\\Program Files\\TAP-Windows\\bin and run addtap.bat to install an additional TAP adapter. Go to "Network Connections" and rename the new adapter to "vlmcsd" and specify \fBVPN=vlmcsd\fR to use it.
.IP "\fBExitLevel"
Can be either 0 (the default) or 1. Controls under what circumstances vlmcsd will exit. Using the default of \fB0\fR vlmcsd stays active as long as it can perform some useful operations. If vlmcsd is run by any form of a watchdog, e.g. NT service manager (Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be desirable to end vlmcsd and let the watchdog restart it. This is especially true if some pre-requisites are not yet met but will be some time later, e.g. network is not yet fully setup.
By using \fBExitLevel = 0\fR vlmcsd will
.RS 12
exit if none of the listening sockets specified with \fB-L\fR can be used. It continues if at least one socket can be setup for listening.
exit any TAP mirror thread (Windows version only) if there is an error condition while reading or writing from or to the VPN adapter but continue to work without utilizing a VPN adapter.
.RE
.IP
By using \fBExitLevel = 1\fR vlmcsd will
.RS 12
exit if not all listening sockets specified with \fB-L\fR can be used.
exit completely if there is a problem with a VPN adapter it is using. This may happen for instance if the VPN adapter has been disabled using "Control Panel - Network - Adapter Settings" while vlmcsd is using it.
.RE
.IP
Please note that \fBExitLevel = 1\fR is kind of a workaround option. While it may help under some circumstances, it is better to solve the problem at its origin, e.g. properly implementing dependencies in your startup script to ensure all network interfaces and the VPN adapter you will use are completely setup before you start vlmcsd.
.IP "\fBUseNDR64\fR"
Can be TRUE or FALSE. Specifies whether you want to use the NDR64 transfer syntax. See options \fB-n0\fR and \fB-n1\fR in \fBvlmcsd\fR(8). The default is TRUE.
.IP "\fBUseBTFN\fR"
Can be TRUE or FALSE. Specifies whether you want to use bind time feature negotiation in RPC. See options \fB-b0\fR and \fB-b1\fR in \fBvlmcsd\fR(8). The default is TRUE.
.IP "\fBRandomizationLevel\fR"
The \fIargument\fR must 0, 1 or 2. This specifies the ePID randomization level. See options \fB-r0\fR, \fB-r1\fR and \fB-r2\fR in \fBvlmcsd\fR(8). The default randomization level is 1. A \fBRandomizationLevel\fR of 2 is not recommended and should be treated as a debugging level.
.IP "\fBLCID\fR"
Use a specific culture id (LCID) even if the ePID is randomized. The \fIargument\fR must be a number between 1 and 32767. While any number in that range is valid, you should use an offcial LCID. A list of assigned LCIDs can be found at http://msdn.microsoft.com/en\-us/goglobal/bb964664.aspx. On the command line you control this setting with option \fB-C\fR.
.IP "\fBMaxWorkers\fR"
The \fIargument\fR specifies the maximum number of worker processes or threads that will be used to serve activation requests concurrently. This is the same as specifying \fB-m\fR on the command line. Minimum is 1. The maximum is platform specific and is at least 32767 but is likely to be greater on most systems. The default is no limit.
.IP "\fBConnectionTimeout\fR"
Used to control when the vlmcsd disconnects idle TPC connections. The default is 30 seconds. This is the same setting as \fB-t\fR on the command line.
.IP "\fBDisconnectClientsImmediately\fR"
Set this to TRUE to disconnect a client after it got an activation response regardless whether a timeout has occured or not. The default is FALSE. Setting this to TRUE is non-standard behavior. Use only if you are experiencing DoS or DDoS attacks. On the command line you control this behavior with options \fB-d\fR and \fB-k\fR.
.IP "\fBPidFile\fR"
Write a pid file. The \fIargument\fR is the full pathname of a pid file. The pid file contains is single line containing the process id of the vlmcsd process. It can be used to stop (SIGTERM) or restart (SIGHUP) vlmcsd. This directive can be overriden using \fB-p\fR on the command line.
.IP "\fBLogFile\fR"
Write a log file. The \fIargument\fR is the full pathname of a log file. On a unixoid OS and with Cygwin you can use the special filename 'syslog' to log to the syslog facility. This is the same as specifying \fB-l\fR on the command line.
.IP "\fBKmsData\fR"
Use a KMS data file. The \fIargument\fR is the full pathname of a KMS data file. By default vlmcsd only contains the minimum product data that is required to perform all operations correctly. You may use a more complete KMS data file that contains all detailed product names. This is especially useful if you are logging KMS requests. If you don't log, there is no need to load an external KMS data file.
You may use \fBKmsData\ =\ \-\fR to prevent the default KMS data file to be loaded.
.IP "\fBLogDateAndTime\fR"
Can be TRUE or FALSE. The default is TRUE. If set to FALSE, logging output does not include date and time. This is useful if you log to \fBstdout\fR(3) which is redirected to another logging mechanism that already includes date and time in its output, for instance \fBsystemd-journald\fR(8). If you log to \fBsyslog\fR(3), \fBLogDateAndTime\fR is ignored and date and time will never be included in the output sent to \fBsyslog\fR(3). Using the command line you control this setting with options \fB-T0\fR and \fB-T1\fR.
.IP "\fBLogVerbose\fR"
Set this to either TRUE or FALSE. The default is FALSE. If set to TRUE, more details of each activation will be logged. You use \fB-v\fR and \fB-q\fR in the command line to control this setting. \fBLogVerbose\fR has an effect only if you specify a log file or redirect logging to \fBstdout\fR(3).
.IP "\fBWhitelistingLevel\fR"
Can be 0, 1, 2 or 3. The default is 0. Sets the whitelisting level to determine which products vlmcsd activates or refuses.
.RS 12
\fB0\fR: activate all products with an unknown, retail or beta/preview KMS ID.
.br
\fB1\fR: activate products with a retail or beta/preview KMS ID but refuse to activate products with an unknown KMS ID.
.br
\fB2\fR: activate products with an unknown KMS ID but refuse products with a retail or beta/preview KMS ID.
.br
\fB3\fR: activate only products with a known volume license RTM KMS ID and refuse all others.
.RE
.IP ""
The SKU ID is not checked. Like a genuine KMS server vlmcsd activates a product that has a random or unknown SKU ID. If you select \fB1\fR or \fB3\fR, vlmcsd also checks the Application ID for correctness. If Microsoft introduces a new KMS ID for a new product, you cannot activate it if you used \fB1\fR or \fB3\fR until a new version of vlmcsd is available.
.IP "\fBCheckClientTime\fR"
Can be TRUE or FALSE. The default is FALSE. If you set this to TRUE \fBvlmcsd\fR(8) checks if the client time differs no more than four hours from the system time. This is useful to prevent emulator detection. A client that tries to detect an emulator could simply send two subsequent request with two time stamps that differ more than four hours from each other. If both requests succeed, the server is an emulator. If you set this to TRUE on a system with no reliable time source, activations will fail. It is ok to set the correct system time after you started \fBvlmcsd\fR(8).
.IP "\fBMaintainClients\fR"
Can be TRUE or FALSE (the default). Disables (FALSE) or enables (TRUE) maintaining a list of client machine IDs (CMIDs). TRUE is useful to prevent emulator detection. By maintaing a CMID list, \fBvlmcsd\fR(8) reports current active clients exactly like a genuine KMS emulator. This includes bug compatibility to the extent that you can permanently kill a genuine KMS emulator by sending an "overcharge request" with a required client count of 376 or more and then request activation for 671 clients. \fBvlmcsd\fR(8) can be reset from this condition by restarting it. If FALSE is used, \fBvlmcsd\fR(8) reports current active clients as good as possible. If no client sends an "overcharge request", it is not possible to detect \fBvlmcsd\fR(8) as an emulator with \fBMaintainClients\fR\~=\~FALSE. Maintaining clients requires the allocation of a buffer that is about 50 kB in size. On hardware with few memory resources use it only if you really need it.
If you start \fBvlmcsd\fR(8) from an internet superserver, this setting cannot be used. Since \fBvlmcsd\fR(8) exits after each activation, it cannot maintain any state in memory.
.IP "\fBStartEmpty\fR"
This setting is ignored if you do not also specify \fBMaintainClients\fR\~=\~TRUE. If you specify FALSE (the default), \fBvlmcsd\fR(8) starts up as a fully "charged" KMS server. Clients activate immediately. \fBStartEmpty\fR\~=\~TRUE lets you start up \fBvlmcsd\fR(8) with an empty CMID list. Activation will start when the required minimum clients (25 for Windows Client OSses, 5 for Windows Server OSses and Office) have registered with the KMS server. As long as the minimum client count has not been reached, clients end up in HRESULT 0xC004F038 "The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator". You may use \fBvlmcs\fR(1) or another KMS client emulator to "charge" \fBvlmcsd\fR(8). Setting this parameter to TRUE does not improve emulator detection prevention. It's primary purpose is to help developers of KMS clients to test "charging" a KMS server.
.IP "\fBActivationInterval\fR"
This is the same as specifying \fB-A\fR on the command line. See \fBvlmcsd\fR(8) for details. The default is 2 hours. Example: ActivationInterval\~=\~1h
.IP "\fBRenewalInterval\fR"
This is the same as specifying \fB-R\fR on the command line. See \fBvlmcsd\fR(8) for details. The default is 7 days. Example: RenewalInterval = 3d. Please note that the KMS client decides itself when to renew activation. Even though vlmcsd sends the renewal interval you specify, it is no more than some kind of recommendation to the client. Older KMS clients did follow the recommendation from a KMS server or emulator. Newer clients do not.
.IP "\fBUser\fR"
Run vlmcsd as another, preferrably less privileged, user. The \fIargument\fR can be a user name or a numeric user id. You must have the required privileges (capabilities on Linux) to change the security context of a process without providing any credentials (a password in most cases). On most unixoid OSses 'root' is the only user who has these privileges in the default configuration. This setting is not available in the native Windows version of vlmcsd. See \fB-u\fR in \fBvlmcsd\fR(8). This setting cannot be changed on the fly by sending SIGHUP to vlmcsd.
.IP "\fBGroup\fR"
Run vlmcsd as another, preferrably less privileged, group. The \fIargument\fR can be a group name or a numeric group id. You must have the required privileges (capabilities on Linux) to change the security context of a process without providing any credentials (a password in most cases). On most unixoid OSses 'root' is the only user who has these privileges in the default configuration. This setting is not available in the native Windows version of vlmcsd. See \fB-g\fR in \fBvlmcsd\fR(8). This setting cannot be changed on the fly by sending SIGHUP to vlmcsd.
.IP "\fBWindows\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Windows activations. If specified, \fBRandomizationLevel\fR for Windows activitations will be ignored.
.IP "\fBOffice2010\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2010 activations. If specified, \fBRandomizationLevel\fR for Office 2010 activitations will be ignored.
.IP "\fBOffice2013\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2013 activations. If specified, \fBRandomizationLevel\fR for Office 2013 activitations will be ignored.
.IP "\fBOffice2016\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2016 activations. If specified, \fBRandomizationLevel\fR for Office 2016 activitations will be ignored.
.SH "VALID EPIDS"
The ePID is currently a comment only. You can specify any string up to 63 bytes. In Windows 7 Microsoft has blacklisted few ( < 10 ) ePIDs that were used in KMSv5 versions of the "Ratiborus Virtual Machine". Microsoft has given up on blacklisting when KMS emulators appeared in the wild.
Even if you can use "Activated by cool hacker guys" as an ePID, you may wish to use ePIDs that cannot be detected as non-MS ePIDs. If you don't know how these "valid" ePIDs look like exactly, do not use GUIDS in vlmcsd.ini. vlmcsd provides internal mechanisms to generate valid ePIDs.
If you use non-ASCII characters in your ePID (you shouldn't do anyway), these must be in UTF-8 format. This is especially important when you run vlmcsd on Windows or cygwin because UTF-8 is not the default encoding for most editors.
If you are specifying an optional HWID it follows the same syntax as in the \fB\-H\fR option in \fBvlmcsd\fR(8) ecxept that you must not enclose a HWID in quotes even if it contains spaces.
.SH FILES
.IP "\fBvlmcsd.ini\fR(5)"
.SH AUTHOR
\fBvlmcsd\fR(8) was written by crony12, Hotbird64 and vityan666. With contributions from DougQaid.
.SH CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
.SH SEE ALSO
\fBvlmcsd\fR(8), \fBvlmcsd\fR(7), \fBvlmcs\fR(1), \fBvlmcsdmulti\fR(1)

491
man/vlmcsd.ini.5.dos.txt Normal file
View File

@ -0,0 +1,491 @@
VLMCSD.INI(5) KMS Activation Manual VLMCSD.INI(5)
NAME
vlmcsd.ini - vlmcsd KMS emulator configuration file
SYNOPSIS
vlmcsd.ini
DESCRIPTION
vlmcsd.ini (or simply called the "ini file") is a configuration file
for vlmcsd(8). By default vlmcsd does not use a configuration file. It
is completely optional and for advanced users only. You must use the -i
option on the vlmcsd command line to use an ini file. There is no
default name or default location for the ini file.
Everything, that can be configured in the ini file, may also be speci
fied on the command line. Any configuration option specified on the
command line takes precedence over the respective configuration line in
the ini file.
Benefits of a configuration file
While you can use the configuration file to simply modify the default
behavior of vlmcsd, it can also be used to change the configuration of
vlmcsd after you sent a HUP signal(7). Whenever you send SIGHUP, the
configuration file will be re-read. Any changes you made to the ini
file will be reflected after vlmcsd received the hangup signal.
Differences between command line and configuration file
If you specify an illegal option or option argument on the command
line, vlmcsd displays help and exits. If you specify an incorrect key
word or argument in the ini file, vlmcsd displays a warning with some
information, ignores the respective line and continues. This is inten
tional and prevents vlmcsd from aborting after a SIGHUP if the configu
ration was modified incorrectly.
SYNTAX
vlmcsd.ini is a UTF-8 encoded text file with each line being in the
format keyword = argument. The keyword is not case-sensitive. The argu
ment is treated literally. It is neither required nor allowed to
enclose the argument in any form of quote characters except when quote
characters are part of the argument itself. Whitespace characters are
ignored only
- at the beginning of a line
- between the keyword and '='
- between '=' and the argument
Lines, that start with '#' or ';' are treated as comments. Empty lines
are ignored as well. If a keyword is repeated in another line, vlmcsd
will use the argument of the last occurence of the keyword. An excep
tion to this is the Listen keyword which can be specified multiple
times and causes vlmcsd to listen on more than one IP address and/or
port.
Some arguments are binary arguments that need to be either TRUE or
FALSE. You can use "Yes", "On" or "1" as an alias for TRUE and "No",
"Off" or "0" as an alias for FALSE. Binary arguments are case-insensi
tive.
KEYWORDS
The following keywords are defined (not all keywords may be available
depending on the operating system and the options used when vlmcsd(8)
was compiled):
Listen This defines on what combinations of IP addresses and ports vlm
csd should listen. Listen can be specified more than once. The
argument has the form ipaddress[:port]. If you omit the port,
the default port of 1688 is used. If the ipaddress contains
colons and a port is used, you must enclose the ipaddress in
brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688
which means listen to all IPv4 and all IPv6 addresses. See the
-L option in vlmcsd(8) for more info about the syntax. If you
use -L or -P on the command line, all Listen keywords in the ini
file will be ignored. The Listen keyword cannot be used if vlm
csd has been compiled to use Microsoft RPC (Windows and Cygwin
only) or simple sockets.
Examples:
Listen = 192.168.1.123:1688
Listen = 0.0.0.0:1234
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used if vlmcsd has been compiled to use simple sock
ets or on Windows and Cygwin if vlmcsd(8) has been compiled to
use Microsoft RPC. Otherwise you must use Listen instead. Causes
vlmcsd to listen on that port instead of 1688.
FreeBind
Can be TRUE or FALSE. If TRUE, you can use the Listen keyword
with IP addresses that are currently not defined on your system.
vlmcsd(8) will start listening on these IP addresses as soon as
they become available. This keyword is only available under
Linux and FreeBSD because no other OS currently supports that
feature. FreeBSD supports this only for IPv4 and requires the
PRIV_NETINET_BINDANY privilege which is normally assigned to
proccesses of the root user.
PublicIPProtectionLevel
Set the level of protection against KMS activations from public
IP addresses.
0 = No protection (default)
1 = Listen on private IP addresses only (plus those specified by
one or more Listen statements)
2 = Disconnect clients with public IP addresses without activat
ing
3 = Combines 1 and 2
For details on public IP protection levels see vlmcsd(8) command
line option -o.
VPN Has to be in the form vpn-adapter-name[=ipv4-address][/cidr-
mask][:dhcp-lease-duration].
Enables a compatible VPN adapter to create additional local IPv4
addresses (like 127.0.0.1) that appear as remote IPv4 addresses
to the system. This allows product activation using a local
instance of vlmcsd. This feature is only available in Windows
and Cygwin builds of vlmcsd since it is not of any use on other
operating systems. Compatible VPN adapters are Tap-windows ver
sion 8.2 or higher (from OpenVPN) and the TeamViewer VPN
adapter. There is a special vpn-adapter-name. A single period
(.) instructs vlmcsd to use the first available compatible VPN
adapter. The vpn-adapter-name is not case-sensitive. If the vpn-
adapter-name contains spaces (e.g. Ethernet 3), do not enclose
it in quotes.
The default ipv4-address is 10.10.10.9 and the default cidr-mask
is 30. If you are using the default values, your VPN adapter
uses an IPv4 address of 10.10.10.9 and you can set your activa
tion client to use the easy to remember address 10.10.10.10
(e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs
/sethst:10.10.10.10).
The dhcp-lease-duration is a number optionally followed by s, m,
h, d or w to indicate seconds, minutes, hours, days or weeks.
The default dhcp-lease-duration is 1d (one day). It is normally
not required to change this value.
It is advised not to manually configure your OpenVPN TAP or
TeamViewer VPN adapter in "Network Connections". If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the VPN= directive. It is safe leave the
IPv4 configuration to automatic (DHCP). vlmcsd will wait up to
four seconds for the DHCP configuration to complete before bind
ing to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter
at a time. If you use the TeamViewer VPN adapter for example,
you will not be able to use the VPN feature of TeamViewer as
long as vlmcsd is running. The same applies to OpenVPN TAP
adapters that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid con
flicts is to install Tap-Windows from OpenVPN, cd to C:\Program
Files\TAP-Windows\bin and run addtap.bat to install an addi
tional TAP adapter. Go to "Network Connections" and rename the
new adapter to "vlmcsd" and specify VPN=vlmcsd to use it.
ExitLevel
Can be either 0 (the default) or 1. Controls under what circum
stances vlmcsd will exit. Using the default of 0 vlmcsd stays
active as long as it can perform some useful operations. If vlm
csd is run by any form of a watchdog, e.g. NT service manager
(Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be
desirable to end vlmcsd and let the watchdog restart it. This is
especially true if some pre-requisites are not yet met but will
be some time later, e.g. network is not yet fully setup.
By using ExitLevel = 0 vlmcsd will
exit if none of the listening sockets specified with -L can
be used. It continues if at least one socket can be setup
for listening.
exit any TAP mirror thread (Windows version only) if there
is an error condition while reading or writing from or to
the VPN adapter but continue to work without utilizing a
VPN adapter.
By using ExitLevel = 1 vlmcsd will
exit if not all listening sockets specified with -L can be
used.
exit completely if there is a problem with a VPN adapter it
is using. This may happen for instance if the VPN adapter
has been disabled using "Control Panel - Network - Adapter
Settings" while vlmcsd is using it.
Please note that ExitLevel = 1 is kind of a workaround option.
While it may help under some circumstances, it is better to
solve the problem at its origin, e.g. properly implementing
dependencies in your startup script to ensure all network inter
faces and the VPN adapter you will use are completely setup
before you start vlmcsd.
UseNDR64
Can be TRUE or FALSE. Specifies whether you want to use the
NDR64 transfer syntax. See options -n0 and -n1 in vlmcsd(8). The
default is TRUE.
UseBTFN
Can be TRUE or FALSE. Specifies whether you want to use bind
time feature negotiation in RPC. See options -b0 and -b1 in vlm
csd(8). The default is TRUE.
RandomizationLevel
The argument must 0, 1 or 2. This specifies the ePID randomiza
tion level. See options -r0, -r1 and -r2 in vlmcsd(8). The
default randomization level is 1. A RandomizationLevel of 2 is
not recommended and should be treated as a debugging level.
LCID Use a specific culture id (LCID) even if the ePID is randomized.
The argument must be a number between 1 and 32767. While any
number in that range is valid, you should use an offcial LCID. A
list of assigned LCIDs can be found at http://msdn.micro
soft.com/en-us/goglobal/bb964664.aspx. On the command line you
control this setting with option -C.
MaxWorkers
The argument specifies the maximum number of worker processes or
threads that will be used to serve activation requests concur
rently. This is the same as specifying -m on the command line.
Minimum is 1. The maximum is platform specific and is at least
32767 but is likely to be greater on most systems. The default
is no limit.
ConnectionTimeout
Used to control when the vlmcsd disconnects idle TPC connec
tions. The default is 30 seconds. This is the same setting as -t
on the command line.
DisconnectClientsImmediately
Set this to TRUE to disconnect a client after it got an activa
tion response regardless whether a timeout has occured or not.
The default is FALSE. Setting this to TRUE is non-standard
behavior. Use only if you are experiencing DoS or DDoS attacks.
On the command line you control this behavior with options -d
and -k.
PidFile
Write a pid file. The argument is the full pathname of a pid
file. The pid file contains is single line containing the
process id of the vlmcsd process. It can be used to stop
(SIGTERM) or restart (SIGHUP) vlmcsd. This directive can be
overriden using -p on the command line.
LogFile
Write a log file. The argument is the full pathname of a log
file. On a unixoid OS and with Cygwin you can use the special
filename 'syslog' to log to the syslog facility. This is the
same as specifying -l on the command line.
KmsData
Use a KMS data file. The argument is the full pathname of a KMS
data file. By default vlmcsd only contains the minimum product
data that is required to perform all operations correctly. You
may use a more complete KMS data file that contains all detailed
product names. This is especially useful if you are logging KMS
requests. If you don't log, there is no need to load an external
KMS data file.
You may use KmsData = - to prevent the default KMS data file to
be loaded.
LogDateAndTime
Can be TRUE or FALSE. The default is TRUE. If set to FALSE, log
ging output does not include date and time. This is useful if
you log to stdout(3) which is redirected to another logging
mechanism that already includes date and time in its output, for
instance systemd-journald(8). If you log to syslog(3), LogDate
AndTime is ignored and date and time will never be included in
the output sent to syslog(3). Using the command line you control
this setting with options -T0 and -T1.
LogVerbose
Set this to either TRUE or FALSE. The default is FALSE. If set
to TRUE, more details of each activation will be logged. You use
-v and -q in the command line to control this setting. LogVer
bose has an effect only if you specify a log file or redirect
logging to stdout(3).
WhitelistingLevel
Can be 0, 1, 2 or 3. The default is 0. Sets the whitelisting
level to determine which products vlmcsd activates or refuses.
0: activate all products with an unknown, retail or
beta/preview KMS ID.
1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select 1 or 3, vlmcsd also checks the Application ID for cor
rectness. If Microsoft introduces a new KMS ID for a new prod
uct, you cannot activate it if you used 1 or 3 until a new ver
sion of vlmcsd is available.
CheckClientTime
Can be TRUE or FALSE. The default is FALSE. If you set this to
TRUE vlmcsd(8) checks if the client time differs no more than
four hours from the system time. This is useful to prevent emu
lator detection. A client that tries to detect an emulator could
simply send two subsequent request with two time stamps that
differ more than four hours from each other. If both requests
succeed, the server is an emulator. If you set this to TRUE on a
system with no reliable time source, activations will fail. It
is ok to set the correct system time after you started vlm
csd(8).
MaintainClients
Can be TRUE or FALSE (the default). Disables (FALSE) or enables
(TRUE) maintaining a list of client machine IDs (CMIDs). TRUE is
useful to prevent emulator detection. By maintaing a CMID list,
vlmcsd(8) reports current active clients exactly like a genuine
KMS emulator. This includes bug compatibility to the extent that
you can permanently kill a genuine KMS emulator by sending an
"overcharge request" with a required client count of 376 or more
and then request activation for 671 clients. vlmcsd(8) can be
reset from this condition by restarting it. If FALSE is used,
vlmcsd(8) reports current active clients as good as possible. If
no client sends an "overcharge request", it is not possible to
detect vlmcsd(8) as an emulator with MaintainClients = FALSE.
Maintaining clients requires the allocation of a buffer that is
about 50 kB in size. On hardware with few memory resources use
it only if you really need it.
If you start vlmcsd(8) from an internet superserver, this set
ting cannot be used. Since vlmcsd(8) exits after each activa
tion, it cannot maintain any state in memory.
StartEmpty
This setting is ignored if you do not also specify Maintain
Clients = TRUE. If you specify FALSE (the default), vlmcsd(8)
starts up as a fully "charged" KMS server. Clients activate
immediately. StartEmpty = TRUE lets you start up vlmcsd(8) with
an empty CMID list. Activation will start when the required min
imum clients (25 for Windows Client OSses, 5 for Windows Server
OSses and Office) have registered with the KMS server. As long
as the minimum client count has not been reached, clients end up
in HRESULT 0xC004F038 "The count reported by your Key Management
Service (KMS) is insufficient. Please contact your system admin
istrator". You may use vlmcs(1) or another KMS client emulator
to "charge" vlmcsd(8). Setting this parameter to TRUE does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
ActivationInterval
This is the same as specifying -A on the command line. See vlm
csd(8) for details. The default is 2 hours. Example: Activation
Interval = 1h
RenewalInterval
This is the same as specifying -R on the command line. See vlm
csd(8) for details. The default is 7 days. Example: RenewalIn
terval = 3d. Please note that the KMS client decides itself when
to renew activation. Even though vlmcsd sends the renewal inter
val you specify, it is no more than some kind of recommendation
to the client. Older KMS clients did follow the recommendation
from a KMS server or emulator. Newer clients do not.
User Run vlmcsd as another, preferrably less privileged, user. The
argument can be a user name or a numeric user id. You must have
the required privileges (capabilities on Linux) to change the
security context of a process without providing any credentials
(a password in most cases). On most unixoid OSses 'root' is the
only user who has these privileges in the default configuration.
This setting is not available in the native Windows version of
vlmcsd. See -u in vlmcsd(8). This setting cannot be changed on
the fly by sending SIGHUP to vlmcsd.
Group Run vlmcsd as another, preferrably less privileged, group. The
argument can be a group name or a numeric group id. You must
have the required privileges (capabilities on Linux) to change
the security context of a process without providing any creden
tials (a password in most cases). On most unixoid OSses 'root'
is the only user who has these privileges in the default config
uration. This setting is not available in the native Windows
version of vlmcsd. See -g in vlmcsd(8). This setting cannot be
changed on the fly by sending SIGHUP to vlmcsd.
Windows
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Windows activations. If specified, RandomizationLevel
for Windows activitations will be ignored.
Office2010
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2010 activations. If specified, Randomization
Level for Office 2010 activitations will be ignored.
Office2013
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2013 activations. If specified, Randomization
Level for Office 2013 activitations will be ignored.
Office2016
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2016 activations. If specified, Randomization
Level for Office 2016 activitations will be ignored.
VALID EPIDS
The ePID is currently a comment only. You can specify any string up to
63 bytes. In Windows 7 Microsoft has blacklisted few ( < 10 ) ePIDs
that were used in KMSv5 versions of the "Ratiborus Virtual Machine".
Microsoft has given up on blacklisting when KMS emulators appeared in
the wild.
Even if you can use "Activated by cool hacker guys" as an ePID, you may
wish to use ePIDs that cannot be detected as non-MS ePIDs. If you don't
know how these "valid" ePIDs look like exactly, do not use GUIDS in
vlmcsd.ini. vlmcsd provides internal mechanisms to generate valid
ePIDs.
If you use non-ASCII characters in your ePID (you shouldn't do anyway),
these must be in UTF-8 format. This is especially important when you
run vlmcsd on Windows or cygwin because UTF-8 is not the default encod
ing for most editors.
If you are specifying an optional HWID it follows the same syntax as in
the -H option in vlmcsd(8) ecxept that you must not enclose a HWID in
quotes even if it contains spaces.
FILES
vlmcsd.ini(5)
AUTHOR
vlmcsd(8) was written by crony12, Hotbird64 and vityan666. With contri
butions from DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
SEE ALSO
vlmcsd(8), vlmcsd(7), vlmcs(1), vlmcsdmulti(1)
Hotbird64 January 2017 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 5 14:31:11 2016 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -25,7 +25,7 @@
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#SYNTAX">SYNTAX</a><br>
<a href="#KEYWORDS">KEYWORDS</a><br>
<a href="#SPECIAL KEYWORDS">SPECIAL KEYWORDS</a><br>
<a href="#VALID EPIDS">VALID EPIDS</a><br>
<a href="#FILES">FILES</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#CREDITS">CREDITS</a><br>
@ -41,7 +41,7 @@
<p style="margin-left:11%; margin-top: 1em"><b>vlmcsd.ini</b>
&minus; vlmcsd KMS emulator configuration file</p>
- vlmcsd KMS emulator configuration file</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
@ -208,6 +208,141 @@ feature. FreeBSD supports this only for IPv4 and requires
the PRIV_NETINET_BINDANY privilege which is normally
assigned to proccesses of the root user.</p>
<p style="margin-left:11%;"><b>PublicIPProtectionLevel</b></p>
<p style="margin-left:22%;">Set the level of protection
against KMS activations from public IP addresses.</p>
<p style="margin-left:22%; margin-top: 1em">0 = No
protection (default) <br>
1&nbsp;=&nbsp;Listen on private IP addresses only (plus
those specified by one or more <b>Listen</b> statements)
<br>
2&nbsp;=&nbsp;Disconnect clients with public IP addresses
without activating <br>
3&nbsp;=&nbsp;Combines 1 and 2</p>
<p style="margin-left:22%; margin-top: 1em">For details on
public IP protection levels see <b>vlmcsd</b>(8) command
line option <b>-o</b>.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>VPN</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Has to be in the form
<i>vpn-adapter-name</i>[=<i>ipv4-address</i>][/<i>cidr-mask</i>][:<i>dhcp-lease-duration</i>].</p> </td></tr>
</table>
<p style="margin-left:22%; margin-top: 1em">Enables a
compatible VPN adapter to create additional local IPv4
addresses (like 127.0.0.1) that appear as remote IPv4
addresses to the system. This allows product activation
using a local instance of vlmcsd. This feature is only
available in Windows and Cygwin builds of vlmcsd since it is
not of any use on other operating systems. Compatible VPN
adapters are Tap-windows version 8.2 or higher (from
OpenVPN) and the TeamViewer VPN adapter. There is a special
<i>vpn-adapter-name</i>. A single period (.) instructs
vlmcsd to use the first available compatible VPN adapter.
The <i>vpn-adapter-name</i> is <b>not</b> case-sensitive. If
the <i>vpn-adapter-name</i> contains spaces (e.g. Ethernet
3), do <b>not</b> enclose it in quotes.</p>
<p style="margin-left:22%; margin-top: 1em">The default
<i>ipv4-address</i> is 10.10.10.9 and the default
<i>cidr-mask</i> is 30. If you are using the default values,
your VPN adapter uses an IPv4 address of 10.10.10.9 and you
can set your activation client to use the easy to remember
address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript
ospp.vbs /sethst:10.10.10.10).</p>
<p style="margin-left:22%; margin-top: 1em">The
<i>dhcp-lease-duration</i> is a number optionally followed
by s, m, h, d or w to indicate seconds, minutes, hours, days
or weeks. The default <i>dhcp-lease-duration</i> is 1d (one
day). It is normally not required to change this value.</p>
<p style="margin-left:22%; margin-top: 1em">It is advised
not to manually configure your OpenVPN TAP or TeamViewer VPN
adapter in &quot;Network Connections&quot;. If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the <b>VPN=</b> directive. It is safe
leave the IPv4 configuration to automatic (DHCP). vlmcsd
will wait up to four seconds for the DHCP configuration to
complete before binding to and listenin on any
interfaces.</p>
<p style="margin-left:22%; margin-top: 1em">You should be
aware that only one program can use a VPN adapter at a time.
If you use the TeamViewer VPN adapter for example, you will
not be able to use the VPN feature of TeamViewer as long as
vlmcsd is running. The same applies to OpenVPN TAP adapters
that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid
conflicts is to install Tap-Windows from OpenVPN, cd to
C:\Program Files\TAP-Windows\bin and run addtap.bat to
install an additional TAP adapter. Go to &quot;Network
Connections&quot; and rename the new adapter to
&quot;vlmcsd&quot; and specify <b>VPN=vlmcsd</b> to use
it.</p>
<p style="margin-left:11%;"><b>ExitLevel</b></p>
<p style="margin-left:22%;">Can be either 0 (the default)
or 1. Controls under what circumstances vlmcsd will exit.
Using the default of <b>0</b> vlmcsd stays active as long as
it can perform some useful operations. If vlmcsd is run by
any form of a watchdog, e.g. NT service manager (Windows),
systemd (Linux) or launchd (Mac OS / iOS), it may be
desirable to end vlmcsd and let the watchdog restart it.
This is especially true if some pre-requisites are not yet
met but will be some time later, e.g. network is not yet
fully setup.</p>
<p style="margin-left:22%; margin-top: 1em">By using
<b>ExitLevel = 0</b> vlmcsd will</p>
<p style="margin-left:29%; margin-top: 1em">exit if none of
the listening sockets specified with <b>-L</b> can be used.
It continues if at least one socket can be setup for
listening.</p>
<p style="margin-left:29%; margin-top: 1em">exit any TAP
mirror thread (Windows version only) if there is an error
condition while reading or writing from or to the VPN
adapter but continue to work without utilizing a VPN
adapter.</p>
<p style="margin-left:22%; margin-top: 1em">By using
<b>ExitLevel = 1</b> vlmcsd will</p>
<p style="margin-left:29%; margin-top: 1em">exit if not all
listening sockets specified with <b>-L</b> can be used.</p>
<p style="margin-left:29%; margin-top: 1em">exit completely
if there is a problem with a VPN adapter it is using. This
may happen for instance if the VPN adapter has been disabled
using &quot;Control Panel - Network - Adapter Settings&quot;
while vlmcsd is using it.</p>
<p style="margin-left:22%; margin-top: 1em">Please note
that <b>ExitLevel = 1</b> is kind of a workaround option.
While it may help under some circumstances, it is better to
solve the problem at its origin, e.g. properly implementing
dependencies in your startup script to ensure all network
interfaces and the VPN adapter you will use are completely
setup before you start vlmcsd.</p>
<p style="margin-left:11%;"><b>UseNDR64</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. Specifies
@ -227,7 +362,9 @@ RPC. See options <b>-b0</b> and <b>-b1</b> in
<p style="margin-left:22%;">The <i>argument</i> must 0, 1
or 2. This specifies the ePID randomization level. See
options <b>-r0</b>, <b>-r1</b> and <b>-r2</b> in
<b>vlmcsd</b>(8). The default randomization level is 1.</p>
<b>vlmcsd</b>(8). The default randomization level is 1. A
<b>RandomizationLevel</b> of 2 is not recommended and should
be treated as a debugging level.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
@ -246,8 +383,8 @@ randomized. The <i>argument</i> must be a number between 1
and 32767. While any number in that range is valid, you
should use an offcial LCID. A list of assigned LCIDs can be
found at
http://msdn.microsoft.com/en&minus;us/goglobal/bb964664.aspx.
On the command line you control this setting with option
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx. On
the command line you control this setting with option
<b>-C</b>.</p> </td></tr>
</table>
@ -296,6 +433,34 @@ unixoid OS and with Cygwin you can use the special filename
&rsquo;syslog&rsquo; to log to the syslog facility. This is
the same as specifying <b>-l</b> on the command line.</p>
<p style="margin-left:11%;"><b>KmsData</b></p>
<p style="margin-left:22%;">Use a KMS data file. The
<i>argument</i> is the full pathname of a KMS data file. By
default vlmcsd only contains the minimum product data that
is required to perform all operations correctly. You may use
a more complete KMS data file that contains all detailed
product names. This is especially useful if you are logging
KMS requests. If you don&rsquo;t log, there is no need to
load an external KMS data file.</p>
<p style="margin-left:22%; margin-top: 1em">You may use
<b>KmsData&nbsp;=&nbsp;-</b> to prevent the default KMS data
file to be loaded.</p>
<p style="margin-left:11%;"><b>LogDateAndTime</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. The
default is TRUE. If set to FALSE, logging output does not
include date and time. This is useful if you log to
<b>stdout</b>(3) which is redirected to another logging
mechanism that already includes date and time in its output,
for instance <b>systemd-journald</b>(8). If you log to
<b>syslog</b>(3), <b>LogDateAndTime</b> is ignored and date
and time will never be included in the output sent to
<b>syslog</b>(3). Using the command line you control this
setting with options <b>-T0</b> and <b>-T1</b>.</p>
<p style="margin-left:11%;"><b>LogVerbose</b></p>
<p style="margin-left:22%;">Set this to either TRUE or
@ -305,19 +470,114 @@ each activation will be logged. You use <b>-v</b> and
<b>LogVerbose</b> has an effect only if you specify a log
file or redirect logging to <b>stdout</b>(3).</p>
<p style="margin-left:11%;"><b>WhitelistingLevel</b></p>
<p style="margin-left:22%;">Can be 0, 1, 2 or 3. The
default is 0. Sets the whitelisting level to determine which
products vlmcsd activates or refuses.</p>
<p style="margin-left:29%; margin-top: 1em"><b>0</b>:
activate all products with an unknown, retail or
beta/preview KMS ID. <b><br>
1</b>: activate products with a retail or beta/preview KMS
ID but refuse to activate products with an unknown KMS ID.
<b><br>
2</b>: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID. <b><br>
3</b>: activate only products with a known volume license
RTM KMS ID and refuse all others.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="22%"></td>
<td width="78%">
<p>The SKU ID is not checked. Like a genuine KMS server
vlmcsd activates a product that has a random or unknown SKU
ID. If you select <b>1</b> or <b>3</b>, vlmcsd also checks
the Application ID for correctness. If Microsoft introduces
a new KMS ID for a new product, you cannot activate it if
you used <b>1</b> or <b>3</b> until a new version of vlmcsd
is available.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>CheckClientTime</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. The
default is FALSE. If you set this to TRUE <b>vlmcsd</b>(8)
checks if the client time differs no more than four hours
from the system time. This is useful to prevent emulator
detection. A client that tries to detect an emulator could
simply send two subsequent request with two time stamps that
differ more than four hours from each other. If both
requests succeed, the server is an emulator. If you set this
to TRUE on a system with no reliable time source,
activations will fail. It is ok to set the correct system
time after you started <b>vlmcsd</b>(8).</p>
<p style="margin-left:11%;"><b>MaintainClients</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE (the
default). Disables (FALSE) or enables (TRUE) maintaining a
list of client machine IDs (CMIDs). TRUE is useful to
prevent emulator detection. By maintaing a CMID list,
<b>vlmcsd</b>(8) reports current active clients exactly like
a genuine KMS emulator. This includes bug compatibility to
the extent that you can permanently kill a genuine KMS
emulator by sending an &quot;overcharge request&quot; with a
required client count of 376 or more and then request
activation for 671 clients. <b>vlmcsd</b>(8) can be reset
from this condition by restarting it. If FALSE is used,
<b>vlmcsd</b>(8) reports current active clients as good as
possible. If no client sends an &quot;overcharge
request&quot;, it is not possible to detect <b>vlmcsd</b>(8)
as an emulator with
<b>MaintainClients&nbsp;</b>=&nbsp;FALSE. Maintaining
clients requires the allocation of a buffer that is about 50
kB in size. On hardware with few memory resources use it
only if you really need it.</p>
<p style="margin-left:22%; margin-top: 1em">If you start
<b>vlmcsd</b>(8) from an internet superserver, this setting
cannot be used. Since <b>vlmcsd</b>(8) exits after each
activation, it cannot maintain any state in memory.</p>
<p style="margin-left:11%;"><b>StartEmpty</b></p>
<p style="margin-left:22%;">This setting is ignored if you
do not also specify <b>MaintainClients&nbsp;</b>=&nbsp;TRUE.
If you specify FALSE (the default), <b>vlmcsd</b>(8) starts
up as a fully &quot;charged&quot; KMS server. Clients
activate immediately. <b>StartEmpty&nbsp;</b>=&nbsp;TRUE
lets you start up <b>vlmcsd</b>(8) with an empty CMID list.
Activation will start when the required minimum clients (25
for Windows Client OSses, 5 for Windows Server OSses and
Office) have registered with the KMS server. As long as the
minimum client count has not been reached, clients end up in
HRESULT 0xC004F038 &quot;The count reported by your Key
Management Service (KMS) is insufficient. Please contact
your system administrator&quot;. You may use <b>vlmcs</b>(1)
or another KMS client emulator to &quot;charge&quot;
<b>vlmcsd</b>(8). Setting this parameter to TRUE does not
improve emulator detection prevention. It&rsquo;s primary
purpose is to help developers of KMS clients to test
&quot;charging&quot; a KMS server.</p>
<p style="margin-left:11%;"><b>ActivationInterval</b></p>
<p style="margin-left:22%;">This is the same as specifying
<b>-A</b> on the command line. See <b>vlmcsd</b>(8) for
details. The default is 2 hours. Example: ActivationInterval
= 1h</p>
details. The default is 2 hours. Example:
ActivationInterval&nbsp;=&nbsp;1h</p>
<p style="margin-left:11%;"><b>RenewalInterval</b></p>
<p style="margin-left:22%;">This is the same as specifying
<b>-R</b> on the command line. See <b>vlmcsd</b>(8) for
details. The default is 7 days. Example: ActivationInterval
= 3h. Please note that the KMS client decides itself when to
details. The default is 7 days. Example: RenewalInterval =
3d. Please note that the KMS client decides itself when to
renew activation. Even though vlmcsd sends the renewal
interval you specify, it is no more than some kind of
recommendation to the client. Older KMS clients did follow
@ -370,46 +630,48 @@ Windows version of vlmcsd. See <b>-g</b> in
by sending SIGHUP to vlmcsd.</p></td></tr>
</table>
<h2>SPECIAL KEYWORDS
<a name="SPECIAL KEYWORDS"></a>
<p style="margin-left:11%;"><b>Windows</b></p>
<p style="margin-left:22%;">The <i>argument</i> has the
form <i>ePID</i> [ / <i>HwId</i> ]. Always use <i>ePID</i>
and <i>HwId</i> for Windows activations. If specified,
<b>RandomizationLevel</b> for Windows activitations will be
ignored.</p>
<p style="margin-left:11%;"><b>Office2010</b></p>
<p style="margin-left:22%;">The <i>argument</i> has the
form <i>ePID</i> [ / <i>HwId</i> ]. Always use <i>ePID</i>
and <i>HwId</i> for Office 2010 activations. If specified,
<b>RandomizationLevel</b> for Office 2010 activitations will
be ignored.</p>
<p style="margin-left:11%;"><b>Office2013</b></p>
<p style="margin-left:22%;">The <i>argument</i> has the
form <i>ePID</i> [ / <i>HwId</i> ]. Always use <i>ePID</i>
and <i>HwId</i> for Office 2013 activations. If specified,
<b>RandomizationLevel</b> for Office 2013 activitations will
be ignored.</p>
<p style="margin-left:11%;"><b>Office2016</b></p>
<p style="margin-left:22%;">The <i>argument</i> has the
form <i>ePID</i> [ / <i>HwId</i> ]. Always use <i>ePID</i>
and <i>HwId</i> for Office 2016 activations. If specified,
<b>RandomizationLevel</b> for Office 2016 activitations will
be ignored.</p>
<h2>VALID EPIDS
<a name="VALID EPIDS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Any valid GUID
is being treated as a special <b>keyword</b> in the ini
file. It is used to select a specfic ePID and HwId for an
application GUID. The <i>argument</i> has the form
<i>ePID</i> [ / <i>HwId</i> ]. KMS currently knows only 3
application GUIDs:</p>
<p style="margin-left:11%; margin-top: 1em">55c92734&minus;d682&minus;4d71&minus;983e&minus;d6ec3f16059f&nbsp;(Windows)
<br>
59a52881&minus;a989&minus;479d&minus;af46&minus;f275c6370663&nbsp;(Office
2010) <br>
0ff1ce15&minus;a989&minus;479d&minus;af46&minus;f275c6370663&nbsp;(Office
2013)</p>
<p style="margin-left:11%; margin-top: 1em">To use specific
ePIDs for Windows, Office 2010 and Office 2013/2016 you
could add the following lines to vlmcsd.ini:</p>
<p style="margin-left:11%; margin-top: 1em"><small>55c92734&minus;d682&minus;4d71&minus;983e&minus;d6ec3f16059f&nbsp;=&nbsp;55041&minus;00206&minus;184&minus;207146&minus;03&minus;1062&minus;6002.0000&minus;3322013
<br>
59a52881&minus;a989&minus;479d&minus;af46&minus;f275c6370663&nbsp;=&nbsp;55041&minus;00096&minus;216&minus;598637&minus;03&minus;17418&minus;6002.0000&minus;3312013
<br>
0ff1ce15&minus;a989&minus;479d&minus;af46&minus;f275c6370663&nbsp;=&nbsp;55041&minus;00206-234&minus;742099&minus;03&minus;9217&minus;6002.0000&minus;2942013</small></p>
<p style="margin-left:11%; margin-top: 1em">The ePID is
currently a comment only. You can specify any string up to
63 bytes. In Windows 7 Microsoft has blacklisted few ( &lt;
10 ) ePIDs that were used in KMSv5 versions of the
&quot;ratiborus virtual machine&quot;. Microsoft has given
&quot;Ratiborus Virtual Machine&quot;. Microsoft has given
up on blacklisting when KMS emulators appeared in the
wild.</p>
@ -429,8 +691,8 @@ UTF-8 is not the default encoding for most editors.</p>
<p style="margin-left:11%; margin-top: 1em">If you are
specifying an optional HWID it follows the same syntax as in
the <b>&minus;H</b> option in <b>vlmcsd</b>(8) ecxept that
you must not enclose a HWID in quotes even if it contains
the <b>-H</b> option in <b>vlmcsd</b>(8) ecxept that you
must not enclose a HWID in quotes even if it contains
spaces.</p>
<h2>FILES

BIN
man/vlmcsd.ini.5.pdf Normal file

Binary file not shown.

491
man/vlmcsd.ini.5.unix.txt Normal file
View File

@ -0,0 +1,491 @@
VLMCSD.INI(5) KMS Activation Manual VLMCSD.INI(5)
NAME
vlmcsd.ini - vlmcsd KMS emulator configuration file
SYNOPSIS
vlmcsd.ini
DESCRIPTION
vlmcsd.ini (or simply called the "ini file") is a configuration file
for vlmcsd(8). By default vlmcsd does not use a configuration file. It
is completely optional and for advanced users only. You must use the -i
option on the vlmcsd command line to use an ini file. There is no
default name or default location for the ini file.
Everything, that can be configured in the ini file, may also be speci
fied on the command line. Any configuration option specified on the
command line takes precedence over the respective configuration line in
the ini file.
Benefits of a configuration file
While you can use the configuration file to simply modify the default
behavior of vlmcsd, it can also be used to change the configuration of
vlmcsd after you sent a HUP signal(7). Whenever you send SIGHUP, the
configuration file will be re-read. Any changes you made to the ini
file will be reflected after vlmcsd received the hangup signal.
Differences between command line and configuration file
If you specify an illegal option or option argument on the command
line, vlmcsd displays help and exits. If you specify an incorrect key
word or argument in the ini file, vlmcsd displays a warning with some
information, ignores the respective line and continues. This is inten
tional and prevents vlmcsd from aborting after a SIGHUP if the configu
ration was modified incorrectly.
SYNTAX
vlmcsd.ini is a UTF-8 encoded text file with each line being in the
format keyword = argument. The keyword is not case-sensitive. The argu
ment is treated literally. It is neither required nor allowed to
enclose the argument in any form of quote characters except when quote
characters are part of the argument itself. Whitespace characters are
ignored only
- at the beginning of a line
- between the keyword and '='
- between '=' and the argument
Lines, that start with '#' or ';' are treated as comments. Empty lines
are ignored as well. If a keyword is repeated in another line, vlmcsd
will use the argument of the last occurence of the keyword. An excep
tion to this is the Listen keyword which can be specified multiple
times and causes vlmcsd to listen on more than one IP address and/or
port.
Some arguments are binary arguments that need to be either TRUE or
FALSE. You can use "Yes", "On" or "1" as an alias for TRUE and "No",
"Off" or "0" as an alias for FALSE. Binary arguments are case-insensi
tive.
KEYWORDS
The following keywords are defined (not all keywords may be available
depending on the operating system and the options used when vlmcsd(8)
was compiled):
Listen This defines on what combinations of IP addresses and ports vlm
csd should listen. Listen can be specified more than once. The
argument has the form ipaddress[:port]. If you omit the port,
the default port of 1688 is used. If the ipaddress contains
colons and a port is used, you must enclose the ipaddress in
brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688
which means listen to all IPv4 and all IPv6 addresses. See the
-L option in vlmcsd(8) for more info about the syntax. If you
use -L or -P on the command line, all Listen keywords in the ini
file will be ignored. The Listen keyword cannot be used if vlm
csd has been compiled to use Microsoft RPC (Windows and Cygwin
only) or simple sockets.
Examples:
Listen = 192.168.1.123:1688
Listen = 0.0.0.0:1234
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used if vlmcsd has been compiled to use simple sock
ets or on Windows and Cygwin if vlmcsd(8) has been compiled to
use Microsoft RPC. Otherwise you must use Listen instead. Causes
vlmcsd to listen on that port instead of 1688.
FreeBind
Can be TRUE or FALSE. If TRUE, you can use the Listen keyword
with IP addresses that are currently not defined on your system.
vlmcsd(8) will start listening on these IP addresses as soon as
they become available. This keyword is only available under
Linux and FreeBSD because no other OS currently supports that
feature. FreeBSD supports this only for IPv4 and requires the
PRIV_NETINET_BINDANY privilege which is normally assigned to
proccesses of the root user.
PublicIPProtectionLevel
Set the level of protection against KMS activations from public
IP addresses.
0 = No protection (default)
1 = Listen on private IP addresses only (plus those specified by
one or more Listen statements)
2 = Disconnect clients with public IP addresses without activat
ing
3 = Combines 1 and 2
For details on public IP protection levels see vlmcsd(8) command
line option -o.
VPN Has to be in the form vpn-adapter-name[=ipv4-address][/cidr-
mask][:dhcp-lease-duration].
Enables a compatible VPN adapter to create additional local IPv4
addresses (like 127.0.0.1) that appear as remote IPv4 addresses
to the system. This allows product activation using a local
instance of vlmcsd. This feature is only available in Windows
and Cygwin builds of vlmcsd since it is not of any use on other
operating systems. Compatible VPN adapters are Tap-windows ver
sion 8.2 or higher (from OpenVPN) and the TeamViewer VPN
adapter. There is a special vpn-adapter-name. A single period
(.) instructs vlmcsd to use the first available compatible VPN
adapter. The vpn-adapter-name is not case-sensitive. If the vpn-
adapter-name contains spaces (e.g. Ethernet 3), do not enclose
it in quotes.
The default ipv4-address is 10.10.10.9 and the default cidr-mask
is 30. If you are using the default values, your VPN adapter
uses an IPv4 address of 10.10.10.9 and you can set your activa
tion client to use the easy to remember address 10.10.10.10
(e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs
/sethst:10.10.10.10).
The dhcp-lease-duration is a number optionally followed by s, m,
h, d or w to indicate seconds, minutes, hours, days or weeks.
The default dhcp-lease-duration is 1d (one day). It is normally
not required to change this value.
It is advised not to manually configure your OpenVPN TAP or
TeamViewer VPN adapter in "Network Connections". If you set the
IPv4 configuration manually anyway, the IPv4 address and the
subnet mask must match the VPN= directive. It is safe leave the
IPv4 configuration to automatic (DHCP). vlmcsd will wait up to
four seconds for the DHCP configuration to complete before bind
ing to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter
at a time. If you use the TeamViewer VPN adapter for example,
you will not be able to use the VPN feature of TeamViewer as
long as vlmcsd is running. The same applies to OpenVPN TAP
adapters that are in use by other programs (for example OpenVPN,
QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid con
flicts is to install Tap-Windows from OpenVPN, cd to C:\Program
Files\TAP-Windows\bin and run addtap.bat to install an addi
tional TAP adapter. Go to "Network Connections" and rename the
new adapter to "vlmcsd" and specify VPN=vlmcsd to use it.
ExitLevel
Can be either 0 (the default) or 1. Controls under what circum
stances vlmcsd will exit. Using the default of 0 vlmcsd stays
active as long as it can perform some useful operations. If vlm
csd is run by any form of a watchdog, e.g. NT service manager
(Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be
desirable to end vlmcsd and let the watchdog restart it. This is
especially true if some pre-requisites are not yet met but will
be some time later, e.g. network is not yet fully setup.
By using ExitLevel = 0 vlmcsd will
exit if none of the listening sockets specified with -L can
be used. It continues if at least one socket can be setup
for listening.
exit any TAP mirror thread (Windows version only) if there
is an error condition while reading or writing from or to
the VPN adapter but continue to work without utilizing a
VPN adapter.
By using ExitLevel = 1 vlmcsd will
exit if not all listening sockets specified with -L can be
used.
exit completely if there is a problem with a VPN adapter it
is using. This may happen for instance if the VPN adapter
has been disabled using "Control Panel - Network - Adapter
Settings" while vlmcsd is using it.
Please note that ExitLevel = 1 is kind of a workaround option.
While it may help under some circumstances, it is better to
solve the problem at its origin, e.g. properly implementing
dependencies in your startup script to ensure all network inter
faces and the VPN adapter you will use are completely setup
before you start vlmcsd.
UseNDR64
Can be TRUE or FALSE. Specifies whether you want to use the
NDR64 transfer syntax. See options -n0 and -n1 in vlmcsd(8). The
default is TRUE.
UseBTFN
Can be TRUE or FALSE. Specifies whether you want to use bind
time feature negotiation in RPC. See options -b0 and -b1 in vlm
csd(8). The default is TRUE.
RandomizationLevel
The argument must 0, 1 or 2. This specifies the ePID randomiza
tion level. See options -r0, -r1 and -r2 in vlmcsd(8). The
default randomization level is 1. A RandomizationLevel of 2 is
not recommended and should be treated as a debugging level.
LCID Use a specific culture id (LCID) even if the ePID is randomized.
The argument must be a number between 1 and 32767. While any
number in that range is valid, you should use an offcial LCID. A
list of assigned LCIDs can be found at http://msdn.micro
soft.com/en-us/goglobal/bb964664.aspx. On the command line you
control this setting with option -C.
MaxWorkers
The argument specifies the maximum number of worker processes or
threads that will be used to serve activation requests concur
rently. This is the same as specifying -m on the command line.
Minimum is 1. The maximum is platform specific and is at least
32767 but is likely to be greater on most systems. The default
is no limit.
ConnectionTimeout
Used to control when the vlmcsd disconnects idle TPC connec
tions. The default is 30 seconds. This is the same setting as -t
on the command line.
DisconnectClientsImmediately
Set this to TRUE to disconnect a client after it got an activa
tion response regardless whether a timeout has occured or not.
The default is FALSE. Setting this to TRUE is non-standard
behavior. Use only if you are experiencing DoS or DDoS attacks.
On the command line you control this behavior with options -d
and -k.
PidFile
Write a pid file. The argument is the full pathname of a pid
file. The pid file contains is single line containing the
process id of the vlmcsd process. It can be used to stop
(SIGTERM) or restart (SIGHUP) vlmcsd. This directive can be
overriden using -p on the command line.
LogFile
Write a log file. The argument is the full pathname of a log
file. On a unixoid OS and with Cygwin you can use the special
filename 'syslog' to log to the syslog facility. This is the
same as specifying -l on the command line.
KmsData
Use a KMS data file. The argument is the full pathname of a KMS
data file. By default vlmcsd only contains the minimum product
data that is required to perform all operations correctly. You
may use a more complete KMS data file that contains all detailed
product names. This is especially useful if you are logging KMS
requests. If you don't log, there is no need to load an external
KMS data file.
You may use KmsData = - to prevent the default KMS data file to
be loaded.
LogDateAndTime
Can be TRUE or FALSE. The default is TRUE. If set to FALSE, log
ging output does not include date and time. This is useful if
you log to stdout(3) which is redirected to another logging
mechanism that already includes date and time in its output, for
instance systemd-journald(8). If you log to syslog(3), LogDate
AndTime is ignored and date and time will never be included in
the output sent to syslog(3). Using the command line you control
this setting with options -T0 and -T1.
LogVerbose
Set this to either TRUE or FALSE. The default is FALSE. If set
to TRUE, more details of each activation will be logged. You use
-v and -q in the command line to control this setting. LogVer
bose has an effect only if you specify a log file or redirect
logging to stdout(3).
WhitelistingLevel
Can be 0, 1, 2 or 3. The default is 0. Sets the whitelisting
level to determine which products vlmcsd activates or refuses.
0: activate all products with an unknown, retail or
beta/preview KMS ID.
1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select 1 or 3, vlmcsd also checks the Application ID for cor
rectness. If Microsoft introduces a new KMS ID for a new prod
uct, you cannot activate it if you used 1 or 3 until a new ver
sion of vlmcsd is available.
CheckClientTime
Can be TRUE or FALSE. The default is FALSE. If you set this to
TRUE vlmcsd(8) checks if the client time differs no more than
four hours from the system time. This is useful to prevent emu
lator detection. A client that tries to detect an emulator could
simply send two subsequent request with two time stamps that
differ more than four hours from each other. If both requests
succeed, the server is an emulator. If you set this to TRUE on a
system with no reliable time source, activations will fail. It
is ok to set the correct system time after you started vlm
csd(8).
MaintainClients
Can be TRUE or FALSE (the default). Disables (FALSE) or enables
(TRUE) maintaining a list of client machine IDs (CMIDs). TRUE is
useful to prevent emulator detection. By maintaing a CMID list,
vlmcsd(8) reports current active clients exactly like a genuine
KMS emulator. This includes bug compatibility to the extent that
you can permanently kill a genuine KMS emulator by sending an
"overcharge request" with a required client count of 376 or more
and then request activation for 671 clients. vlmcsd(8) can be
reset from this condition by restarting it. If FALSE is used,
vlmcsd(8) reports current active clients as good as possible. If
no client sends an "overcharge request", it is not possible to
detect vlmcsd(8) as an emulator with MaintainClients = FALSE.
Maintaining clients requires the allocation of a buffer that is
about 50 kB in size. On hardware with few memory resources use
it only if you really need it.
If you start vlmcsd(8) from an internet superserver, this set
ting cannot be used. Since vlmcsd(8) exits after each activa
tion, it cannot maintain any state in memory.
StartEmpty
This setting is ignored if you do not also specify Maintain
Clients = TRUE. If you specify FALSE (the default), vlmcsd(8)
starts up as a fully "charged" KMS server. Clients activate
immediately. StartEmpty = TRUE lets you start up vlmcsd(8) with
an empty CMID list. Activation will start when the required min
imum clients (25 for Windows Client OSses, 5 for Windows Server
OSses and Office) have registered with the KMS server. As long
as the minimum client count has not been reached, clients end up
in HRESULT 0xC004F038 "The count reported by your Key Management
Service (KMS) is insufficient. Please contact your system admin
istrator". You may use vlmcs(1) or another KMS client emulator
to "charge" vlmcsd(8). Setting this parameter to TRUE does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
ActivationInterval
This is the same as specifying -A on the command line. See vlm
csd(8) for details. The default is 2 hours. Example: Activation
Interval = 1h
RenewalInterval
This is the same as specifying -R on the command line. See vlm
csd(8) for details. The default is 7 days. Example: RenewalIn
terval = 3d. Please note that the KMS client decides itself when
to renew activation. Even though vlmcsd sends the renewal inter
val you specify, it is no more than some kind of recommendation
to the client. Older KMS clients did follow the recommendation
from a KMS server or emulator. Newer clients do not.
User Run vlmcsd as another, preferrably less privileged, user. The
argument can be a user name or a numeric user id. You must have
the required privileges (capabilities on Linux) to change the
security context of a process without providing any credentials
(a password in most cases). On most unixoid OSses 'root' is the
only user who has these privileges in the default configuration.
This setting is not available in the native Windows version of
vlmcsd. See -u in vlmcsd(8). This setting cannot be changed on
the fly by sending SIGHUP to vlmcsd.
Group Run vlmcsd as another, preferrably less privileged, group. The
argument can be a group name or a numeric group id. You must
have the required privileges (capabilities on Linux) to change
the security context of a process without providing any creden
tials (a password in most cases). On most unixoid OSses 'root'
is the only user who has these privileges in the default config
uration. This setting is not available in the native Windows
version of vlmcsd. See -g in vlmcsd(8). This setting cannot be
changed on the fly by sending SIGHUP to vlmcsd.
Windows
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Windows activations. If specified, RandomizationLevel
for Windows activitations will be ignored.
Office2010
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2010 activations. If specified, Randomization
Level for Office 2010 activitations will be ignored.
Office2013
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2013 activations. If specified, Randomization
Level for Office 2013 activitations will be ignored.
Office2016
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2016 activations. If specified, Randomization
Level for Office 2016 activitations will be ignored.
VALID EPIDS
The ePID is currently a comment only. You can specify any string up to
63 bytes. In Windows 7 Microsoft has blacklisted few ( < 10 ) ePIDs
that were used in KMSv5 versions of the "Ratiborus Virtual Machine".
Microsoft has given up on blacklisting when KMS emulators appeared in
the wild.
Even if you can use "Activated by cool hacker guys" as an ePID, you may
wish to use ePIDs that cannot be detected as non-MS ePIDs. If you don't
know how these "valid" ePIDs look like exactly, do not use GUIDS in
vlmcsd.ini. vlmcsd provides internal mechanisms to generate valid
ePIDs.
If you use non-ASCII characters in your ePID (you shouldn't do anyway),
these must be in UTF-8 format. This is especially important when you
run vlmcsd on Windows or cygwin because UTF-8 is not the default encod
ing for most editors.
If you are specifying an optional HWID it follows the same syntax as in
the -H option in vlmcsd(8) ecxept that you must not enclose a HWID in
quotes even if it contains spaces.
FILES
vlmcsd.ini(5)
AUTHOR
vlmcsd(8) was written by crony12, Hotbird64 and vityan666. With contri
butions from DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
SEE ALSO
vlmcsd(8), vlmcsd(7), vlmcs(1), vlmcsdmulti(1)
Hotbird64 January 2017 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!-- CreationDate: Thu Jan 19 21:29:26 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -36,8 +36,8 @@
</h2>
<p style="margin-left:11%; margin-top: 1em">vlmcsdmulti
&minus; a multi-call binary containing <b>vlmcs</b>(1) and
<p style="margin-left:11%; margin-top: 1em">vlmcsdmulti - a
multi-call binary containing <b>vlmcs</b>(1) and
<b>vlmcsd</b>(8)</p>
<h2>SYNOPSIS

View File

@ -1,346 +0,0 @@
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
#include CONFIG
#include "ntservice.h"
#include "shared_globals.h"
#include "vlmcsd.h"
#include "output.h"
#include "helpers.h"
#ifdef _NTSERVICE
SERVICE_STATUS gSvcStatus;
SERVICE_STATUS_HANDLE gSvcStatusHandle;
static VOID WINAPI ServiceCtrlHandler(const DWORD dwCtrl)
{
// Handle the requested control code.
switch(dwCtrl)
{
case SERVICE_CONTROL_STOP:
case SERVICE_CONTROL_SHUTDOWN:
ServiceShutdown = TRUE;
ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
// Remove PID file and free ressources
cleanup();
# ifdef USE_MSRPC
ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
# endif // !USE_MSRPC
return;
/*case SERVICE_CONTROL_INTERROGATE:
break;*/
default:
break;
}
}
static VOID WINAPI ServiceMain(const int argc_unused, CARGV argv_unused)
{
// Register the handler function for the service
gSvcStatusHandle = RegisterServiceCtrlHandler(
NT_SERVICE_NAME,
ServiceCtrlHandler
);
if(!gSvcStatusHandle)
{
//ServiceReportEvent(RegisterServiceCtrlHandler);
return;
}
// These SERVICE_STATUS members remain as set here
gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
gSvcStatus.dwServiceSpecificExitCode = 0;
// Run the actual program
ReportServiceStatus(SERVICE_STOPPED, newmain(), 3000);
}
SERVICE_TABLE_ENTRY NTServiceDispatchTable[] = {
{
(LPSTR)NT_SERVICE_NAME,
(LPSERVICE_MAIN_FUNCTION) ServiceMain
},
{
NULL,
NULL
}
};
VOID ReportServiceStatus(const DWORD dwCurrentState, const DWORD dwWin32ExitCode, const DWORD dwWaitHint)
{
static DWORD dwCheckPoint = 1;
// Fill in the SERVICE_STATUS structure.
gSvcStatus.dwCurrentState = dwCurrentState;
gSvcStatus.dwWin32ExitCode = dwWin32ExitCode;
gSvcStatus.dwWaitHint = dwWaitHint;
if (dwCurrentState == SERVICE_START_PENDING)
gSvcStatus.dwControlsAccepted = 0;
else
gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
if ( (dwCurrentState == SERVICE_RUNNING) ||
(dwCurrentState == SERVICE_STOPPED) )
gSvcStatus.dwCheckPoint = 0;
else
gSvcStatus.dwCheckPoint = dwCheckPoint++;
// Report the status of the service to the SCM.
SetServiceStatus(gSvcStatusHandle, &gSvcStatus);
}
/*VOID ServiceReportEvent(char *szFunction)
{
HANDLE hEventSource;
const char *eventStrings[2];
TCHAR Buffer[80];
hEventSource = RegisterEventSource(NULL, NT_SERVICE_NAME);
if (hEventSource)
{
snprintf(Buffer, 80, "%s failed with %d", szFunction, GetLastError());
eventStrings[0] = NT_SERVICE_NAME;
eventStrings[1] = Buffer;
ReportEvent(hEventSource, // event log handle
EVENTLOG_ERROR_TYPE, // event type
0, // event category
00, // event identifier
NULL, // no security identifier
2, // size of lpszStrings array
0, // no binary data
eventStrings, // array of strings
NULL); // no binary data
DeregisterEventSource(hEventSource);
}
}*/
//Returns 0=Error, 1=Success, 2=Doesn't exist
static uint_fast8_t OpenAndRemoveService(DWORD *dwPreviousState, SC_HANDLE *schSCManager)
{
SERVICE_STATUS status;
uint_fast8_t i;
SC_HANDLE installedService;
uint_fast8_t result = 1;
BOOL closeManager = FALSE;
// Allow NULL for both Arguments
if (!dwPreviousState) dwPreviousState = (DWORD*)alloca(sizeof(*dwPreviousState));
if (!schSCManager)
{
schSCManager = (SC_HANDLE*)alloca(sizeof(*schSCManager));
closeManager = TRUE;
}
*schSCManager = OpenSCManager(
NULL, // local computer
NULL, // ServicesActive database
SC_MANAGER_ALL_ACCESS); // full access rights
if (!*schSCManager) return 0;
if (!(installedService = OpenService(*schSCManager, NT_SERVICE_NAME, SERVICE_ALL_ACCESS)))
{
result = 2;
}
else
{
*dwPreviousState = SERVICE_STOPPED;
if (QueryServiceStatus(installedService, &status)) *dwPreviousState = status.dwCurrentState;
ControlService(installedService, SERVICE_CONTROL_STOP, &status);
for (i = 0; i < 10; i++)
{
QueryServiceStatus(installedService, &status);
// Give it 100 ms after it reported SERVICE_STOPPED. Subsequent CreateService will fail otherwise
Sleep(100);
if (status.dwCurrentState == SERVICE_STOPPED) break;
}
if (!DeleteService(installedService)) result = 0;
CloseServiceHandle(installedService);
}
if (closeManager) CloseServiceHandle(*schSCManager);
return result;
}
static VOID ServiceInstaller(const char *restrict ServiceUser, const char *const ServicePassword)
{
SC_HANDLE schSCManager;
SC_HANDLE schService;
char szPath[MAX_PATH] = "\"";
if (!GetModuleFileName(NULL, szPath + sizeof(char), MAX_PATH - 1))
{
errorout("Cannot install service (%d)\n", (uint32_t)GetLastError());
return;
}
strcat(szPath,"\"");
int i;
for (i = 1; i < global_argc; i ++)
{
// Strip unneccessary parameters, especially the password
if (!strcmp(global_argv[i], "-s")) continue;
if (!strcmp(global_argv[i], "-W") ||
!strcmp(global_argv[i], "-U"))
{
i++;
continue;
}
strcat(szPath, " ");
if (strchr(global_argv[i], ' '))
{
strcat(szPath, "\"");
strcat(szPath, global_argv[i]);
strcat(szPath, "\"");
}
else
strcat(szPath, global_argv[i]);
}
// Get a handle to the SCM database.
SERVICE_STATUS status;
DWORD dwPreviousState;
if (!OpenAndRemoveService(&dwPreviousState, &schSCManager))
{
errorout("Service removal failed (%d)\n", (uint32_t)GetLastError());
return;
}
char *tempUser = NULL;
if (ServiceUser)
{
// Shortcuts for some well known users
if (!strcasecmp(ServiceUser, "/l")) ServiceUser="NT AUTHORITY\\LocalService";
if (!strcasecmp(ServiceUser, "/n")) ServiceUser="NT AUTHORITY\\NetworkService";
// Allow Local Users without .\ , e.g. "johndoe" instead of ".\johndoe"
if (!strchr(ServiceUser, '\\'))
{
tempUser = (char*)vlmcsd_malloc(strlen(ServiceUser) + 3);
strcpy(tempUser, ".\\");
strcat(tempUser, ServiceUser);
ServiceUser = tempUser;
}
}
schService = CreateService(
schSCManager, // SCM database
NT_SERVICE_NAME, // name of service
NT_SERVICE_DISPLAY_NAME, // service name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, // start type
SERVICE_ERROR_NORMAL, // error control type
szPath, // path to service's binary
NULL, // no load ordering group
NULL, // no tag identifier
"tcpip\0", // depends on TCP/IP
ServiceUser, // LocalSystem account
ServicePassword); // no password
# if __clang__ && (__CYGWIN__ || __MINGW64__ )
// Workaround for clang not understanding some GCC asm syntax used in <w32api/psdk_inc/intrin-impl.h>
ZeroMemory((char*)ServicePassword, strlen(ServicePassword));
# else
SecureZeroMemory((char*)ServicePassword, strlen(ServicePassword));
# endif
if (tempUser) free(tempUser);
if (schService == NULL)
{
errorout("CreateService failed (%u)\n", (uint32_t)GetLastError());
CloseServiceHandle(schSCManager);
return;
}
else
{
errorout("Service installed successfully\n");
if (dwPreviousState == SERVICE_RUNNING)
{
printf("Restarting " NT_SERVICE_NAME " service => ");
status.dwCurrentState = SERVICE_STOPPED;
if (StartService(schService, 0, NULL))
{
for (i = 0; i < 10; i++)
{
if (!QueryServiceStatus(schService, &status) || status.dwCurrentState != SERVICE_START_PENDING) break;
Sleep(100);
}
if (status.dwCurrentState == SERVICE_RUNNING)
printf("Success\n");
else if (status.dwCurrentState == SERVICE_START_PENDING)
printf("Not ready within a second\n");
else
errorout("Error\n");
}
else
errorout("Error %u\n", (uint32_t)GetLastError());
}
}
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
}
int NtServiceInstallation(const int_fast8_t installService, const char *restrict ServiceUser, const char *const ServicePassword)
{
if (IsNTService) return 0;
if (installService == 1) // Install
{
ServiceInstaller(ServiceUser, ServicePassword);
return(0);
}
if (installService == 2) // Remove
{
switch(OpenAndRemoveService(NULL, NULL))
{
case 0:
errorout("Error removing service %s\n", NT_SERVICE_NAME);
return(!0);
case 1:
printf("Service %s removed successfully\n", NT_SERVICE_NAME);
return(0);
default:
errorout("Service %s does not exist.\n", NT_SERVICE_NAME);
return(!0);
}
}
// Do nothing
return(0);
}
#endif // _NTSERVICE

1113
rpc.c

File diff suppressed because it is too large Load Diff

178
rpc.h
View File

@ -1,178 +0,0 @@
#ifndef __rpc_h
#define __rpc_h
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
#include CONFIG
#include "types.h"
typedef struct {
BYTE VersionMajor;
BYTE VersionMinor;
BYTE PacketType;
BYTE PacketFlags;
DWORD DataRepresentation;
WORD FragLength;
WORD AuthLength;
DWORD CallId;
} /*__packed*/ RPC_HEADER;
typedef struct {
WORD MaxXmitFrag;
WORD MaxRecvFrag;
DWORD AssocGroup;
DWORD NumCtxItems;
struct {
WORD ContextId;
WORD NumTransItems;
GUID InterfaceUUID;
WORD InterfaceVerMajor;
WORD InterfaceVerMinor;
GUID TransferSyntax;
DWORD SyntaxVersion;
} CtxItems[1];
} /*__packed*/ RPC_BIND_REQUEST;
typedef struct {
WORD MaxXmitFrag;
WORD MaxRecvFrag;
DWORD AssocGroup;
WORD SecondaryAddressLength;
BYTE SecondaryAddress[6];
DWORD NumResults;
struct {
WORD AckResult;
WORD AckReason;
GUID TransferSyntax;
DWORD SyntaxVersion;
} Results[0];
} /*__packed*/ RPC_BIND_RESPONSE;
typedef struct {
DWORD AllocHint;
WORD ContextId;
WORD Opnum;
struct {
DWORD DataLength;
DWORD DataSizeIs;
} Ndr;
BYTE Data[0];
} /*__packed*/ RPC_REQUEST;
typedef struct {
DWORD AllocHint;
WORD ContextId;
BYTE CancelCount;
BYTE Pad1;
struct {
DWORD DataLength;
DWORD DataSizeIs1;
DWORD DataSizeIs2;
} Ndr;
BYTE Data[0];
} /*__packed*/ RPC_RESPONSE;
typedef struct {
DWORD AllocHint;
WORD ContextId;
WORD Opnum;
union {
struct {
DWORD DataLength;
DWORD DataSizeIs;
BYTE Data[0];
} Ndr;
struct {
uint64_t DataLength;
uint64_t DataSizeIs;
BYTE Data[0];
} Ndr64;
};
} /*__packed*/ RPC_REQUEST64;
typedef struct {
DWORD AllocHint;
WORD ContextId;
BYTE CancelCount;
BYTE Pad1;
union {
struct {
DWORD DataLength;
DWORD DataSizeMax;
union
{
DWORD DataSizeIs;
DWORD status;
};
BYTE Data[0];
} Ndr;
struct {
uint64_t DataLength;
uint64_t DataSizeMax;
union
{
uint64_t DataSizeIs;
DWORD status;
};
BYTE Data[0];
} Ndr64;
};
} /*__packed*/ RPC_RESPONSE64;
typedef SOCKET RpcCtx;
typedef int RpcStatus;
#define INVALID_NDR_CTX ((WORD)~0)
#define RPC_BIND_ACCEPT (0)
#define RPC_BIND_NACK (LE16(2))
#define RPC_BIND_ACK (LE16(3))
#define RPC_SYNTAX_UNSUPPORTED (LE16(2))
#define RPC_ABSTRACTSYNTAX_UNSUPPORTED (LE16(1))
#define RPC_BTFN_SEC_CONTEXT_MULTIPLEX (LE16(1))
#define RPC_BTFN_KEEP_ORPHAN (LE16(2))
#define INVALID_RPCCTX INVALID_SOCKET
#define closeRpc socketclose
#define RPC_PT_REQUEST 0
#define RPC_PT_RESPONSE 2
#define RPC_PT_BIND_REQ 11
#define RPC_PT_BIND_ACK 12
#define RPC_PT_ALTERCONTEXT_REQ 14
#define RPC_PT_ALTERCONTEXT_ACK 15
#define RPC_PF_FIRST 1
#define RPC_PF_LAST 2
#define RPC_PF_CANCEL_PENDING 4
#define RPC_PF_RESERVED 8
#define RPC_PF_MULTIPLEX 16
#define RPC_PF_NOT_EXEC 32
#define RPC_PF_MAYBE 64
#define RPC_PF_OBJECT 128
typedef union _RPC_FLAGS
{
DWORD mask;
struct {
uint32_t FlagsBTFN : 16;
BOOL HasNDR32 : 1;
BOOL HasNDR64 : 1;
BOOL HasBTFN : 1;
};
} RPC_FLAGS, *PRPC_FLAGS;
extern RPC_FLAGS RpcFlags;
void rpcServer(const RpcCtx socket, const DWORD RpcAssocGroup, const char* const ipstr);
RpcStatus rpcBindClient(const RpcCtx sock, const int_fast8_t verbose);
RpcStatus rpcSendRequest(const RpcCtx socket, const BYTE *const KmsRequest, const size_t requestSize, BYTE **KmsResponse, size_t *const responseSize);
#endif // __rpc_h

653
src/GNUmakefile Normal file
View File

@ -0,0 +1,653 @@
################################################################################
.PHONY: clean
PROGRAM_NAME ?= ../bin/vlmcsd
CLIENT_NAME ?= ../bin/vlmcs
MULTI_NAME ?= ../bin/vlmcsdmulti
OBJ_NAME ?= ../build/libkms-static.o
A_NAME ?= ../lib/libkms.a
CONFIG ?= config.h
COMPILER_LANGUAGE ?= c
BASE_PROGRAM_NAME=$(notdir $(PROGRAM_NAME))
BASE_CLIENT_NAME=$(notdir $(CLIENT_NAME))
BASE_MULTI_NAME=$(notdir $(MULTI_NAME))
BASE_DLL_NAME=$(notdir $(DLL_NAME))
BASE_A_NAME=$(notdir $(A_NAME))
ifeq (1,$(FROM_PARENT))
CLIENT_NAME_TEST=$(patsubst /%,/,$(CLIENT_NAME))
MULTI_NAME_TEST=$(patsubst /%,/,$(MULTI_NAME))
DLL_NAME_TEST=$(patsubst /%,/,$(DLL_NAME))
A_NAME_TEST=$(patsubst /%,/,$(A_NAME))
PROGRAM_NAME_TEST=$(patsubst /%,/,$(PROGRAM_NAME))
ifneq (/,$(PROGRAM_NAME_TEST))
PROGRAM_PREFIX=../
endif
ifneq (/,$(CLIENT_NAME_TEST))
CLIENT_PREFIX=../
endif
ifneq (/,$(MULTI_NAME_TEST))
MULTI_PREFIX=../
endif
ifneq (/,$(DLL_NAME_TEST))
DLL_PREFIX=../
endif
ifneq (/,$(A_NAME_TEST))
A_PREFIX=../
endif
endif
REAL_PROGRAM_NAME=$(PROGRAM_PREFIX)$(PROGRAM_NAME)
REAL_CLIENT_NAME=$(CLIENT_PREFIX)$(CLIENT_NAME)
REAL_MULTI_NAME=$(MULTI_PREFIX)$(MULTI_NAME)
REAL_DLL_NAME=$(DLL_PREFIX)$(DLL_NAME)
REAL_A_NAME=$(A_PREFIX)$(A_NAME)
# crypto library to use for standard algos, could save ~1-2kb ;)
# can be either 'openssl', 'polarssl' or anything other for internal impl
CRYPTO ?= internal
# use DNS_PARSER=internal if your OS doesn't supply the DNS parser routines
DNS_PARSER ?= OS
# You should supply your own version string here
VLMCSD_VERSION ?= $(shell test -d ../.git && git describe)
FEATURES ?= full
VERBOSE ?= NO
################################################################################
CC ?= gcc
TARGETPLATFORM := $(shell LANG=en_US.UTF-8 $(CC) -v 2>&1 | grep '^Target: ' | cut -f 2 -d ' ')
ifneq (,$(findstring darwin,$(TARGETPLATFORM)))
DARWIN := 1
UNIX := 1
endif
ifneq (,$(findstring android,$(TARGETPLATFORM)))
ANDROID := 1
UNIX := 1
ELF := 1
endif
ifneq (,$(findstring minix,$(TARGETPLATFORM)))
MINIX := 1
UNIX := 1
ELF := 1
endif
ifneq (,$(findstring mingw,$(TARGETPLATFORM)))
MINGW := 1
WIN := 1
PE := 1
endif
ifneq (,$(findstring cygwin,$(TARGETPLATFORM)))
CYGWIN := 1
WIN := 1
PE := 1
endif
ifneq (,$(findstring cygnus,$(TARGETPLATFORM)))
CYGWIN := 1
WIN := 1
PE := 1
endif
ifneq (,$(findstring freebsd,$(TARGETPLATFORM)))
FREEBSD := 1
UNIX := 1
BSD := 1
ELF := 1
endif
ifneq (,$(findstring netbsd,$(TARGETPLATFORM)))
NETBSD := 1
UNIX := 1
BSD := 1
ELF := 1
endif
ifneq (,$(findstring openbsd,$(TARGETPLATFORM)))
OPENBSD := 1
UNIX := 1
BSD := 1
ELF := 1
endif
ifneq (,$(findstring solaris,$(TARGETPLATFORM)))
SOLARIS := 1
UNIX := 1
ELF := 1
endif
ifneq (,$(findstring linux,$(TARGETPLATFORM)))
LINUX := 1
UNIX := 1
ELF := 1
endif
ifneq (,$(findstring gnu,$(TARGETPLATFORM)))
ifeq (,$(findstring linux,$(TARGETPLATFORM)))
UNIX := 1
HURD := 1
ELF := 1
endif
endif
ifeq ($(CYGWIN),1)
DLL_NAME ?= ../lib/cygkms.dll
else ifeq ($(WIN),1)
DLL_NAME ?= ../lib/libkms.dll
else ifeq ($(DARWIN),1)
DLL_NAME ?= ../lib/libkms.dylib
else
DLL_NAME ?= ../lib/libkms.so
endif
BASECFLAGS = -DVLMCSD_COMPILER=\"$(notdir $(CC))\" -DVLMCSD_PLATFORM=\"$(TARGETPLATFORM)\" -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections
BASELDFLAGS =
STRIPFLAGS =
CLIENTLDFLAGS =
SERVERLDFLAGS =
ifndef SAFE_MODE
BASECFLAGS += -fvisibility=hidden -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants
ifeq ($(ELF),1)
BASELDFLAGS += -Wl,-z,norelro
endif
ifneq (,$(findstring gcc,$(notdir $(CC))))
BASECFLAGS += -flto
endif
endif
ifeq ($(ELF), 1)
PICFLAGS += -fPIC
endif
ifeq ($(NOLIBS),1)
NOLRESOLV=1
NOLPTHREAD=1
endif
ifneq ($(NOLIBS),1)
ifeq ($(MINGW),1)
BASELDFLAGS += -lws2_32 -liphlpapi -lshlwapi
endif
endif
ifneq ($(NOLIBS),1)
ifeq ($(CYGWIN),1)
BASELDFLAGS += -liphlpapi
endif
endif
ifneq ($(NO_DNS),1)
ifneq ($(ANDROID),1)
ifneq ($(NOLRESOLV),1)
ifeq ($(MINGW),1)
CLIENTLDFLAGS += -ldnsapi
endif
ifeq ($(LINUX),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(HURD),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(DARWIN),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(CYGWIN),1)
DNS_PARSER := internal
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(OPENBSD),1)
DNS_PARSER := internal
endif
ifeq ($(SOLARIS),1)
CLIENTLDFLAGS += -lresolv
endif
endif
endif
else
BASECFLAGS += -DNO_DNS
endif
ifneq ($(CAT),2)
BASECFLAGS += "-Wall"
endif
ifeq ($(DARWIN), 1)
STRIPFLAGS += -Wl,-S -Wl,-x
BASECFLAGS += -Wno-deprecated-declarations
else ifeq ($(shell uname), SunOS)
STRIPFLAGS += -s
ifeq ($(notdir $(LD_ALTEXEC)),gld)
BASELDFLAGS += -Wl,--gc-sections
endif
BASELDFLAGS += -lsocket
else
ifneq ($(CC),tcc)
BASELDFLAGS += -Wl,--gc-sections
endif
STRIPFLAGS += -s
endif
LIBRARY_CFLAGS = -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT -DNO_STRICT_MODES -DNO_CLIENT_LIST -DNO_TAP -UNO_SOCKETS -USIMPLE_RPC
ifeq ($(FEATURES), embedded)
BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), autostart)
BASECFLAGS += -DNO_HELP -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), minimum)
BASECFLAGS += -DSIMPLE_RPC -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT -DSMALL_AES -DNO_STRICT_MODES -DNO_TAP -DNO_CLIENT_LIST -DUNSAFE_DATA_LOAD -DNO_EXTERNAL_DATA -UFULL_INTERNAL_DATA -U_PEDANTIC
else ifeq ($(FEATURES), most)
BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT
else ifeq ($(FEATURES), inetd)
BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), fixedepids)
BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE
endif
ifdef INI
BASECFLAGS += -DINI_FILE=\"$(INI)\"
endif
ifdef DATA
BASECFLAGS += -DDATA_FILE=\"$(DATA)\"
endif
ifeq ($(NO_GETIFADDRS), 1)
BASECFLAGS += -DNO_GETIFADDRS
endif
ifeq ($(THREADS), 1)
BASECFLAGS += -DUSE_THREADS
endif
ifeq ($(CHILD_HANDLER), 1)
BASECFLAGS += -DCHILD_HANDLER
endif
ifeq ($(NO_TIMEOUT), 1)
BASECFLAGS += -DNO_TIMEOUT
endif
ifdef WINDOWS
BASECFLAGS += -DEPID_WINDOWS=\"$(WINDOWS)\"
endif
ifdef OFFICE2010
BASECFLAGS += -DEPID_OFFICE2010=\"$(OFFICE2010)\"
endif
ifdef OFFICE2013
BASECFLAGS += -DEPID_OFFICE2013=\"$(OFFICE2013)\"
endif
ifdef OFFICE2016
BASECFLAGS += -DEPID_OFFICE2016=\"$(OFFICE2016)\"
endif
ifdef HWID
BASECFLAGS += -DHWID=$(HWID)
endif
ifdef TERMINAL_WIDTH
BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) -DDISPLAY_WIDTH=\"$(TERMINAL_WIDTH)\"
endif
ifeq ($(NOPROCFS), 1)
BASECFLAGS += -DNO_PROCFS
endif
ifeq ($(AUXV), 1)
BASECFLAGS += -DUSE_AUXV
endif
ifneq ($(ANDROID), 1)
ifneq ($(MINIX), 1)
ifneq ($(NOLPTHREAD), 1)
ifneq ($(DARWIN), 1)
ifeq ($(THREADS), 1)
SERVERLDFLAGS += -lpthread
endif
ifeq (,$(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)))
SERVERLDFLAGS += -lpthread
endif
endif
endif
endif
endif
$(REAL_MULTI_NAME): BASECFLAGS += -DMULTI_CALL_BINARY=1
all: $(REAL_CLIENT_NAME) $(REAL_PROGRAM_NAME)
allmulti: $(REAL_CLIENT_NAME) $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME)
vlmcsd: $(REAL_PROGRAM_NAME)
+@true
vlmcs: $(REAL_CLIENT_NAME)
+@true
vlmcsdmulti: $(REAL_MULTI_NAME)
+@true
libkms: $(REAL_DLL_NAME)
+@true
libkms-static: $(REAL_A_NAME)
ifneq ($(strip $(VLMCSD_VERSION)),)
BASECFLAGS += -DVERSION=\"$(VLMCSD_VERSION),\ built\ $(shell date -u '+%Y-%m-%d %H:%M:%S' | sed -e 's/ /\\ /g')\ UTC\"
endif
ifdef CAT
BASECFLAGS += -DONE_FILE
endif
SRCS = crypto.c kms.c endian.c output.c shared_globals.c helpers.c
HEADERS = $(CONFIG) types.h rpc.h vlmcsd.h endian.h crypto.h kms.h network.h output.h shared_globals.h vlmcs.h helpers.h kmsdata.h
DEPS = $(patsubst %,../build/%,$(MULTI_SRCS:.c=.d))
VLMCSD_SRCS = vlmcsd.c kmsdata.c $(SRCS)
VLMCSD_OBJS = $(patsubst %,../build/%,$(VLMCSD_SRCS:.c=.o))
VLMCS_SRCS = vlmcs.c kmsdata-full.c $(SRCS)
VLMCS_OBJS = $(patsubst %,../build/%,$(VLMCS_SRCS:.c=.o))
MULTI_SRCS = vlmcsd.c vlmcs.c vlmcsdmulti.c kmsdata-full.c $(SRCS)
MULTI_OBJS = $(patsubst %,../build/%,$(SRCS:.c=.o)) ../build/kmsdata-full.o ../build/vlmcsd-m.o ../build/vlmcs-m.o ../build/vlmcsdmulti-m.o
DLL_SRCS = libkms.c vlmcs.c $(SRCS)
DLL_OBJS = $(patsubst %,../build/%,$(DLL_SRCS:.c=-l.o))
A_OBJS = $(patsubst %,../build/%,$(DLL_SRCS:.c=-a.o))
PDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf vlmcsd-floppy.7.pdf
HTMLDOCS = $(PDFDOCS:.pdf=.html)
UNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)
DOSDOCS = $(PDFDOCS:.pdf=.dos.txt)
ifneq ($(NO_DNS),1)
VLMCS_SRCS += dns_srv.c
MULTI_SRCS += dns_srv.c
MULTI_OBJS += ../build/dns_srv.o
ifeq ($(DNS_PARSER),internal)
ifneq ($(MINGW),1)
VLMCS_SRCS += ns_parse.c ns_name.c
MULTI_SRCS += ns_parse.c ns_name.c
MULTI_OBJS += ../build/ns_parse.o ../build/ns_name.o
BASECFLAGS += "-DDNS_PARSER_INTERNAL"
endif
endif
endif
ifeq ($(MSRPC),1)
VLMCSD_SRCS += msrpc-server.c
VLMCS_SRCS += msrpc-client.c
MULTI_SRCS += msrpc-server.c msrpc-client.c
MULTI_OBJS += ../build/msrpc-server-m.o ../build/msrpc-client-m.o
DLL_SRCS += msrpc-server.c
BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas
BASELDFLAGS += -lrpcrt4
else
SRCS += network.c rpc.c
endif
ifeq ($(GETIFADDRS),musl)
ifneq ($(NO_GETIFADDRS),1)
BASECFLAGS += -DGETIFADDRS_MUSL
VLMCSD_SRCS += getifaddrs-musl.c
MULTI_SRCS += getifaddrs-musl.c
VLMCS_SRCS += getifaddrs-musl.c
DLL_SRCS += getifaddrs-musl.c
MULTI_OBJS += ../build/getifaddrs-musl.o
endif
endif
ifeq ($(ANDROID),1)
ifneq ($(NO_GETIFADDRS),1)
VLMCSD_SRCS += ifaddrs-android.c
MULTI_SRCS += ifaddrs-android.c
DLL_SRCS += ifaddrs-android.c
MULTI_OBJS += ../build/ifaddrs-android.o
endif
endif
ifeq "$(WIN)" "1"
VLMCSD_SRCS += ntservice.c wintap.c
MULTI_SRCS += ntservice.c wintap.c
MULTI_OBJS += ../build/ntservice.o ../build/wintap.o
endif
ifeq ($(CRYPTO), openssl_with_aes)
BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), openssl_with_aes_soft)
BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL -D_OPENSSL_SOFTWARE
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), openssl)
BASECFLAGS += -D_CRYPTO_OPENSSL
BASELDFLAGS += -lcrypto
SRCS += crypto_openssl.c
else ifeq ($(CRYPTO), polarssl)
BASECFLAGS += -D_CRYPTO_POLARSSL
BASELDFLAGS += -lpolarssl
else ifeq ($(CRYPTO), windows)
BASECFLAGS += -D_CRYPTO_WINDOWS
SRCS += crypto_windows.c
else
BASECFLAGS += -D_CRYPTO_INTERNAL
SRCS += crypto_internal.c
endif
ifneq ($(STRIP),0)
BASELDFLAGS += $(STRIPFLAGS)
endif
ifeq ($(OPENSSL_HMAC),0)
BASECFLAGS += -D_OPENSSL_NO_HMAC
endif
ifeq ($(DEPENDENCIES),2)
BASECFLAGS += -MMD
endif
ifeq ($(VERBOSE),3)
COMPILER := $(shell printf "%-40s" $(notdir $(CC)))
ARCHIVER := $(shell printf "%-40s" $(notdir $(AR)))
endif
ARCMD := AR
ifdef CAT
LDCMD := CC/LD
else
LDCMD := LD
endif
-include $(MULTI_SRCS:.c=.d)
../build/%.o: %.c
ifeq ($(VERBOSE),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< -o $@
ifeq ($(DEPENDENCIES),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@
endif
else
+@echo "$(COMPILER) CC $(notdir $@) <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< -o $@
ifeq ($(DEPENDENCIES),1)
+@echo "$(COMPILER) DEP $*.d <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@
endif
endif
../build/%-m.o: %.c
ifeq ($(VERBOSE),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@
endif
else
+@echo "$(COMPILER) CC $(notdir $@) <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+@echo "$(COMPILER) DEP $*.d <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@
endif
endif
../build/%-a.o: %.c
ifeq ($(VERBOSE),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<
endif
else
+@echo "$(COMPILER) CC $(notdir $@) <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+@echo "$(COMPILER) DEP $*.d <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<
endif
endif
../build/%-l.o: %.c
ifeq ($(VERBOSE),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<
endif
else
+@echo "$(COMPILER) CC $(notdir $@) <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
+@echo "$(COMPILER) DEP $*.d <- $<"
+@$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<
endif
endif
ifdef CAT
BUILDCOMMAND = cat $^ | $(CC) -x$(COMPILER_LANGUAGE) -o $@ -
VLMCSD_PREREQUISITES = $(VLMCSD_SRCS)
VLMCS_PREREQUISITES = $(VLMCS_SRCS)
MULTI_PREREQUISITES = $(MULTI_SRCS)
DLL_PREREQUISITES = $(DLL_SRCS)
OBJ_PREREQUISITES = $(DLL_SRCS)
A_PREREQUISITES = $(DLL_SRCS)
else
BUILDCOMMAND = $(CC) -o $@ $^
VLMCSD_PREREQUISITES = $(VLMCSD_OBJS)
VLMCS_PREREQUISITES = $(VLMCS_OBJS)
MULTI_PREREQUISITES = $(MULTI_OBJS)
DLL_PREREQUISITES = $(DLL_OBJS)
OBJ_PREREQUISITES = $(A_OBJS)
A_PREREQUISITES = $(A_OBJS)
endif
ifeq ($(VERBOSE),1)
BUILDCOMMANDPREFIX = +
else
BUILDCOMMANDPREFIX = +@
endif
INFOCOMMAND = +@echo "$(COMPILER) $(LDCMD) $@ <- $(notdir $^)"
ARINFOCOMMAND = +@echo "$(ARCHIVER) $(ARCMD) $@ <. $(notdir $^)"
VLMCSD_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS)
VLMCS_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS)
MULTI_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS) $(SERVERLDFLAGS)
DLL_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -shared -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
OBJ_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(REAL_PROGRAM_NAME): $(VLMCSD_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(VLMCSD_COMMAND)
$(REAL_CLIENT_NAME): $(VLMCS_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(VLMCS_COMMAND)
$(REAL_MULTI_NAME): $(MULTI_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(MULTI_COMMAND)
$(REAL_DLL_NAME): $(DLL_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(DLL_COMMAND)
ifndef CAT
$(OBJ_NAME):
+@echo Cannot make $@ without CAT defined. Please create $(A_NAME)
else
$(OBJ_NAME): $(OBJ_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(OBJ_COMMAND)
endif
ifdef CAT
$(REAL_A_NAME): $(OBJ_NAME)
else
$(REAL_A_NAME): BASECFLAGS += -fvisibility=hidden -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(REAL_A_NAME): $(A_OBJS)
endif
ifneq ($(VERBOSE),1)
$(ARINFOCOMMAND)
endif
+@rm -f $@
$(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^
clean:
rm -f $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME) $(REAL_DLL_NAME) $(REAL_CLIENT_NAME) $(OBJ_NAME) $(REAL_A_NAME) ../bin/* ../build/* *.d
dnsclean:
rm -f ../build/dns_srv.o
help:
@echo "Help is available by typing 'make help' in directory $(shell realpath `pwd`/..). Use 'cd ..' to get there."

View File

@ -41,6 +41,8 @@
#define TRANSMIT_AS_TABLE_SIZE 0
#define WIRE_MARSHAL_TABLE_SIZE 0
#if !MULTI_CALL_BINARY
typedef struct _KMSServer_MIDL_TYPE_FORMAT_STRING
{
short Pad;
@ -68,6 +70,8 @@ extern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;
extern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;
extern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;
#endif // !MULTI_CALL_BINARY
#define GENERIC_BINDING_TABLE_SIZE 0
@ -231,8 +235,6 @@ int RequestActivation(
}
};
#endif // !MULTI_CALL_BINARY
static const unsigned short KMSServer_FormatStringOffsetTable[] =
{
0
@ -241,7 +243,6 @@ static const unsigned short KMSServer_FormatStringOffsetTable[] =
//typedef void *(__RPC_API midl_user_allocate_t)(size_t);
typedef void *(__RPC_API *midl_allocate_t)(size_t);
#if !MULTI_CALL_BINARY
/*static*/ const MIDL_STUB_DESC KMSServer_StubDesc =
{
(void *)& KMSServer___RpcClientInterface,

View File

@ -33,6 +33,8 @@
#include "KMSServer_h.h"
#if !MULTI_CALL_BINARY
#define TYPE_FORMAT_STRING_SIZE 43
#define PROC_FORMAT_STRING_SIZE 61
#define EXPR_FORMAT_STRING_SIZE 1
@ -70,6 +72,8 @@ extern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;
extern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;
extern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;
#endif // !MULTI_CALL_BINARY
#define GENERIC_BINDING_TABLE_SIZE 0
@ -233,14 +237,12 @@ int RequestActivation(
}
};
#endif //!MULTI_CALL_BINARY
static const unsigned short KMSServer_FormatStringOffsetTable[] =
{
0
};
#endif //!MULTI_CALL_BINARY
#endif /* defined(_M_AMD64)*/
@ -276,6 +278,8 @@ static const unsigned short KMSServer_FormatStringOffsetTable[] =
#include "ndr64types.h"
#include "pshpack8.h"
#if !MULTI_CALL_BINARY
typedef
struct
{
@ -363,7 +367,6 @@ NDR64_FORMAT_UINT32
__midl_frag1_t;
extern const __midl_frag1_t __midl_frag1;
#if !MULTI_CALL_BINARY
/*static*/ const __midl_frag13_t __midl_frag13 =
{
/* */
@ -652,6 +655,7 @@ extern const __midl_frag1_t __midl_frag1;
#include "poppack.h"
#if !MULTI_CALL_BINARY
static const FormatInfoRef KMSServer_Ndr64ProcTable[] =
{
@ -661,7 +665,6 @@ static const FormatInfoRef KMSServer_Ndr64ProcTable[] =
//typedef void *__RPC_USER MIDL_user_allocate_t(SIZE_T)
typedef void *(__RPC_API *midl_allocate_t)(size_t);
#if !MULTI_CALL_BINARY
/*static*/ const MIDL_STUB_DESC KMSServer_StubDesc =
{
(void *)& KMSServer___RpcClientInterface,
@ -685,7 +688,6 @@ typedef void *(__RPC_API *midl_allocate_t)(size_t);
(void *)& KMSServer_ProxyInfo, /* proxy/server info */
0
};
#endif // !MULTI_CALL_BINARY
static const MIDL_SYNTAX_INFO KMSServer_SyntaxInfo [ 2 ] =
{
@ -711,6 +713,8 @@ static const MIDL_SYNTAX_INFO KMSServer_SyntaxInfo [ 2 ] =
}
};
#endif // !MULTI_CALL_BINARY
/*static*/ const MIDL_STUBLESS_PROXY_INFO KMSServer_ProxyInfo =
{
&KMSServer_StubDesc,

View File

@ -18,6 +18,10 @@
*/
/* @@MIDL_FILE_HEADING( ) */
#if _WIN32
#include "winsock2.h"
#endif
#pragma warning( disable: 4049 ) /* more than 64k source lines */

View File

@ -0,0 +1,58 @@
/* This file is needed by libio to define various configuration parameters.
These are always the same in the GNU C library. */
#ifndef _G_config_h
#define _G_config_h 1
/* Define types for libio in terms of the standard internal type names. */
#include <bits/types.h>
#define __need_size_t
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define __need_wchar_t
#endif
#define __need_NULL
#include <stddef.h>
#define __need_mbstate_t
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define __need_wint_t
#endif
#include <wchar.h>
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <gconv.h>
typedef union
{
struct __gconv_info __cd;
struct
{
struct __gconv_info __cd;
struct __gconv_step_data __data;
} __combined;
} _G_iconv_t;
#endif
/* These library features are always available in the GNU C library. */
#define _G_va_list __gnuc_va_list
#define _G_HAVE_MMAP 1
#define _G_HAVE_MREMAP 1
#define _G_IO_IO_FILE_VERSION 0x20001
/* This is defined by <bits/stat.h> if `st_blksize' exists. */
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
#define _G_BUFSIZ 8192
#endif /* _G_config.h */

View File

@ -0,0 +1,246 @@
/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
/*
* ISO/IEC 9945-1:1996 6.7: Asynchronous Input and Output
*/
#ifndef _AIO_H
#define _AIO_H 1
#include <features.h>
#include <sys/types.h>
#define __need_sigevent_t
#include <bits/siginfo.h>
#define __need_timespec
#include <time.h>
__BEGIN_DECLS
/* Asynchronous I/O control block. */
struct aiocb
{
int aio_fildes; /* File desriptor. */
int aio_lio_opcode; /* Operation to be performed. */
int aio_reqprio; /* Request priority offset. */
volatile void *aio_buf; /* Location of buffer. */
size_t aio_nbytes; /* Length of transfer. */
struct sigevent aio_sigevent; /* Signal number and value. */
/* Internal members. */
struct aiocb *__next_prio;
int __abs_prio;
int __policy;
int __error_code;
__ssize_t __return_value;
#ifndef __USE_FILE_OFFSET64
__off_t aio_offset; /* File offset. */
char __pad[sizeof (__off64_t) - sizeof (__off_t)];
#else
__off64_t aio_offset; /* File offset. */
#endif
char __glibc_reserved[32];
};
/* The same for the 64bit offsets. Please note that the members aio_fildes
to __return_value have to be the same in aiocb and aiocb64. */
#ifdef __USE_LARGEFILE64
struct aiocb64
{
int aio_fildes; /* File desriptor. */
int aio_lio_opcode; /* Operation to be performed. */
int aio_reqprio; /* Request priority offset. */
volatile void *aio_buf; /* Location of buffer. */
size_t aio_nbytes; /* Length of transfer. */
struct sigevent aio_sigevent; /* Signal number and value. */
/* Internal members. */
struct aiocb *__next_prio;
int __abs_prio;
int __policy;
int __error_code;
__ssize_t __return_value;
__off64_t aio_offset; /* File offset. */
char __glibc_reserved[32];
};
#endif
#ifdef __USE_GNU
/* To customize the implementation one can use the following struct.
This implementation follows the one in Irix. */
struct aioinit
{
int aio_threads; /* Maximal number of threads. */
int aio_num; /* Number of expected simultanious requests. */
int aio_locks; /* Not used. */
int aio_usedba; /* Not used. */
int aio_debug; /* Not used. */
int aio_numusers; /* Not used. */
int aio_idle_time; /* Number of seconds before idle thread
terminates. */
int aio_reserved;
};
#endif
/* Return values of cancelation function. */
enum
{
AIO_CANCELED,
#define AIO_CANCELED AIO_CANCELED
AIO_NOTCANCELED,
#define AIO_NOTCANCELED AIO_NOTCANCELED
AIO_ALLDONE
#define AIO_ALLDONE AIO_ALLDONE
};
/* Operation codes for `aio_lio_opcode'. */
enum
{
LIO_READ,
#define LIO_READ LIO_READ
LIO_WRITE,
#define LIO_WRITE LIO_WRITE
LIO_NOP
#define LIO_NOP LIO_NOP
};
/* Synchronization options for `lio_listio' function. */
enum
{
LIO_WAIT,
#define LIO_WAIT LIO_WAIT
LIO_NOWAIT
#define LIO_NOWAIT LIO_NOWAIT
};
/* Allow user to specify optimization. */
#ifdef __USE_GNU
extern void aio_init (const struct aioinit *__init) __THROW __nonnull ((1));
#endif
#ifndef __USE_FILE_OFFSET64
/* Enqueue read request for given number of bytes and the given priority. */
extern int aio_read (struct aiocb *__aiocbp) __THROW __nonnull ((1));
/* Enqueue write request for given number of bytes and the given priority. */
extern int aio_write (struct aiocb *__aiocbp) __THROW __nonnull ((1));
/* Initiate list of I/O requests. */
extern int lio_listio (int __mode,
struct aiocb *const __list[__restrict_arr],
int __nent, struct sigevent *__restrict __sig)
__THROW __nonnull ((2));
/* Retrieve error status associated with AIOCBP. */
extern int aio_error (const struct aiocb *__aiocbp) __THROW __nonnull ((1));
/* Return status associated with AIOCBP. */
extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW __nonnull ((1));
/* Try to cancel asynchronous I/O requests outstanding against file
descriptor FILDES. */
extern int aio_cancel (int __fildes, struct aiocb *__aiocbp) __THROW;
/* Suspend calling thread until at least one of the asynchronous I/O
operations referenced by LIST has completed.
This function is a cancellation point and therefore not marked with
__THROW. */
extern int aio_suspend (const struct aiocb *const __list[], int __nent,
const struct timespec *__restrict __timeout)
__nonnull ((1));
/* Force all operations associated with file desriptor described by
`aio_fildes' member of AIOCBP. */
extern int aio_fsync (int __operation, struct aiocb *__aiocbp)
__THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64)
__nonnull ((1));
extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64)
__nonnull ((1));
extern int __REDIRECT_NTH (lio_listio,
(int __mode,
struct aiocb *const __list[__restrict_arr],
int __nent, struct sigevent *__restrict __sig),
lio_listio64) __nonnull ((2));
extern int __REDIRECT_NTH (aio_error, (const struct aiocb *__aiocbp),
aio_error64) __nonnull ((1));
extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
aio_return64) __nonnull ((1));
extern int __REDIRECT_NTH (aio_cancel,
(int __fildes, struct aiocb *__aiocbp),
aio_cancel64);
extern int __REDIRECT_NTH (aio_suspend,
(const struct aiocb *const __list[], int __nent,
const struct timespec *__restrict __timeout),
aio_suspend64) __nonnull ((1));
extern int __REDIRECT_NTH (aio_fsync,
(int __operation, struct aiocb *__aiocbp),
aio_fsync64) __nonnull ((2));
# else
# define aio_read aio_read64
# define aio_write aio_write64
# define lio_listio lio_listio64
# define aio_error aio_error64
# define aio_return aio_return64
# define aio_cancel aio_cancel64
# define aio_suspend aio_suspend64
# define aio_fsync aio_fsync64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
extern int lio_listio64 (int __mode,
struct aiocb64 *const __list[__restrict_arr],
int __nent, struct sigevent *__restrict __sig)
__THROW __nonnull ((2));
extern int aio_error64 (const struct aiocb64 *__aiocbp)
__THROW __nonnull ((1));
extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp)
__THROW __nonnull ((1));
extern int aio_cancel64 (int __fildes, struct aiocb64 *__aiocbp) __THROW;
extern int aio_suspend64 (const struct aiocb64 *const __list[], int __nent,
const struct timespec *__restrict __timeout)
__THROW __nonnull ((1));
extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp)
__THROW __nonnull ((2));
#endif
__END_DECLS
#endif /* aio.h */

View File

@ -0,0 +1,63 @@
/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _ALIASES_H
#define _ALIASES_H 1
#include <features.h>
#include <sys/types.h>
__BEGIN_DECLS
/* Structure to represent one entry of the alias data base. */
struct aliasent
{
char *alias_name;
size_t alias_members_len;
char **alias_members;
int alias_local;
};
/* Open alias data base files. */
extern void setaliasent (void) __THROW;
/* Close alias data base files. */
extern void endaliasent (void) __THROW;
/* Get the next entry from the alias data base. */
extern struct aliasent *getaliasent (void) __THROW;
/* Get the next entry from the alias data base and put it in RESULT_BUF. */
extern int getaliasent_r (struct aliasent *__restrict __result_buf,
char *__restrict __buffer, size_t __buflen,
struct aliasent **__restrict __result) __THROW;
/* Get alias entry corresponding to NAME. */
extern struct aliasent *getaliasbyname (const char *__name) __THROW;
/* Get alias entry corresponding to NAME and put it in RESULT_BUF. */
extern int getaliasbyname_r (const char *__restrict __name,
struct aliasent *__restrict __result_buf,
char *__restrict __buffer, size_t __buflen,
struct aliasent **__restrict __result) __THROW;
__END_DECLS
#endif /* aliases.h */

View File

@ -0,0 +1,40 @@
/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _ALLOCA_H
#define _ALLOCA_H 1
#include <features.h>
#define __need_size_t
#include <stddef.h>
__BEGIN_DECLS
/* Remove any previous definitions. */
#undef alloca
/* Allocate a block that will be freed when the calling function exits. */
extern void *alloca (size_t __size) __THROW;
#ifdef __GNUC__
# define alloca(size) __builtin_alloca (size)
#endif /* GCC. */
__END_DECLS
#endif /* alloca.h */

View File

@ -0,0 +1,47 @@
/* Header describing `ar' archive file format.
Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _AR_H
#define _AR_H 1
#include <sys/cdefs.h>
/* Archive files start with the ARMAG identifying string. Then follows a
`struct ar_hdr', and as many bytes of member file data as its `ar_size'
member indicates, for each member file. */
#define ARMAG "!<arch>\n" /* String that begins an archive file. */
#define SARMAG 8 /* Size of that string. */
#define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
__BEGIN_DECLS
struct ar_hdr
{
char ar_name[16]; /* Member file name, sometimes / terminated. */
char ar_date[12]; /* File date, decimal seconds since Epoch. */
char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
char ar_mode[8]; /* File mode, in ASCII octal. */
char ar_size[10]; /* File size, in ASCII decimal. */
char ar_fmag[2]; /* Always contains ARFMAG. */
};
__END_DECLS
#endif /* ar.h */

View File

@ -0,0 +1,594 @@
/* Hierarchial argument parsing, layered over getopt.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _ARGP_H
#define _ARGP_H
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
#include <limits.h>
#define __need_error_t
#include <errno.h>
#ifndef __THROW
# define __THROW
#endif
#ifndef __NTH
# define __NTH(fct) fct __THROW
#endif
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
#else
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
/* GCC 2.95 and later have "__restrict"; C99 compilers have
"restrict", and "configure" may have defined "restrict". */
#ifndef __restrict
# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
# if defined restrict || 199901L <= __STDC_VERSION__
# define __restrict restrict
# else
# define __restrict
# endif
# endif
#endif
#ifndef __error_t_defined
typedef int error_t;
# define __error_t_defined
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* A description of a particular option. A pointer to an array of
these is passed in the OPTIONS field of an argp structure. Each option
entry can correspond to one long option and/or one short option; more
names for the same option can be added by following an entry in an option
array with options having the OPTION_ALIAS flag set. */
struct argp_option
{
/* The long option name. For more than one name for the same option, you
can use following options with the OPTION_ALIAS flag set. */
const char *name;
/* What key is returned for this option. If > 0 and printable, then it's
also accepted as a short option. */
int key;
/* If non-NULL, this is the name of the argument associated with this
option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
const char *arg;
/* OPTION_ flags. */
int flags;
/* The doc string for this option. If both NAME and KEY are 0, This string
will be printed outdented from the normal option column, making it
useful as a group header (it will be the first thing printed in its
group); in this usage, it's conventional to end the string with a `:'. */
const char *doc;
/* The group this option is in. In a long help message, options are sorted
alphabetically within each group, and the groups presented in the order
0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
if this field 0 will inherit the group number of the previous entry, or
zero if it's the first one, unless its a group header (NAME and KEY both
0), in which case, the previous entry + 1 is the default. Automagic
options such as --help are put into group -1. */
int group;
};
/* The argument associated with this option is optional. */
#define OPTION_ARG_OPTIONAL 0x1
/* This option isn't displayed in any help messages. */
#define OPTION_HIDDEN 0x2
/* This option is an alias for the closest previous non-alias option. This
means that it will be displayed in the same help entry, and will inherit
fields other than NAME and KEY from the aliased option. */
#define OPTION_ALIAS 0x4
/* This option isn't actually an option (and so should be ignored by the
actual option parser), but rather an arbitrary piece of documentation that
should be displayed in much the same manner as the options. If this flag
is set, then the option NAME field is displayed unmodified (e.g., no `--'
prefix is added) at the left-margin (where a *short* option would normally
be displayed), and the documentation string in the normal place. For
purposes of sorting, any leading whitespace and punctuation is ignored,
except that if the first non-whitespace character is not `-', this entry
is displayed after all options (and OPTION_DOC entries with a leading `-')
in the same group. */
#define OPTION_DOC 0x8
/* This option shouldn't be included in `long' usage messages (but is still
included in help messages). This is mainly intended for options that are
completely documented in an argp's ARGS_DOC field, in which case including
the option in the generic usage list would be redundant. For instance,
if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
distinguish these two cases, -x should probably be marked
OPTION_NO_USAGE. */
#define OPTION_NO_USAGE 0x10
struct argp; /* fwd declare this type */
struct argp_state; /* " */
struct argp_child; /* " */
/* The type of a pointer to an argp parsing function. */
typedef error_t (*argp_parser_t) (int __key, char *__arg,
struct argp_state *__state);
/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
returns will simply be ignored. For user keys, this error will be turned
into EINVAL (if the call to argp_parse is such that errors are propagated
back to the user instead of exiting); returning EINVAL itself would result
in an immediate stop to parsing in *all* cases. */
#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
/* Special values for the KEY argument to an argument parsing function.
ARGP_ERR_UNKNOWN should be returned if they aren't understood.
The sequence of keys to a parsing function is either (where each
uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
The third case is where every parser returned ARGP_KEY_UNKNOWN for an
argument, in which case parsing stops at that argument (returning the
unparsed arguments to the caller of argp_parse if requested, or stopping
with an error message if not).
If an error occurs (either detected by argp, or because the parsing
function returned an error value), then the parser is called with
ARGP_KEY_ERROR, and no further calls are made. */
/* This is not an option at all, but rather a command line argument. If a
parser receiving this key returns success, the fact is recorded, and the
ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
argument, a parser function decrements the NEXT field of the state it's
passed, the option won't be considered processed; this is to allow you to
actually modify the argument (perhaps into an option), and have it
processed again. */
#define ARGP_KEY_ARG 0
/* There are remaining arguments not parsed by any parser, which may be found
starting at (STATE->argv + STATE->next). If success is returned, but
STATE->next left untouched, it's assumed that all arguments were consume,
otherwise, the parser should adjust STATE->next to reflect any arguments
consumed. */
#define ARGP_KEY_ARGS 0x1000006
/* There are no more command line arguments at all. */
#define ARGP_KEY_END 0x1000001
/* Because it's common to want to do some special processing if there aren't
any non-option args, user parsers are called with this key if they didn't
successfully process any non-option arguments. Called just before
ARGP_KEY_END (where more general validity checks on previously parsed
arguments can take place). */
#define ARGP_KEY_NO_ARGS 0x1000002
/* Passed in before any parsing is done. Afterwards, the values of each
element of the CHILD_INPUT field, if any, in the state structure is
copied to each child's state to be the initial value of the INPUT field. */
#define ARGP_KEY_INIT 0x1000003
/* Use after all other keys, including SUCCESS & END. */
#define ARGP_KEY_FINI 0x1000007
/* Passed in when parsing has successfully been completed (even if there are
still arguments remaining). */
#define ARGP_KEY_SUCCESS 0x1000004
/* Passed in if an error occurs. */
#define ARGP_KEY_ERROR 0x1000005
/* An argp structure contains a set of options declarations, a function to
deal with parsing one, documentation string, a possible vector of child
argp's, and perhaps a function to filter help output. When actually
parsing options, getopt is called with the union of all the argp
structures chained together through their CHILD pointers, with conflicts
being resolved in favor of the first occurrence in the chain. */
struct argp
{
/* An array of argp_option structures, terminated by an entry with both
NAME and KEY having a value of 0. */
const struct argp_option *options;
/* What to do with an option from this structure. KEY is the key
associated with the option, and ARG is any associated argument (NULL if
none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
parsing is stopped immediately, and that value is returned from
argp_parse(). For special (non-user-supplied) values of KEY, see the
ARGP_KEY_ definitions below. */
argp_parser_t parser;
/* A string describing what other arguments are wanted by this program. It
is only used by argp_usage to print the `Usage:' message. If it
contains newlines, the strings separated by them are considered
alternative usage patterns, and printed on separate lines (lines after
the first are prefix by ` or: ' instead of `Usage:'). */
const char *args_doc;
/* If non-NULL, a string containing extra text to be printed before and
after the options in a long help message (separated by a vertical tab
`\v' character). */
const char *doc;
/* A vector of argp_children structures, terminated by a member with a 0
argp field, pointing to child argps should be parsed with this one. Any
conflicts are resolved in favor of this argp, or early argps in the
CHILDREN list. This field is useful if you use libraries that supply
their own argp structure, which you want to use in conjunction with your
own. */
const struct argp_child *children;
/* If non-zero, this should be a function to filter the output of help
messages. KEY is either a key from an option, in which case TEXT is
that option's help text, or a special key from the ARGP_KEY_HELP_
defines, below, describing which other help text TEXT is. The function
should return either TEXT, if it should be used as-is, a replacement
string, which should be malloced, and will be freed by argp, or NULL,
meaning `print nothing'. The value for TEXT is *after* any translation
has been done, so if any of the replacement text also needs translation,
that should be done by the filter function. INPUT is either the input
supplied to argp_parse, or NULL, if argp_help was called directly. */
char *(*help_filter) (int __key, const char *__text, void *__input);
/* If non-zero the strings used in the argp library are translated using
the domain described by this string. Otherwise the currently installed
default domain is used. */
const char *argp_domain;
};
/* Possible KEY arguments to a help filter function. */
#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
TEXT is NULL for this key. */
/* Explanatory note emitted when duplicate option arguments have been
suppressed. */
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
argp_child structures, each of which describes a subsidiary argp. */
struct argp_child
{
/* The child parser. */
const struct argp *argp;
/* Flags for this child. */
int flags;
/* If non-zero, an optional header to be printed in help output before the
child options. As a side-effect, a non-zero value forces the child
options to be grouped together; to achieve this effect without actually
printing a header string, use a value of "". */
const char *header;
/* Where to group the child options relative to the other (`consolidated')
options in the parent argp; the values are the same as the GROUP field
in argp_option structs, but all child-groupings follow parent options at
a particular group level. If both this field and HEADER are zero, then
they aren't grouped at all, but rather merged with the parent options
(merging the child's grouping levels with the parents). */
int group;
};
/* Parsing state. This is provided to parsing functions called by argp,
which may examine and, as noted, modify fields. */
struct argp_state
{
/* The top level ARGP being parsed. */
const struct argp *root_argp;
/* The argument vector being parsed. May be modified. */
int argc;
char **argv;
/* The index in ARGV of the next arg that to be parsed. May be modified. */
int next;
/* The flags supplied to argp_parse. May be modified. */
unsigned flags;
/* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
number of the current arg, starting at zero, and incremented after each
such call returns. At all other times, this is the number of such
arguments that have been processed. */
unsigned arg_num;
/* If non-zero, the index in ARGV of the first argument following a special
`--' argument (which prevents anything following being interpreted as an
option). Only set once argument parsing has proceeded past this point. */
int quoted;
/* An arbitrary pointer passed in from the user. */
void *input;
/* Values to pass to child parsers. This vector will be the same length as
the number of children for the current parser. */
void **child_inputs;
/* For the parser's use. Initialized to 0. */
void *hook;
/* The name used when printing messages. This is initialized to ARGV[0],
or PROGRAM_INVOCATION_NAME if that is unavailable. */
char *name;
/* Streams used when argp prints something. */
FILE *err_stream; /* For errors; initialized to stderr. */
FILE *out_stream; /* For information; initialized to stdout. */
void *pstate; /* Private, for use by argp. */
};
/* Flags for argp_parse (note that the defaults are those that are
convenient for program command line parsing): */
/* Don't ignore the first element of ARGV. Normally (and always unless
ARGP_NO_ERRS is set) the first element of the argument vector is
skipped for option parsing purposes, as it corresponds to the program name
in a command line. */
#define ARGP_PARSE_ARGV0 0x01
/* Don't print error messages for unknown options to stderr; unless this flag
is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
name in the error messages. This flag implies ARGP_NO_EXIT (on the
assumption that silent exiting upon errors is bad behaviour). */
#define ARGP_NO_ERRS 0x02
/* Don't parse any non-option args. Normally non-option args are parsed by
calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
as the value. Since it's impossible to know which parse function wants to
handle it, each one is called in turn, until one returns 0 or an error
other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
argp_parse returns prematurely (but with a return value of 0). If all
args have been parsed without error, all parsing functions are called one
last time with a key of ARGP_KEY_END. This flag needn't normally be set,
as the normal behavior is to stop parsing as soon as some argument can't
be handled. */
#define ARGP_NO_ARGS 0x04
/* Parse options and arguments in the same order they occur on the command
line -- normally they're rearranged so that all options come first. */
#define ARGP_IN_ORDER 0x08
/* Don't provide the standard long option --help, which causes usage and
option help information to be output to stdout, and exit (0) called. */
#define ARGP_NO_HELP 0x10
/* Don't exit on errors (they may still result in error messages). */
#define ARGP_NO_EXIT 0x20
/* Use the gnu getopt `long-only' rules for parsing arguments. */
#define ARGP_LONG_ONLY 0x40
/* Turns off any message-printing/exiting options. */
#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
index in ARGV of the first unparsed option is returned in it. If an
unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
routine returned a non-zero value, it is returned; otherwise 0 is
returned. This function may also call exit unless the ARGP_NO_HELP flag
is set. INPUT is a pointer to a value to be passed in to the parser. */
extern error_t argp_parse (const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input);
extern error_t __argp_parse (const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input);
/* Global variables. */
/* If defined or set by the user program to a non-zero value, then a default
option --version is added (unless the ARGP_NO_HELP flag is used), which
will print this string followed by a newline and exit (unless the
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
extern const char *argp_program_version;
/* If defined or set by the user program to a non-zero value, then a default
option --version is added (unless the ARGP_NO_HELP flag is used), which
calls this function with a stream to print the version to and a pointer to
the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
extern void (*argp_program_version_hook) (FILE *__restrict __stream,
struct argp_state *__restrict
__state);
/* If defined or set by the user program, it should point to string that is
the bug-reporting address for the program. It will be printed by
argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
standard help messages), embedded in a sentence that says something like
`Report bugs to ADDR.'. */
extern const char *argp_program_bug_address;
/* The exit status that argp will use when exiting due to a parsing error.
If not defined or set by the user program, this defaults to EX_USAGE from
<sysexits.h>. */
extern error_t argp_err_exit_status;
/* Flags for argp_help. */
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
#define ARGP_HELP_LONG 0x08 /* a long help message. */
#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
reflect ARGP_LONG_ONLY mode. */
/* These ARGP_HELP flags are only understood by argp_state_help. */
#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
/* The standard thing to do after a program command line parsing error, if an
error message has already been printed. */
#define ARGP_HELP_STD_ERR \
(ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
/* The standard thing to do after a program command line parsing error, if no
more specific error message has been printed. */
#define ARGP_HELP_STD_USAGE \
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
/* The standard thing to do in response to a --help option. */
#define ARGP_HELP_STD_HELP \
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
| ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
/* Output a usage message for ARGP to STREAM. FLAGS are from the set
ARGP_HELP_*. */
extern void argp_help (const struct argp *__restrict __argp,
FILE *__restrict __stream,
unsigned __flags, char *__restrict __name);
extern void __argp_help (const struct argp *__restrict __argp,
FILE *__restrict __stream, unsigned __flags,
char *__name);
/* The following routines are intended to be called from within an argp
parsing routine (thus taking an argp_state structure as the first
argument). They may or may not print an error message and exit, depending
on the flags in STATE -- in any case, the caller should be prepared for
them *not* to exit, and should return an appropiate error after calling
them. [argp_usage & argp_error should probably be called argp_state_...,
but they're used often enough that they should be short] */
/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
from the set ARGP_HELP_*. */
extern void argp_state_help (const struct argp_state *__restrict __state,
FILE *__restrict __stream,
unsigned int __flags);
extern void __argp_state_help (const struct argp_state *__restrict __state,
FILE *__restrict __stream,
unsigned int __flags);
/* Possibly output the standard usage message for ARGP to stderr and exit. */
extern void argp_usage (const struct argp_state *__state);
extern void __argp_usage (const struct argp_state *__state);
/* If appropriate, print the printf string FMT and following args, preceded
by the program name and `:', to stderr, and followed by a `Try ... --help'
message, then exit (1). */
extern void argp_error (const struct argp_state *__restrict __state,
const char *__restrict __fmt, ...)
_GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
extern void __argp_error (const struct argp_state *__restrict __state,
const char *__restrict __fmt, ...)
_GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
/* Similar to the standard gnu error-reporting function error(), but will
respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
to STATE->err_stream. This is useful for argument parsing code that is
shared between program startup (when exiting is desired) and runtime
option parsing (when typically an error code is returned instead). The
difference between this function and argp_error is that the latter is for
*parsing errors*, and the former is for other problems that occur during
parsing but don't reflect a (syntactic) problem with the input. */
extern void argp_failure (const struct argp_state *__restrict __state,
int __status, int __errnum,
const char *__restrict __fmt, ...)
_GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
extern void __argp_failure (const struct argp_state *__restrict __state,
int __status, int __errnum,
const char *__restrict __fmt, ...)
_GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
/* Returns true if the option OPT is a valid short option. */
extern int _option_is_short (const struct argp_option *__opt) __THROW;
extern int __option_is_short (const struct argp_option *__opt) __THROW;
/* Returns true if the option OPT is in fact the last (unused) entry in an
options array. */
extern int _option_is_end (const struct argp_option *__opt) __THROW;
extern int __option_is_end (const struct argp_option *__opt) __THROW;
/* Return the input field for ARGP in the parser corresponding to STATE; used
by the help routines. */
extern void *_argp_input (const struct argp *__restrict __argp,
const struct argp_state *__restrict __state)
__THROW;
extern void *__argp_input (const struct argp *__restrict __argp,
const struct argp_state *__restrict __state)
__THROW;
#ifdef __USE_EXTERN_INLINES
# if !_LIBC
# define __argp_usage argp_usage
# define __argp_state_help argp_state_help
# define __option_is_short _option_is_short
# define __option_is_end _option_is_end
# endif
# ifndef ARGP_EI
# define ARGP_EI __extern_inline
# endif
ARGP_EI void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
ARGP_EI int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
return 0;
else
{
int __key = __opt->key;
return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
}
}
ARGP_EI int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
}
# if !_LIBC
# undef __argp_usage
# undef __argp_state_help
# undef __option_is_short
# undef __option_is_end
# endif
#endif /* Use extern inlines. */
#ifdef __cplusplus
}
#endif
#endif /* argp.h */

Some files were not shown because too many files have changed in this diff Show More