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

8 Commits

Author SHA1 Message Date
d413afbadf vlmcsd-svn1031-2016-10-06-Hotbird64 2016-10-08 13:35:48 +08:00
0b2c216c06 vlmcsd-svn1016-2016-09-16-Hotbird64 2016-09-18 11:30:46 +08:00
213ac7d870 vlmcsd-svn1006-2016-09-03-Hotbird64 2016-09-04 22:03:54 +08:00
032d201234 vlmcsd-svn1003-2016-08-27-Hotbird64 2016-08-31 11:50:33 +08:00
9099d5aa69 vlmcsd-svn998-2016-08-11-Hotbird64 2016-08-15 18:35:59 +08:00
8d3bfb8d55 vlmcsd-svn977-2016-07-13-Hotbird64 2016-08-02 22:39:39 +08:00
f72621f166 vlmcsd-svn934-2016-06-17-Hotbird64 2016-06-28 13:07:01 +08:00
c479a67c2c vlmcsd-svn906-2016-06-05-Hotbird64 2016-06-06 10:36:00 +08:00
105 changed files with 25059 additions and 23872 deletions

View File

@ -5,7 +5,10 @@
PROGRAM_NAME ?= vlmcsd
CLIENT_NAME ?= vlmcs
MULTI_NAME ?= vlmcsdmulti
OBJ_NAME ?= libkms-static.o
A_NAME ?= libkms.a
CONFIG ?= config.h
COMPILER_LANGUAGE ?= c
# crypto library to use for standard algos, could save ~1-2kb ;)
# can be either 'openssl', 'polarssl' or anything other for internal impl
@ -31,52 +34,75 @@ ifneq (,$(findstring darwin,$(TARGETPLATFORM)))
UNIX := 1
endif
ifneq (,$(findstring androideabi,$(TARGETPLATFORM)))
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)
@ -89,36 +115,59 @@ else
DLL_NAME ?= libkms.so
endif
BASECFLAGS = -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections
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 ($(NOLIBS),1)
NOLRESOLV=1
NOLPTHREAD=1
endif
ifneq ($(NOLIBS),1)
ifeq ($(MINGW),1)
BASELDFLAGS += -lws2_32 -liphlpapi
endif
endif
ifneq ($(NO_DNS),1)
ifneq ($(ANDROID),1)
ifneq ($(NOLRESOLV),1)
ifeq ($(MINGW),1)
BASELDFLAGS += -ldnsapi
CLIENTLDFLAGS += -ldnsapi
endif
ifeq ($(LINUX),1)
BASELDFLAGS += -lresolv
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(HURD),1)
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(DARWIN),1)
BASELDFLAGS += -lresolv
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(CYGWIN),1)
DNS_PARSER := internal
BASELDFLAGS += -lresolv
CLIENTLDFLAGS += -lresolv
endif
ifeq ($(OPENBSD),1)
@ -126,7 +175,7 @@ ifneq ($(NO_DNS),1)
endif
ifeq ($(SOLARIS),1)
BASELDFLAGS += -lresolv
CLIENTLDFLAGS += -lresolv
endif
endif
@ -155,16 +204,18 @@ else
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_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT
ifeq ($(FEATURES), embedded)
BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_BASIC_PRODUCT_LIST -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG
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
BASECFLAGS += -DNO_HELP -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), minimum)
BASECFLAGS += -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
BASECFLAGS += -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_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT -DSMALL_AES
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
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
@ -173,6 +224,10 @@ ifdef INI
BASECFLAGS += -DINI_FILE=\"$(INI)\"
endif
ifeq ($(NO_GETIFADDRS), 1)
BASECFLAGS += -DNO_GETIFADDRS
endif
ifeq ($(THREADS), 1)
BASECFLAGS += -DUSE_THREADS
endif
@ -197,12 +252,16 @@ 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)
BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) -DDISPLAY_WIDTH=\"$(TERMINAL_WIDTH)\"
endif
ifeq ($(NOPROCFS), 1)
@ -216,13 +275,15 @@ endif
ifneq ($(ANDROID), 1)
ifneq ($(MINIX), 1)
ifneq ($(NOLPTHREAD), 1)
ifeq ($(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)),)
BASELDFLAGS += -lpthread
ifeq ($(THREADS), 1)
SERVERLDFLAGS += -lpthread
endif
ifeq (,$(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)))
SERVERLDFLAGS += -lpthread
endif
ifneq ($(findstring USE_THREADS,$(BASECFLAGS)),)
BASELDFLAGS += -lpthread
endif
endif
endif
endif
@ -231,9 +292,9 @@ $(MULTI_NAME): BASECFLAGS += -DMULTI_CALL_BINARY=1
all: $(CLIENT_NAME) $(PROGRAM_NAME)
ifdef CAT
#ifdef CAT
allmulti: $(CLIENT_NAME) $(PROGRAM_NAME) $(MULTI_NAME)
endif
#endif
ifneq ($(strip $(VLMCSD_VERSION)),)
BASECFLAGS += -DVERSION=\"$(VLMCSD_VERSION),\ built\ $(shell date -u '+%Y-%m-%d %H:%M:%S' | sed -e 's/ /\\ /g')\ UTC\"
@ -254,12 +315,12 @@ 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)
MULTI_OBJS = $(SRCS:.c=.o) vlmcsd-m.o vlmcs-m.o vlmcsdmulti-m.o
DLL_SRCS = libkms.c $(SRCS)
DLL_OBJS = $(DLL_SRCS:.c=.o)
DLL_SRCS = libkms.c vlmcs.c $(SRCS)
DLL_OBJS = $(DLL_SRCS:.c=-l.o)
PDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf
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)
@ -268,11 +329,13 @@ ifneq ($(NO_DNS),1)
VLMCS_SRCS += dns_srv.c
MULTI_SRCS += dns_srv.c
MULTI_OBJS += 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 += ns_parse.o ns_name.o
BASECFLAGS += "-DDNS_PARSER_INTERNAL"
endif
endif
@ -283,15 +346,38 @@ ifeq ($(MSRPC),1)
VLMCSD_SRCS += msrpc-server.c
VLMCS_SRCS += msrpc-client.c
MULTI_SRCS += msrpc-server.c msrpc-client.c
MULTI_OBJS += msrpc-server-m.o 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 += 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 += ifaddrs-android.o
endif
endif
ifeq "$(WIN)" "1"
VLMCSD_SRCS += ntservice.c
MULTI_SRCS += ntservice.c
MULTI_OBJS += ntservice.o
endif
ifeq ($(CRYPTO), openssl_with_aes)
@ -312,7 +398,6 @@ else ifeq ($(CRYPTO), polarssl)
else ifeq ($(CRYPTO), windows)
BASECFLAGS += -D_CRYPTO_WINDOWS
SRCS += crypto_windows.c
#BASELDFLAGS += -lpolarssl
else
BASECFLAGS += -D_CRYPTO_INTERNAL
SRCS += crypto_internal.c
@ -332,9 +417,12 @@ endif
ifeq ($(VERBOSE),3)
COMPILER := $(shell printf "%-40s" $(notdir $(CC)))
ARCHIVER := $(shell printf "%-40s" $(notdir $(AR)))
endif
ifeq ($(CAT),2)
ARCMD := AR
ifdef CAT
LDCMD := CC/LD
else
LDCMD := LD
@ -344,99 +432,127 @@ endif
%.o: %.c
ifeq ($(VERBOSE),1)
$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1)
$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif
else
@echo "$(COMPILER) CC $@ <- $<"
@$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1)
@echo "$(COMPILER) DEP $*.d <- $<"
@$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
@echo "$(COMPILER) DEP $*.d <- $<"
@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif
endif
vlmcsd_all.c: $(VLMCSD_SRCS)
%-m.o: %.c
ifeq ($(VERBOSE),1)
cat $^ > $@
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o $@ -c $<
ifeq ($(DEPENDENCIES),1)
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif
else
@echo "$(COMPILER) CAT $@ <- $^"
@cat $^ > $@
@echo "$(COMPILER) CC $@ <- $<"
@$(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 $<
endif
endif
vlmcs_all.c: $(VLMCS_SRCS)
%-l.o: %.c
ifeq ($(VERBOSE),1)
cat $^ > $@
$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -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) CAT $@ <- $^"
@cat $^ > $@
@echo "$(COMPILER) CC $@ <- $<"
@$(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
vlmcsdmulti_all.c: $(MULTI_SRCS)
ifeq ($(VERBOSE),1)
cat $^ > $@
else
@echo "$(COMPILER) CAT $@ <- $^"
@cat $^ > $@
endif
ifdef CAT
ifeq ($(CAT),2)
$(PROGRAM_NAME): vlmcsd_all.c
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
$(PROGRAM_NAME): vlmcsd_all.o
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
$(PROGRAM_NAME): $(VLMCSD_OBJS)
BUILDCOMMANDPREFIX = +@
endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
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
ifeq ($(CAT),2)
$(CLIENT_NAME): vlmcs_all.c
$(A_NAME): $(OBJ_NAME)
else
$(CLIENT_NAME): vlmcs_all.o
$(A_NAME): BASECFLAGS += -fvisibility=hidden -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(A_NAME): $(DLL_OBJS)
endif
else
$(CLIENT_NAME): $(VLMCS_OBJS)
endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
ifneq ($(VERBOSE),1)
$(ARINFOCOMMAND)
endif
ifdef CAT
ifeq ($(CAT),2)
$(MULTI_NAME): vlmcsdmulti_all.c
else
$(MULTI_NAME): vlmcsdmulti_all.o
endif
else
$(MULTI_NAME): $(MULTI_OBJS)
endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
endif
$(DLL_NAME): $(DLL_SRCS)
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
endif
+@rm -f $@
$(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^
%.pdf : %
ifeq ($(shell uname), Darwin)
@ -467,10 +583,13 @@ htmldocs : $(HTMLDOCS)
alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)
clean:
rm -f *.o *.d *_all.c $(PROGRAM_NAME) $(MULTI_NAME) $(DLL_NAME) $(CLIENT_NAME) $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS)
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
dnsclean:
rm -f dns_srv.o
help:
@echo "Type:"
@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"
@ -485,8 +604,9 @@ help:
@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 ""
@echo "Options:"
@echo "Options"
@echo " CONFIG=<x> Compile <x> as instead of config.h."
@echo " INI=<x> Compile $(PROGRAM_NAME) with default ini file <x>"
@echo " PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd."
@ -498,7 +618,10 @@ help:
@echo " CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software)."
@echo " CRYPTO=polarssl Use polarssl instead of internal crypto code for SHA256/HMAC calculations."
@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 " 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\"."
@echo " CFLAGS=<x> Pass <x> as additional arguments to the compiler."
@ -513,6 +636,7 @@ help:
@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 " OFFICE2016=<x> Use <x> as the default ePID for Office2016 (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."
@ -522,7 +646,7 @@ help:
@echo " FEATURES=minimum Compiles only basic features of $(PROGRAM_NAME)."
@echo " FEATURES=fixedepids $(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 "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 " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option."
@ -533,26 +657,32 @@ help:
@echo " -DNO_USER_SWITCH Don't support changing uid/gid after program start. Removes -u and -g options."
@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 " -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 " -DNO_PRIVATE_IP_DETECT Don't support protection against clients with public IP addresses in $(PROGRAM_NAME)"
@echo " -DSIMPLE_SOCKETS Compile $(PROGRAM_NAME) with basic socket support only. Removes -L option."
@echo " -DSMALL_AES Use a smaller (saves about 200 bytes) but slower implementation of AES."
@echo ""
@echo "Troubleshooting options"
@echo " CAT=1 Combine all sources in a single file."
@echo " CAT=2 Combine all sources in a single file and don't create a *.o file."
@echo " CAT=1 Combine all sources in a single in-memory file and compile directly to target."
@echo " NOPROCFS=1 Don't rely on a properly mounted proc filesystem in /proc."
@echo " AUXV=1 Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)"
@echo " NOLPTHREAD=1 Disable detection if -lpthread is required (for use with Android NDK)."
@echo " NOLRESOLV=1 Disable detection if -lresolv is requires (for use with Android NDK)."
@echo " NOLRESOLV=1 Disable detection if -lresolv is required (for use with Android NDK)."
@echo " NOLIBS=1 Do not attempt to autodetect any library dependencies."
@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 vlmcs without support for detecting KMS servers via DNS."
@echo " NO_DNS=1 Compile $(CLIENT_NAME) without support for detecting KMS servers via DNS."
@echo " NO_GETIFADDRS=1 Compile $(PROGRAM_NAME) without using getifaddrs()."
@echo " GETIFADDRS=musl Compile $(PROGRAM_NAME) with its own implementation of getifaddrs() based on musl."
@echo " DNS_PARSER=internal Use $(CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
@echo ""
@echo "Other useful CFLAGS:"
@echo "Other useful CFLAGS"
@echo " -DSUPPORT_WINE Add code that the Windows version of $(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."

View File

@ -0,0 +1,236 @@
<?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</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</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)'=='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)'=='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 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 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)..\</OutDir>
<TargetName>libkms32</TargetName>
<GenerateManifest>false</GenerateManifest>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\</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>
<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|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 />
</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 />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\crypto.c" />
<ClCompile Include="..\..\crypto_windows.c" />
<ClCompile Include="..\..\endian.c" />
<ClCompile Include="..\..\helpers.c" />
<ClCompile Include="..\..\kms.c" />
<ClCompile Include="..\..\libkms.c" />
<ClCompile Include="..\..\network.c" />
<ClCompile Include="..\..\output.c" />
<ClCompile Include="..\..\rpc.c" />
<ClCompile Include="..\..\shared_globals.c" />
<ClCompile Include="..\..\vlmcs.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h" />
<ClInclude Include="..\..\crypto.h" />
<ClInclude Include="..\..\crypto_windows.h" />
<ClInclude Include="..\..\endian.h" />
<ClInclude Include="..\..\helpers.h" />
<ClInclude Include="..\..\kms.h" />
<ClInclude Include="..\..\libkms.h" />
<ClInclude Include="..\..\network.h" />
<ClInclude Include="..\..\output.h" />
<ClInclude Include="..\..\rpc.h" />
<ClInclude Include="..\..\shared_globals.h" />
<ClInclude Include="..\..\types.h" />
<ClInclude Include="..\..\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="..\..\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libkms.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\libkms.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

BIN
VisualStudio/msvcrt.lib Executable file

Binary file not shown.

BIN
VisualStudio/msvcrt64.lib Executable file

Binary file not shown.

View File

@ -0,0 +1,227 @@
<?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</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</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)'=='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)'=='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 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 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)..\</OutDir>
<TargetName>vlmcs-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\</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>
<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|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>
</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>
</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>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\crypto.c" />
<ClCompile Include="..\..\crypto_windows.c" />
<ClCompile Include="..\..\dns_srv.c" />
<ClCompile Include="..\..\endian.c" />
<ClCompile Include="..\..\helpers.c" />
<ClCompile Include="..\..\kms.c" />
<ClCompile Include="..\..\network.c" />
<ClCompile Include="..\..\output.c" />
<ClCompile Include="..\..\rpc.c" />
<ClCompile Include="..\..\shared_globals.c" />
<ClCompile Include="..\..\vlmcs.c" />
<ClCompile Include="..\..\wingetopt.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h" />
<ClInclude Include="..\..\crypto.h" />
<ClInclude Include="..\..\crypto_internal.h" />
<ClInclude Include="..\..\crypto_windows.h" />
<ClInclude Include="..\..\dns_srv.h" />
<ClInclude Include="..\..\endian.h" />
<ClInclude Include="..\..\helpers.h" />
<ClInclude Include="..\..\kms.h" />
<ClInclude Include="..\..\network.h" />
<ClInclude Include="..\..\output.h" />
<ClInclude Include="..\..\rpc.h" />
<ClInclude Include="..\..\shared_globals.h" />
<ClInclude Include="..\..\types.h" />
<ClInclude Include="..\..\vlmcs.h" />
<ClInclude Include="..\..\wingetopt.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,102 @@
<?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="..\..\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\dns_srv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\dns_srv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,58 @@

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", "vlmcsd.vcxproj", "{918B4F5B-6356-451E-998C-5FCB29988170}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcs", "vlmcs\vlmcs.vcxproj", "{2B3F305D-6351-4F4A-A7F2-1F9B1988CDEE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlmcsdmulti", "vlmcsdmulti\vlmcsdmulti.vcxproj", "{7F07671D-1432-43E9-9D72-08435F216B5E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libkms", "libkms\libkms.vcxproj", "{2A0FC04D-C3C0-43E2-8812-53AE901C5395}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|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}.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}.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}.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}.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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

229
VisualStudio/vlmcsd.vcxproj Executable file
View File

@ -0,0 +1,229 @@
<?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</RootNamespace>
<WindowsTargetPlatformVersion>
</WindowsTargetPlatformVersion>
</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|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|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|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|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)..\</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)..\</OutDir>
</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>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>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>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>$(SolutionDir)\msvcrt.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>
</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>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>$(SolutionDir)\msvcrt64.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>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\config.h" />
<ClInclude Include="..\crypto.h" />
<ClInclude Include="..\crypto_internal.h" />
<ClInclude Include="..\crypto_windows.h" />
<ClInclude Include="..\endian.h" />
<ClInclude Include="..\helpers.h" />
<ClInclude Include="..\kms.h" />
<ClInclude Include="..\network.h" />
<ClInclude Include="..\ntservice.h" />
<ClInclude Include="..\output.h" />
<ClInclude Include="..\rpc.h" />
<ClInclude Include="..\shared_globals.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="..\vlmcsd.h" />
<ClInclude Include="..\wingetopt.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\crypto.c" />
<ClCompile Include="..\crypto_windows.c" />
<ClCompile Include="..\endian.c" />
<ClCompile Include="..\helpers.c" />
<ClCompile Include="..\kms.c" />
<ClCompile Include="..\network.c" />
<ClCompile Include="..\ntservice.c" />
<ClCompile Include="..\output.c" />
<ClCompile Include="..\rpc.c" />
<ClCompile Include="..\shared_globals.c" />
<ClCompile Include="..\vlmcsd.c" />
<ClCompile Include="..\wingetopt.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,102 @@
<?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="..\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\crypto_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\ntservice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\vlmcsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ntservice.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\vlmcsd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,231 @@
<?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</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</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)'=='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)'=='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 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 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)..\</OutDir>
<TargetName>vlmcsdmulti-Windows-x86</TargetName>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\</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>
<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|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>
</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>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\crypto.c" />
<ClCompile Include="..\..\crypto_windows.c" />
<ClCompile Include="..\..\dns_srv.c" />
<ClCompile Include="..\..\endian.c" />
<ClCompile Include="..\..\helpers.c" />
<ClCompile Include="..\..\kms.c" />
<ClCompile Include="..\..\network.c" />
<ClCompile Include="..\..\ntservice.c" />
<ClCompile Include="..\..\output.c" />
<ClCompile Include="..\..\rpc.c" />
<ClCompile Include="..\..\shared_globals.c" />
<ClCompile Include="..\..\vlmcs.c" />
<ClCompile Include="..\..\vlmcsd.c" />
<ClCompile Include="..\..\vlmcsdmulti.c" />
<ClCompile Include="..\..\wingetopt.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h" />
<ClInclude Include="..\..\crypto.h" />
<ClInclude Include="..\..\crypto_windows.h" />
<ClInclude Include="..\..\dns_srv.h" />
<ClInclude Include="..\..\endian.h" />
<ClInclude Include="..\..\helpers.h" />
<ClInclude Include="..\..\kms.h" />
<ClInclude Include="..\..\network.h" />
<ClInclude Include="..\..\ntservice.h" />
<ClInclude Include="..\..\output.h" />
<ClInclude Include="..\..\rpc.h" />
<ClInclude Include="..\..\shared_globals.h" />
<ClInclude Include="..\..\types.h" />
<ClInclude Include="..\..\vlmcs.h" />
<ClInclude Include="..\..\vlmcsd.h" />
<ClInclude Include="..\..\wingetopt.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,114 @@
<?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="..\..\crypto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\crypto_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\dns_srv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\kms.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\network.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\rpc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared_globals.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\vlmcs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\wingetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\ntservice.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\vlmcsd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\vlmcsdmulti.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\crypto_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\dns_srv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\helpers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\kms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\network.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\output.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\rpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\shared_globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\vlmcs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\wingetopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\ntservice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\vlmcsd.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -37,15 +37,19 @@
*/
#ifndef EPID_WINDOWS
#define EPID_WINDOWS "06401-00206-271-298329-03-1033-9600.0000-0452015"
#define EPID_WINDOWS "03612-00206-471-494932-03-1033-14393.0000-2382016"
#endif
#ifndef EPID_OFFICE2010
#define EPID_OFFICE2010 "06401-00096-199-198322-03-1033-9600.0000-0452015"
#define EPID_OFFICE2010 "03612-00096-199-954738-03-1033-14393.0000-2382016"
#endif
#ifndef EPID_OFFICE2013
#define EPID_OFFICE2013 "06401-00206-234-398213-03-1033-9600.0000-0452015"
#define EPID_OFFICE2013 "03612-00206-234-177489-03-1033-14393.0000-2382016"
#endif
#ifndef EPID_OFFICE2016
#define EPID_OFFICE2016 "03612-00206-437-728387-03-1033-14393.0000-2382016"
#endif
#ifndef HWID // HwId from the Ratiborus VM
@ -82,7 +86,6 @@
/*
* ----------------------------------------------------------------------------------------
* Troubleshooting options. Please note that disabling features may also help troubleshooting.
@ -366,6 +369,20 @@
*/
#ifndef NO_FREEBIND
/*
* Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command
* line option and you can bind only to (listen on) IP addresses that are currently up and running on
* your system.
*/
//#define NO_FREEBIND
#endif // NO_FREEBIND
#ifndef NO_EXTENDED_PRODUCT_LIST
/*
* Do not compile the extended product list. Removes the list of Activation GUIDs (aka
@ -399,6 +416,18 @@
#ifndef NO_VERSION_INFORMATION
/*
* Removes the -V option from vlmcsd and vlmcs that displays the version information
*/
//#define NO_VERSION_INFORMATION
#endif // NO_VERSION_INFORMATION
#ifndef NO_VERBOSE_LOG
/*
* Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v
@ -511,6 +540,19 @@
#ifndef NO_PRIVATE_IP_DETECT
/*
* Disables the ability to protect vlmcsd against KMS requests from public IP addresses.
* Removes -o from the command line.
*/
//#define NO_PRIVATE_IP_DETECT
#endif // NO_PRIVATE_IP_DETECT
#ifndef NO_SOCKETS
/*
* Disables standalone startup of vlmcsd. If you use this config directive, you must start vlmcsd from an internet
@ -577,6 +619,18 @@
#ifndef SIMPLE_SOCKETS
/*
* Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.
* It still supports IPv4 and IPv6.
*/
//#define SIMPLE_SOCKETS
#endif // SIMPLE_SOCKETS
/* Don't change anything BELOW this line */

102
crypto.c
View File

@ -17,28 +17,22 @@ const BYTE AesKeyV6[] = {
0xA9, 0x4A, 0x41, 0x95, 0xE2, 0x01, 0x43, 0x2D, 0x9B, 0xCB, 0x46, 0x04, 0x05, 0xD8, 0x4A, 0x21 };
static const BYTE SBox[] = {
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B,
0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, 0xB7, 0xFD, 0x93, 0x26,
0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2,
0xEB, 0x27, 0xB2, 0x75, 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0,
0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, 0x53, 0xD1, 0x00, 0xED,
0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F,
0x50, 0x3C, 0x9F, 0xA8, 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5,
0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, 0xCD, 0x0C, 0x13, 0xEC,
0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14,
0xDE, 0x5E, 0x0B, 0xDB, 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C,
0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, 0xE7, 0xC8, 0x37, 0x6D,
0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F,
0x4B, 0xBD, 0x8B, 0x8A, 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E,
0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, 0xE1, 0xF8, 0x98, 0x11,
0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F,
0xB0, 0x54, 0xBB, 0x16
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
};
@ -123,7 +117,7 @@ void AesInitKey(AesCtx *Ctx, const BYTE *Key, int_fast8_t IsV6, int RijndaelKeyB
memcpy(Ctx->Key, Key, RijndaelKeyBytes);
for ( i = RijndaelKeyDwords; i < ( Ctx->rounds + 1 ) << 2; i++ )
for ( i = (uint_fast8_t)RijndaelKeyDwords; i < ( Ctx->rounds + 1 ) << 2; i++ )
{
temp = Ctx->Key[ i - 1 ];
@ -221,31 +215,45 @@ void AesCmacV4(BYTE *Message, size_t MessageSize, BYTE *MacOut)
#if !defined(_CRYPTO_OPENSSL) || !defined(_USE_AES_FROM_OPENSSL)
#ifndef SMALL_AES
static const BYTE SBoxR[] = {
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E,
0x81, 0xF3, 0xD7, 0xFB, 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87,
0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, 0x54, 0x7B, 0x94, 0x32,
0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49,
0x6D, 0x8B, 0xD1, 0x25, 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16,
0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, 0x6C, 0x70, 0x48, 0x50,
0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05,
0xB8, 0xB3, 0x45, 0x06, 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02,
0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, 0x3A, 0x91, 0x11, 0x41,
0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8,
0x1C, 0x75, 0xDF, 0x6E, 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89,
0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, 0xFC, 0x56, 0x3E, 0x4B,
0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59,
0x27, 0x80, 0xEC, 0x5F, 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D,
0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, 0xA0, 0xE0, 0x3B, 0x4D,
0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63,
0x55, 0x21, 0x0C, 0x7D
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
};
#define GetSBoxR(x) SBoxR[x]
#else // SMALL_AES
static uint8_t SBoxR(uint8_t byte)
{
uint8_t i;
for (i = 0; TRUE; i++)
{
if (byte == SBox[i]) return i;
}
}
#define GetSBoxR(x) SBoxR(x)
#endif // SMALL_AES
static void ShiftRowsR(BYTE *state)
{
@ -264,7 +272,9 @@ static void SubBytesR(BYTE *block)
uint_fast8_t i;
for (i = 0; i < AES_BLOCK_BYTES; i++)
block[i] = SBoxR[ block[i] ];
{
block[i] = GetSBoxR( block[i] );
}
}

View File

@ -14,12 +14,10 @@
#include "endian.h"
#include <stdint.h>
//#define AES_ROUNDS (10)
#define AES_KEY_BYTES (16) // 128 Bits
#define AES_BLOCK_BYTES (16)
#define AES_BLOCK_WORDS (AES_BLOCK_BYTES / sizeof(DWORD))
#define AES_KEY_DWORDS (AES_KEY_BYTES / sizeof(DWORD))
//#define V4_ROUNDS (11)
#define V4_KEY_BYTES (20) // 160 Bits
#define ROR32(v, n) ( (v) << (32 - n) | (v) >> n )
@ -39,7 +37,7 @@ typedef struct {
void AesInitKey(AesCtx *Ctx, const BYTE *Key, int_fast8_t IsV6, int AesKeyBytes);
void AesEncryptBlock(const AesCtx *const Ctx, BYTE *block);
void AesDecryptBlock(const AesCtx *const Ctx, BYTE *block);
void AesEncryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t *len);
void AesEncryptCbc(const AesCtx *const Ctx, BYTE *restrict iv, BYTE *restrict data, size_t *restrict len);
void AesDecryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t len);
void MixColumnsR(BYTE *restrict state);

View File

@ -95,7 +95,7 @@ static void Sha256Update(Sha256Ctx *Ctx, BYTE *data, size_t len)
unsigned int b_len = Ctx->Len & 63,
r_len = (b_len ^ 63) + 1;
Ctx->Len += len;
Ctx->Len += (unsigned int)len;
if ( len < r_len )
{

View File

@ -39,7 +39,7 @@ static int_fast8_t AcquireCryptContext()
{
if (!hRsaAesProvider)
{
return CryptAcquireContextW
return (int_fast8_t)CryptAcquireContextW
(
&hRsaAesProvider, // Provider handle
NULL, // No key container name
@ -163,7 +163,7 @@ int_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* re
if (hKey) CryptDestroyKey(hKey);
if (hHmacHash) CryptDestroyHash(hHmacHash);
return success;
return (int_fast8_t)success;
}
#endif // _WIN32 || __CYGWIN__

View File

@ -11,6 +11,9 @@
#else // _WIN32 || __CYGWIN__
#include "types.h"
#if _MSC_VER
#include "Wincrypt.h"
#endif
typedef struct _Sha2356HmacCtx
{
@ -18,7 +21,7 @@ typedef struct _Sha2356HmacCtx
HCRYPTKEY hKey;
} Sha256HmacCtx;
int_fast8_t Sha256(BYTE *data, DWORD len, BYTE *hash);
int_fast8_t Sha256(BYTE* restrict data, DWORD DataSize, BYTE* restrict hash);
int_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);
/*int_fast8_t Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, uint8_t keySize);

View File

@ -309,7 +309,7 @@ int getKmsServerList(kms_server_dns_ptr** serverlist, const char *const restrict
memset(kms_server, 0, sizeof(kms_server_dns_t));
snprintf(kms_server->serverName, sizeof(kms_server->serverName), "%s:%hu", dns_iterator->Data.SRV.pNameTarget, dns_iterator->Data.SRV.wPort);
vlmcsd_snprintf(kms_server->serverName, sizeof(kms_server->serverName), "%s:%hu", dns_iterator->Data.SRV.pNameTarget, dns_iterator->Data.SRV.wPort);
kms_server->priority = dns_iterator->Data.SRV.wPriority;
kms_server->weight = dns_iterator->Data.SRV.wWeight;

View File

@ -96,7 +96,7 @@ typedef enum __ns_class {
#endif
int getKmsServerList(kms_server_dns_ptr** serverlist, const char *restrict query);
int getKmsServerList(kms_server_dns_ptr** serverlist, const char *const restrict query);
void sortSrvRecords(kms_server_dns_ptr* serverlist, const int answers);
#endif // NO_DNS

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

Binary file not shown.

263
getifaddrs-musl.c Normal file
View File

@ -0,0 +1,263 @@
#define _GNU_SOURCE
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "ifaddrs-musl.h"
//#include <syscall.h>
#include <net/if.h>
#include <netinet/in.h>
#include "netlink-musl.h"
#define IFADDRS_HASH_SIZE 64
/* getifaddrs() reports hardware addresses with PF_PACKET that implies
* struct sockaddr_ll. But e.g. Infiniband socket address length is
* longer than sockaddr_ll.ssl_addr[8] can hold. Use this hack struct
* to extend ssl_addr - callers should be able to still use it. */
struct sockaddr_ll_hack {
unsigned short sll_family, sll_protocol;
int sll_ifindex;
unsigned short sll_hatype;
unsigned char sll_pkttype, sll_halen;
unsigned char sll_addr[24];
};
union sockany {
struct sockaddr sa;
struct sockaddr_ll_hack ll;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
};
struct ifaddrs_storage {
struct ifaddrs ifa;
struct ifaddrs_storage *hash_next;
union sockany addr, netmask, ifu;
unsigned int index;
char name[IFNAMSIZ+1];
};
struct ifaddrs_ctx {
struct ifaddrs_storage *first;
struct ifaddrs_storage *last;
struct ifaddrs_storage *hash[IFADDRS_HASH_SIZE];
};
void freeifaddrs(struct ifaddrs *ifp)
{
struct ifaddrs *n;
while (ifp) {
n = ifp->ifa_next;
free(ifp);
ifp = n;
}
}
static int __netlink_enumerate(int fd, unsigned int seq, int type, int af,
int (*cb)(void *ctx, struct nlmsghdr *h), void *ctx)
{
struct nlmsghdr *h;
union {
uint8_t buf[8192];
struct {
struct nlmsghdr nlh;
struct rtgenmsg g;
} req;
struct nlmsghdr reply;
} u;
int r, ret;
memset(&u.req, 0, sizeof(u.req));
u.req.nlh.nlmsg_len = sizeof(u.req);
u.req.nlh.nlmsg_type = type;
u.req.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;
u.req.nlh.nlmsg_seq = seq;
u.req.g.rtgen_family = af;
r = send(fd, &u.req, sizeof(u.req), 0);
if (r < 0) return r;
while (1) {
r = recv(fd, u.buf, sizeof(u.buf), MSG_DONTWAIT);
if (r <= 0) return -1;
for (h = &u.reply; NLMSG_OK(h, (void*)&u.buf[r]); h = NLMSG_NEXT(h)) {
if (h->nlmsg_type == NLMSG_DONE) return 0;
if (h->nlmsg_type == NLMSG_ERROR) return -1;
ret = cb(ctx, h);
if (ret) return ret;
}
}
}
int __rtnetlink_enumerate(int link_af, int addr_af, int (*cb)(void *ctx, struct nlmsghdr *h), void *ctx)
{
int fd, r;
fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (fd < 0) return -1;
r = __netlink_enumerate(fd, 1, RTM_GETLINK, link_af, cb, ctx);
if (!r) r = __netlink_enumerate(fd, 2, RTM_GETADDR, addr_af, cb, ctx);
close(fd);
return r;
}
static void copy_addr(struct sockaddr **r, int af, union sockany *sa, void *addr, size_t addrlen, int ifindex)
{
uint8_t *dst;
int len;
switch (af) {
case AF_INET:
dst = (uint8_t*) &sa->v4.sin_addr;
len = 4;
break;
case AF_INET6:
dst = (uint8_t*) &sa->v6.sin6_addr;
len = 16;
if (IN6_IS_ADDR_LINKLOCAL(addr) || IN6_IS_ADDR_MC_LINKLOCAL(addr))
sa->v6.sin6_scope_id = ifindex;
break;
default:
return;
}
if (addrlen < len) return;
sa->sa.sa_family = af;
memcpy(dst, addr, len);
*r = &sa->sa;
}
static void gen_netmask(struct sockaddr **r, int af, union sockany *sa, int prefixlen)
{
uint8_t addr[16] = {0};
int i;
if (prefixlen > 8*sizeof(addr)) prefixlen = 8*sizeof(addr);
i = prefixlen / 8;
memset(addr, 0xff, i);
if (i < sizeof(addr)) addr[i++] = 0xff << (8 - (prefixlen % 8));
copy_addr(r, af, sa, addr, sizeof(addr), 0);
}
static void copy_lladdr(struct sockaddr **r, union sockany *sa, void *addr, size_t addrlen, int ifindex, unsigned short hatype)
{
if (addrlen > sizeof(sa->ll.sll_addr)) return;
sa->ll.sll_family = AF_PACKET;
sa->ll.sll_ifindex = ifindex;
sa->ll.sll_hatype = hatype;
sa->ll.sll_halen = addrlen;
memcpy(sa->ll.sll_addr, addr, addrlen);
*r = &sa->sa;
}
static int netlink_msg_to_ifaddr(void *pctx, struct nlmsghdr *h)
{
struct ifaddrs_ctx *ctx = pctx;
struct ifaddrs_storage *ifs, *ifs0;
struct ifinfomsg *ifi = NLMSG_DATA(h);
struct ifaddrmsg *ifa = NLMSG_DATA(h);
struct rtattr *rta;
int stats_len = 0;
if (h->nlmsg_type == RTM_NEWLINK) {
for (rta = NLMSG_RTA(h, sizeof(*ifi)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {
if (rta->rta_type != IFLA_STATS) continue;
stats_len = RTA_DATALEN(rta);
break;
}
} else {
for (ifs0 = ctx->hash[ifa->ifa_index % IFADDRS_HASH_SIZE]; ifs0; ifs0 = ifs0->hash_next)
if (ifs0->index == ifa->ifa_index)
break;
if (!ifs0) return 0;
}
ifs = calloc(1, sizeof(struct ifaddrs_storage) + stats_len);
if (ifs == 0) return -1;
if (h->nlmsg_type == RTM_NEWLINK) {
ifs->index = ifi->ifi_index;
ifs->ifa.ifa_flags = ifi->ifi_flags;
for (rta = NLMSG_RTA(h, sizeof(*ifi)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {
switch (rta->rta_type) {
case IFLA_IFNAME:
if (RTA_DATALEN(rta) < sizeof(ifs->name)) {
memcpy(ifs->name, RTA_DATA(rta), RTA_DATALEN(rta));
ifs->ifa.ifa_name = ifs->name;
}
break;
case IFLA_ADDRESS:
copy_lladdr(&ifs->ifa.ifa_addr, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type);
break;
case IFLA_BROADCAST:
copy_lladdr(&ifs->ifa.ifa_broadaddr, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type);
break;
case IFLA_STATS:
ifs->ifa.ifa_data = (void*)(ifs+1);
memcpy(ifs->ifa.ifa_data, RTA_DATA(rta), RTA_DATALEN(rta));
break;
}
}
if (ifs->ifa.ifa_name) {
unsigned int bucket = ifs->index % IFADDRS_HASH_SIZE;
ifs->hash_next = ctx->hash[bucket];
ctx->hash[bucket] = ifs;
}
} else {
ifs->ifa.ifa_name = ifs0->ifa.ifa_name;
ifs->ifa.ifa_flags = ifs0->ifa.ifa_flags;
for (rta = NLMSG_RTA(h, sizeof(*ifa)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {
switch (rta->rta_type) {
case IFA_ADDRESS:
/* If ifa_addr is already set we, received an IFA_LOCAL before
* so treat this as destination address */
if (ifs->ifa.ifa_addr)
copy_addr(&ifs->ifa.ifa_dstaddr, ifa->ifa_family, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);
else
copy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);
break;
case IFA_BROADCAST:
copy_addr(&ifs->ifa.ifa_broadaddr, ifa->ifa_family, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);
break;
case IFA_LOCAL:
/* If ifa_addr is set and we get IFA_LOCAL, assume we have
* a point-to-point network. Move address to correct field. */
if (ifs->ifa.ifa_addr) {
ifs->ifu = ifs->addr;
ifs->ifa.ifa_dstaddr = &ifs->ifu.sa;
memset(&ifs->addr, 0, sizeof(ifs->addr));
}
copy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);
break;
case IFA_LABEL:
if (RTA_DATALEN(rta) < sizeof(ifs->name)) {
memcpy(ifs->name, RTA_DATA(rta), RTA_DATALEN(rta));
ifs->ifa.ifa_name = ifs->name;
}
break;
}
}
if (ifs->ifa.ifa_addr)
gen_netmask(&ifs->ifa.ifa_netmask, ifa->ifa_family, &ifs->netmask, ifa->ifa_prefixlen);
}
if (ifs->ifa.ifa_name) {
if (!ctx->first) ctx->first = ifs;
if (ctx->last) ctx->last->ifa.ifa_next = &ifs->ifa;
ctx->last = ifs;
} else {
free(ifs);
}
return 0;
}
int getifaddrs(struct ifaddrs **ifap)
{
struct ifaddrs_ctx _ctx, *ctx = &_ctx;
int r;
memset(ctx, 0, sizeof *ctx);
r = __rtnetlink_enumerate(AF_UNSPEC, AF_UNSPEC, netlink_msg_to_ifaddr, ctx);
if (r == 0) *ifap = &ctx->first->ifa;
else freeifaddrs(&ctx->first->ifa);
return r;
}

View File

@ -2,6 +2,10 @@
* Helper functions used by other modules
*/
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
@ -10,7 +14,11 @@
#ifndef _WIN32
#include <errno.h>
#endif // _WIN32
#ifndef _MSC_VER
#include <getopt.h>
#else
#include "wingetopt.h"
#endif
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@ -20,6 +28,7 @@
#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
@ -72,7 +81,7 @@ int ucs2_to_utf8_char (const WCHAR ucs2_le, char *utf8)
const WCHAR ucs2 = LE16(ucs2_le);
if (ucs2 < 0x80) {
utf8[0] = ucs2;
utf8[0] = (char)ucs2;
utf8[1] = '\0';
return 1;
}
@ -153,7 +162,7 @@ BOOL stringToInt(const char *const szValue, const unsigned int min, const unsign
char *nextchar;
errno = 0;
long long result = strtoll(szValue, &nextchar, 10);
long long result = vlmcsd_strtoll(szValue, &nextchar, 10);
if (errno || result < (long long)min || result > (long long)max || *nextchar)
{
@ -177,7 +186,7 @@ int_fast8_t string2Uuid(const char *const restrict input, GUID *const restrict g
{
if (i == 8 || i == 13 || i == 18 || i == 23) continue;
const char c = toupper((int)input[i]);
const char c = (char)toupper((int)input[i]);
if (c < '0' || c > 'F' || (c > '9' && c < 'A')) return FALSE;
}
@ -211,7 +220,7 @@ void LEGUID(GUID *const restrict out, const GUID* const restrict in)
#endif
}
#if !IS_LIBRARY
//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)
{
@ -226,7 +235,6 @@ __pure unsigned int getOptionArgumentInt(const char o, const unsigned int min, c
return result;
}
// Resets getopt() to start parsing from the beginning
void optReset(void)
{
@ -241,7 +249,7 @@ void optReset(void)
optind = 1;
#endif
}
#endif // !IS_LIBRARY
#if defined(_WIN32) || defined(USE_MSRPC)
@ -295,9 +303,13 @@ void parseAddress(char *const addr, char** szHost, char** szPort)
// Initialize random generator (needs to be done in each thread)
void randomNumberInit()
{
# if _MSC_VER
srand(GetTickCount());
# else
struct timeval tv;
gettimeofday(&tv, NULL);
srand((unsigned int)(tv.tv_sec ^ tv.tv_usec));
# endif
}

600
ifaddrs-android.c Normal file
View File

@ -0,0 +1,600 @@
/*
Copyright (c) 2013, Kenneth MacKay
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ifaddrs-android.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
typedef struct NetlinkList
{
struct NetlinkList *m_next;
struct nlmsghdr *m_data;
unsigned int m_size;
} NetlinkList;
static int netlink_socket(void)
{
int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if(l_socket < 0)
{
return -1;
}
struct sockaddr_nl l_addr;
memset(&l_addr, 0, sizeof(l_addr));
l_addr.nl_family = AF_NETLINK;
if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0)
{
close(l_socket);
return -1;
}
return l_socket;
}
static int netlink_send(int p_socket, int p_request)
{
char l_buffer[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))];
memset(l_buffer, 0, sizeof(l_buffer));
struct nlmsghdr *l_hdr = (struct nlmsghdr *)l_buffer;
struct rtgenmsg *l_msg = (struct rtgenmsg *)NLMSG_DATA(l_hdr);
l_hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*l_msg));
l_hdr->nlmsg_type = p_request;
l_hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
l_hdr->nlmsg_pid = 0;
l_hdr->nlmsg_seq = p_socket;
l_msg->rtgen_family = AF_UNSPEC;
struct sockaddr_nl l_addr;
memset(&l_addr, 0, sizeof(l_addr));
l_addr.nl_family = AF_NETLINK;
return (sendto(p_socket, l_hdr, l_hdr->nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr)));
}
static int netlink_recv(int p_socket, void *p_buffer, size_t p_len)
{
struct msghdr l_msg;
struct iovec l_iov = { p_buffer, p_len };
struct sockaddr_nl l_addr;
//int l_result;
for(;;)
{
l_msg.msg_name = (void *)&l_addr;
l_msg.msg_namelen = sizeof(l_addr);
l_msg.msg_iov = &l_iov;
l_msg.msg_iovlen = 1;
l_msg.msg_control = NULL;
l_msg.msg_controllen = 0;
l_msg.msg_flags = 0;
int l_result = recvmsg(p_socket, &l_msg, 0);
if(l_result < 0)
{
if(errno == EINTR)
{
continue;
}
return -2;
}
if(l_msg.msg_flags & MSG_TRUNC)
{ // buffer was too small
return -1;
}
return l_result;
}
}
static struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done)
{
size_t l_size = 4096;
void *l_buffer = NULL;
for(;;)
{
free(l_buffer);
l_buffer = malloc(l_size);
int l_read = netlink_recv(p_socket, l_buffer, l_size);
*p_size = l_read;
if(l_read == -2)
{
free(l_buffer);
return NULL;
}
if(l_read >= 0)
{
pid_t l_pid = getpid();
struct nlmsghdr *l_hdr;
for(l_hdr = (struct nlmsghdr *)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); l_hdr = (struct nlmsghdr *)NLMSG_NEXT(l_hdr, l_read))
{
if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
{
continue;
}
if(l_hdr->nlmsg_type == NLMSG_DONE)
{
*p_done = 1;
break;
}
if(l_hdr->nlmsg_type == NLMSG_ERROR)
{
free(l_buffer);
return NULL;
}
}
return l_buffer;
}
l_size *= 2;
}
}
static NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size)
{
NetlinkList *l_item = malloc(sizeof(NetlinkList));
l_item->m_next = NULL;
l_item->m_data = p_data;
l_item->m_size = p_size;
return l_item;
}
static void freeResultList(NetlinkList *p_list)
{
NetlinkList *l_cur;
while(p_list)
{
l_cur = p_list;
p_list = p_list->m_next;
free(l_cur->m_data);
free(l_cur);
}
}
static NetlinkList *getResultList(int p_socket, int p_request)
{
if(netlink_send(p_socket, p_request) < 0)
{
return NULL;
}
NetlinkList *l_list = NULL;
NetlinkList *l_end = NULL;
int l_size;
int l_done = 0;
while(!l_done)
{
struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done);
if(!l_hdr)
{ // error
freeResultList(l_list);
return NULL;
}
NetlinkList *l_item = newListItem(l_hdr, l_size);
if(!l_list)
{
l_list = l_item;
}
else
{
l_end->m_next = l_item;
}
l_end = l_item;
}
return l_list;
}
static size_t maxSize(size_t a, size_t b)
{
return (a > b ? a : b);
}
static size_t calcAddrLen(sa_family_t p_family, int p_dataSize)
{
switch(p_family)
{
case AF_INET:
return sizeof(struct sockaddr_in);
case AF_INET6:
return sizeof(struct sockaddr_in6);
case AF_PACKET:
return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize);
default:
return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize);
}
}
static void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size)
{
switch(p_family)
{
case AF_INET:
memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size);
break;
case AF_INET6:
memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size);
break;
case AF_PACKET:
memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size);
((struct sockaddr_ll*)p_dest)->sll_halen = p_size;
break;
default:
memcpy(p_dest->sa_data, p_data, p_size);
break;
}
p_dest->sa_family = p_family;
}
static void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry)
{
if(!*p_resultList)
{
*p_resultList = p_entry;
}
else
{
struct ifaddrs *l_cur = *p_resultList;
while(l_cur->ifa_next)
{
l_cur = l_cur->ifa_next;
}
l_cur->ifa_next = p_entry;
}
}
static void interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_links, struct ifaddrs **p_resultList)
{
struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr);
size_t l_nameSize = 0;
size_t l_addrSize = 0;
size_t l_dataSize = 0;
size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));
struct rtattr *l_rta;
for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifinfomsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
{
//void *l_rtaData = RTA_DATA(l_rta);
size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
switch(l_rta->rta_type)
{
case IFLA_ADDRESS:
case IFLA_BROADCAST:
l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize));
break;
case IFLA_IFNAME:
l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);
break;
case IFLA_STATS:
l_dataSize += NLMSG_ALIGN(l_rtaSize);
break;
default:
break;
}
}
struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize + l_dataSize);
memset(l_entry, 0, sizeof(struct ifaddrs));
l_entry->ifa_name = "";
char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs);
char *l_addr = l_name + l_nameSize;
char *l_data = l_addr + l_addrSize;
l_entry->ifa_flags = l_info->ifi_flags;
l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));
for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifinfomsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
{
void *l_rtaData = RTA_DATA(l_rta);
size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
switch(l_rta->rta_type)
{
case IFLA_ADDRESS:
case IFLA_BROADCAST:
{
size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize);
makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);
((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index;
((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type;
if(l_rta->rta_type == IFLA_ADDRESS)
{
l_entry->ifa_addr = (struct sockaddr *)l_addr;
}
else
{
l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;
}
l_addr += NLMSG_ALIGN(l_addrLen);
break;
}
case IFLA_IFNAME:
strncpy(l_name, l_rtaData, l_rtaDataSize);
l_name[l_rtaDataSize] = '\0';
l_entry->ifa_name = l_name;
break;
case IFLA_STATS:
memcpy(l_data, l_rtaData, l_rtaDataSize);
l_entry->ifa_data = l_data;
break;
default:
break;
}
}
addToEnd(p_resultList, l_entry);
p_links[l_info->ifi_index - 1] = l_entry;
}
static void interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_links, struct ifaddrs **p_resultList)
{
struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr);
size_t l_nameSize = 0;
size_t l_addrSize = 0;
int l_addedNetmask = 0;
size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));
struct rtattr *l_rta;
for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
{
//void *l_rtaData = RTA_DATA(l_rta);
size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
if(l_info->ifa_family == AF_PACKET)
{
continue;
}
switch(l_rta->rta_type)
{
case IFA_ADDRESS:
case IFA_LOCAL:
if((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask)
{ // make room for netmask
l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));
l_addedNetmask = 1;
}
case IFA_BROADCAST:
l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));
break;
case IFA_LABEL:
l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);
break;
default:
break;
}
}
struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize);
memset(l_entry, 0, sizeof(struct ifaddrs));
l_entry->ifa_name = p_links[l_info->ifa_index - 1]->ifa_name;
char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs);
char *l_addr = l_name + l_nameSize;
l_entry->ifa_flags = l_info->ifa_flags | p_links[l_info->ifa_index - 1]->ifa_flags;
l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));
for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
{
void *l_rtaData = RTA_DATA(l_rta);
size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
switch(l_rta->rta_type)
{
case IFA_ADDRESS:
case IFA_BROADCAST:
case IFA_LOCAL:
{
size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize);
makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);
if(l_info->ifa_family == AF_INET6)
{
if(IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData))
{
((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index;
}
}
if(l_rta->rta_type == IFA_ADDRESS)
{ // apparently in a point-to-point network IFA_ADDRESS contains the dest address and IFA_LOCAL contains the local address
if(l_entry->ifa_addr)
{
l_entry->ifa_dstaddr = (struct sockaddr *)l_addr;
}
else
{
l_entry->ifa_addr = (struct sockaddr *)l_addr;
}
}
else if(l_rta->rta_type == IFA_LOCAL)
{
if(l_entry->ifa_addr)
{
l_entry->ifa_dstaddr = l_entry->ifa_addr;
}
l_entry->ifa_addr = (struct sockaddr *)l_addr;
}
else
{
l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;
}
l_addr += NLMSG_ALIGN(l_addrLen);
break;
}
case IFA_LABEL:
strncpy(l_name, l_rtaData, l_rtaDataSize);
l_name[l_rtaDataSize] = '\0';
l_entry->ifa_name = l_name;
break;
default:
break;
}
}
if(l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6))
{
unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128);
unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen);
char l_mask[16] = {0};
unsigned i;
for(i=0; i<(l_prefix/8); ++i)
{
l_mask[i] = 0xff;
}
l_mask[i] = 0xff << (8 - (l_prefix % 8));
makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8);
l_entry->ifa_netmask = (struct sockaddr *)l_addr;
}
addToEnd(p_resultList, l_entry);
}
static void interpret(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_links, struct ifaddrs **p_resultList)
{
pid_t l_pid = getpid();
for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)
{
unsigned int l_nlsize = p_netlinkList->m_size;
struct nlmsghdr *l_hdr;
for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))
{
if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
{
continue;
}
if(l_hdr->nlmsg_type == NLMSG_DONE)
{
break;
}
if(l_hdr->nlmsg_type == RTM_NEWLINK)
{
interpretLink(l_hdr, p_links, p_resultList);
}
else if(l_hdr->nlmsg_type == RTM_NEWADDR)
{
interpretAddr(l_hdr, p_links, p_resultList);
}
}
}
}
static unsigned countLinks(int p_socket, NetlinkList *p_netlinkList)
{
unsigned l_links = 0;
pid_t l_pid = getpid();
for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)
{
unsigned int l_nlsize = p_netlinkList->m_size;
struct nlmsghdr *l_hdr;
for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))
{
if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
{
continue;
}
if(l_hdr->nlmsg_type == NLMSG_DONE)
{
break;
}
if(l_hdr->nlmsg_type == RTM_NEWLINK)
{
++l_links;
}
}
}
return l_links;
}
int getifaddrs(struct ifaddrs **ifap)
{
if(!ifap)
{
return -1;
}
*ifap = NULL;
int l_socket = netlink_socket();
if(l_socket < 0)
{
return -1;
}
NetlinkList *l_linkResults = getResultList(l_socket, RTM_GETLINK);
if(!l_linkResults)
{
close(l_socket);
return -1;
}
NetlinkList *l_addrResults = getResultList(l_socket, RTM_GETADDR);
if(!l_addrResults)
{
close(l_socket);
freeResultList(l_linkResults);
return -1;
}
unsigned l_numLinks = countLinks(l_socket, l_linkResults) + countLinks(l_socket, l_addrResults);
struct ifaddrs *l_links[l_numLinks];
memset(l_links, 0, l_numLinks * sizeof(struct ifaddrs *));
interpret(l_socket, l_linkResults, l_links, ifap);
interpret(l_socket, l_addrResults, l_links, ifap);
freeResultList(l_linkResults);
freeResultList(l_addrResults);
close(l_socket);
return 0;
}
void freeifaddrs(struct ifaddrs *ifa)
{
struct ifaddrs *l_cur;
while(ifa)
{
l_cur = ifa;
ifa = ifa->ifa_next;
free(l_cur);
}
}

58
ifaddrs-android.h Normal file
View File

@ -0,0 +1,58 @@
/*
* Copyright (c) 1995, 1999
* Berkeley Software Design, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
*/
#if !__ANDROID__
#error ifaddrs-android only works with Android
#endif
#ifndef _IFADDRS_H_
#define _IFADDRS_H_
struct ifaddrs {
struct ifaddrs *ifa_next;
char *ifa_name;
unsigned int ifa_flags;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
struct sockaddr *ifa_dstaddr;
void *ifa_data;
};
/*
* This may have been defined in <net/if.h>. Note that if <net/if.h> is
* to be included it must be included before this header file.
*/
#ifndef ifa_broadaddr
#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
#endif
#include <sys/cdefs.h>
__BEGIN_DECLS
extern int getifaddrs(struct ifaddrs **ifap);
extern void freeifaddrs(struct ifaddrs *ifa);
__END_DECLS
#endif

43
ifaddrs-musl.h Normal file
View File

@ -0,0 +1,43 @@
#ifndef _IFADDRS_H
#define _IFADDRS_H
#ifdef __cplusplus
extern "C" {
#endif
#if !__linux__
#error ifaddrs-musl.h only works with a Linux kernel
#endif
#if __ANDROID__
#error ifaddrs-musl.h does not work with Android
#endif
#include <features.h>
#include <netinet/in.h>
#include <sys/socket.h>
struct ifaddrs {
struct ifaddrs *ifa_next;
char *ifa_name;
unsigned ifa_flags;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
union {
struct sockaddr *ifu_broadaddr;
struct sockaddr *ifu_dstaddr;
} ifa_ifu;
void *ifa_data;
};
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
void freeifaddrs(struct ifaddrs *ifp);
int getifaddrs(struct ifaddrs **ifap);
#ifdef __cplusplus
}
#endif
#endif

551
kms.c
View File

@ -3,6 +3,10 @@
#endif // CONFIG
#include CONFIG
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@ -21,215 +25,282 @@
#define FRIENDLY_NAME_WINDOWS "Windows"
#define FRIENDLY_NAME_OFFICE2010 "Office 2010"
#define FRIENDLY_NAME_OFFICE2013 "Office"
#define FRIENDLY_NAME_OFFICE2013 "Office 2013+"
#ifndef IS_LIBRARY
#ifdef NO_LOG
#define LOGTEXT(x) ""
#else //!NO_LOG
#define LOGTEXT(x) x
#endif // !NO_LOG
#ifndef NO_BASIC_PRODUCT_LIST
// Do not change the order of this list. Append items as necessary
const KmsIdList ProductList[] = {
/* 000 */ { { 0x212a64dc, 0x43b1, 0x4d3d, { 0xa3, 0x0c, 0x2f, 0xc6, 0x9d, 0x20, 0x95, 0xc6 } } /*"212a64dc-43b1-4d3d-a30c-2fc69d2095c6"*/, "Vista", EPID_WINDOWS, 4, 25 },
/* 001 */ { { 0x7fde5219, 0xfbfa, 0x484a, { 0x82, 0xc9, 0x34, 0xd1, 0xad, 0x53, 0xe8, 0x56 } } /*"7fde5219-fbfa-484a-82c9-34d1ad53e856"*/, "Windows 7", EPID_WINDOWS, 4, 25 },
/* 002 */ { { 0x3c40b358, 0x5948, 0x45af, { 0x92, 0x3b, 0x53, 0xd2, 0x1f, 0xcc, 0x7e, 0x79 } } /*"3c40b358-5948-45af-923b-53d21fcc7e79"*/, "Windows 8 VL", EPID_WINDOWS, 5, 25 },
/* 003 */ { { 0x5f94a0bb, 0xd5a0, 0x4081, { 0xa6, 0x85, 0x58, 0x19, 0x41, 0x8b, 0x2f, 0xe0 } } /*"5f94a0bb-d5a0-4081-a685-5819418b2fe0"*/, "Windows Preview", EPID_WINDOWS, 6, 25 },
/* 004 */ { { 0xbbb97b3b, 0x8ca4, 0x4a28, { 0x97, 0x17, 0x89, 0xfa, 0xbd, 0x42, 0xc4, 0xac } } /*"bbb97b3b-8ca4-4a28-9717-89fabd42c4ac"*/, "Windows 8 Retail", EPID_WINDOWS, 5, 25 },
/* 005 */ { { 0xcb8fc780, 0x2c05, 0x495a, { 0x97, 0x10, 0x85, 0xaf, 0xff, 0xc9, 0x04, 0xd7 } } /*"cb8fc780-2c05-495a-9710-85afffc904d7"*/, "Windows 8.1 VL", EPID_WINDOWS, 6, 25 },
/* 006 */ { { 0x6d646890, 0x3606, 0x461a, { 0x86, 0xab, 0x59, 0x8b, 0xb8, 0x4a, 0xce, 0x82 } } /*"6d646890-3606-461a-86ab-598bb84ace82"*/, "Windows 8.1 Retail", EPID_WINDOWS, 6, 25 },
/* 007 */ { { 0x33e156e4, 0xb76f, 0x4a52, { 0x9f, 0x91, 0xf6, 0x41, 0xdd, 0x95, 0xac, 0x48 } } /*"33e156e4-b76f-4a52-9f91-f641dd95ac48"*/, "Windows 2008 A", EPID_WINDOWS, 4, 5 },
/* 008 */ { { 0x8fe53387, 0x3087, 0x4447, { 0x89, 0x85, 0xf7, 0x51, 0x32, 0x21, 0x5a, 0xc9 } } /*"8fe53387-3087-4447-8985-f75132215ac9"*/, "Windows 2008 B", EPID_WINDOWS, 4, 5 },
/* 009 */ { { 0x8a21fdf3, 0xcbc5, 0x44eb, { 0x83, 0xf3, 0xfe, 0x28, 0x4e, 0x66, 0x80, 0xa7 } } /*"8a21fdf3-cbc5-44eb-83f3-fe284e6680a7"*/, "Windows 2008 C", EPID_WINDOWS, 4, 5 },
/* 010 */ { { 0x0fc6ccaf, 0xff0e, 0x4fae, { 0x9d, 0x08, 0x43, 0x70, 0x78, 0x5b, 0xf7, 0xed } } /*"0fc6ccaf-ff0e-4fae-9d08-4370785bf7ed"*/, "Windows 2008 R2 A", EPID_WINDOWS, 4, 5 },
/* 011 */ { { 0xca87f5b6, 0xcd46, 0x40c0, { 0xb0, 0x6d, 0x8e, 0xcd, 0x57, 0xa4, 0x37, 0x3f } } /*"ca87f5b6-cd46-40c0-b06d-8ecd57a4373f"*/, "Windows 2008 R2 B", EPID_WINDOWS, 4, 5 },
/* 012 */ { { 0xb2ca2689, 0xa9a8, 0x42d7, { 0x93, 0x8d, 0xcf, 0x8e, 0x9f, 0x20, 0x19, 0x58 } } /*"b2ca2689-a9a8-42d7-938d-cf8e9f201958"*/, "Windows 2008 R2 C", EPID_WINDOWS, 4, 5 },
/* 013 */ { { 0x8665cb71, 0x468c, 0x4aa3, { 0xa3, 0x37, 0xcb, 0x9b, 0xc9, 0xd5, 0xea, 0xac } } /*"8665cb71-468c-4aa3-a337-cb9bc9d5eaac"*/, "Windows 2012", EPID_WINDOWS, 5, 5 },
/* 014 */ { { 0x8456EFD3, 0x0C04, 0x4089, { 0x87, 0x40, 0x5b, 0x72, 0x38, 0x53, 0x5a, 0x65 } } /*"8456EFD3-0C04-4089-8740-5B7238535A65"*/, "Windows 2012 R2", EPID_WINDOWS, 6, 5 },
/* 015 */ { { 0xe85af946, 0x2e25, 0x47b7, { 0x83, 0xe1, 0xbe, 0xbc, 0xeb, 0xea, 0xc6, 0x11 } } /*"e85af946-2e25-47b7-83e1-bebcebeac611"*/, "Office 2010", EPID_OFFICE2010, 4, 5 },
/* 016 */ { { 0xe6a6f1bf, 0x9d40, 0x40c3, { 0xaa, 0x9f, 0xc7, 0x7b, 0xa2, 0x15, 0x78, 0xc0 } } /*"e6a6f1bf-9d40-40c3-aa9f-c77ba21578c0"*/, "Office 2013", EPID_OFFICE2013, 6, 5 },
/* 017 */ { { 0x6d5f5270, 0x31ac, 0x433e, { 0xb9, 0x0a, 0x39, 0x89, 0x29, 0x23, 0xc6, 0x57 } } /*"6d5f5270-31ac-433e-b90a-39892923c657"*/, "Windows Server Preview", EPID_WINDOWS, 6, 5 },
/* 018 */ { { 0x85b5f61b, 0x320b, 0x4be3, { 0x81, 0x4a, 0xb7, 0x6b, 0x2b, 0xfa, 0xfc, 0x82 } } /*"85b5f61b-320b-4be3-814a-b76b2bfafc82"*/, "Office 2016", EPID_OFFICE2013, 6, 5 },
/* 019 */ { { 0x58e2134f, 0x8e11, 0x4d17, { 0x9c, 0xb2, 0x91, 0x06, 0x9c, 0x15, 0x11, 0x48 } } /*"58e2134f-8e11-4d17-9cb2-91069c151148"*/, "Windows 10 VL", EPID_WINDOWS, 6, 25 },
/* 020 */ { { 0xe1c51358, 0xfe3e, 0x4203, { 0xa4, 0xa2, 0x3b, 0x6b, 0x20, 0xc9, 0x73, 0x4e } } /*"e1c51358-fe3e-4203-a4a2-3b6b20c9734e"*/, "Windows 10 Retail", EPID_WINDOWS, 6, 25 },
/* 021 */ { { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, NULL, NULL, 0, 0 }
/* 000 */ { { 0xe85af946, 0x2e25, 0x47b7, { 0x83, 0xe1, 0xbe, 0xbc, 0xeb, 0xea, 0xc6, 0x11, } } /*e85af946-2e25-47b7-83e1-bebcebeac611*/, LOGTEXT("Office 2010"), EPID_OFFICE2010, 4, 5 },
/* 001 */ { { 0xe6a6f1bf, 0x9d40, 0x40c3, { 0xaa, 0x9f, 0xc7, 0x7b, 0xa2, 0x15, 0x78, 0xc0, } } /*e6a6f1bf-9d40-40c3-aa9f-c77ba21578c0*/, LOGTEXT("Office 2013"), EPID_OFFICE2013, 5, 5 },
/* 002 */ { { 0xaa4c7968, 0xb9da, 0x4680, { 0x92, 0xb6, 0xac, 0xb2, 0x5e, 0x2f, 0x86, 0x6c, } } /*aa4c7968-b9da-4680-92b6-acb25e2f866c*/, LOGTEXT("Office 2013 (Pre-Release)"), EPID_OFFICE2013, 5, 5 },
/* 003 */ { { 0x85b5f61b, 0x320b, 0x4be3, { 0x81, 0x4a, 0xb7, 0x6b, 0x2b, 0xfa, 0xfc, 0x82, } } /*85b5f61b-320b-4be3-814a-b76b2bfafc82*/, LOGTEXT("Office 2016"), EPID_OFFICE2016, 6, 5 },
# ifndef NO_BASIC_PRODUCT_LIST
/* 004 */ { { 0x212a64dc, 0x43b1, 0x4d3d, { 0xa3, 0x0c, 0x2f, 0xc6, 0x9d, 0x20, 0x95, 0xc6, } } /*212a64dc-43b1-4d3d-a30c-2fc69d2095c6*/, LOGTEXT("Windows Vista"), EPID_WINDOWS, 4, 25 },
/* 005 */ { { 0x7fde5219, 0xfbfa, 0x484a, { 0x82, 0xc9, 0x34, 0xd1, 0xad, 0x53, 0xe8, 0x56, } } /*7fde5219-fbfa-484a-82c9-34d1ad53e856*/, LOGTEXT("Windows 7"), EPID_WINDOWS, 4, 25 },
/* 006 */ { { 0x3c40b358, 0x5948, 0x45af, { 0x92, 0x3b, 0x53, 0xd2, 0x1f, 0xcc, 0x7e, 0x79, } } /*3c40b358-5948-45af-923b-53d21fcc7e79*/, LOGTEXT("Windows 8 (Volume)"), EPID_WINDOWS, 5, 25 },
/* 007 */ { { 0x5f94a0bb, 0xd5a0, 0x4081, { 0xa6, 0x85, 0x58, 0x19, 0x41, 0x8b, 0x2f, 0xe0, } } /*5f94a0bb-d5a0-4081-a685-5819418b2fe0*/, LOGTEXT("Windows Preview"), EPID_WINDOWS, 5, 25 },
/* 008 */ { { 0xbbb97b3b, 0x8ca4, 0x4a28, { 0x97, 0x17, 0x89, 0xfa, 0xbd, 0x42, 0xc4, 0xac, } } /*bbb97b3b-8ca4-4a28-9717-89fabd42c4ac*/, LOGTEXT("Windows 8 (Retail)"), EPID_WINDOWS, 5, 25 },
/* 009 */ { { 0xcb8fc780, 0x2c05, 0x495a, { 0x97, 0x10, 0x85, 0xaf, 0xff, 0xc9, 0x04, 0xd7, } } /*cb8fc780-2c05-495a-9710-85afffc904d7*/, LOGTEXT("Windows 8.1 (Volume)"), EPID_WINDOWS, 6, 25 },
/* 010 */ { { 0x6d646890, 0x3606, 0x461a, { 0x86, 0xab, 0x59, 0x8b, 0xb8, 0x4a, 0xce, 0x82, } } /*6d646890-3606-461a-86ab-598bb84ace82*/, LOGTEXT("Windows 8.1 (Retail)"), EPID_WINDOWS, 6, 25 },
/* 011 */ { { 0x33e156e4, 0xb76f, 0x4a52, { 0x9f, 0x91, 0xf6, 0x41, 0xdd, 0x95, 0xac, 0x48, } } /*33e156e4-b76f-4a52-9f91-f641dd95ac48*/, LOGTEXT("Windows Server 2008 A (Web and HPC)"), EPID_WINDOWS, 4, 5 },
/* 012 */ { { 0x8fe53387, 0x3087, 0x4447, { 0x89, 0x85, 0xf7, 0x51, 0x32, 0x21, 0x5a, 0xc9, } } /*8fe53387-3087-4447-8985-f75132215ac9*/, LOGTEXT("Windows Server 2008 B (Standard and Enterprise)"), EPID_WINDOWS, 4, 5 },
/* 013 */ { { 0x8a21fdf3, 0xcbc5, 0x44eb, { 0x83, 0xf3, 0xfe, 0x28, 0x4e, 0x66, 0x80, 0xa7, } } /*8a21fdf3-cbc5-44eb-83f3-fe284e6680a7*/, LOGTEXT("Windows Server 2008 C (Datacenter)"), EPID_WINDOWS, 4, 5 },
/* 014 */ { { 0x0fc6ccaf, 0xff0e, 0x4fae, { 0x9d, 0x08, 0x43, 0x70, 0x78, 0x5b, 0xf7, 0xed, } } /*0fc6ccaf-ff0e-4fae-9d08-4370785bf7ed*/, LOGTEXT("Windows Server 2008 R2 A (Web and HPC)"), EPID_WINDOWS, 4, 5 },
/* 015 */ { { 0xca87f5b6, 0xcd46, 0x40c0, { 0xb0, 0x6d, 0x8e, 0xcd, 0x57, 0xa4, 0x37, 0x3f, } } /*ca87f5b6-cd46-40c0-b06d-8ecd57a4373f*/, LOGTEXT("Windows Server 2008 R2 B (Standard and Enterprise)"), EPID_WINDOWS, 4, 5 },
/* 016 */ { { 0xb2ca2689, 0xa9a8, 0x42d7, { 0x93, 0x8d, 0xcf, 0x8e, 0x9f, 0x20, 0x19, 0x58, } } /*b2ca2689-a9a8-42d7-938d-cf8e9f201958*/, LOGTEXT("Windows Server 2008 R2 C (Datacenter)"), EPID_WINDOWS, 4, 5 },
/* 017 */ { { 0x8665cb71, 0x468c, 0x4aa3, { 0xa3, 0x37, 0xcb, 0x9b, 0xc9, 0xd5, 0xea, 0xac, } } /*8665cb71-468c-4aa3-a337-cb9bc9d5eaac*/, LOGTEXT("Windows Server 2012"), EPID_WINDOWS, 5, 5 },
/* 018 */ { { 0x8456efd3, 0x0c04, 0x4089, { 0x87, 0x40, 0x5b, 0x72, 0x38, 0x53, 0x5a, 0x65, } } /*8456efd3-0c04-4089-8740-5b7238535a65*/, LOGTEXT("Windows Server 2012 R2"), EPID_WINDOWS, 6, 5 },
/* 019 */ { { 0x6d5f5270, 0x31ac, 0x433e, { 0xb9, 0x0a, 0x39, 0x89, 0x29, 0x23, 0xc6, 0x57, } } /*6d5f5270-31ac-433e-b90a-39892923c657*/, LOGTEXT("Windows Server Preview"), EPID_WINDOWS, 6, 5 },
/* 020 */ { { 0x58e2134f, 0x8e11, 0x4d17, { 0x9c, 0xb2, 0x91, 0x06, 0x9c, 0x15, 0x11, 0x48, } } /*58e2134f-8e11-4d17-9cb2-91069c151148*/, LOGTEXT("Windows 10 2015 (Volume)"), EPID_WINDOWS, 6, 25 },
/* 021 */ { { 0xe1c51358, 0xfe3e, 0x4203, { 0xa4, 0xa2, 0x3b, 0x6b, 0x20, 0xc9, 0x73, 0x4e, } } /*e1c51358-fe3e-4203-a4a2-3b6b20c9734e*/, LOGTEXT("Windows 10 (Retail)"), EPID_WINDOWS, 6, 25 },
/* 022 */ { { 0x6e9fc069, 0x257d, 0x4bc4, { 0xb4, 0xa7, 0x75, 0x05, 0x14, 0xd3, 0x27, 0x43, } } /*6e9fc069-257d-4bc4-b4a7-750514d32743*/, LOGTEXT("Windows Server 2016"), EPID_WINDOWS, 6, 5 },
/* 023 */ { { 0x969fe3c0, 0xa3ec, 0x491a, { 0x9f, 0x25, 0x42, 0x36, 0x05, 0xde, 0xb3, 0x65, } } /*969fe3c0-a3ec-491a-9f25-423605deb365*/, LOGTEXT("Windows 10 2016 (Volume)"), EPID_WINDOWS, 6, 25 },
# endif // NO_BASIC_PRODUCT_LIST
/* 024 */ { { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } }, NULL, NULL, 0, 0 }
};
#endif
#ifndef NO_LOG
// Application ID is used by KMS server to count KeyManagementServiceCurrentCount
// Do not change the order of this list. Append items as necessary
const KmsIdList AppList[] = {
/* 000 */ { { 0x55c92734, 0xd682, 0x4d71, { 0x98, 0x3e, 0xd6, 0xec, 0x3f, 0x16, 0x05, 0x9f } } /*"55C92734-D682-4D71-983E-D6EC3F16059F"*/, FRIENDLY_NAME_WINDOWS, EPID_WINDOWS, 0, 0},
/* 001 */ { { 0x59A52881, 0xa989, 0x479d, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"59A52881-A989-479D-AF46-F275C6370663"*/, FRIENDLY_NAME_OFFICE2010, EPID_OFFICE2010, 0, 0},
/* 002 */ { { 0x0FF1CE15, 0xA989, 0x479D, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"0FF1CE15-A989-479D-AF46-F275C6370663"*/, FRIENDLY_NAME_OFFICE2013, EPID_OFFICE2013, 0, 0},
/* 000 */ { { 0x55c92734, 0xd682, 0x4d71, { 0x98, 0x3e, 0xd6, 0xec, 0x3f, 0x16, 0x05, 0x9f } } /*"55C92734-D682-4D71-983E-D6EC3F16059F"*/, LOGTEXT(FRIENDLY_NAME_WINDOWS), EPID_WINDOWS, 0, 0},
/* 001 */ { { 0x59A52881, 0xa989, 0x479d, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"59A52881-A989-479D-AF46-F275C6370663"*/, LOGTEXT(FRIENDLY_NAME_OFFICE2010), EPID_OFFICE2010, 0, 0},
/* 002 */ { { 0x0FF1CE15, 0xA989, 0x479D, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"0FF1CE15-A989-479D-AF46-F275C6370663"*/, LOGTEXT(FRIENDLY_NAME_OFFICE2013), EPID_OFFICE2013, 0, 0},
/* 003 */ { { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, NULL, NULL, 0, 0 }
};
#endif // NO_LOG
#ifndef NO_EXTENDED_PRODUCT_LIST
const KmsIdList ExtendedProductList [] = {
// Windows 10 (Retail)
{ { 0x58e97c99, 0xf377, 0x4ef1, { 0x81, 0xd5, 0x4a, 0xd5, 0x52, 0x2b, 0x5f, 0xd8, } } /*58e97c99-f377-4ef1-81d5-4ad5522b5fd8*/, LOGTEXT("Windows 10 Home"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL },
{ { 0xa9107544, 0xf4a0, 0x4053, { 0xa9, 0x6a, 0x14, 0x79, 0xab, 0xde, 0xf9, 0x12, } } /*a9107544-f4a0-4053-a96a-1479abdef912*/, LOGTEXT("Windows 10 Home Country Specific"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL },
{ { 0x7b9e1751, 0xa8da, 0x4f75, { 0x95, 0x60, 0x5f, 0xad, 0xfe, 0x3d, 0x8e, 0x38, } } /*7b9e1751-a8da-4f75-9560-5fadfe3d8e38*/, LOGTEXT("Windows 10 Home N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL },
{ { 0xcd918a57, 0xa41b, 0x4c82, { 0x8d, 0xce, 0x1a, 0x53, 0x8e, 0x22, 0x1a, 0x83, } } /*cd918a57-a41b-4c82-8dce-1a538e221a83*/, LOGTEXT("Windows 10 Home Single Language"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL },
// Windows Server
// Windows 10 2015 (Volume)
{ { 0xe0c42288, 0x980c, 0x4788, { 0xa0, 0x14, 0xc0, 0x80, 0xd2, 0xe1, 0x92, 0x6e, } } /*e0c42288-980c-4788-a014-c080d2e1926e*/, LOGTEXT("Windows 10 Education"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x3c102355, 0xd027, 0x42c6, { 0xad, 0x23, 0x2e, 0x7e, 0xf8, 0xa0, 0x25, 0x85, } } /*3c102355-d027-42c6-ad23-2e7ef8a02585*/, LOGTEXT("Windows 10 Education N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x73111121, 0x5638, 0x40f6, { 0xbc, 0x11, 0xf1, 0xd7, 0xb0, 0xd6, 0x43, 0x00, } } /*73111121-5638-40f6-bc11-f1d7b0d64300*/, LOGTEXT("Windows 10 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x7b51a46c, 0x0c04, 0x4e8f, { 0x9a, 0xf4, 0x84, 0x96, 0xcc, 0xa9, 0x0d, 0x5e, } } /*7b51a46c-0c04-4e8f-9af4-8496cca90d5e*/, LOGTEXT("Windows 10 Enterprise 2015 LTSB"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x87b838b7, 0x41b6, 0x4590, { 0x83, 0x18, 0x57, 0x97, 0x95, 0x1d, 0x85, 0x29, } } /*87b838b7-41b6-4590-8318-5797951d8529*/, LOGTEXT("Windows 10 Enterprise 2015 LTSB N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xe272e3e2, 0x732f, 0x4c65, { 0xa8, 0xf0, 0x48, 0x47, 0x47, 0xd0, 0xd9, 0x47, } } /*e272e3e2-732f-4c65-a8f0-484747d0d947*/, LOGTEXT("Windows 10 Enterprise N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x43f2ab05, 0x7c87, 0x4d56, { 0xb2, 0x7c, 0x44, 0xd0, 0xf9, 0xa3, 0xda, 0xbd, } } /*43f2ab05-7c87-4d56-b27c-44d0f9a3dabd*/, LOGTEXT("Windows 10 Enterprise Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x2de67392, 0xb7a7, 0x462a, { 0xb1, 0xca, 0x10, 0x8d, 0xd1, 0x89, 0xf5, 0x88, } } /*2de67392-b7a7-462a-b1ca-108dd189f588*/, LOGTEXT("Windows 10 Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x3f1afc82, 0xf8ac, 0x4f6c, { 0x80, 0x05, 0x1d, 0x23, 0x3e, 0x60, 0x6e, 0xee, } } /*3f1afc82-f8ac-4f6c-8005-1d233e606eee*/, LOGTEXT("Windows 10 Professional Education"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0x5300b18c, 0x2e33, 0x4dc2, { 0x82, 0x91, 0x47, 0xff, 0xce, 0xc7, 0x46, 0xdd, } } /*5300b18c-2e33-4dc2-8291-47ffcec746dd*/, LOGTEXT("Windows 10 Professional Education N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xa80b5abf, 0x76ad, 0x428b, { 0xb0, 0x5d, 0xa4, 0x7d, 0x2d, 0xff, 0xee, 0xbf, } } /*a80b5abf-76ad-428b-b05d-a47d2dffeebf*/, LOGTEXT("Windows 10 Professional N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xff808201, 0xfec6, 0x4fd4, { 0xae, 0x16, 0xab, 0xbd, 0xda, 0xde, 0x57, 0x06, } } /*ff808201-fec6-4fd4-ae16-abbddade5706*/, LOGTEXT("Windows 10 Professional Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xad2542d4, 0x9154, 0x4c6d, { 0x8a, 0x44, 0x30, 0xf1, 0x1e, 0xe9, 0x69, 0x89, } } /*ad2542d4-9154-4c6d-8a44-30f11ee96989*/, "Windows Server 2008 Standard", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008A },
{ { 0x2401e3d0, 0xc50a, 0x4b58, { 0x87, 0xb2, 0x7e, 0x79, 0x4b, 0x7d, 0x26, 0x07, } } /*2401e3d0-c50a-4b58-87b2-7e794b7d2607*/, "Windows Server 2008 Standard V", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008A },
{ { 0x68b6e220, 0xcf09, 0x466b, { 0x92, 0xd3, 0x45, 0xcd, 0x96, 0x4b, 0x95, 0x09, } } /*68b6e220-cf09-466b-92d3-45cd964b9509*/, "Windows Server 2008 Datacenter", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0xfd09ef77, 0x5647, 0x4eff, { 0x80, 0x9c, 0xaf, 0x2b, 0x64, 0x65, 0x9a, 0x45, } } /*fd09ef77-5647-4eff-809c-af2b64659a45*/, "Windows Server 2008 Datacenter V", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0xc1af4d90, 0xd1bc, 0x44ca, { 0x85, 0xd4, 0x00, 0x3b, 0xa3, 0x3d, 0xb3, 0xb9, } } /*c1af4d90-d1bc-44ca-85d4-003ba33db3b9*/, "Windows Server 2008 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
{ { 0x8198490a, 0xadd0, 0x47b2, { 0xb3, 0xba, 0x31, 0x6b, 0x12, 0xd6, 0x47, 0xb4, } } /*8198490a-add0-47b2-b3ba-316b12d647b4*/, "Windows Server 2008 Enterprise V", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
{ { 0xddfa9f7c, 0xf09e, 0x40b9, { 0x8c, 0x1a, 0xbe, 0x87, 0x7a, 0x9a, 0x7f, 0x4b, } } /*ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b*/, "Windows Server 2008 Web", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008A },
{ { 0x7afb1156, 0x2c1d, 0x40fc, { 0xb2, 0x60, 0xaa, 0xb7, 0x44, 0x2b, 0x62, 0xfe, } } /*7afb1156-2c1d-40fc-b260-aab7442b62fe*/, "Windows Server 2008 Compute Cluster", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0x68531fb9, 0x5511, 0x4989, { 0x97, 0xbe, 0xd1, 0x1a, 0x0f, 0x55, 0x63, 0x3f, } } /*68531fb9-5511-4989-97be-d11a0f55633f*/, "Windows Server 2008 R2 Standard", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2A },
{ { 0x7482e61b, 0xc589, 0x4b7f, { 0x8e, 0xcc, 0x46, 0xd4, 0x55, 0xac, 0x3b, 0x87, } } /*7482e61b-c589-4b7f-8ecc-46d455ac3b87*/, "Windows Server 2008 R2 Datacenter", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2C },
{ { 0x620e2b3d, 0x09e7, 0x42fd, { 0x80, 0x2a, 0x17, 0xa1, 0x36, 0x52, 0xfe, 0x7a, } } /*620e2b3d-09e7-42fd-802a-17a13652fe7a*/, "Windows Server 2008 R2 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2B },
{ { 0xa78b8bd9, 0x8017, 0x4df5, { 0xb8, 0x6a, 0x09, 0xf7, 0x56, 0xaf, 0xfa, 0x7c, } } /*a78b8bd9-8017-4df5-b86a-09f756affa7c*/, "Windows Server 2008 R2 Web", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2A },
{ { 0xcda18cf3, 0xc196, 0x46ad, { 0xb2, 0x89, 0x60, 0xc0, 0x72, 0x86, 0x99, 0x94, } } /*cda18cf3-c196-46ad-b289-60c072869994*/, "Windows Server 2008 R2 Compute Cluster", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2C },
{ { 0xd3643d60, 0x0c42, 0x412d, { 0xa7, 0xd6, 0x52, 0xe6, 0x63, 0x53, 0x27, 0xf6, } } /*d3643d60-0c42-412d-a7d6-52e6635327f6*/, "Windows Server 2012 Datacenter", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0xf0f5ec41, 0x0d55, 0x4732, { 0xaf, 0x02, 0x44, 0x0a, 0x44, 0xa3, 0xcf, 0x0f, } } /*f0f5ec41-0d55-4732-af02-440a44a3cf0f*/, "Windows Server 2012 Standard", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0x95fd1c83, 0x7df5, 0x494a, { 0xbe, 0x8b, 0x13, 0x00, 0xe1, 0xc9, 0xd1, 0xcd, } } /*95fd1c83-7df5-494a-be8b-1300e1c9d1cd*/, "Windows Server 2012 MultiPoint Premium", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0x7d5486c7, 0xe120, 0x4771, { 0xb7, 0xf1, 0x7b, 0x56, 0xc6, 0xd3, 0x17, 0x0c, } } /*7d5486c7-e120-4771-b7f1-7b56c6d3170c*/, "Windows Server 2012 MultiPoint Standard", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0x00091344, 0x1ea4, 0x4f37, { 0xb7, 0x89, 0x01, 0x75, 0x0b, 0xa6, 0x98, 0x8c, } } /*00091344-1ea4-4f37-b789-01750ba6988c*/, "Windows Server 2012 R2 Datacenter", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0xb3ca044e, 0xa358, 0x4d68, { 0x98, 0x83, 0xaa, 0xa2, 0x94, 0x1a, 0xca, 0x99, } } /*b3ca044e-a358-4d68-9883-aaa2941aca99*/, "Windows Server 2012 R2 Standard", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0xb743a2be, 0x68d4, 0x4dd3, { 0xaf, 0x32, 0x92, 0x42, 0x5b, 0x7b, 0xb6, 0x23, } } /*b743a2be-68d4-4dd3-af32-92425b7bb623*/, "Windows Server 2012 R2 Cloud Storage", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0x21db6ba4, 0x9a7b, 0x4a14, { 0x9e, 0x29, 0x64, 0xa6, 0x0c, 0x59, 0x30, 0x1d, } } /*21db6ba4-9a7b-4a14-9e29-64a60c59301d*/, "Windows Server 2012 R2 Essentials", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0xba947c44, 0xd19d, 0x4786, { 0xb6, 0xae, 0x22, 0x77, 0x0b, 0xc9, 0x4c, 0x54, } } /*ba947c44-d19d-4786-b6ae-22770bc94c54*/, "Windows Server 2016 Datacenter Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_SRV_BETA },
// Windows 10 2016 (Volume)
{ { 0x2d5a5a60, 0x3040, 0x48bf, { 0xbe, 0xb0, 0xfc, 0xd7, 0x70, 0xc2, 0x0c, 0xe0, } } /*2d5a5a60-3040-48bf-beb0-fcd770c20ce0*/, LOGTEXT("Windows 10 Enterprise 2016 LTSB"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_LTSB2016 },
{ { 0x9f776d83, 0x7156, 0x45b2, { 0x8a, 0x5c, 0x35, 0x9b, 0x9c, 0x9f, 0x22, 0xa3, } } /*9f776d83-7156-45b2-8a5c-359b9c9f22a3*/, LOGTEXT("Windows 10 Enterprise 2016 LTSB N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_LTSB2016 },
// Windows 10 Unknown (Volume)
// Windows 10 Preview
# ifdef INCLUDE_BETAS
{ { 0x6496e59d, 0x89dc, 0x49eb, { 0xa3, 0x53, 0x09, 0xce, 0xb9, 0x40, 0x48, 0x45, } } /*6496e59d-89dc-49eb-a353-09ceb9404845*/, "Windows 10 Core Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0xa4383e6b, 0xdada, 0x423d, { 0xa4, 0x3d, 0xf2, 0x56, 0x78, 0x42, 0x96, 0x76, } } /*a4383e6b-dada-423d-a43d-f25678429676*/, "Windows 10 Professional Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0xcf59a07b, 0x1a2a, 0x4be0, { 0xbf, 0xe0, 0x42, 0x3b, 0x58, 0x23, 0xe6, 0x63, } } /*cf59a07b-1a2a-4be0-bfe0-423b5823e663*/, "Windows 10 Professional WMC Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0xcde952c7, 0x2f96, 0x4d9d, { 0x8f, 0x2b, 0x2d, 0x34, 0x9f, 0x64, 0xfc, 0x51, } } /*cde952c7-2f96-4d9d-8f2b-2d349f64fc51*/, "Windows 10 Enterprise Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
# endif
// Windows 7
{ { 0xdb537896, 0x376f, 0x48ae, { 0xa4, 0x92, 0x53, 0xd0, 0x54, 0x77, 0x73, 0xd0, } } /*db537896-376f-48ae-a492-53d0547773d0*/, LOGTEXT("Windows 7 Embedded POSReady"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xe1a8296a, 0xdb37, 0x44d1, { 0x8c, 0xce, 0x7b, 0xc9, 0x61, 0xd5, 0x9c, 0x54, } } /*e1a8296a-db37-44d1-8cce-7bc961d59c54*/, LOGTEXT("Windows 7 Embedded Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xae2ee509, 0x1b34, 0x41c0, { 0xac, 0xb7, 0x6d, 0x46, 0x50, 0x16, 0x89, 0x15, } } /*ae2ee509-1b34-41c0-acb7-6d4650168915*/, LOGTEXT("Windows 7 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x46bbed08, 0x9c7b, 0x48fc, { 0xa6, 0x14, 0x95, 0x25, 0x05, 0x73, 0xf4, 0xea, } } /*46bbed08-9c7b-48fc-a614-95250573f4ea*/, LOGTEXT("Windows 7 Enterprise E"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x1cb6d605, 0x11b3, 0x4e14, { 0xbb, 0x30, 0xda, 0x91, 0xc8, 0xe3, 0x98, 0x3a, } } /*1cb6d605-11b3-4e14-bb30-da91c8e3983a*/, LOGTEXT("Windows 7 Enterprise N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xb92e9980, 0xb9d5, 0x4821, { 0x9c, 0x94, 0x14, 0x0f, 0x63, 0x2f, 0x63, 0x12, } } /*b92e9980-b9d5-4821-9c94-140f632f6312*/, LOGTEXT("Windows 7 Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x5a041529, 0xfef8, 0x4d07, { 0xb0, 0x6f, 0xb5, 0x9b, 0x57, 0x3b, 0x32, 0xd2, } } /*5a041529-fef8-4d07-b06f-b59b573b32d2*/, LOGTEXT("Windows 7 Professional E"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x54a09a0d, 0xd57b, 0x4c10, { 0x8b, 0x69, 0xa8, 0x42, 0xd6, 0x59, 0x0a, 0xd5, } } /*54a09a0d-d57b-4c10-8b69-a842d6590ad5*/, LOGTEXT("Windows 7 Professional N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xaa6dd3aa, 0xc2b4, 0x40e2, { 0xa5, 0x44, 0xa6, 0xbb, 0xb3, 0xf5, 0xc3, 0x95, } } /*aa6dd3aa-c2b4-40e2-a544-a6bbb3f5c395*/, LOGTEXT("Windows 7 ThinPC"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
// Windows 8 (Retail)
{ { 0xc04ed6bf, 0x55c8, 0x4b47, { 0x9f, 0x8e, 0x5a, 0x1f, 0x31, 0xce, 0xee, 0x60, } } /*c04ed6bf-55c8-4b47-9f8e-5a1f31ceee60*/, LOGTEXT("Windows 8 Core"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x9d5584a2, 0x2d85, 0x419a, { 0x98, 0x2c, 0xa0, 0x08, 0x88, 0xbb, 0x9d, 0xdf, } } /*9d5584a2-2d85-419a-982c-a00888bb9ddf*/, LOGTEXT("Windows 8 Core Country Specific"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x197390a0, 0x65f6, 0x4a95, { 0xbd, 0xc4, 0x55, 0xd5, 0x8a, 0x3b, 0x02, 0x53, } } /*197390a0-65f6-4a95-bdc4-55d58a3b0253*/, LOGTEXT("Windows 8 Core N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x8860fcd4, 0xa77b, 0x4a20, { 0x90, 0x45, 0xa1, 0x50, 0xff, 0x11, 0xd6, 0x09, } } /*8860fcd4-a77b-4a20-9045-a150ff11d609*/, LOGTEXT("Windows 8 Core Single Language"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0xa00018a3, 0xf20f, 0x4632, { 0xbf, 0x7c, 0x8d, 0xaa, 0x53, 0x51, 0xc9, 0x14, } } /*a00018a3-f20f-4632-bf7c-8daa5351c914*/, LOGTEXT("Windows 8 Professional WMC"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
// Windows 10
// Windows 8 (Volume)
{ { 0x18db1848, 0x12e0, 0x4167, { 0xb9, 0xd7, 0xda, 0x7f, 0xcd, 0xa5, 0x07, 0xdb, } } /*18db1848-12e0-4167-b9d7-da7fcda507db*/, LOGTEXT("Windows 8 Embedded Industry Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0x10018baf, 0xce21, 0x4060, { 0x80, 0xbd, 0x47, 0xfe, 0x74, 0xed, 0x4d, 0xab, } } /*10018baf-ce21-4060-80bd-47fe74ed4dab*/, LOGTEXT("Windows 8 Embedded Industry Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0x458e1bec, 0x837a, 0x45f6, { 0xb9, 0xd5, 0x92, 0x5e, 0xd5, 0xd2, 0x99, 0xde, } } /*458e1bec-837a-45f6-b9d5-925ed5d299de*/, LOGTEXT("Windows 8 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xe14997e7, 0x800a, 0x4cf7, { 0xad, 0x10, 0xde, 0x4b, 0x45, 0xb5, 0x78, 0xdb, } } /*e14997e7-800a-4cf7-ad10-de4b45b578db*/, LOGTEXT("Windows 8 Enterprise N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xa98bcd6d, 0x5343, 0x4603, { 0x8a, 0xfe, 0x59, 0x08, 0xe4, 0x61, 0x11, 0x12, } } /*a98bcd6d-5343-4603-8afe-5908e4611112*/, LOGTEXT("Windows 8 Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xebf245c1, 0x29a8, 0x4daf, { 0x9c, 0xb1, 0x38, 0xdf, 0xc6, 0x08, 0xa8, 0xc8, } } /*ebf245c1-29a8-4daf-9cb1-38dfc608a8c8*/, LOGTEXT("Windows 8 Professional N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0x73111121, 0x5638, 0x40f6, { 0xbc, 0x11, 0xf1, 0xd7, 0xb0, 0xd6, 0x43, 0x00, } } /*73111121-5638-40f6-bc11-f1d7b0d64300*/, "Windows 10 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xe272e3e2, 0x732f, 0x4c65, { 0xa8, 0xf0, 0x48, 0x47, 0x47, 0xd0, 0xd9, 0x47, } } /*e272e3e2-732f-4c65-a8f0-484747d0d947*/, "Windows 10 Enterprise N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0x7b51a46c, 0x0c04, 0x4e8f, { 0x9a, 0xf4, 0x84, 0x96, 0xcc, 0xa9, 0x0d, 0x5e, } } /*7b51a46c-0c04-4e8f-9af4-8496cca90d5e*/, "Windows 10 Enterprise LTSB", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0x87b838b7, 0x41b6, 0x4590, { 0x83, 0x18, 0x57, 0x97, 0x95, 0x1d, 0x85, 0x29, } } /*87b838b7-41b6-4590-8318-5797951d8529*/, "Windows 10 Enterprise LTSB N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0xe0c42288, 0x980c, 0x4788, { 0xa0, 0x14, 0xc0, 0x80, 0xd2, 0xe1, 0x92, 0x6e, } } /*e0c42288-980c-4788-a014-c080d2e1926e*/, "Windows 10 Education", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0x3c102355, 0xd027, 0x42c6, { 0xad, 0x23, 0x2e, 0x7e, 0xf8, 0xa0, 0x25, 0x85, } } /*3c102355-d027-42c6-ad23-2e7ef8a02585*/, "Windows 10 Education N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0x2de67392, 0xb7a7, 0x462a, { 0xb1, 0xca, 0x10, 0x8d, 0xd1, 0x89, 0xf5, 0x88, } } /*2de67392-b7a7-462a-b1ca-108dd189f588*/, "Windows 10 Professional", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL },
{ { 0xa80b5abf, 0x75ad, 0x428b, { 0xb0, 0x5d, 0xa4, 0x7d, 0x2d, 0xff, 0xee, 0xbf, } } /*a80b5abf-76ad-428b-b05d-a47d2dffeebf*/, "Windows 10 Professional N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_VL},
{ { 0x58e97c99, 0xf377, 0x4ef1, { 0x81, 0xd5, 0x4a, 0xd5, 0x52, 0x2b, 0x5f, 0xd8, } } /*58e97c99-f377-4ef1-81d5-4ad5522b5fd8*/, "Windows 10 Home", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL},
{ { 0x7b9e1751, 0xa8da, 0x4f75, { 0x95, 0x60, 0x5f, 0xad, 0xfe, 0x3d, 0x8e, 0x38, } } /*7b9e1751-a8da-4f75-9560-5fadfe3d8e38*/, "Windows 10 Home N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL},
{ { 0xcd918a57, 0xa41b, 0x4c82, { 0x8d, 0xce, 0x1a, 0x53, 0x8e, 0x22, 0x1a, 0x83, } } /*cd918a57-a41b-4c82-8dce-1a538e221a83*/, "Windows 10 Home Single Language", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL},
{ { 0xa9107544, 0xf4a0, 0x4053, { 0xa9, 0x6a, 0x14, 0x79, 0xab, 0xde, 0xf9, 0x12, } } /*a9107544-f4a0-4053-a96a-1479abdef912*/, "Windows 10 Home Country Specific", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN10_RETAIL},
// Windows 8.1 (Retail)
{ { 0xfe1c3238, 0x432a, 0x43a1, { 0x8e, 0x25, 0x97, 0xe7, 0xd1, 0xef, 0x10, 0xf3, } } /*fe1c3238-432a-43a1-8e25-97e7d1ef10f3*/, LOGTEXT("Windows 8.1 Core"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xffee456a, 0xcd87, 0x4390, { 0x8e, 0x07, 0x16, 0x14, 0x6c, 0x67, 0x2f, 0xd0, } } /*ffee456a-cd87-4390-8e07-16146c672fd0*/, LOGTEXT("Windows 8.1 Core ARM"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xdb78b74f, 0xef1c, 0x4892, { 0xab, 0xfe, 0x1e, 0x66, 0xb8, 0x23, 0x1d, 0xf6, } } /*db78b74f-ef1c-4892-abfe-1e66b8231df6*/, LOGTEXT("Windows 8.1 Core Country Specific"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0x78558a64, 0xdc19, 0x43fe, { 0xa0, 0xd0, 0x80, 0x75, 0xb2, 0xa3, 0x70, 0xa3, } } /*78558a64-dc19-43fe-a0d0-8075b2a370a3*/, LOGTEXT("Windows 8.1 Core N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xc72c6a1d, 0xf252, 0x4e7e, { 0xbd, 0xd1, 0x3f, 0xca, 0x34, 0x2a, 0xcb, 0x35, } } /*c72c6a1d-f252-4e7e-bdd1-3fca342acb35*/, LOGTEXT("Windows 8.1 Core Single Language"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xe58d87b5, 0x8126, 0x4580, { 0x80, 0xfb, 0x86, 0x1b, 0x22, 0xf7, 0x92, 0x96, } } /*e58d87b5-8126-4580-80fb-861b22f79296*/, LOGTEXT("Windows 8.1 Professional Student"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xcab491c7, 0xa918, 0x4f60, { 0xb5, 0x02, 0xda, 0xb7, 0x5e, 0x33, 0x4f, 0x40, } } /*cab491c7-a918-4f60-b502-dab75e334f40*/, LOGTEXT("Windows 8.1 Professional Student N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0x096ce63d, 0x4fac, 0x48a9, { 0x82, 0xa9, 0x61, 0xae, 0x9e, 0x80, 0x0e, 0x5f, } } /*096ce63d-4fac-48a9-82a9-61ae9e800e5f*/, LOGTEXT("Windows 8.1 Professional WMC"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
// Windows 8.1 (Volume)
{ { 0xe9942b32, 0x2e55, 0x4197, { 0xb0, 0xbd, 0x5f, 0xf5, 0x8c, 0xba, 0x88, 0x60, } } /*e9942b32-2e55-4197-b0bd-5ff58cba8860*/, LOGTEXT("Windows 8.1 Core Connected"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xba998212, 0x460a, 0x44db, { 0xbf, 0xb5, 0x71, 0xbf, 0x09, 0xd1, 0xc6, 0x8b, } } /*ba998212-460a-44db-bfb5-71bf09d1c68b*/, LOGTEXT("Windows 8.1 Core Connected Country Specific"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xc6ddecd6, 0x2354, 0x4c19, { 0x90, 0x9b, 0x30, 0x6a, 0x30, 0x58, 0x48, 0x4e, } } /*c6ddecd6-2354-4c19-909b-306a3058484e*/, LOGTEXT("Windows 8.1 Core Connected N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xb8f5e3a3, 0xed33, 0x4608, { 0x81, 0xe1, 0x37, 0xd6, 0xc9, 0xdc, 0xfd, 0x9c, } } /*b8f5e3a3-ed33-4608-81e1-37d6c9dcfd9c*/, LOGTEXT("Windows 8.1 Core Connected Single Language"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xf7e88590, 0xdfc7, 0x4c78, { 0xbc, 0xcb, 0x6f, 0x38, 0x65, 0xb9, 0x9d, 0x1a, } } /*f7e88590-dfc7-4c78-bccb-6f3865b99d1a*/, LOGTEXT("Windows 8.1 Embedded Industry Automotive"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xcd4e2d9f, 0x5059, 0x4a50, { 0xa9, 0x2d, 0x05, 0xd5, 0xbb, 0x12, 0x67, 0xc7, } } /*cd4e2d9f-5059-4a50-a92d-05d5bb1267c7*/, LOGTEXT("Windows 8.1 Embedded Industry Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x0ab82d54, 0x47f4, 0x4acb, { 0x81, 0x8c, 0xcc, 0x5b, 0xf0, 0xec, 0xb6, 0x49, } } /*0ab82d54-47f4-4acb-818c-cc5bf0ecb649*/, LOGTEXT("Windows 8.1 Embedded Industry Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x81671aaf, 0x79d1, 0x4eb1, { 0xb0, 0x04, 0x8c, 0xbb, 0xe1, 0x73, 0xaf, 0xea, } } /*81671aaf-79d1-4eb1-b004-8cbbe173afea*/, LOGTEXT("Windows 8.1 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x113e705c, 0xfa49, 0x48a4, { 0xbe, 0xea, 0x7d, 0xd8, 0x79, 0xb4, 0x6b, 0x14, } } /*113e705c-fa49-48a4-beea-7dd879b46b14*/, LOGTEXT("Windows 8.1 Enterprise N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xc06b6981, 0xd7fd, 0x4a35, { 0xb7, 0xb4, 0x05, 0x47, 0x42, 0xb7, 0xaf, 0x67, } } /*c06b6981-d7fd-4a35-b7b4-054742b7af67*/, LOGTEXT("Windows 8.1 Professional"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x7476d79f, 0x8e48, 0x49b4, { 0xab, 0x63, 0x4d, 0x0b, 0x81, 0x3a, 0x16, 0xe4, } } /*7476d79f-8e48-49b4-ab63-4d0b813a16e4*/, LOGTEXT("Windows 8.1 Professional N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
// Windows 8.x
// Windows Preview
# ifdef INCLUDE_BETAS
{ { 0xcde952c7, 0x2f96, 0x4d9d, { 0x8f, 0x2b, 0x2d, 0x34, 0x9f, 0x64, 0xfc, 0x51, } } /*cde952c7-2f96-4d9d-8f2b-2d349f64fc51*/, LOGTEXT("Windows 10 Enterprise Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0xa4383e6b, 0xdada, 0x423d, { 0xa4, 0x3d, 0xf2, 0x56, 0x78, 0x42, 0x96, 0x76, } } /*a4383e6b-dada-423d-a43d-f25678429676*/, LOGTEXT("Windows 10 Professional Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0xcf59a07b, 0x1a2a, 0x4be0, { 0xbf, 0xe0, 0x42, 0x3b, 0x58, 0x23, 0xe6, 0x63, } } /*cf59a07b-1a2a-4be0-bfe0-423b5823e663*/, LOGTEXT("Windows 10 Professional WMC Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0x2b9c337f, 0x7a1d, 0x4271, { 0x90, 0xa3, 0xc6, 0x85, 0x5a, 0x2b, 0x8a, 0x1c, } } /*2b9c337f-7a1d-4271-90a3-c6855a2b8a1c*/, LOGTEXT("Windows 8.x Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0x631ead72, 0xa8ab, 0x4df8, { 0xbb, 0xdf, 0x37, 0x20, 0x29, 0x98, 0x9b, 0xdd, } } /*631ead72-a8ab-4df8-bbdf-372029989bdd*/, LOGTEXT("Windows 8.x Preview ARM"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
# endif // INCLUDE_BETAS
# ifdef INCLUDE_BETAS
{ { 0x2B9C337F, 0x7A1D, 0x4271, { 0x90, 0xA3, 0xC6, 0x85, 0x5A, 0x2B, 0x8A, 0x1C, } } /*2B9C337F-7A1D-4271-90A3-C6855A2B8A1C*/, "Windows 8.x Preview", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
{ { 0x631EAD72, 0xA8AB, 0x4DF8, { 0xBB, 0xDF, 0x37, 0x20, 0x29, 0x98, 0x9B, 0xDD, } } /*631EAD72-A8AB-4DF8-BBDF-372029989BDD*/, "Windows 8.x Preview ARM", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_BETA },
# endif
{ { 0x81671aaf, 0x79d1, 0x4eb1, { 0xb0, 0x04, 0x8c, 0xbb, 0xe1, 0x73, 0xaf, 0xea, } } /*81671aaf-79d1-4eb1-b004-8cbbe173afea*/, "Windows 8.1 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x113e705c, 0xfa49, 0x48a4, { 0xbe, 0xea, 0x7d, 0xd8, 0x79, 0xb4, 0x6b, 0x14, } } /*113e705c-fa49-48a4-beea-7dd879b46b14*/, "Windows 8.1 Enterprise N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x096ce63d, 0x4fac, 0x48a9, { 0x82, 0xa9, 0x61, 0xae, 0x9e, 0x80, 0x0e, 0x5f, } } /*096ce63d-4fac-48a9-82a9-61ae9e800e5f*/, "Windows 8.1 Professional WMC", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xc06b6981, 0xd7fd, 0x4a35, { 0xb7, 0xb4, 0x05, 0x47, 0x42, 0xb7, 0xaf, 0x67, } } /*c06b6981-d7fd-4a35-b7b4-054742b7af67*/, "Windows 8.1 Professional", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0x7476d79f, 0x8e48, 0x49b4, { 0xab, 0x63, 0x4d, 0x0b, 0x81, 0x3a, 0x16, 0xe4, } } /*7476d79f-8e48-49b4-ab63-4d0b813a16e4*/, "Windows 8.1 Professional N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xfe1c3238, 0x432a, 0x43a1, { 0x8e, 0x25, 0x97, 0xe7, 0xd1, 0xef, 0x10, 0xf3, } } /*fe1c3238-432a-43a1-8e25-97e7d1ef10f3*/, "Windows 8.1 Core", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0x78558a64, 0xdc19, 0x43fe, { 0xa0, 0xd0, 0x80, 0x75, 0xb2, 0xa3, 0x70, 0xa3, } } /*78558a64-dc19-43fe-a0d0-8075b2a370a3*/, "Windows 8.1 Core N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xffee456a, 0xcd87, 0x4390, { 0x8e, 0x07, 0x16, 0x14, 0x6c, 0x67, 0x2f, 0xd0, } } /*ffee456a-cd87-4390-8e07-16146c672fd0*/, "Windows 8.1 Core ARM", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xc72c6a1d, 0xf252, 0x4e7e, { 0xbd, 0xd1, 0x3f, 0xca, 0x34, 0x2a, 0xcb, 0x35, } } /*c72c6a1d-f252-4e7e-bdd1-3fca342acb35*/, "Windows 8.1 Core Single Language", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xdb78b74f, 0xef1c, 0x4892, { 0xab, 0xfe, 0x1e, 0x66, 0xb8, 0x23, 0x1d, 0xf6, } } /*db78b74f-ef1c-4892-abfe-1e66b8231df6*/, "Windows 8.1 Core Country Specific", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xe9942b32, 0x2e55, 0x4197, { 0xb0, 0xbd, 0x5f, 0xf5, 0x8c, 0xba, 0x88, 0x60, } } /*e9942b32-2e55-4197-b0bd-5ff58cba8860*/, "Windows 8.1 Core Connected", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xc6ddecd6, 0x2354, 0x4c19, { 0x90, 0x9b, 0x30, 0x6a, 0x30, 0x58, 0x48, 0x4e, } } /*c6ddecd6-2354-4c19-909b-306a3058484e*/, "Windows 8.1 Core Connected N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xb8f5e3a3, 0xed33, 0x4608, { 0x81, 0xe1, 0x37, 0xd6, 0xc9, 0xdc, 0xfd, 0x9c, } } /*b8f5e3a3-ed33-4608-81e1-37d6c9dcfd9c*/, "Windows 8.1 Core Connected Single Language", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xba998212, 0x460a, 0x44db, { 0xbf, 0xb5, 0x71, 0xbf, 0x09, 0xd1, 0xc6, 0x8b, } } /*ba998212-460a-44db-bfb5-71bf09d1c68b*/, "Windows 8.1 Core Connected Country Specific", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xe58d87b5, 0x8126, 0x4580, { 0x80, 0xfb, 0x86, 0x1b, 0x22, 0xf7, 0x92, 0x96, } } /*e58d87b5-8126-4580-80fb-861b22f79296*/, "Windows 8.1 Professional Student", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xcab491c7, 0xa918, 0x4f60, { 0xb5, 0x02, 0xda, 0xb7, 0x5e, 0x33, 0x4f, 0x40, } } /*cab491c7-a918-4f60-b502-dab75e334f40*/, "Windows 8.1 Professional Student N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_RETAIL },
{ { 0xa00018a3, 0xf20f, 0x4632, { 0xbf, 0x7c, 0x8d, 0xaa, 0x53, 0x51, 0xc9, 0x14, } } /*a00018a3-f20f-4632-bf7c-8daa5351c914*/, "Windows 8 Professional WMC", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0xa98bcd6d, 0x5343, 0x4603, { 0x8a, 0xfe, 0x59, 0x08, 0xe4, 0x61, 0x11, 0x12, } } /*a98bcd6d-5343-4603-8afe-5908e4611112*/, "Windows 8 Professional", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xebf245c1, 0x29a8, 0x4daf, { 0x9c, 0xb1, 0x38, 0xdf, 0xc6, 0x08, 0xa8, 0xc8, } } /*ebf245c1-29a8-4daf-9cb1-38dfc608a8c8*/, "Windows 8 Professional N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0x458e1bec, 0x837a, 0x45f6, { 0xb9, 0xd5, 0x92, 0x5e, 0xd5, 0xd2, 0x99, 0xde, } } /*458e1bec-837a-45f6-b9d5-925ed5d299de*/, "Windows 8 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xe14997e7, 0x800a, 0x4cf7, { 0xad, 0x10, 0xde, 0x4b, 0x45, 0xb5, 0x78, 0xdb, } } /*e14997e7-800a-4cf7-ad10-de4b45b578db*/, "Windows 8 Enterprise N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_VL },
{ { 0xc04ed6bf, 0x55c8, 0x4b47, { 0x9f, 0x8e, 0x5a, 0x1f, 0x31, 0xce, 0xee, 0x60, } } /*c04ed6bf-55c8-4b47-9f8e-5a1f31ceee60*/, "Windows 8 Core", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x197390a0, 0x65f6, 0x4a95, { 0xbd, 0xc4, 0x55, 0xd5, 0x8a, 0x3b, 0x02, 0x53, } } /*197390a0-65f6-4a95-bdc4-55d58a3b0253*/, "Windows 8 Core N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x9d5584a2, 0x2d85, 0x419a, { 0x98, 0x2c, 0xa0, 0x08, 0x88, 0xbb, 0x9d, 0xdf, } } /*9d5584a2-2d85-419a-982c-a00888bb9ddf*/, "Windows 8 Core Country Specific", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
{ { 0x8860fcd4, 0xa77b, 0x4a20, { 0x90, 0x45, 0xa1, 0x50, 0xff, 0x11, 0xd6, 0x09, } } /*8860fcd4-a77b-4a20-9045-a150ff11d609*/, "Windows 8 Core Single Language", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN8_RETAIL },
// Windows Server 2008 A (Web and HPC)
{ { 0x7afb1156, 0x2c1d, 0x40fc, { 0xb2, 0x60, 0xaa, 0xb7, 0x44, 0x2b, 0x62, 0xfe, } } /*7afb1156-2c1d-40fc-b260-aab7442b62fe*/, LOGTEXT("Windows Server 2008 Compute Cluster"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008A },
{ { 0xddfa9f7c, 0xf09e, 0x40b9, { 0x8c, 0x1a, 0xbe, 0x87, 0x7a, 0x9a, 0x7f, 0x4b, } } /*ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b*/, LOGTEXT("Windows Server 2008 Web"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008A },
// Windows Server 2008 B (Standard and Enterprise)
{ { 0xc1af4d90, 0xd1bc, 0x44ca, { 0x85, 0xd4, 0x00, 0x3b, 0xa3, 0x3d, 0xb3, 0xb9, } } /*c1af4d90-d1bc-44ca-85d4-003ba33db3b9*/, LOGTEXT("Windows Server 2008 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
{ { 0x8198490a, 0xadd0, 0x47b2, { 0xb3, 0xba, 0x31, 0x6b, 0x12, 0xd6, 0x47, 0xb4, } } /*8198490a-add0-47b2-b3ba-316b12d647b4*/, LOGTEXT("Windows Server 2008 Enterprise without Hyper-V"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
{ { 0xad2542d4, 0x9154, 0x4c6d, { 0x8a, 0x44, 0x30, 0xf1, 0x1e, 0xe9, 0x69, 0x89, } } /*ad2542d4-9154-4c6d-8a44-30f11ee96989*/, LOGTEXT("Windows Server 2008 Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
{ { 0x2401e3d0, 0xc50a, 0x4b58, { 0x87, 0xb2, 0x7e, 0x79, 0x4b, 0x7d, 0x26, 0x07, } } /*2401e3d0-c50a-4b58-87b2-7e794b7d2607*/, LOGTEXT("Windows Server 2008 Standard without Hyper-V"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008B },
// Windows 7
// Windows Server 2008 C (Datacenter)
{ { 0x68b6e220, 0xcf09, 0x466b, { 0x92, 0xd3, 0x45, 0xcd, 0x96, 0x4b, 0x95, 0x09, } } /*68b6e220-cf09-466b-92d3-45cd964b9509*/, LOGTEXT("Windows Server 2008 Datacenter"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0xfd09ef77, 0x5647, 0x4eff, { 0x80, 0x9c, 0xaf, 0x2b, 0x64, 0x65, 0x9a, 0x45, } } /*fd09ef77-5647-4eff-809c-af2b64659a45*/, LOGTEXT("Windows Server 2008 Datacenter without Hyper-V"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0x01ef176b, 0x3e0d, 0x422a, { 0xb4, 0xf8, 0x4e, 0xa8, 0x80, 0x03, 0x5e, 0x8f, } } /*01ef176b-3e0d-422a-b4f8-4ea880035e8f*/, LOGTEXT("Windows Server 2008 for Itanium"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008C },
{ { 0xae2ee509, 0x1b34, 0x41c0, { 0xac, 0xb7, 0x6d, 0x46, 0x50, 0x16, 0x89, 0x15, } } /*ae2ee509-1b34-41c0-acb7-6d4650168915*/, "Windows 7 Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x1cb6d605, 0x11b3, 0x4e14, { 0xbb, 0x30, 0xda, 0x91, 0xc8, 0xe3, 0x98, 0x3a, } } /*1cb6d605-11b3-4e14-bb30-da91c8e3983a*/, "Windows 7 Enterprise N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xb92e9980, 0xb9d5, 0x4821, { 0x9c, 0x94, 0x14, 0x0f, 0x63, 0x2f, 0x63, 0x12, } } /*b92e9980-b9d5-4821-9c94-140f632f6312*/, "Windows 7 Professional", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x54a09a0d, 0xd57b, 0x4c10, { 0x8b, 0x69, 0xa8, 0x42, 0xd6, 0x59, 0x0a, 0xd5, } } /*54a09a0d-d57b-4c10-8b69-a842d6590ad5*/, "Windows 7 Professional N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
// Windows Server 2008 R2 A (Web and HPC)
{ { 0xf772515c, 0x0e87, 0x48d5, { 0xa6, 0x76, 0xe6, 0x96, 0x2c, 0x3e, 0x11, 0x95, } } /*f772515c-0e87-48d5-a676-e6962c3e1195*/, LOGTEXT("Windows MultiPoint Server 2010"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2A },
{ { 0xcda18cf3, 0xc196, 0x46ad, { 0xb2, 0x89, 0x60, 0xc0, 0x72, 0x86, 0x99, 0x94, } } /*cda18cf3-c196-46ad-b289-60c072869994*/, LOGTEXT("Windows Server 2008 R2 HPC Edition"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2A },
{ { 0xa78b8bd9, 0x8017, 0x4df5, { 0xb8, 0x6a, 0x09, 0xf7, 0x56, 0xaf, 0xfa, 0x7c, } } /*a78b8bd9-8017-4df5-b86a-09f756affa7c*/, LOGTEXT("Windows Server 2008 R2 Web"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2A },
// Windows Server 2008 R2 B (Standard and Enterprise)
{ { 0x620e2b3d, 0x09e7, 0x42fd, { 0x80, 0x2a, 0x17, 0xa1, 0x36, 0x52, 0xfe, 0x7a, } } /*620e2b3d-09e7-42fd-802a-17a13652fe7a*/, LOGTEXT("Windows Server 2008 R2 Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2B },
{ { 0x68531fb9, 0x5511, 0x4989, { 0x97, 0xbe, 0xd1, 0x1a, 0x0f, 0x55, 0x63, 0x3f, } } /*68531fb9-5511-4989-97be-d11a0f55633f*/, LOGTEXT("Windows Server 2008 R2 Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2B },
// Windows Vista
// Windows Server 2008 R2 C (Datacenter)
{ { 0x7482e61b, 0xc589, 0x4b7f, { 0x8e, 0xcc, 0x46, 0xd4, 0x55, 0xac, 0x3b, 0x87, } } /*7482e61b-c589-4b7f-8ecc-46d455ac3b87*/, LOGTEXT("Windows Server 2008 R2 Datacenter"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2C },
{ { 0x8a26851c, 0x1c7e, 0x48d3, { 0xa6, 0x87, 0xfb, 0xca, 0x9b, 0x9a, 0xc1, 0x6b, } } /*8a26851c-1c7e-48d3-a687-fbca9b9ac16b*/, LOGTEXT("Windows Server 2008 R2 for Itanium Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2008R2C },
{ { 0xcfd8ff08, 0xc0d7, 0x452b, { 0x9f, 0x60, 0xef, 0x5c, 0x70, 0xc3, 0x20, 0x94, } } /*cfd8ff08-c0d7-452b-9f60-ef5c70c32094*/, "Windows Vista Enterprise", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0xd4f54950, 0x26f2, 0x4fb4, { 0xba, 0x21, 0xff, 0xab, 0x16, 0xaf, 0xca, 0xde, } } /*d4f54950-26f2-4fb4-ba21-ffab16afcade*/, "Windows Vista Enterprise N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0x4f3d1606, 0x3fea, 0x4c01, { 0xbe, 0x3c, 0x8d, 0x67, 0x1c, 0x40, 0x1e, 0x3b, } } /*4f3d1606-3fea-4c01-be3c-8d671c401e3b*/, "Windows Vista Business", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0x2c682dc2, 0x8b68, 0x4f63, { 0xa1, 0x65, 0xae, 0x29, 0x1d, 0x4c, 0xf1, 0x38, } } /*2c682dc2-8b68-4f63-a165-ae291d4cf138*/, "Windows Vista Business N", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
// Windows Server 2012
{ { 0xd3643d60, 0x0c42, 0x412d, { 0xa7, 0xd6, 0x52, 0xe6, 0x63, 0x53, 0x27, 0xf6, } } /*d3643d60-0c42-412d-a7d6-52e6635327f6*/, LOGTEXT("Windows Server 2012 Datacenter"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0x95fd1c83, 0x7df5, 0x494a, { 0xbe, 0x8b, 0x13, 0x00, 0xe1, 0xc9, 0xd1, 0xcd, } } /*95fd1c83-7df5-494a-be8b-1300e1c9d1cd*/, LOGTEXT("Windows Server 2012 MultiPoint Premium"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0x7d5486c7, 0xe120, 0x4771, { 0xb7, 0xf1, 0x7b, 0x56, 0xc6, 0xd3, 0x17, 0x0c, } } /*7d5486c7-e120-4771-b7f1-7b56c6d3170c*/, LOGTEXT("Windows Server 2012 MultiPoint Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
{ { 0xf0f5ec41, 0x0d55, 0x4732, { 0xaf, 0x02, 0x44, 0x0a, 0x44, 0xa3, 0xcf, 0x0f, } } /*f0f5ec41-0d55-4732-af02-440a44a3cf0f*/, LOGTEXT("Windows Server 2012 Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012 },
// Windows Server 2012 R2
{ { 0xb743a2be, 0x68d4, 0x4dd3, { 0xaf, 0x32, 0x92, 0x42, 0x5b, 0x7b, 0xb6, 0x23, } } /*b743a2be-68d4-4dd3-af32-92425b7bb623*/, LOGTEXT("Windows Server 2012 R2 Cloud Storage"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0x00091344, 0x1ea4, 0x4f37, { 0xb7, 0x89, 0x01, 0x75, 0x0b, 0xa6, 0x98, 0x8c, } } /*00091344-1ea4-4f37-b789-01750ba6988c*/, LOGTEXT("Windows Server 2012 R2 Datacenter"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0x21db6ba4, 0x9a7b, 0x4a14, { 0x9e, 0x29, 0x64, 0xa6, 0x0c, 0x59, 0x30, 0x1d, } } /*21db6ba4-9a7b-4a14-9e29-64a60c59301d*/, LOGTEXT("Windows Server 2012 R2 Essentials"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
{ { 0xb3ca044e, 0xa358, 0x4d68, { 0x98, 0x83, 0xaa, 0xa2, 0x94, 0x1a, 0xca, 0x99, } } /*b3ca044e-a358-4d68-9883-aaa2941aca99*/, LOGTEXT("Windows Server 2012 R2 Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2012R2 },
// Windows Embedded
// Windows Server 2016
{ { 0x3dbf341b, 0x5f6c, 0x4fa7, { 0xb9, 0x36, 0x69, 0x9d, 0xce, 0x9e, 0x26, 0x3f, } } /*3dbf341b-5f6c-4fa7-b936-699dce9e263f*/, LOGTEXT("Windows Server 2016 Azure Core"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2016 },
{ { 0x7b4433f4, 0xb1e7, 0x4788, { 0x89, 0x5a, 0xc4, 0x53, 0x78, 0xd3, 0x82, 0x53, } } /*7b4433f4-b1e7-4788-895a-c45378d38253*/, LOGTEXT("Windows Server 2016 Cloud Storage"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2016 },
{ { 0x21c56779, 0xb449, 0x4d20, { 0xad, 0xfc, 0xee, 0xce, 0x0e, 0x1a, 0xd7, 0x4b, } } /*21c56779-b449-4d20-adfc-eece0e1ad74b*/, LOGTEXT("Windows Server 2016 Datacenter"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2016 },
{ { 0x2b5a1b0f, 0xa5ab, 0x4c54, { 0xac, 0x2f, 0xa6, 0xd9, 0x48, 0x24, 0xa2, 0x83, } } /*2b5a1b0f-a5ab-4c54-ac2f-a6d94824a283*/, LOGTEXT("Windows Server 2016 Essentials"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2016 },
{ { 0x8c1c5410, 0x9f39, 0x4805, { 0x8c, 0x9d, 0x63, 0xa0, 0x77, 0x06, 0x35, 0x8f, } } /*8c1c5410-9f39-4805-8c9d-63a07706358f*/, LOGTEXT("Windows Server 2016 Standard"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN2016 },
{ { 0xaa6dd3aa, 0xc2b4, 0x40e2, { 0xa5, 0x44, 0xa6, 0xbb, 0xb3, 0xf5, 0xc3, 0x95, } } /*aa6dd3aa-c2b4-40e2-a544-a6bbb3f5c395*/, "Windows ThinPC", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0xdb537896, 0x376f, 0x48ae, { 0xa4, 0x92, 0x53, 0xd0, 0x54, 0x77, 0x73, 0xd0, } } /*db537896-376f-48ae-a492-53d0547773d0*/, "Windows Embedded POSReady 7", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN7 },
{ { 0x0ab82d54, 0x47f4, 0x4acb, { 0x81, 0x8c, 0xcc, 0x5b, 0xf0, 0xec, 0xb6, 0x49, } } /*0ab82d54-47f4-4acb-818c-cc5bf0ecb649*/, "Windows Embedded Industry 8.1", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xcd4e2d9f, 0x5059, 0x4a50, { 0xa9, 0x2d, 0x05, 0xd5, 0xbb, 0x12, 0x67, 0xc7, } } /*cd4e2d9f-5059-4a50-a92d-05d5bb1267c7*/, "Windows Embedded Industry E 8.1", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
{ { 0xf7e88590, 0xdfc7, 0x4c78, { 0xbc, 0xcb, 0x6f, 0x38, 0x65, 0xb9, 0x9d, 0x1a, } } /*f7e88590-dfc7-4c78-bccb-6f3865b99d1a*/, "Windows Embedded Industry A 8.1", EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN81_VL },
// Windows Server Preview
# ifdef INCLUDE_BETAS
{ { 0xba947c44, 0xd19d, 0x4786, { 0xb6, 0xae, 0x22, 0x77, 0x0b, 0xc9, 0x4c, 0x54, } } /*ba947c44-d19d-4786-b6ae-22770bc94c54*/, LOGTEXT("Windows Server 2016 Datacenter Preview"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_WIN_SRV_BETA },
# endif // INCLUDE_BETAS
// Office 2010
// Windows Vista
{ { 0x4f3d1606, 0x3fea, 0x4c01, { 0xbe, 0x3c, 0x8d, 0x67, 0x1c, 0x40, 0x1e, 0x3b, } } /*4f3d1606-3fea-4c01-be3c-8d671c401e3b*/, LOGTEXT("Windows Vista Business"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0x2c682dc2, 0x8b68, 0x4f63, { 0xa1, 0x65, 0xae, 0x29, 0x1d, 0x4c, 0xf1, 0x38, } } /*2c682dc2-8b68-4f63-a165-ae291d4cf138*/, LOGTEXT("Windows Vista Business N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0xcfd8ff08, 0xc0d7, 0x452b, { 0x9f, 0x60, 0xef, 0x5c, 0x70, 0xc3, 0x20, 0x94, } } /*cfd8ff08-c0d7-452b-9f60-ef5c70c32094*/, LOGTEXT("Windows Vista Enterprise"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0xd4f54950, 0x26f2, 0x4fb4, { 0xba, 0x21, 0xff, 0xab, 0x16, 0xaf, 0xca, 0xde, } } /*d4f54950-26f2-4fb4-ba21-ffab16afcade*/, LOGTEXT("Windows Vista Enterprise N"), EPID_WINDOWS, APP_ID_WINDOWS, KMS_ID_VISTA },
{ { 0x8ce7e872, 0x188c, 0x4b98, { 0x9d, 0x90, 0xf8, 0xf9, 0x0b, 0x7a, 0xad, 0x02, } } /*8ce7e872-188c-4b98-9d90-f8f90b7aad02*/, "Office Access 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xcee5d470, 0x6e3b, 0x4fcc, { 0x8c, 0x2b, 0xd1, 0x74, 0x28, 0x56, 0x8a, 0x9f, } } /*cee5d470-6e3b-4fcc-8c2b-d17428568a9f*/, "Office Excel 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x8947d0b8, 0xc33b, 0x43e1, { 0x8c, 0x56, 0x9b, 0x67, 0x4c, 0x05, 0x28, 0x32, } } /*8947d0b8-c33b-43e1-8c56-9b674c052832*/, "Office Groove 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xca6b6639, 0x4ad6, 0x40ae, { 0xa5, 0x75, 0x14, 0xde, 0xe0, 0x7f, 0x64, 0x30, } } /*ca6b6639-4ad6-40ae-a575-14dee07f6430*/, "Office InfoPath 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x09ed9640, 0xf020, 0x400a, { 0xac, 0xd8, 0xd7, 0xd8, 0x67, 0xdf, 0xd9, 0xc2, } } /*09ed9640-f020-400a-acd8-d7d867dfd9c2*/, "Office Mondo 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xef3d4e49, 0xa53d, 0x4d81, { 0xa2, 0xb1, 0x2c, 0xa6, 0xc2, 0x55, 0x6b, 0x2c, } } /*ef3d4e49-a53d-4d81-a2b1-2ca6c2556b2c*/, "Office Mondo 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xab586f5c, 0x5256, 0x4632, { 0x96, 0x2f, 0xfe, 0xfd, 0x8b, 0x49, 0xe6, 0xf4, } } /*ab586f5c-5256-4632-962f-fefd8b49e6f4*/, "Office OneNote 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xecb7c192, 0x73ab, 0x4ded, { 0xac, 0xf4, 0x23, 0x99, 0xb0, 0x95, 0xd0, 0xcc, } } /*ecb7c192-73ab-4ded-acf4-2399b095d0cc*/, "Office OutLook 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x45593b1d, 0xdfb1, 0x4e91, { 0xbb, 0xfb, 0x2d, 0x5d, 0x0c, 0xe2, 0x22, 0x7a, } } /*45593b1d-dfb1-4e91-bbfb-2d5d0ce2227a*/, "Office PowerPoint 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xdf133ff7, 0xbf14, 0x4f95, { 0xaf, 0xe3, 0x7b, 0x48, 0xe7, 0xe3, 0x31, 0xef, } } /*df133ff7-bf14-4f95-afe3-7b48e7e331ef*/, "Office Project Pro 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x5dc7bf61, 0x5ec9, 0x4996, { 0x9c, 0xcb, 0xdf, 0x80, 0x6a, 0x2d, 0x0e, 0xfe, } } /*5dc7bf61-5ec9-4996-9ccb-df806a2d0efe*/, "Office Project Standard 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xb50c4f75, 0x599b, 0x43e8, { 0x8d, 0xcd, 0x10, 0x81, 0xa7, 0x96, 0x72, 0x41, } } /*b50c4f75-599b-43e8-8dcd-1081a7967241*/, "Office Publisher 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x92236105, 0xbb67, 0x494f, { 0x94, 0xc7, 0x7f, 0x7a, 0x60, 0x79, 0x29, 0xbd, } } /*92236105-bb67-494f-94c7-7f7a607929bd*/, "Office Visio Premium 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xe558389c, 0x83c3, 0x4b29, { 0xad, 0xfe, 0x5e, 0x4d, 0x7f, 0x46, 0xc3, 0x58, } } /*e558389c-83c3-4b29-adfe-5e4d7f46c358*/, "Office Visio Pro 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x9ed833ff, 0x4f92, 0x4f36, { 0xb3, 0x70, 0x86, 0x83, 0xa4, 0xf1, 0x32, 0x75, } } /*9ed833ff-4f92-4f36-b370-8683a4f13275*/, "Office Visio Standard 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x2d0882e7, 0xa4e7, 0x423b, { 0x8c, 0xcc, 0x70, 0xd9, 0x1e, 0x01, 0x58, 0xb1, } } /*2d0882e7-a4e7-423b-8ccc-70d91e0158b1*/, "Office Word 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x6f327760, 0x8c5c, 0x417c, { 0x9b, 0x61, 0x83, 0x6a, 0x98, 0x28, 0x7e, 0x0c, } } /*6f327760-8c5c-417c-9b61-836a98287e0c*/, "Office Professional Plus 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x9da2a678, 0xfb6b, 0x4e67, { 0xab, 0x84, 0x60, 0xdd, 0x6a, 0x9c, 0x81, 0x9a, } } /*9da2a678-fb6b-4e67-ab84-60dd6a9c819a*/, "Office Standard 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xea509e87, 0x07a1, 0x4a45, { 0x9e, 0xdc, 0xeb, 0xa5, 0xa3, 0x9f, 0x36, 0xaf, } } /*ea509e87-07a1-4a45-9edc-eba5a39f36af*/, "Office Small Business Basics 2010", EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
// Office 2010
{ { 0x8ce7e872, 0x188c, 0x4b98, { 0x9d, 0x90, 0xf8, 0xf9, 0x0b, 0x7a, 0xad, 0x02, } } /*8ce7e872-188c-4b98-9d90-f8f90b7aad02*/, LOGTEXT("Office Access 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xcee5d470, 0x6e3b, 0x4fcc, { 0x8c, 0x2b, 0xd1, 0x74, 0x28, 0x56, 0x8a, 0x9f, } } /*cee5d470-6e3b-4fcc-8c2b-d17428568a9f*/, LOGTEXT("Office Excel 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x8947d0b8, 0xc33b, 0x43e1, { 0x8c, 0x56, 0x9b, 0x67, 0x4c, 0x05, 0x28, 0x32, } } /*8947d0b8-c33b-43e1-8c56-9b674c052832*/, LOGTEXT("Office Groove 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xca6b6639, 0x4ad6, 0x40ae, { 0xa5, 0x75, 0x14, 0xde, 0xe0, 0x7f, 0x64, 0x30, } } /*ca6b6639-4ad6-40ae-a575-14dee07f6430*/, LOGTEXT("Office InfoPath 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x09ed9640, 0xf020, 0x400a, { 0xac, 0xd8, 0xd7, 0xd8, 0x67, 0xdf, 0xd9, 0xc2, } } /*09ed9640-f020-400a-acd8-d7d867dfd9c2*/, LOGTEXT("Office Mondo 1 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xef3d4e49, 0xa53d, 0x4d81, { 0xa2, 0xb1, 0x2c, 0xa6, 0xc2, 0x55, 0x6b, 0x2c, } } /*ef3d4e49-a53d-4d81-a2b1-2ca6c2556b2c*/, LOGTEXT("Office Mondo 2 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xab586f5c, 0x5256, 0x4632, { 0x96, 0x2f, 0xfe, 0xfd, 0x8b, 0x49, 0xe6, 0xf4, } } /*ab586f5c-5256-4632-962f-fefd8b49e6f4*/, LOGTEXT("Office OneNote 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xecb7c192, 0x73ab, 0x4ded, { 0xac, 0xf4, 0x23, 0x99, 0xb0, 0x95, 0xd0, 0xcc, } } /*ecb7c192-73ab-4ded-acf4-2399b095d0cc*/, LOGTEXT("Office OutLook 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x45593b1d, 0xdfb1, 0x4e91, { 0xbb, 0xfb, 0x2d, 0x5d, 0x0c, 0xe2, 0x22, 0x7a, } } /*45593b1d-dfb1-4e91-bbfb-2d5d0ce2227a*/, LOGTEXT("Office PowerPoint 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x6f327760, 0x8c5c, 0x417c, { 0x9b, 0x61, 0x83, 0x6a, 0x98, 0x28, 0x7e, 0x0c, } } /*6f327760-8c5c-417c-9b61-836a98287e0c*/, LOGTEXT("Office Professional Plus 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xdf133ff7, 0xbf14, 0x4f95, { 0xaf, 0xe3, 0x7b, 0x48, 0xe7, 0xe3, 0x31, 0xef, } } /*df133ff7-bf14-4f95-afe3-7b48e7e331ef*/, LOGTEXT("Office Project Pro 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x5dc7bf61, 0x5ec9, 0x4996, { 0x9c, 0xcb, 0xdf, 0x80, 0x6a, 0x2d, 0x0e, 0xfe, } } /*5dc7bf61-5ec9-4996-9ccb-df806a2d0efe*/, LOGTEXT("Office Project Standard 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xb50c4f75, 0x599b, 0x43e8, { 0x8d, 0xcd, 0x10, 0x81, 0xa7, 0x96, 0x72, 0x41, } } /*b50c4f75-599b-43e8-8dcd-1081a7967241*/, LOGTEXT("Office Publisher 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xea509e87, 0x07a1, 0x4a45, { 0x9e, 0xdc, 0xeb, 0xa5, 0xa3, 0x9f, 0x36, 0xaf, } } /*ea509e87-07a1-4a45-9edc-eba5a39f36af*/, LOGTEXT("Office Small Business Basics 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x9da2a678, 0xfb6b, 0x4e67, { 0xab, 0x84, 0x60, 0xdd, 0x6a, 0x9c, 0x81, 0x9a, } } /*9da2a678-fb6b-4e67-ab84-60dd6a9c819a*/, LOGTEXT("Office Standard 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x92236105, 0xbb67, 0x494f, { 0x94, 0xc7, 0x7f, 0x7a, 0x60, 0x79, 0x29, 0xbd, } } /*92236105-bb67-494f-94c7-7f7a607929bd*/, LOGTEXT("Office Visio Premium 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0xe558389c, 0x83c3, 0x4b29, { 0xad, 0xfe, 0x5e, 0x4d, 0x7f, 0x46, 0xc3, 0x58, } } /*e558389c-83c3-4b29-adfe-5e4d7f46c358*/, LOGTEXT("Office Visio Pro 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x9ed833ff, 0x4f92, 0x4f36, { 0xb3, 0x70, 0x86, 0x83, 0xa4, 0xf1, 0x32, 0x75, } } /*9ed833ff-4f92-4f36-b370-8683a4f13275*/, LOGTEXT("Office Visio Standard 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
{ { 0x2d0882e7, 0xa4e7, 0x423b, { 0x8c, 0xcc, 0x70, 0xd9, 0x1e, 0x01, 0x58, 0xb1, } } /*2d0882e7-a4e7-423b-8ccc-70d91e0158b1*/, LOGTEXT("Office Word 2010"), EPID_OFFICE2010, APP_ID_OFFICE2010, KMS_ID_OFFICE2010 },
// Office 2013
// Office 2013
{ { 0x6ee7622c, 0x18d8, 0x4005, { 0x9f, 0xb7, 0x92, 0xdb, 0x64, 0x4a, 0x27, 0x9b, } } /*6ee7622c-18d8-4005-9fb7-92db644a279b*/, LOGTEXT("Office Access 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xf7461d52, 0x7c2b, 0x43b2, { 0x87, 0x44, 0xea, 0x95, 0x8e, 0x0b, 0xd0, 0x9a, } } /*f7461d52-7c2b-43b2-8744-ea958e0bd09a*/, LOGTEXT("Office Excel 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xa30b8040, 0xd68a, 0x423f, { 0xb0, 0xb5, 0x9c, 0xe2, 0x92, 0xea, 0x5a, 0x8f, } } /*a30b8040-d68a-423f-b0b5-9ce292ea5a8f*/, LOGTEXT("Office InfoPath 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x1b9f11e3, 0xc85c, 0x4e1b, { 0xbb, 0x29, 0x87, 0x9a, 0xd2, 0xc9, 0x09, 0xe3, } } /*1b9f11e3-c85c-4e1b-bb29-879ad2c909e3*/, LOGTEXT("Office Lync 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xdc981c6b, 0xfc8e, 0x420f, { 0xaa, 0x43, 0xf8, 0xf3, 0x3e, 0x5c, 0x09, 0x23, } } /*dc981c6b-fc8e-420f-aa43-f8f33e5c0923*/, LOGTEXT("Office Mondo 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xefe1f3e6, 0xaea2, 0x4144, { 0xa2, 0x08, 0x32, 0xaa, 0x87, 0x2b, 0x65, 0x45, } } /*efe1f3e6-aea2-4144-a208-32aa872b6545*/, LOGTEXT("Office OneNote 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x771c3afa, 0x50c5, 0x443f, { 0xb1, 0x51, 0xff, 0x25, 0x46, 0xd8, 0x63, 0xa0, } } /*771c3afa-50c5-443f-b151-ff2546d863a0*/, LOGTEXT("Office OutLook 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x8c762649, 0x97d1, 0x4953, { 0xad, 0x27, 0xb7, 0xe2, 0xc2, 0x5b, 0x97, 0x2e, } } /*8c762649-97d1-4953-ad27-b7e2c25b972e*/, LOGTEXT("Office PowerPoint 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xb322da9c, 0xa2e2, 0x4058, { 0x9e, 0x4e, 0xf5, 0x9a, 0x69, 0x70, 0xbd, 0x69, } } /*b322da9c-a2e2-4058-9e4e-f59a6970bd69*/, LOGTEXT("Office Professional Plus 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x4a5d124a, 0xe620, 0x44ba, { 0xb6, 0xff, 0x65, 0x89, 0x61, 0xb3, 0x3b, 0x9a, } } /*4a5d124a-e620-44ba-b6ff-658961b33b9a*/, LOGTEXT("Office Project Pro 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x427a28d1, 0xd17c, 0x4abf, { 0xb7, 0x17, 0x32, 0xc7, 0x80, 0xba, 0x6f, 0x07, } } /*427a28d1-d17c-4abf-b717-32c780ba6f07*/, LOGTEXT("Office Project Standard 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x00c79ff1, 0x6850, 0x443d, { 0xbf, 0x61, 0x71, 0xcd, 0xe0, 0xde, 0x30, 0x5f, } } /*00c79ff1-6850-443d-bf61-71cde0de305f*/, LOGTEXT("Office Publisher 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xb13afb38, 0xcd79, 0x4ae5, { 0x9f, 0x7f, 0xee, 0xd0, 0x58, 0xd7, 0x50, 0xca, } } /*b13afb38-cd79-4ae5-9f7f-eed058d750ca*/, LOGTEXT("Office Standard 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xe13ac10e, 0x75d0, 0x4aff, { 0xa0, 0xcd, 0x76, 0x49, 0x82, 0xcf, 0x54, 0x1c, } } /*e13ac10e-75d0-4aff-a0cd-764982cf541c*/, LOGTEXT("Office Visio Pro 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xac4efaf0, 0xf81f, 0x4f61, { 0xbd, 0xf7, 0xea, 0x32, 0xb0, 0x2a, 0xb1, 0x17, } } /*ac4efaf0-f81f-4f61-bdf7-ea32b02ab117*/, LOGTEXT("Office Visio Standard 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xd9f5b1c6, 0x5386, 0x495a, { 0x88, 0xf9, 0x9a, 0xd6, 0xb4, 0x1a, 0xc9, 0xb3, } } /*d9f5b1c6-5386-495a-88f9-9ad6b41ac9b3*/, LOGTEXT("Office Word 2013"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x6ee7622c, 0x18d8, 0x4005, { 0x9f, 0xb7, 0x92, 0xdb, 0x64, 0x4a, 0x27, 0x9b, } } /*6ee7622c-18d8-4005-9fb7-92db644a279b*/, "Office Access 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xf7461d52, 0x7c2b, 0x43b2, { 0x87, 0x44, 0xea, 0x95, 0x8e, 0x0b, 0xd0, 0x9a, } } /*f7461d52-7c2b-43b2-8744-ea958e0bd09a*/, "Office Excel 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xa30b8040, 0xd68a, 0x423f, { 0xb0, 0xb5, 0x9c, 0xe2, 0x92, 0xea, 0x5a, 0x8f, } } /*a30b8040-d68a-423f-b0b5-9ce292ea5a8f*/, "Office InfoPath 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x1b9f11e3, 0xc85c, 0x4e1b, { 0xbb, 0x29, 0x87, 0x9a, 0xd2, 0xc9, 0x09, 0xe3, } } /*1b9f11e3-c85c-4e1b-bb29-879ad2c909e3*/, "Office Lync 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xdc981c6b, 0xfc8e, 0x420f, { 0xaa, 0x43, 0xf8, 0xf3, 0x3e, 0x5c, 0x09, 0x23, } } /*dc981c6b-fc8e-420f-aa43-f8f33e5c0923*/, "Office Mondo 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xefe1f3e6, 0xaea2, 0x4144, { 0xa2, 0x08, 0x32, 0xaa, 0x87, 0x2b, 0x65, 0x45, } } /*efe1f3e6-aea2-4144-a208-32aa872b6545*/, "Office OneNote 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x771c3afa, 0x50c5, 0x443f, { 0xb1, 0x51, 0xff, 0x25, 0x46, 0xd8, 0x63, 0xa0, } } /*771c3afa-50c5-443f-b151-ff2546d863a0*/, "Office OutLook 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x8c762649, 0x97d1, 0x4953, { 0xad, 0x27, 0xb7, 0xe2, 0xc2, 0x5b, 0x97, 0x2e, } } /*8c762649-97d1-4953-ad27-b7e2c25b972e*/, "Office PowerPoint 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x4a5d124a, 0xe620, 0x44ba, { 0xb6, 0xff, 0x65, 0x89, 0x61, 0xb3, 0x3b, 0x9a, } } /*4a5d124a-e620-44ba-b6ff-658961b33b9a*/, "Office Project Pro 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x427a28d1, 0xd17c, 0x4abf, { 0xb7, 0x17, 0x32, 0xc7, 0x80, 0xba, 0x6f, 0x07, } } /*427a28d1-d17c-4abf-b717-32c780ba6f07*/, "Office Project Standard 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0x00c79ff1, 0x6850, 0x443d, { 0xbf, 0x61, 0x71, 0xcd, 0xe0, 0xde, 0x30, 0x5f, } } /*00c79ff1-6850-443d-bf61-71cde0de305f*/, "Office Publisher 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xac4efaf0, 0xf81f, 0x4f61, { 0xbd, 0xf7, 0xea, 0x32, 0xb0, 0x2a, 0xb1, 0x17, } } /*ac4efaf0-f81f-4f61-bdf7-ea32b02ab117*/, "Office Visio Standard 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xe13ac10e, 0x75d0, 0x4aff, { 0xa0, 0xcd, 0x76, 0x49, 0x82, 0xcf, 0x54, 0x1c, } } /*e13ac10e-75d0-4aff-a0cd-764982cf541c*/, "Office Visio Pro 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xd9f5b1c6, 0x5386, 0x495a, { 0x88, 0xf9, 0x9a, 0xd6, 0xb4, 0x1a, 0xc9, 0xb3, } } /*d9f5b1c6-5386-495a-88f9-9ad6b41ac9b3*/, "Office Word 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xb322da9c, 0xa2e2, 0x4058, { 0x9e, 0x4e, 0xf5, 0x9a, 0x69, 0x70, 0xbd, 0x69, } } /*b322da9c-a2e2-4058-9e4e-f59a6970bd69*/, "Office Professional Plus 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
{ { 0xb13afb38, 0xcd79, 0x4ae5, { 0x9f, 0x7f, 0xee, 0xd0, 0x58, 0xd7, 0x50, 0xca, } } /*b13afb38-cd79-4ae5-9f7f-eed058d750ca*/, "Office Standard 2013", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013 },
// Office 2013 (Pre-Release)
# ifdef INCLUDE_BETAS
{ { 0x44b538e2, 0xfb34, 0x4732, { 0x81, 0xe4, 0x64, 0x4c, 0x17, 0xd2, 0xe7, 0x46, } } /*44b538e2-fb34-4732-81e4-644c17d2e746*/, LOGTEXT("Office Access 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x9373bfa0, 0x97b3, 0x4587, { 0xab, 0x73, 0x30, 0x93, 0x44, 0x61, 0xd5, 0x5c, } } /*9373bfa0-97b3-4587-ab73-30934461d55c*/, LOGTEXT("Office Excel 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0xaa286eb4, 0x556f, 0x4eeb, { 0x96, 0x7c, 0xc1, 0xb7, 0x71, 0xb7, 0x67, 0x3e, } } /*aa286eb4-556f-4eeb-967c-c1b771b7673e*/, LOGTEXT("Office Groove 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x7ccc8256, 0xfbaa, 0x49c6, { 0xb2, 0xa9, 0xf5, 0xaf, 0xb4, 0x25, 0x7c, 0xd2, } } /*7ccc8256-fbaa-49c6-b2a9-f5afb4257cd2*/, LOGTEXT("Office InfoPath 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0xc53dfe17, 0xcc00, 0x4967, { 0xb1, 0x88, 0xa0, 0x88, 0xa9, 0x65, 0x49, 0x4d, } } /*c53dfe17-cc00-4967-b188-a088a965494d*/, LOGTEXT("Office Lync 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x2816a87d, 0xe1ed, 0x4097, { 0xb3, 0x11, 0xe2, 0x34, 0x1c, 0x57, 0xb1, 0x79, } } /*2816a87d-e1ed-4097-b311-e2341c57b179*/, LOGTEXT("Office Mondo 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x67c0f908, 0x184f, 0x4f64, { 0x82, 0x50, 0x12, 0xdb, 0x79, 0x7a, 0xb3, 0xc3, } } /*67c0f908-184f-4f64-8250-12db797ab3c3*/, LOGTEXT("Office OneNote 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x7bce4e7a, 0xdd80, 0x4682, { 0x98, 0xfa, 0xf9, 0x93, 0x72, 0x58, 0x03, 0xd2, } } /*7bce4e7a-dd80-4682-98fa-f993725803d2*/, LOGTEXT("Office Outlook 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x1ec10c0a, 0x54f6, 0x453e, { 0xb8, 0x5a, 0x6f, 0xa1, 0xbb, 0xfe, 0xa9, 0xb7, } } /*1ec10c0a-54f6-453e-b85a-6fa1bbfea9b7*/, LOGTEXT("Office PowerPoint 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x87d2b5bf, 0xd47b, 0x41fb, { 0xaf, 0x62, 0x71, 0xc3, 0x82, 0xf5, 0xcc, 0x85, } } /*87d2b5bf-d47b-41fb-af62-71c382f5cc85*/, LOGTEXT("Office Professional Plus 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x3cfe50a9, 0x0e03, 0x4b29, { 0x97, 0x54, 0x9f, 0x19, 0x3f, 0x07, 0xb7, 0x1f, } } /*3cfe50a9-0e03-4b29-9754-9f193f07b71f*/, LOGTEXT("Office Project Pro 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x39e49e57, 0xae68, 0x4ee3, { 0xb0, 0x98, 0x26, 0x48, 0x0d, 0xf3, 0xda, 0x96, } } /*39e49e57-ae68-4ee3-b098-26480df3da96*/, LOGTEXT("Office Project Standard 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x15aa2117, 0x8f79, 0x49a8, { 0x83, 0x17, 0x75, 0x30, 0x26, 0xd6, 0xa0, 0x54, } } /*15aa2117-8f79-49a8-8317-753026d6a054*/, LOGTEXT("Office Publisher 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0xcfbfd60e, 0x0b5f, 0x427d, { 0x91, 0x7c, 0xa4, 0xdf, 0x42, 0xa8, 0x0e, 0x44, } } /*cfbfd60e-0b5f-427d-917c-a4df42a80e44*/, LOGTEXT("Office Visio Pro 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0x7012cc81, 0x8887, 0x42e9, { 0xb1, 0x7d, 0x4e, 0x5e, 0x42, 0x76, 0x0f, 0x0d, } } /*7012cc81-8887-42e9-b17d-4e5e42760f0d*/, LOGTEXT("Office Visio Standard 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
{ { 0xde9c7eb6, 0x5a85, 0x420d, { 0x97, 0x03, 0xff, 0xf1, 0x1b, 0xdd, 0x4d, 0x43, } } /*de9c7eb6-5a85-420d-9703-fff11bdd4d43*/, LOGTEXT("Office Word 2013 (Pre-Release)"), EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2013_BETA },
# endif // INCLUDE_BETAS
// Office 2016
{ { 0xd450596f, 0x894d, 0x49e0, { 0x96, 0x6a, 0xfd, 0x39, 0xed, 0x4c, 0x4c, 0x64, } } /*d450596f-894d-49e0-966a-fd39ed4c4c64*/, "Office Professional Plus 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x4f414197, 0x0fc2, 0x4c01, { 0xb6, 0x8a, 0x86, 0xcb, 0xb9, 0xac, 0x25, 0x4c, } } /*4f414197-0fc2-4c01-b68a-86cbb9ac254c*/, "Office Project Pro 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x6bf301c1, 0xb94a, 0x43e9, { 0xba, 0x31, 0xd4, 0x94, 0x59, 0x8c, 0x47, 0xfb, } } /*6bf301c1-b94a-43e9-ba31-d494598c47fb*/, "Office Visio Pro 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x041a06cb, 0xc5b8, 0x4772, { 0x80, 0x9f, 0x41, 0x6d, 0x03, 0xd1, 0x66, 0x54, } } /*041a06cb-c5b8-4772-809f-416d03d16654*/, "Office Publisher 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x67c0fc0c, 0xdeba, 0x401b, { 0xbf, 0x8b, 0x9c, 0x8a, 0xd8, 0x39, 0x58, 0x04, } } /*67c0fc0c-deba-401b-bf8b-9c8ad8395804*/, "Office Access 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x83e04ee1, 0xfa8d, 0x436d, { 0x89, 0x94, 0xd3, 0x1a, 0x86, 0x2c, 0xab, 0x77, } } /*83e04ee1-fa8d-436d-8994-d31a862cab77*/, "Office Skype for Business 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x9caabccb, 0x61b1, 0x4b4b, { 0x8b, 0xec, 0xd1, 0x0a, 0x3c, 0x3a, 0xc2, 0xce, } } /*9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce*/, "Office Mondo 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xaa2a7821, 0x1827, 0x4c2c, { 0x8f, 0x1d, 0x45, 0x13, 0xa3, 0x4d, 0xda, 0x97, } } /*aa2a7821-1827-4c2c-8f1d-4513a34dda97*/, "Office Visio Standard 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xbb11badf, 0xd8aa, 0x470e, { 0x93, 0x11, 0x20, 0xea, 0xf8, 0x0f, 0xe5, 0xcc, } } /*bb11badf-d8aa-470e-9311-20eaf80fe5cc*/, "Office Word 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xc3e65d36, 0x141f, 0x4d2f, { 0xa3, 0x03, 0xa8, 0x42, 0xee, 0x75, 0x6a, 0x29, } } /*c3e65d36-141f-4d2f-a303-a842ee756a29*/, "Office Excel 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xd70b1bba, 0xb893, 0x4544, { 0x96, 0xe2, 0xb7, 0xa3, 0x18, 0x09, 0x1c, 0x33, } } /*d70b1bba-b893-4544-96e2-b7a318091c33*/, "Office Powerpoint 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xd8cace59, 0x33d2, 0x4ac7, { 0x9b, 0x1b, 0x9b, 0x72, 0x33, 0x9c, 0x51, 0xc8, } } /*d8cace59-33d2-4ac7-9b1b-9b72339c51c8*/, "Office OneNote 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xda7ddabc, 0x3fbe, 0x4447, { 0x9e, 0x01, 0x6a, 0xb7, 0x44, 0x0b, 0x4c, 0xd4, } } /*da7ddabc-3fbe-4447-9e01-6ab7440b4cd4*/, "Office Project Standard 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xdedfa23d, 0x6ed1, 0x45a6, { 0x85, 0xdc, 0x63, 0xca, 0xe0, 0x54, 0x6d, 0xe6, } } /*dedfa23d-6ed1-45a6-85dc-63cae0546de6*/, "Office Standard 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xe914ea6e, 0xa5fa, 0x4439, { 0xa3, 0x94, 0xa9, 0xbb, 0x32, 0x93, 0xca, 0x09, } } /*e914ea6e-a5fa-4439-a394-a9bb3293ca09*/, "Office Mondo R 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xec9d9265, 0x9d1e, 0x4ed0, { 0x83, 0x8a, 0xcd, 0xc2, 0x0f, 0x25, 0x51, 0xa1, } } /*ec9d9265-9d1e-4ed0-838a-cdc20f2551a1*/, "Office Outlook 2016", EPID_OFFICE2013, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
// Office 2016
{ { 0x67c0fc0c, 0xdeba, 0x401b, { 0xbf, 0x8b, 0x9c, 0x8a, 0xd8, 0x39, 0x58, 0x04, } } /*67c0fc0c-deba-401b-bf8b-9c8ad8395804*/, LOGTEXT("Office Access 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xc3e65d36, 0x141f, 0x4d2f, { 0xa3, 0x03, 0xa8, 0x42, 0xee, 0x75, 0x6a, 0x29, } } /*c3e65d36-141f-4d2f-a303-a842ee756a29*/, LOGTEXT("Office Excel 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x9caabccb, 0x61b1, 0x4b4b, { 0x8b, 0xec, 0xd1, 0x0a, 0x3c, 0x3a, 0xc2, 0xce, } } /*9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce*/, LOGTEXT("Office Mondo 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xe914ea6e, 0xa5fa, 0x4439, { 0xa3, 0x94, 0xa9, 0xbb, 0x32, 0x93, 0xca, 0x09, } } /*e914ea6e-a5fa-4439-a394-a9bb3293ca09*/, LOGTEXT("Office Mondo R 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xd8cace59, 0x33d2, 0x4ac7, { 0x9b, 0x1b, 0x9b, 0x72, 0x33, 0x9c, 0x51, 0xc8, } } /*d8cace59-33d2-4ac7-9b1b-9b72339c51c8*/, LOGTEXT("Office OneNote 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xec9d9265, 0x9d1e, 0x4ed0, { 0x83, 0x8a, 0xcd, 0xc2, 0x0f, 0x25, 0x51, 0xa1, } } /*ec9d9265-9d1e-4ed0-838a-cdc20f2551a1*/, LOGTEXT("Office Outlook 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xd70b1bba, 0xb893, 0x4544, { 0x96, 0xe2, 0xb7, 0xa3, 0x18, 0x09, 0x1c, 0x33, } } /*d70b1bba-b893-4544-96e2-b7a318091c33*/, LOGTEXT("Office Powerpoint 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xd450596f, 0x894d, 0x49e0, { 0x96, 0x6a, 0xfd, 0x39, 0xed, 0x4c, 0x4c, 0x64, } } /*d450596f-894d-49e0-966a-fd39ed4c4c64*/, LOGTEXT("Office Professional Plus 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x4f414197, 0x0fc2, 0x4c01, { 0xb6, 0x8a, 0x86, 0xcb, 0xb9, 0xac, 0x25, 0x4c, } } /*4f414197-0fc2-4c01-b68a-86cbb9ac254c*/, LOGTEXT("Office Project Pro 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x829b8110, 0x0e6f, 0x4349, { 0xbc, 0xa4, 0x42, 0x80, 0x35, 0x77, 0x78, 0x8d, } } /*829b8110-0e6f-4349-bca4-42803577788d*/, LOGTEXT("Office Project Pro 2016 XC2R"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xda7ddabc, 0x3fbe, 0x4447, { 0x9e, 0x01, 0x6a, 0xb7, 0x44, 0x0b, 0x4c, 0xd4, } } /*da7ddabc-3fbe-4447-9e01-6ab7440b4cd4*/, LOGTEXT("Office Project Standard 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xcbbaca45, 0x556a, 0x4416, { 0xad, 0x03, 0xbd, 0xa5, 0x98, 0xea, 0xa7, 0xc8, } } /*cbbaca45-556a-4416-ad03-bda598eaa7c8*/, LOGTEXT("Office Project Standard 2016 XC2R"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x041a06cb, 0xc5b8, 0x4772, { 0x80, 0x9f, 0x41, 0x6d, 0x03, 0xd1, 0x66, 0x54, } } /*041a06cb-c5b8-4772-809f-416d03d16654*/, LOGTEXT("Office Publisher 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x83e04ee1, 0xfa8d, 0x436d, { 0x89, 0x94, 0xd3, 0x1a, 0x86, 0x2c, 0xab, 0x77, } } /*83e04ee1-fa8d-436d-8994-d31a862cab77*/, LOGTEXT("Office Skype for Business 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xdedfa23d, 0x6ed1, 0x45a6, { 0x85, 0xdc, 0x63, 0xca, 0xe0, 0x54, 0x6d, 0xe6, } } /*dedfa23d-6ed1-45a6-85dc-63cae0546de6*/, LOGTEXT("Office Standard 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x6bf301c1, 0xb94a, 0x43e9, { 0xba, 0x31, 0xd4, 0x94, 0x59, 0x8c, 0x47, 0xfb, } } /*6bf301c1-b94a-43e9-ba31-d494598c47fb*/, LOGTEXT("Office Visio Pro 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xb234abe3, 0x0857, 0x4f9c, { 0xb0, 0x5a, 0x4d, 0xc3, 0x14, 0xf8, 0x55, 0x57, } } /*b234abe3-0857-4f9c-b05a-4dc314f85557*/, LOGTEXT("Office Visio Pro 2016 XC2R"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xaa2a7821, 0x1827, 0x4c2c, { 0x8f, 0x1d, 0x45, 0x13, 0xa3, 0x4d, 0xda, 0x97, } } /*aa2a7821-1827-4c2c-8f1d-4513a34dda97*/, LOGTEXT("Office Visio Standard 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0x361fe620, 0x64f4, 0x41b5, { 0xba, 0x77, 0x84, 0xf8, 0xe0, 0x79, 0xb1, 0xf7, } } /*361fe620-64f4-41b5-ba77-84f8e079b1f7*/, LOGTEXT("Office Visio Standard 2016 XC2R"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
{ { 0xbb11badf, 0xd8aa, 0x470e, { 0x93, 0x11, 0x20, 0xea, 0xf8, 0x0f, 0xe5, 0xcc, } } /*bb11badf-d8aa-470e-9311-20eaf80fe5cc*/, LOGTEXT("Office Word 2016"), EPID_OFFICE2016, APP_ID_OFFICE2013, KMS_ID_OFFICE2016 },
// End marker (necessity should be removed when time permits)
@ -243,12 +314,16 @@ __pure ProdListIndex_t getExtendedProductListSize(void)
return _countof(ExtendedProductList) - 1;
}
#ifndef NO_LOG
__pure ProdListIndex_t getAppListSize(void)
{
return _countof(AppList);
}
#endif // NO_LOG
#endif // NO_EXTENDED_PRODUCT_LIST
#endif // IS_LIBRARY
#endif
#ifndef NO_RANDOM_EPID
// HostType and OSBuild
@ -258,15 +333,15 @@ static const struct KMSHostOS { uint16_t Type; uint16_t Build; } HostOS[] =
{ 55041, 7601 }, // Windows Server 2008 R2 SP1
{ 5426, 9200 }, // Windows Server 2012
{ 6401, 9600 }, // Windows Server 2012 R2
{ 3612, 10240}, // Windows Server 2016
{ 3612, 14393 }, // Windows Server 2016
};
// GroupID and PIDRange
static const struct PKEYCONFIG { uint16_t GroupID; uint32_t RangeMin; uint32_t RangeMax; } pkeyconfig[] = {
{ 206, 152000000, 191999999 }, // Windows Server 2012 KMS Host pkeyconfig
{ 206, 271000000, 310999999 }, // Windows Server 2012 R2 KMS Host pkeyconfig
{ 96, 199000000, 217999999 }, // Office2010 KMS Host pkeyconfig
{ 206, 234000000, 255999999 }, // Office2013 KMS Host pkeyconfig
{ 206, 471000000, 530999999 }, // Windows Server 2016
{ 96, 199000000, 217999999 }, // Office2010
{ 206, 234000000, 255999999 }, // Office2013
{ 206, 437000000, 458999999 }, // Office2016
};
// Valid language identifiers to be used in the ePID
@ -377,7 +452,8 @@ static int getRandomServerType()
# ifndef USE_MSRPC
else
{
// return 9200/9600/10240 if NDR64 is in use, otherwise 6002/7601
// return 9200/9600 if NDR64 is in use, otherwise 6002/7601
// return (rand() % 2) + (UseRpcNDR64 ? 2 : 0);
if (UseRpcNDR64) return (rand() % 3) + 2;
return (rand() % 2);
}
@ -388,9 +464,8 @@ static int getRandomServerType()
/*
* Generates a random ePID
*/
static void generateRandomPid(const int index, char *const szPid, int serverType, int16_t lang)
static void generateRandomPid(int index, char *const szPid, int serverType, int16_t lang)
{
int clientApp;
char numberBuffer[12];
if (serverType < 0 || serverType >= (int)_countof(HostOS))
@ -401,17 +476,12 @@ static void generateRandomPid(const int index, char *const szPid, int serverType
strcpy(szPid, itoc(numberBuffer, HostOS[serverType].Type, 5));
strcat(szPid, "-");
if (index == 2)
clientApp = 3;
else if (index == 1)
clientApp = 2;
else
clientApp = serverType == 3 /*change if HostOS changes*/ ? 1 : 0;
if (index > 3) index=0;
strcat(szPid, itoc(numberBuffer, pkeyconfig[clientApp].GroupID, 5));
strcat(szPid, itoc(numberBuffer, pkeyconfig[index].GroupID, 5));
strcat(szPid, "-");
int keyId = (rand32() % (pkeyconfig[clientApp].RangeMax - pkeyconfig[clientApp].RangeMin)) + pkeyconfig[clientApp].RangeMin;
int keyId = (rand32() % (pkeyconfig[index].RangeMax - pkeyconfig[index].RangeMin)) + pkeyconfig[index].RangeMin;
strcat(szPid, itoc(numberBuffer, keyId / 1000000, 3));
strcat(szPid, "-");
strcat(szPid, itoc(numberBuffer, keyId % 1000000, 6));
@ -424,16 +494,19 @@ static void generateRandomPid(const int index, char *const szPid, int serverType
strcat(szPid, itoc(numberBuffer, HostOS[serverType].Build, 0));
strcat(szPid, ".0000-");
# define minTime ((time_t)1436958000) // Release Date Windows 10 RTM Escrow
# define minTime ((time_t)1470175200) /* Release Date Win 2016 */
time_t maxTime, kmsTime;
time(&maxTime);
if (maxTime < minTime) // Just in case the system time is < 07/15/2015 1:00 pm
# ifndef BUILD_TIME
# define BUILD_TIME 1474752907
# endif
if (maxTime < (time_t)BUILD_TIME) // Just in case the system time is < 10/17/2013 1:00 pm
maxTime = (time_t)BUILD_TIME;
kmsTime = (rand32() % (maxTime - minTime)) + minTime;
# undef minTime
struct tm *pidTime;
pidTime = gmtime(&kmsTime);
@ -454,7 +527,7 @@ void randomPidInit()
int serverType = getRandomServerType();
int16_t lang = Lcid ? Lcid : LcidList[rand() % _countof(LcidList)];
for (i = 0; i < _countof(AppList) - 1; i++)
for (i = 0; i < MAX_KMSAPPS; i++)
{
if (KmsResponseParameters[i].Epid) continue;
@ -489,10 +562,8 @@ static void logRequest(const REQUEST *const baseRequest)
if (++index >= (int)_countof(ExtendedProductList))
#endif // NO_EXTENDED_PRODUCT_LIST
{
#ifndef NO_BASIC_PRODUCT_LIST
productName = getProductNameLE(&baseRequest->KMSID, ProductList, &index);
if (++index >= (int)_countof(ProductList))
#endif // NO_BASIC_PRODUCT_LIST
{
productName = getProductNameLE(&baseRequest->AppID, AppList, &index);
}
@ -519,10 +590,11 @@ static void logRequest(const REQUEST *const baseRequest)
/*
* Converts a utf-8 ePID string to UCS-2 and writes it to a RESPONSE struct
*/
#ifndef IS_LIBRARY
static void getEpidFromString(RESPONSE *const Response, const char *const pid)
{
size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);
Response->PIDSize = LE32(((unsigned int )length + 1) << 1);
Response->PIDSize = LE32(((unsigned int)length + 1) << 1);
}
@ -548,7 +620,21 @@ static void getEpid(RESPONSE *const baseResponse, const char** EpidSource, const
else
#endif // NO_RANDOM_EPID
{
pid = AppList[index].pid;
switch(index)
{
case EPID_INDEX_OFFICE2016:
pid = EPID_OFFICE2016;
break;
case EPID_INDEX_OFFICE2013:
pid = EPID_OFFICE2013;
break;
case EPID_INDEX_OFFICE2010:
pid = EPID_OFFICE2010;
break;
default:
pid = EPID_WINDOWS;
break;
}
#ifndef NO_LOG
*EpidSource = "vlmcsd default";
#endif // NO_LOG
@ -567,6 +653,7 @@ static void getEpid(RESPONSE *const baseResponse, const char** EpidSource, const
}
getEpidFromString(baseResponse, pid);
}
#endif // IS_LIBRARY
#if !defined(NO_LOG) && defined(_PEDANTIC)
@ -627,6 +714,7 @@ static void logResponse(const RESPONSE *const baseResponse, const BYTE *const hw
/*
* Creates the unencrypted base response
*/
#ifndef IS_LIBRARY
static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr)
{
const char* EpidSource;
@ -639,9 +727,27 @@ static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseReques
ProdListIndex_t index;
getProductNameLE(&baseRequest->AppID, AppList, &index);
getProductNameLE(&baseRequest->KMSID, ProductList, &index);
if (index >= _countof(AppList) - 1) index = 0; //default to Windows
switch(index)
{
case KMS_ID_OFFICE2016:
index = EPID_INDEX_OFFICE2016;
break;
case KMS_ID_OFFICE2013:
case KMS_ID_OFFICE2013_BETA:
index = EPID_INDEX_OFFICE2013;
break;
case KMS_ID_OFFICE2010:
index = EPID_INDEX_OFFICE2010;
break;
default:
index = EPID_INDEX_WINDOWS;
break;
}
getEpid(baseResponse, &EpidSource, index, hwId);
@ -650,10 +756,12 @@ static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseReques
memcpy(&baseResponse->CMID, &baseRequest->CMID, sizeof(GUID));
memcpy(&baseResponse->ClientTime, &baseRequest->ClientTime, sizeof(FILETIME));
baseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);
baseResponse->Count = index > 0 && index < 4 ? LE32(10) : LE32(50);
baseResponse->VLActivationInterval = LE32(VLActivationInterval);
baseResponse->VLRenewalInterval = LE32(VLRenewalInterval);
if (LE32(baseRequest->N_Policy) > LE32(baseResponse->Count)) baseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);
#ifndef NO_LOG
logResponse(baseResponse, hwId, EpidSource);
#endif // NO_LOG
@ -663,6 +771,13 @@ static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseReques
RequestCallback_t CreateResponseBase = &CreateResponseBaseCallback;
#else // IS_LIBRARY
RequestCallback_t CreateResponseBase = NULL;
#endif // IS_LIBRARY
////TODO: Move to helpers.c
void get16RandomBytes(void* ptr)
{
@ -670,7 +785,6 @@ void get16RandomBytes(void* ptr)
for (i = 0; i < 4; i++) ((DWORD*)ptr)[i] = rand32();
}
/*
* Creates v4 response
*/
@ -727,10 +841,10 @@ static int_fast8_t CreateV6Hmac(BYTE *const encrypt_start, const size_t encryptS
// The last 16 bytes of the hashed time slot are the actual HMAC key
if (!Sha256Hmac
(
hash + halfHashSize, // Use last 16 bytes of SHA256 as HMAC key
encrypt_start, // hash only the encrypted part of the v6 response
encryptSize - sizeof(((RESPONSE_V6*)0)->HMAC), // encryptSize minus the HMAC itself
hash // use same buffer for resulting hash where the key came from
hash + halfHashSize, // Use last 16 bytes of SHA256 as HMAC key
encrypt_start, // hash only the encrypted part of the v6 response
(DWORD)(encryptSize - sizeof(((RESPONSE_V6*)0)->HMAC)), // encryptSize minus the HMAC itself
hash // use same buffer for resulting hash where the key came from
))
{
return FALSE;
@ -966,24 +1080,21 @@ static RESPONSE_RESULT VerifyResponseV6(RESPONSE_RESULT result, const AesCtx* Ct
{
CreateV6Hmac
(
rawResponse + sizeof(response_v6->Version), // Pointer to start of the encrypted part of the response
(size_t)result.correctResponseSize - V6_UNENCRYPTED_SIZE, // size of the encrypted part
tolerance // tolerance -1, 0, or +1
rawResponse + sizeof(response_v6->Version), // Pointer to start of the encrypted part of the response
(size_t)result.correctResponseSize - sizeof(response_v6->Version), // size of the encrypted part
tolerance // tolerance -1, 0, or +1
);
if
((
result.HmacSha256OK = !memcmp // Compare both HMACs
(
OldHmac,
rawResponse + (size_t)result.correctResponseSize - sizeof(response_v6->HMAC),
sizeof(OldHmac)
)
))
{
break;
}
result.HmacSha256OK = !memcmp // Compare both HMACs
(
OldHmac,
rawResponse + (size_t)result.correctResponseSize - sizeof(response_v6->HMAC),
sizeof(OldHmac)
);
if (result.HmacSha256OK) break;
}
return result;
}

55
kms.h
View File

@ -6,7 +6,11 @@
#endif // CONFIG
#include CONFIG
#if _MSC_VER
#include <time.h>
#else
#include <sys/time.h>
#endif // _MSC_VER
#include <stdlib.h>
#include "types.h"
//
@ -231,27 +235,36 @@ typedef struct
#define APP_ID_OFFICE2010 1
#define APP_ID_OFFICE2013 2
#define KMS_ID_VISTA 0
#define KMS_ID_WIN7 1
#define KMS_ID_WIN8_VL 2
#define KMS_ID_WIN_BETA 3
#define KMS_ID_WIN8_RETAIL 4
#define KMS_ID_WIN81_VL 5
#define KMS_ID_WIN81_RETAIL 6
#define KMS_ID_WIN2008A 7
#define KMS_ID_WIN2008B 8
#define KMS_ID_WIN2008C 9
#define KMS_ID_WIN2008R2A 10
#define KMS_ID_WIN2008R2B 11
#define KMS_ID_WIN2008R2C 12
#define KMS_ID_WIN2012 13
#define KMS_ID_WIN2012R2 14
#define KMS_ID_OFFICE2010 15
#define KMS_ID_OFFICE2013 16
#define KMS_ID_WIN_SRV_BETA 17
#define KMS_ID_OFFICE2016 18
#define KMS_ID_WIN10_VL 19
#define KMS_ID_WIN10_RETAIL 20
#define EPID_INDEX_WINDOWS APP_ID_WINDOWS
#define EPID_INDEX_OFFICE2010 APP_ID_OFFICE2010
#define EPID_INDEX_OFFICE2013 APP_ID_OFFICE2013
#define EPID_INDEX_OFFICE2016 3
// Update these numbers in License Manager
#define KMS_ID_OFFICE2010 0
#define KMS_ID_OFFICE2013 1
#define KMS_ID_OFFICE2013_BETA 2
#define KMS_ID_OFFICE2016 3
#define KMS_ID_VISTA 4
#define KMS_ID_WIN7 5
#define KMS_ID_WIN8_VL 6
#define KMS_ID_WIN_BETA 7
#define KMS_ID_WIN8_RETAIL 8
#define KMS_ID_WIN81_VL 9
#define KMS_ID_WIN81_RETAIL 10
#define KMS_ID_WIN2008A 11
#define KMS_ID_WIN2008B 12
#define KMS_ID_WIN2008C 13
#define KMS_ID_WIN2008R2A 14
#define KMS_ID_WIN2008R2B 15
#define KMS_ID_WIN2008R2C 16
#define KMS_ID_WIN2012 17
#define KMS_ID_WIN2012R2 18
#define KMS_ID_WIN_SRV_BETA 19
#define KMS_ID_WIN10_VL 20
#define KMS_ID_WIN10_RETAIL 21
#define KMS_ID_WIN2016 22
#define KMS_ID_WIN10_LTSB2016 23
#define PWINGUID &AppList[APP_ID_WINDOWS].guid
#define POFFICE2010GUID &AppList[APP_ID_OFFICE2010].guid

View File

@ -29,7 +29,14 @@ __stdcall BOOL KmsCallBack(const REQUEST *const baseRequest, RESPONSE *const bas
int main(int argc, char** argv)
{
printf("libvlmcs-test.c: Program start\n");
int version = GetLibKmsVersion();
if (version < 0x30001)
{
fprintf(stderr, "KMS library version %u.%u or greater required\n", (unsigned int)(version >> 16), (unsigned int)(version & 0xffff));
}
printf("%s: Program start\n", GetEmulatorVersion());
StartKmsServer(1688, KmsCallBack);
return 0;
}

128
libkms.c
View File

@ -7,9 +7,13 @@
#endif // CONFIG
#include CONFIG
#ifdef EXTERNAL
#undef EXTERNAL
#endif
#define EXTERNAL dllexport
#define DLLVERSION 0x30000
#define DLLVERSION 0x30002
#include "libkms.h"
#include "shared_globals.h"
@ -26,37 +30,85 @@
static int_fast8_t IsServerStarted = FALSE;
#ifdef _WIN32
#ifndef USE_MSRPC
EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest
(
const char* const hostname,
const int port,
RESPONSE* baseResponse,
const REQUEST* const baseRequest,
RESPONSE_RESULT* result, BYTE *hwid
)
static int_fast8_t SocketsInitialized = FALSE;
WSADATA wsadata;
static int initializeWinSockets()
{
return !0; // not yet implemented
if (SocketsInitialized) return 0;
SocketsInitialized = TRUE;
return WSAStartup(0x0202, &wsadata);
}
#endif // USE_MSRPC
#endif // _WIN32
EXTERNC __declspec(EXTERNAL) char* __cdecl GetErrorMessage()
{
return ErrorMessage;
}
EXTERNC __declspec(EXTERNAL) SOCKET __cdecl ConnectToServer(const char* host, const char* port, const int addressFamily)
{
SOCKET sock;
*ErrorMessage = 0;
# if defined(_WIN32) && !defined(USE_MSRPC)
initializeWinSockets();
# endif // defined(_WIN32) && !defined(USE_MSRPC)
size_t adrlen = strlen(host) + 16;
char* RemoteAddr = (char*)alloca(adrlen);
vlmcsd_snprintf(RemoteAddr, adrlen, "[%s]:%s", host, port);
sock = connectToAddress(RemoteAddr, addressFamily, FALSE);
if (sock == INVALID_RPCCTX)
{
printerrorf("Fatal: Could not connect to %s\n", RemoteAddr);
return sock;
}
return sock;
}
EXTERNC __declspec(EXTERNAL) RpcStatus __cdecl BindRpc(const SOCKET sock, const int_fast8_t useMultiplexedRpc)
{
*ErrorMessage = 0;
UseMultiplexedRpc = useMultiplexedRpc;
return rpcBindClient(sock, FALSE);
}
EXTERNC __declspec(EXTERNAL) void __cdecl CloseConnection(const SOCKET sock)
{
socketclose(sock);
}
EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendKMSRequest(const SOCKET sock, RESPONSE* baseResponse, REQUEST* baseRequest, RESPONSE_RESULT* result, BYTE *hwid)
{
*ErrorMessage = 0;
return SendActivationRequest(sock, baseResponse, baseRequest, result, hwid);
}
EXTERNC __declspec(EXTERNAL) int_fast8_t __cdecl IsDisconnected(const SOCKET sock)
{
return isDisconnected(sock);
}
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
int error = initializeWinSockets();
if (error) return error;
# endif // _WIN32
CreateResponseBase = requestCallback;
@ -97,6 +149,32 @@ EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, Reques
IsServerStarted = FALSE;
return 0;
# else // SIMPLE_SOCKETS
if (IsServerStarted) return !0;
int error;
# ifdef _WIN32
error = initializeWinSockets();
if (error) return error;
# endif // _WIN32
defaultport = vlmcsd_malloc(16);
vlmcsd_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
}
@ -105,7 +183,11 @@ EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer()
if (!IsServerStarted) return !0;
closeAllListeningSockets();
# ifndef SIMPLE_SOCKETS
if (SocketList) free(SocketList);
# endif
return 0;
}
@ -115,3 +197,9 @@ EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion()
return DLLVERSION;
}
EXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion()
{
return VERSION;
}

View File

@ -8,25 +8,26 @@
#include "types.h"
#include "kms.h"
#include "rpc.h"
#include "vlmcs.h"
#ifndef EXTERNC
#ifdef __cplusplus
#define EXTERNC extern "C"
#define EXTERNC EXTERN "C"
#else
#define EXTERNC
#endif
#if !defined(_WIN32) && !__CYGWIN__
#define __declspec(x) __attribute__((__visibility__("default")))
#endif
#if !defined(EXTERNAL)
#define EXTERNAL dllimport
#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 SendKMSRequest(const SOCKET sock, RESPONSE* baseResponse, REQUEST* 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();
EXTERNC __declspec(EXTERNAL) SOCKET __cdecl ConnectToServer(const char* host, const char* port, const int addressFamily);
EXTERNC __declspec(EXTERNAL) char* __cdecl GetErrorMessage();
EXTERNC __declspec(EXTERNAL) void __cdecl CloseConnection(const SOCKET sock);
EXTERNC __declspec(EXTERNAL) RpcStatus __cdecl BindRpc(const SOCKET sock, const int_fast8_t useMultiplexedRpc);
EXTERNC __declspec(EXTERNAL) int_fast8_t __cdecl IsDisconnected(const SOCKET sock);
//EXTERN_C __declspec(EXTERNAL) unsigned int __cdecl GetRandom32();

View File

@ -1,9 +1,11 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsd-Dragon* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
@ -14,10 +16,9 @@ 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
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=vlmcsdmulti-DragonFly-x64 PROGRAM_NAME=vlmcsd-DragonFly-x64 CLIENT_NAME=vlmcs-DragonFly-x64 CFLAGS="$CF" LDFLAGS="$LF" allmulti
rm *.o
@ -28,4 +29,4 @@ 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

@ -1,9 +1,10 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsd-Free* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
@ -14,33 +15,24 @@ CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tabl
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.2-x64-gcc CLIENT_NAME=vlmcs-FreeBSD-10.2-x64-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-gcc CC=gcc5 CFLAGS="$CF" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.2-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.2-x64 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.2-x86 PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.2-x86 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x86-gcc CLIENT_NAME=vlmcs-FreeBSD-10.2-x86-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-gcc CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.2-x64-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.2-x64-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.2-x86-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.2-x86-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-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.2-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.2-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
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=gcc6 CFLAGS="$CF" LDFLAGS="$LF"
gmake $MAKEFLAGS MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x64 CLIENT_NAME=vlmcs-FreeBSD-10.3-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF" allmulti
gmake $MAKEFLAGS MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x86 CLIENT_NAME=vlmcs-FreeBSD-10.3-x86 PROGRAM_NAME=vlmcsd-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=gcc6 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=gcc6 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=gcc6 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.2-x86-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-10.2-x86-gcc /usr/local/bin/vlmcs
sudo cp -af vlmcsd-FreeBSD-10.3-x64-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-10.3-x64-gcc /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/
scp -p vlmcsdmulti-* vlmcsd-Free* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/

38
make_hurd Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-hurd* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j1"
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 MULTI_NAME=vlmcsdmulti-hurd-x86-glibc vlmcsdmulti-hurd-x86-glibc PROGRAM_NAME=vlmcsd-hurd-x86-glibc CLIENT_NAME=vlmcs-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" allmulti
make clean
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af vlmcsd-hurd-x86-glibc /usr/local/sbin/vlmcsd
cp -af vlmcs-hurd-x86-glibc /usr/local/bin/vlmcs
# Copy man pages
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
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/
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-hurd* vlmcs-* root@ubuntu64.internal:x/binaries/Hurd/intel/

46
make_kfreebsd Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-Free* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j`nproc`"
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
make $MAKEFLAGS CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2 allmulti
cp -af $PROGRAM_NAME /usr/local/sbin/vlmcsd
cp -af $CLIENT_NAME /usr/local/bin/vlmcs
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 allmulti
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
# Copy man pages
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
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/
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-Free* vlmcs-* root@ubuntu64.internal:x/binaries/FreeBSD/intel/

1139
make_linux

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@
#!/bin/bash
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"
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m31 -mesa -mpacked-stack -msmall-exec"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu"
export THREADS=0
export FEATURES=full
export MULTI_NAME=vlmcsdmulti-s390-glibc
export CLIENT_NAME=vlmcs-s390-glibc
export PROGRAM_NAME=vlmcsd-s390-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
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
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
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
cp -af vlmcsd-s390-glibc /usr/local/sbin/vlmcsd
cp -af vlmcs-s390-glibc /usr/local/bin/vlmcs
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
mkdir -p /usr/local/man/man7 2>/dev/null
cp -a vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -a vlmcsd.7 /usr/local/man/man7/
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
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

View File

@ -16,9 +16,7 @@ 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
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 *$SUFFIX

122
make_multilib_linux Executable file
View File

@ -0,0 +1,122 @@
#!/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
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-s390* vlmcsd-sparc64* vlmcsd-mips64* vlmcs-* vlmcsdmulti-*
## IBM S/390
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m31 -mesa -mpacked-stack -msmall-exec"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu"
export THREADS=0
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
make -B -j`nproc` allmulti
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## SPARC64
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 BIG-ENDIAN
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 LITTLE-ENDIAN
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
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
make -B -j`nproc` allmulti
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ "$1" == "nocopy" ]; then
exit 0
fi
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
mkdir -p /usr/local/man/man7 2>/dev/null
cp -a vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -a vlmcsd.7 /usr/local/man/man7/
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
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
scp -p vlmcsdmulti-mips64el-glibc vlmcs-mips64el-glibc vlmcsd-mips64el-glibc vlmcsdmulti-mips64elmm-glibc vlmcs-mips64elmm-glibc vlmcsd-mips64elmm-glibc ubuntu64.internal:x/binaries/Linux/mips/little-endian/glibc
scp -p -P 2222 vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc s390:vlmcsd
scp -p -P 2222 vlmcsdmulti-s390-glibc vlmcsdmulti-s390x-glibc s390:/usr/local/sbin

View File

@ -1,35 +1,34 @@
#!/usr/pkg/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
rm -f vlmcsd-NetBSD* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
gmake clean
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/gcc49/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/gcc49/bin/gcc CFLAGS="$CF" LDFLAGS="$LF" MULTI_NAME=vlmcsdmulti-NetBSD-x64
gmake $MAKEFLAGS CC=/usr/pkg/gcc5/bin/gcc PROGRAM_NAME=vlmcsd-NetBSD-x64 CLIENT_NAME=vlmcs-NetBSD-x64 MULTI_NAME=vlmcsdmulti-NetBSD-x64 allmulti CFLAGS="$CF" LDFLAGS="$LF"
gmake allmulti $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=vlmcsdmulti-NetBSD-x86 PROGRAM_NAME=vlmcsd-NetBSD-x86 CLIENT_NAME=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
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-*
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-*
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,9 +1,10 @@
#!/usr/local/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsd-Open* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
@ -15,7 +16,7 @@ CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tabl
LF="-Wl,-z,norelro"
LFCLANG="-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 MULTI_NAME=vlmcsdmulti-OpenBSD-x64 PROGRAM_NAME=vlmcsd-OpenBSD-x64 CLIENT_NAME=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"
@ -30,4 +31,4 @@ 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/

View File

@ -1,51 +1,38 @@
#!/bin/bash
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export DNS_PARSER=OS
rm vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm vlmcsd-Mac* vlmcsd-iOS* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm vlmcsd vlmcs vlmcsdmulti 2>/dev/null
MAKEFLAGS="-j -B"
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 allmulti MULTI_NAME=vlmcsdmulti-MacOSX-x86 CLIENT_NAME=vlmcs-MacOSX-x86 PROGRAM_NAME=vlmcsd-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 allmulti MULTI_NAME=vlmcsdmulti-MacOSX-x64 CLIENT_NAME=vlmcs-MacOSX-x64 PROGRAM_NAME=vlmcsd-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.* && \
#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-9.1-armv7 PROGRAM_NAME=vlmcsd-iOS-9.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-9.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-9.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-9.1-armv8-aarch64 PROGRAM_NAME=vlmcsd-iOS-9.1-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-9.1-armv8-aarch64 MULTI_NAME=vlmcsdmulti-iOS-9.1-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \
make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-iOS-armv7 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" && \
make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-iOS-armv8-aarch64 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" && \
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 allmulti MULTI_NAME=vlmcsdmulti-iOS-6.1-armv7 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" && \
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" && \
make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-iOS-5.1-armv7-clang3.4 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" && \
#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/iOS5.1-MacOS-Lion/usr/bin:$PATH make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-iOS-5.1-armv6-clang3.1 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" && \
#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.* && \
@ -56,19 +43,13 @@ PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmult
#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 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 vlmcsdmulti-MacOSX-ppc MULTI_NAME=vlmcsdmulti-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0"
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj allmulti SAFE_MODE=1 MULTI_NAME=vlmcsdmulti-MacOSX-ppc 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" && \
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" && \
make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-MacOSX-x86-gcc CLIENT_NAME=vlmcs-MacOSX-x86-gcc PROGRAM_NAME=vlmcsd-MacOSX-x86-gcc CC=gcc-6 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-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS allmulti MULTI_NAME=vlmcsdmulti-MacOSX-x64-gcc CLIENT_NAME=vlmcs-MacOSX-x64-gcc PROGRAM_NAME=vlmcsd-MacOSX-x64-gcc CC=gcc-6 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-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
# Sign the iOS binaries
#ldid -S *iOS*
@ -88,7 +69,7 @@ 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-floppy.7 vlmcsd.7 /usr/local/share/man/man7
sudo cp -p vlmcsd.ini.5 //usr/local/share/man/man5
# Copy the stuff to distribution server

View File

@ -1,5 +1,6 @@
#!/bin/sh
export VLMCSD_VERSION="svn`svnversion`"
export VERBOSE=3
export CAT=2
@ -10,7 +11,7 @@ fi
SOLARIS_VERSION=`uname -v`
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsd-Solaris* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j`nproc`"
@ -24,9 +25,7 @@ LF="-fwhole-program -Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
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"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld MULTI_NAME=vlmcsdmulti-Solaris$SOLARIS_VERSION-x86 CLIENT_NAME=vlmcs-Solaris$SOLARIS_VERSION-x86 PROGRAM_NAME=vlmcsd-Solaris$SOLARIS_VERSION-x86 CC=gcc CFLAGS="$CF" LDFLAGS="$LF" allmulti
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"
@ -39,9 +38,7 @@ 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"
gmake $MAKEFLAGS LD_ALTEXEC=/usr/bin/gld 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" allmulti
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"
@ -54,4 +51,4 @@ gstrip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-sect
#sstrip -z vlmcs-* vlmcsd-*
# Copy stuff to distribution server
scp -p vlmcsd-* vlmcs-* vlmcsdmulti-* root@ubuntu64:x/binaries/Solaris/intel
scp -p vlmcsd-Sola* vlmcs-* vlmcsdmulti-* root@ubuntu64:x/binaries/Solaris/intel

View File

@ -1,6 +1,16 @@
#!/bin/bash
rm -f cygkms*.dll libkms*.dll vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* vlmcsd.exe vlmcs.exe vlmcsdmulti.exe 2> /dev/null
export VLMCSD_VERSION="svn`svnversion`"
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"
rm -f cygkms*.dll libkms*.dll vlmcs-* vlmcsd-win* vlmcsd-cyg* vlmcsdmulti-* *_all.* vlmcsd.exe vlmcs.exe vlmcsdmulti.exe 2> /dev/null
export ExternalCompilerOptions="/D VERSION=\"\\\"$version\\\"\" /D BUILD_TIME=$(date '+%s')"
"$msbuild" VisualStudio/vlmcsd-2015-with-2013-c++-build-tools.sln /t:Rebuild /p:Configuration=Release /p:Platform=x86 /m /v:m
"$msbuild" VisualStudio/vlmcsd-2015-with-2013-c++-build-tools.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /m /v:m
export CAT=2
export VERBOSE=3
@ -10,18 +20,18 @@ CF="-Wno-missing-braces -fno-common -fno-exceptions -fno-non-call-exceptions -fn
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"
LFWIN32="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware"
LFWIN64="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware"
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"
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"
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"
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"
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"
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 allmulti 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 allmulti 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
@ -33,20 +43,26 @@ make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-m
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 libkms32-gcc.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms32-gcc.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32"
make $MAKEFLAGS libkms64-gcc.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=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=windows CLIENT_NAME=vlmcs-Windows-x86-gcc PROGRAM_NAME=vlmcsd-Windows-x86-gcc MULTI_NAME=vlmcsdmulti-Windows-x86-gcc CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
make $MAKEFLAGS allmulti THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x64-gcc PROGRAM_NAME=vlmcsd-Windows-x64-gcc MULTI_NAME=vlmcsdmulti-Windows-x64-gcc CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
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"
make -Bj allmulti 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 -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
make $MAKEFLAGS allmulti 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 -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
#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/*Windows* root@ubuntu64:x/binaries/Windows/intel/libkms* .
echo ""
echo "Installing binaries"
@ -56,10 +72,11 @@ 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
cp -p vlmcsd-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcsd.exe
cp -p vlmcs-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcs.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 &
#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"
@ -68,12 +85,12 @@ 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.7 vlmcsd-floppy.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 &
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 vlmcsd-* vlmcs-* vlmcsdmulti-* *.dll root@ubuntu64:x/binaries/Windows/intel
scp -p vlmcsd-cyg* vlmcsd-Win* vlmcs-* vlmcsdmulti-* *.dll root@ubuntu64:x/binaries/Windows/intel

View File

@ -72,13 +72,13 @@ RpcCtx connectToAddress(char *const addr, const int AddressFamily_unused, int_fa
if ((status = createStringBinding(addr, &stringBinding)) != RPC_S_OK)
{
errorout("%s\n", win_strerror(status));
printerrorf("%s\n", win_strerror(status));
return !0;
}
if (PreviousRpcCallFailed)
{
errorout("%s\n", win_strerror(PreviousRpcCallFailed));
printerrorf("%s\n", win_strerror(PreviousRpcCallFailed));
return !0;
}

View File

@ -2,11 +2,13 @@
* msrpc-client.h
*/
#ifdef USE_MSRPC
#ifndef MSRPC_CLIENT_H_
#define MSRPC_CLIENT_H_
#include "types.h"
#include <setjmp.h>
#include "output.h"
typedef int_fast8_t RpcCtx;
typedef RPC_STATUS RpcStatus;
@ -18,5 +20,6 @@ RpcStatus rpcSendRequest(const RpcCtx handle, BYTE* KmsRequest, size_t requestSi
RpcStatus closeRpc(RpcCtx s);
#define INVALID_RPCCTX ((RpcCtx)~0)
#endif // USE_MSRPC
#endif /* MSRPC_CLIENT_H_ */

View File

@ -9,6 +9,10 @@
#error MSRPC is only available with native Windows or Cygwin
#endif
#if _WIN32 && !defined(NO_PRIVATE_IP_DETECT)
#include <winsock2.h>
#endif
#include "msrpc-server.h"
#include "output.h"
#include "kms.h"
@ -157,6 +161,56 @@ RPC_STATUS getClientIp(const RPC_BINDING_HANDLE clientBinding, RPC_CSTR *ipAddre
#endif // NO_LOG
#ifndef NO_PRIVATE_IP_DETECT
static int_fast8_t IsPrivateIPAddress(char* ipAddress)
{
int family = strchr(ipAddress,'.') ? AF_INET : AF_INET6;
switch(family)
{
case AF_INET:
{
int i;
char* current;
char* next;
uint32_t ip;
for (ip = 0, i = 0, current = ipAddress; i < 4; i++, current = next + 1)
{
ip = (ip << 8) | strtoul(current, &next, 10);
if (*next != '.') break;
}
if
(
(ip & 0xff000000) == 0x7f000000 || // 127.x.x.x localhost
(ip & 0xffff0000) == 0xc0a80000 || // 192.168.x.x private routeable
(ip & 0xffff0000) == 0xa9fe0000 || // 169.254.x.x link local
(ip & 0xff000000) == 0x0a000000 || // 10.x.x.x private routeable
(ip & 0xfff00000) == 0xac100000 // 172.16-31.x.x private routeable
)
{
return TRUE;
}
break;
}
case AF_INET6:
{
if (!strcmp(ipAddress, "::1")) return TRUE;
if (strchr(ipAddress, ':') - ipAddress != 4) break;
int16_t firstWord;
hex2bin((BYTE*)&firstWord, ipAddress, 2);
if ((BE16(firstWord) & 0xe000) != 0x2000) return TRUE;
}
}
return FALSE;
}
#endif // NO_PRIVATE_IP_DETECT
/*
* This is the callback function for the RPC request as defined in KMSServer.idl
@ -167,7 +221,7 @@ int ProcessActivationRequest(handle_t IDL_handle, int requestSize, unsigned char
{
RPC_CSTR clientIpAddress;
RPC_STATUS result;
int status = RPC_S_OK;
int status = 0;
result = getClientIp(IDL_handle, &clientIpAddress);
@ -177,29 +231,63 @@ int ProcessActivationRequest(handle_t IDL_handle, int requestSize, unsigned char
# endif // NO_LOG
# ifndef NO_PRIVATE_IP_DETECT
if (result && (PublicIPProtectionLevel & 2))
{
# ifndef NO_LOG
logger ("Cannot verify that client has a private IP address\n");
# endif
return 0x80070000 | RPC_S_ACCESS_DENIED;
}
if (!result && (PublicIPProtectionLevel & 2) && !IsPrivateIPAddress((char*)clientIpAddress))
{
# ifndef NO_LOG
logger("Client with public IP address rejected\n");
# endif
RpcStringFreeA(&clientIpAddress);
return 0x80070000 | RPC_S_ACCESS_DENIED;
}
# endif // NO_PRIVATE_IP_DETECT
// Discard any packet smaller than a v4 request
if (requestSize < (int)sizeof(REQUEST_V4))
{
if (!result) RpcStringFreeA(&clientIpAddress);
return RPC_S_CANNOT_SUPPORT;
return 0x8007000D;
}
*response = (uint8_t *)midl_user_allocate(MAX_RESPONSE_SIZE);
int kmsStatus = 0x8007000D;
int version = LE32(((REQUEST*)(request))->Version);
switch(LE16(((REQUEST*)(request))->MajorVer))
switch(version)
{
case 4:
*responseSize = CreateResponseV4((REQUEST_V4 *)request, *response, (char*)clientIpAddress);
case 0x40000:
kmsStatus = CreateResponseV4((REQUEST_V4 *)request, *response, (char*)clientIpAddress);
break;
case 5:
case 6:
*responseSize = CreateResponseV6((REQUEST_V6 *) request, *response, (char*)clientIpAddress);
case 0x50000:
case 0x60000:
kmsStatus = CreateResponseV6((REQUEST_V6 *) request, *response, (char*)clientIpAddress);
break;
default:
status = RPC_S_INVALID_ARG;
# ifndef NO_LOG
logger("Fatal: KMSv%u.%u unsupported\n", version >> 16, version & 0xffff);
# endif // NO_LOG
break;
}
if (kmsStatus < 0)
{
status = kmsStatus;
}
else
{
*responseSize = kmsStatus;
}
if (!result) RpcStringFreeA(&clientIpAddress);
return status;
}

107
netlink-musl.h Normal file
View File

@ -0,0 +1,107 @@
#ifndef NETLINK_MUSL_H
#define NETLINK_MUSL_H
#if !__linux__
#error netlink-musl.h only works with a linux kernel
#endif
#if __ANDROID__
#error netlink-musl.h does not work with Android
#endif
#include <stdint.h>
/* linux/netlink.h */
#define NETLINK_ROUTE 0
struct nlmsghdr {
uint32_t nlmsg_len;
uint16_t nlmsg_type;
uint16_t nlmsg_flags;
uint32_t nlmsg_seq;
uint32_t nlmsg_pid;
};
#define NLM_F_REQUEST 1
#define NLM_F_MULTI 2
#define NLM_F_ACK 4
#define NLM_F_ROOT 0x100
#define NLM_F_MATCH 0x200
#define NLM_F_ATOMIC 0x400
#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
#define NLMSG_NOOP 0x1
#define NLMSG_ERROR 0x2
#define NLMSG_DONE 0x3
#define NLMSG_OVERRUN 0x4
/* linux/rtnetlink.h */
#define RTM_NEWLINK 16
#define RTM_GETLINK 18
#define RTM_NEWADDR 20
#define RTM_GETADDR 22
struct rtattr {
unsigned short rta_len;
unsigned short rta_type;
};
struct rtgenmsg {
unsigned char rtgen_family;
};
struct ifinfomsg {
unsigned char ifi_family;
unsigned char __ifi_pad;
unsigned short ifi_type;
int ifi_index;
unsigned ifi_flags;
unsigned ifi_change;
};
/* linux/if_link.h */
#define IFLA_ADDRESS 1
#define IFLA_BROADCAST 2
#define IFLA_IFNAME 3
#define IFLA_STATS 7
/* linux/if_addr.h */
struct ifaddrmsg {
uint8_t ifa_family;
uint8_t ifa_prefixlen;
uint8_t ifa_flags;
uint8_t ifa_scope;
uint32_t ifa_index;
};
#define IFA_ADDRESS 1
#define IFA_LOCAL 2
#define IFA_LABEL 3
#define IFA_BROADCAST 4
/* musl */
#define NETLINK_ALIGN(len) (((len)+3) & ~3)
#define NLMSG_DATA(nlh) ((void*)((char*)(nlh)+sizeof(struct nlmsghdr)))
#define NLMSG_DATALEN(nlh) ((nlh)->nlmsg_len-sizeof(struct nlmsghdr))
#define NLMSG_DATAEND(nlh) ((char*)(nlh)+(nlh)->nlmsg_len)
#define NLMSG_NEXT(nlh) (struct nlmsghdr*)((char*)(nlh)+NETLINK_ALIGN((nlh)->nlmsg_len))
#define NLMSG_OK(nlh,end) ((char*)(end)-(char*)(nlh) >= sizeof(struct nlmsghdr))
#define RTA_DATA(rta) ((void*)((char*)(rta)+sizeof(struct rtattr)))
#define RTA_DATALEN(rta) ((rta)->rta_len-sizeof(struct rtattr))
#define RTA_DATAEND(rta) ((char*)(rta)+(rta)->rta_len)
#define RTA_NEXT(rta) (struct rtattr*)((char*)(rta)+NETLINK_ALIGN((rta)->rta_len))
#define RTA_OK(nlh,end) ((char*)(end)-(char*)(rta) >= sizeof(struct rtattr))
#define NLMSG_RTA(nlh,len) ((void*)((char*)(nlh)+sizeof(struct nlmsghdr)+NETLINK_ALIGN(len)))
#define NLMSG_RTAOK(rta,nlh) RTA_OK(rta,NLMSG_DATAEND(nlh))
int __rtnetlink_enumerate(int link_af, int addr_af, int (*cb)(void *ctx, struct nlmsghdr *h), void *ctx);
#endif // NETLINK_MUSL_H

425
network.c
View File

@ -9,23 +9,42 @@
#define _GNU_SOURCE
#endif
#include "types.h"
#if HAVE_GETIFADDR && _WIN32
#include <iphlpapi.h>
#endif
#include <string.h>
#ifndef _WIN32
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <netinet/in.h>
#endif // WIN32
#include <sys/types.h>
#if HAVE_GETIFADDR
#if __ANDROID__
#include "ifaddrs-android.h"
#elif defined(GETIFADDRS_MUSL)
#include "ifaddrs-musl.h"
#else // getifaddrs from OS
#include <ifaddrs.h>
#endif // getifaddrs from OS
#endif // HAVE_GETIFADDR
#endif // !WIN32
#include "network.h"
#include "endian.h"
#include "output.h"
//#include "output.h"
#include "helpers.h"
#include "shared_globals.h"
#include "rpc.h"
#ifndef _WIN32
typedef ssize_t (*sendrecv_t)(int, void*, size_t, int);
#else
@ -72,7 +91,7 @@ static int_fast8_t ip2str(char *restrict result, const size_t resultLength, cons
return FALSE;
}
if ((unsigned int)snprintf(result, resultLength, socketAddress->sa_family == AF_INET6 ? fIPv6 : fIPv4, ipAddress, portNumber) > resultLength) return FALSE;
if ((unsigned int)vlmcsd_snprintf(result, resultLength, socketAddress->sa_family == AF_INET6 ? fIPv6 : fIPv4, ipAddress, portNumber) > resultLength) return FALSE;
return TRUE;
}
@ -147,6 +166,69 @@ int_fast8_t isDisconnected(const SOCKET s)
}
#if !defined(NO_PRIVATE_IP_DETECT)
// Check, if a sockaddr is a private IPv4 or IPv6 address
static int_fast8_t isPrivateIPAddress(struct sockaddr* addr, socklen_t* length)
{
union v6addr
{
uint8_t bytes[16];
uint16_t words[8];
uint32_t dwords[4];
uint64_t qwords[2];
};
if (addr == NULL) return FALSE;
switch (addr->sa_family)
{
case AF_INET6:
{
union v6addr* ipv6addr = (union v6addr*)&((struct sockaddr_in6*)addr)->sin6_addr;
if
(
(ipv6addr->qwords[0] != 0 || BE64(ipv6addr->qwords[1]) != 1) && // ::1 IPv6 localhost
(BE16(ipv6addr->words[0]) & 0xe000) == 0x2000 // !2000::/3
)
{
return FALSE;
}
if (length) *length = sizeof(struct sockaddr_in6);
break;
}
case AF_INET:
{
uint32_t ipv4addr = BE32(((struct sockaddr_in*)addr)->sin_addr.s_addr);
if
(
(ipv4addr & 0xff000000) != 0x7f000000 && // 127.x.x.x localhost
(ipv4addr & 0xffff0000) != 0xc0a80000 && // 192.168.x.x private routeable
(ipv4addr & 0xffff0000) != 0xa9fe0000 && // 169.254.x.x link local
(ipv4addr & 0xff000000) != 0x0a000000 && // 10.x.x.x private routeable
(ipv4addr & 0xfff00000) != 0xac100000 // 172.16-31.x.x private routeable
)
{
return FALSE;
}
if (length) *length = sizeof(struct sockaddr_in);
break;
}
default:
return FALSE;
}
return TRUE;
}
#endif // !defined(NO_PRIVATE_IP_DETECT)
// Connect to TCP address addr (e.g. "kms.example.com:1688") and return an
// open socket for the connection if successful or INVALID_SOCKET otherwise
SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fast8_t showHostName)
@ -162,7 +244,7 @@ SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fas
// struct sockaddr_in* addr4 = (struct sockaddr_in*)sa->ai_addr;
// struct sockaddr_in6* addr6 = (struct sockaddr_in6*)sa->ai_addr;
if (ip2str(szAddr, sizeof(szAddr), sa->ai_addr, sa->ai_addrlen))
if (ip2str(szAddr, sizeof(szAddr), sa->ai_addr, (socklen_t)sa->ai_addrlen))
{
if (showHostName)
printf("Connecting to %s (%s) ... ", addr, szAddr);
@ -191,13 +273,13 @@ SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fas
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (sockopt_t)&to, sizeof(to));
# endif // !defined(NO_TIMEOUT) && !__minix__
if (!connect(s, sa->ai_addr, sa->ai_addrlen))
if (!connect(s, sa->ai_addr, (int)sa->ai_addrlen))
{
printf("successful\n");
break;
}
errorout("%s\n", socket_errno == VLMCSD_EINPROGRESS ? "Timed out" : vlmcsd_strerror(socket_errno));
printerrorf("%s: %s\n", szAddr, socket_errno == VLMCSD_EINPROGRESS ? "Timed out" : vlmcsd_strerror(socket_errno));
socketclose(s);
s = INVALID_SOCKET;
@ -207,8 +289,229 @@ SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fas
return s;
}
// fix for lame tomato toolchain
# if !defined(IPV6_V6ONLY) && defined(__linux__)
# define IPV6_V6ONLY (26)
# endif // !defined(IPV6_V6ONLY) && defined(__linux__)
#ifndef NO_SOCKETS
#ifdef SIMPLE_SOCKETS
static int_fast8_t allowSocketReuse(SOCKET s)
{
# if !defined(_WIN32) && !defined(__CYGWIN__)
BOOL socketOption = TRUE;
# else // _WIN32
BOOL socketOption = FALSE;
# endif // _WIN32
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC
printerrorf("Warning: Socket option SO_REUSEADDR unsupported: %s\n", vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
return 0;
}
int listenOnAllAddresses()
{
uint32_t port_listen;
if (!stringToInt(defaultport, 1, 65535, &port_listen))
{
printerrorf("Fatal: Port must be numeric between 1 and 65535.\n");
exit(!0);
}
struct sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));
addr.sin6_family = AF_INET6;
addr.sin6_port = BE16((uint16_t)port_listen);
addr.sin6_addr = in6addr_any;
BOOL v6only = FALSE;
s_server = socket(AF_INET6, SOCK_STREAM, 0);
if (s_server == INVALID_SOCKET
|| allowSocketReuse(s_server)
|| setsockopt(s_server, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&v6only, sizeof(v6only))
|| bind(s_server, (struct sockaddr *)&addr, sizeof(addr))
|| listen(s_server, SOMAXCONN) )
{
socketclose(s_server);
struct sockaddr_in addr = {
.sin_family = AF_INET,
.sin_port = BE16((uint16_t)port_listen),
};
addr.sin_addr.s_addr = BE32(INADDR_ANY);
s_server = socket(AF_INET, SOCK_STREAM, 0);
if ( s_server == INVALID_SOCKET
|| allowSocketReuse(s_server)
|| bind(s_server, (struct sockaddr *)&addr, sizeof(addr))
|| listen(s_server, SOMAXCONN) )
{
int error = socket_errno;
printerrorf("Fatal: Cannot bind to TCP port %u: %s\n", port_listen, vlmcsd_strerror(error));
return error;
}
}
#ifndef NO_LOG
logger("Listening on TCP port %u\n", port_listen);
#endif // NO_LOG
return 0;
}
#else // !SIMPLE_SOCKETS
#if HAVE_GETIFADDR && !defined(NO_PRIVATE_IP_DETECT)
// Get list of private IP addresses.
// Returns 0 on success or an errno error code on failure
void getPrivateIPAddresses(int* numAddresses, char*** ipAddresses)
{
# if _WIN32
PIP_ADAPTER_ADDRESSES firstAdapter, currentAdapter;
DWORD dwRetVal = NO_ERROR;
ULONG outBufLen = 16384;
ULONG flags = GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME;
firstAdapter = (PIP_ADAPTER_ADDRESSES)vlmcsd_malloc(outBufLen);
if ((dwRetVal = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, firstAdapter, &outBufLen)) == ERROR_BUFFER_OVERFLOW)
{
free(firstAdapter);
firstAdapter = (PIP_ADAPTER_ADDRESSES)vlmcsd_malloc(outBufLen);
dwRetVal = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, firstAdapter, &outBufLen);
}
if (dwRetVal != NO_ERROR)
{
printerrorf("FATAL: Could not get network address list: %s\n", vlmcsd_strerror(dwRetVal));
exit(dwRetVal);
}
for (currentAdapter = firstAdapter, *numAddresses = 0; currentAdapter != NULL; currentAdapter = currentAdapter->Next)
{
PIP_ADAPTER_UNICAST_ADDRESS currentAddress;
int length;
if (currentAdapter->OperStatus != IfOperStatusUp) continue;
for (currentAddress = currentAdapter->FirstUnicastAddress; currentAddress != NULL; currentAddress = currentAddress->Next)
{
if (isPrivateIPAddress(currentAddress->Address.lpSockaddr, &length)) (*numAddresses)++;
}
}
*ipAddresses = (char**)vlmcsd_malloc(*numAddresses * sizeof(char*));
for (currentAdapter = firstAdapter, *numAddresses = 0; currentAdapter != NULL; currentAdapter = currentAdapter->Next)
{
PIP_ADAPTER_UNICAST_ADDRESS currentAddress;
int length;
if (currentAdapter->OperStatus != IfOperStatusUp) continue;
for (currentAddress = currentAdapter->FirstUnicastAddress; currentAddress != NULL; currentAddress = currentAddress->Next)
{
if (!isPrivateIPAddress(currentAddress->Address.lpSockaddr, &length)) continue;
char *ipAddress = (char*)vlmcsd_malloc(64);
int error = getnameinfo(currentAddress->Address.lpSockaddr, currentAddress->Address.iSockaddrLength, ipAddress, 64, NULL, 0, NI_NUMERICHOST);
if (error)
{
printerrorf("WARNING: Could not get IP address from interface list: %s\n", gai_strerror(error));
*ipAddress = 0;
}
(*ipAddresses)[(*numAddresses)++] = ipAddress;
}
}
free(firstAdapter);
# else // !_WIN32
struct ifaddrs *addrs, *addr;
if (getifaddrs(&addrs))
{
printerrorf("FATAL: Could not get network address list: %s\n", vlmcsd_strerror(errno));
exit(errno);
}
socklen_t length;
for (addr = addrs, *numAddresses = 0; addr != NULL; addr = addr->ifa_next)
{
if (!isPrivateIPAddress(addr->ifa_addr, &length)) continue;
(*numAddresses)++;
}
*ipAddresses = (char**)vlmcsd_malloc(*numAddresses * sizeof(char*));
for (addr = addrs, *numAddresses = 0; addr != NULL; addr = addr->ifa_next)
{
if (!isPrivateIPAddress(addr->ifa_addr, &length)) continue;
char *ipAddress = (char*)vlmcsd_malloc(64);
int error = getnameinfo(addr->ifa_addr, length, ipAddress, 64, NULL, 0, NI_NUMERICHOST);
if (error)
{
printerrorf("WARNING: Could not get IP address from interface list: %s\n", gai_strerror(error));
*ipAddress = 0;
}
# if __UCLIBC__ || __gnu_hurd__
size_t adrlen = strlen(ipAddress);
if
(
addr->ifa_addr->sa_family == AF_INET6 &&
adrlen > 5 &&
!strchr(ipAddress, '%') &&
(BE16(*(uint16_t*)&((struct sockaddr_in6*)addr->ifa_addr)->sin6_addr) & 0xffc0) == 0xfe80
)
{
size_t ifnamelen = strlen(addr->ifa_name);
char* workaroundIpAddress = (char*)vlmcsd_malloc(adrlen + ifnamelen + 2);
strcpy(workaroundIpAddress, ipAddress);
strcat(workaroundIpAddress, "%");
strcat(workaroundIpAddress, addr->ifa_name);
(*ipAddresses)[(*numAddresses)++] = workaroundIpAddress;
free(ipAddress);
}
else
{
(*ipAddresses)[(*numAddresses)++] = ipAddress;
}
# else // !__UCLIBC__
(*ipAddresses)[(*numAddresses)++] = ipAddress;
# endif // !__UCLIBC__
}
freeifaddrs(addrs);
# endif // !_WIN32
}
#endif // HAVE_GETIFADDR && !defined(NO_PRIVATE_IP_DETECT)
// Create a Listening socket for addrinfo sa and return socket s
// szHost and szPort are for logging only
@ -217,7 +520,7 @@ static int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)
int error;
char ipstr[64];
ip2str(ipstr, sizeof(ipstr), ai->ai_addr, ai->ai_addrlen);
ip2str(ipstr, sizeof(ipstr), ai->ai_addr, (socklen_t)ai->ai_addrlen);
//*s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
*s = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);
@ -249,22 +552,69 @@ static int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)
BOOL socketOption = TRUE;
// fix for lame tomato toolchain
# ifndef IPV6_V6ONLY
# ifdef __linux__
# define IPV6_V6ONLY (26)
# endif // __linux__
# endif // IPV6_V6ONLY
# ifdef IPV6_V6ONLY
if (ai->ai_family == AF_INET6) setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&socketOption, sizeof(socketOption));
if (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC
# if defined(_WIN32) || defined(__CYGWIN__)
// if (IsWindowsVistaOrGreater()) //Doesn't work with older version of MingW32-w64 toolchain
if ((GetVersion() & 0xff) > 5)
# endif // _WIN32
printerrorf("Warning: %s does not support socket option IPV6_V6ONLY: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
# endif
# ifndef _WIN32
setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption));
# endif
if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC
printerrorf("Warning: %s does not support socket option SO_REUSEADDR: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
# endif // _WIN32
if (bind(*s, ai->ai_addr, ai->ai_addrlen) || listen(*s, SOMAXCONN))
# if HAVE_FREEBIND
# if (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)
# define IPV6_BINDANY 64
# endif // (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)
if (freebind)
{
# if defined(IP_FREEBIND) // Linux
if (setsockopt(*s, IPPROTO_IP, IP_FREEBIND, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use FREEBIND on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_FREEBIND)
# if defined(IP_BINDANY) // FreeBSD IPv4
if (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_BINDANY)
# if defined(IPV6_BINDANY) // FreeBSD IPv6
if (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IP, IPV6_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC // FreeBSD defines the symbol but doesn't have BINDANY in IPv6 (Kame stack doesn't have it)
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif
}
# endif // defined(IPV6_BINDANY)
# if defined(IP_NONLOCALOK) && !defined(IP_BINDANY) // FreeBSD with GNU userspace IPv4
if (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_NONLOCALOK, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_NONLOCALOK) && !defined(IP_BINDANY)
}
# endif // HAVE_FREEBIND
if (bind(*s, ai->ai_addr, (int)ai->ai_addrlen) || listen(*s, SOMAXCONN))
{
error = socket_errno;
printerrorf("Warning: %s: %s\n", ipstr, vlmcsd_strerror(error));
@ -279,7 +629,6 @@ static int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)
return 0;
}
// Adds a listening socket for an address string,
// e.g. 127.0.0.1:1688 or [2001:db8:dead:beef::1]:1688
BOOL addListeningSocket(const char *const addr)
@ -346,7 +695,7 @@ static SOCKET network_accept_any()
if (SocketList[i] > maxSocket) maxSocket = SocketList[i];
}
status = select(maxSocket + 1, &ListeningSocketsList, NULL, NULL, NULL);
status = select((int)maxSocket + 1, &ListeningSocketsList, NULL, NULL, NULL);
if (status < 0) return INVALID_SOCKET;
@ -366,10 +715,18 @@ static SOCKET network_accept_any()
else
return accept(sock, NULL, NULL);
}
#endif // !SIMPLE_SOCKETS
void closeAllListeningSockets()
{
# ifdef SIMPLE_SOCKETS
shutdown(s_server, VLMCSD_SHUT_RDWR);
socketclose(s_server);
# else // !SIMPLE_SOCKETS
int i;
for (i = 0; i < numsockets; i++)
@ -377,6 +734,8 @@ void closeAllListeningSockets()
shutdown(SocketList[i], VLMCSD_SHUT_RDWR);
socketclose(SocketList[i]);
}
#endif // !SIMPLE_SOCKETS
}
#endif // NO_SOCKETS
@ -440,8 +799,25 @@ static void serveClient(const SOCKET s_client, const DWORD RpcAssocGroup)
logger(fIP, connection_type, cAccepted, ipstr);
#endif // NO_LOG
# if !defined(NO_PRIVATE_IP_DETECT)
if (!(PublicIPProtectionLevel & 2) || isPrivateIPAddress((struct sockaddr*)&addr, NULL))
{
rpcServer(s_client, RpcAssocGroup, ipstr);
}
# ifndef NO_LOG
else
{
logger("Client with public IP address rejected\n");
}
# endif // NO_LOG
# else // defined(NO_PRIVATE_IP_DETECT)
rpcServer(s_client, RpcAssocGroup, ipstr);
# endif // defined(NO_PRIVATE_IP_DETECT)
# ifndef NO_LOG
logger(fIP, connection_type, cClosed, ipstr);
# endif // NO_LOG
@ -494,7 +870,7 @@ static void *serveClientThreadProc (PCLDATA clData)
#ifndef NO_SOCKETS
#if defined(USE_THREADS) && (defined(_WIN32) || defined(__CYGWIN__)) // Windows Threads
static int serveClientAsyncWinThreads(const PCLDATA thr_CLData)
static int serveClientAsyncWinThreads(PCLDATA thr_CLData)
{
wait_sem();
@ -641,13 +1017,16 @@ int runServer()
return 0;
}
// Standalone mode
for (;;)
{
int error;
SOCKET s_client;
#ifdef SIMPLE_SOCKETS
if ( (s_client = accept(s_server, NULL, NULL)) == INVALID_SOCKET )
#else // Standalone mode fully featured sockets
if ( (s_client = network_accept_any()) == INVALID_SOCKET )
#endif // Standalone mode fully featured sockets
{
error = socket_errno;

View File

@ -11,8 +11,15 @@
#endif
#include "types.h"
#include "output.h"
#if _MSC_VER
//typedef signed char int_fast8_t;
//typedef unsigned char BYTE;
//typedef UINT_PTR size_t;
//typedef unsigned long DWORD;
#define STDIN_FILENO 0
#endif
int_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send);
@ -22,9 +29,16 @@ int_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send);
#ifndef NO_SOCKETS
void closeAllListeningSockets();
#ifdef SIMPLE_SOCKETS
int listenOnAllAddresses();
#endif // SIMPLE_SOCKETS
BOOL addListeningSocket(const char *const addr);
__pure int_fast8_t checkProtocolStack(const int addressfamily);
#if HAVE_GETIFADDR
void getPrivateIPAddresses(int* numAddresses, char*** ipAddresses);
#endif // HAVE_GETIFADDR
#endif // NO_SOCKETS
int runServer();

View File

@ -14,7 +14,7 @@
SERVICE_STATUS gSvcStatus;
SERVICE_STATUS_HANDLE gSvcStatusHandle;
static VOID WINAPI ServiceCtrlHandler(const DWORD dwCtrl)
VOID WINAPI ServiceCtrlHandler(DWORD dwCtrl)
{
// Handle the requested control code.

442
output.c
View File

@ -2,6 +2,10 @@
#define _DEFAULT_SOURCE
#endif // _DEFAULT_SOURCE
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
@ -51,11 +55,14 @@ static void vlogger(const char *message, va_list args)
char mbstr[24];
#endif
strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %X", localtime(&now));
if (LogDateAndTime)
strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %X: ", localtime(&now));
else
*mbstr = 0;
#ifndef USE_THREADS
fprintf(log, "%s: ", mbstr);
fprintf(log, "%s", mbstr);
vfprintf(log, message, args);
fflush(log);
@ -63,12 +70,15 @@ static void vlogger(const char *message, va_list args)
// We write everything to a string before we really log inside the critical section
// so formatting the output can be concurrent
strcat(mbstr, ": ");
int len = strlen(mbstr);
vsnprintf(mbstr + len, sizeof(mbstr) - len, message, args);
int len = (int)strlen(mbstr);
//# if !_MSC_VER
vlmcsd_vsnprintf(mbstr + len, sizeof(mbstr) - len, message, args);
//# else
// wvsprintf(mbstr + len, message, args);
//# endif
lock_mutex(&logmutex);
fputs(mbstr, log);
fprintf(log, "%s", mbstr);
fflush(log);
unlock_mutex(&logmutex);
@ -92,27 +102,39 @@ int logger(const char *const fmt, ...)
// Output to stderr if it is available or to log otherwise (e.g. if running as daemon/service)
void printerrorf(const char *const fmt, ...)
int printerrorf(const char *const fmt, ...)
{
int error = errno;
va_list arglist;
va_start(arglist, fmt);
#ifndef NO_LOG
#ifdef _NTSERVICE
# ifdef IS_LIBRARY
size_t len = strlen(ErrorMessage);
vlmcsd_vsnprintf(ErrorMessage + len, MESSAGE_BUFFER_SIZE - len - 1, fmt, arglist);
# else // !IS_LIBRARY
# ifndef NO_LOG
# ifdef _NTSERVICE
if (InetdMode || IsNTService)
#else // !_NTSERVICE
# else // !_NTSERVICE
if (InetdMode)
#endif // NTSERVIICE
# endif // NTSERVIICE
vlogger(fmt, arglist);
else
#endif //NO_LOG
# endif //NO_LOG
# endif // IS_LIBRARY
{
vfprintf(stderr, fmt, arglist);
fflush(stderr);
}
va_end(arglist);
errno = error;
return 0;
}
@ -130,10 +152,12 @@ int errorout(const char* fmt, ...)
}
#ifndef NO_VERBOSE_LOG
static const char *LicenseStatusText[] =
{
"Unlicensed", "Licensed", "OOB grace", "OOT grace", "Non-Genuine", "Notification", "Extended grace"
};
#endif // NO_VERBOSE_LOG
void uuid2StringLE(const GUID *const guid, char *const string)
@ -152,7 +176,7 @@ void uuid2StringLE(const GUID *const guid, char *const string)
);
}
#if !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
{
char guidBuffer[GUID_STRING_LENGTH + 1];
@ -177,17 +201,11 @@ void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
productName = "Unknown";
#endif
p("Activation ID (Product) : %s (%s)\n", guidBuffer, productName);
p("SKU ID (aka Activation ID) : %s (%s)\n", guidBuffer, productName);
uuid2StringLE(&Request->KMSID, guidBuffer);
#ifndef NO_BASIC_PRODUCT_LIST
productName = getProductNameLE(&Request->KMSID, ProductList, &index);
#else
productName = "Unknown";
#endif
p("Key Management Service ID : %s (%s)\n", guidBuffer, productName);
p("KMS ID (aka KMS counted ID) : %s (%s)\n", guidBuffer, productName);
uuid2StringLE(&Request->CMID, guidBuffer);
p("Client machine ID : %s\n", guidBuffer);
@ -208,7 +226,6 @@ void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
p("N count policy (minimum clients): %u\n", (uint32_t)LE32(Request->N_Policy));
}
void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p)
{
char guidBuffer[GUID_STRING_LENGTH + 1];
@ -237,4 +254,385 @@ void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RE
p("Renewal interval policy : %u\n", (uint32_t)LE32(response->VLRenewalInterval));
p("Activation interval policy : %u\n", (uint32_t)LE32(response->VLActivationInterval));
}
#endif // !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)
#ifndef NO_VERSION_INFORMATION
void printPlatform()
{
int testNumber = 0x1234;
# ifdef VLMCSD_COMPILER
printf
(
"Compiler: %s\n", VLMCSD_COMPILER
# ifdef __VERSION__
" " __VERSION__
# endif // __VERSION__
);
# endif // VLMCSD_COMPILER
printf
(
"Intended platform:%s %s\n", ""
# if __i386__ || _M_IX86
" Intel x86"
# endif
# if __x86_64__ || __amd64__ || _M_X64 || _M_AMD64
" Intel x86_64"
# endif
# if _M_ARM || __arm__
" ARM"
# endif
# if __thumb__
" thumb"
# endif
# if __aarch64__
" ARM64"
# endif
# if __hppa__
" HP/PA RISC"
# endif
# if __ia64__
" Intel Itanium"
# endif
# if __mips__
" MIPS"
# endif
# if defined(_MIPS_ARCH)
" " _MIPS_ARCH
# endif
# if __mips16
" mips16"
# endif
# if __mips_micromips
" micromips"
# endif
# if __ppc__ || __powerpc__
" PowerPC"
# endif
# if __powerpc64__ || __ppc64__
" PowerPC64"
# endif
# if __sparc__
" SPARC"
# endif
# if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
" IBM S/390"
# endif
# if __zarch__ || __s390x__
" IBM z/Arch (S/390x)"
# endif
# if __m68k__
" Motorola 68k"
# endif
# if __ANDROID__
" Android"
# endif
# if __ANDROID_API__
" (API level " ANDROID_API_LEVEL ")"
# endif
# if __FreeBSD__ || __FreeBSD_kernel__
" FreeBSD"
# endif
# if __NetBSD__
" NetBSD"
# endif
# if __OpenBSD__
" OpenBSD"
# endif
# if __DragonFly__
" DragonFly BSD"
# endif
# if defined(__CYGWIN__) && !defined(_WIN64)
" Cygwin32"
# endif
# if defined(__CYGWIN__) && defined(_WIN64)
" Cygwin64"
# endif
# if __GNU__
" GNU"
# endif
# if __gnu_hurd__
" Hurd"
# endif
# if __MACH__
" Mach"
# endif
# if __linux__
" Linux"
# endif
# if __APPLE__ && __MACH__
" Darwin"
# endif
# if __minix__
" Minix"
# endif
# if __QNX__
" QNX"
# endif
# if __svr4__ || __SVR4
" SYSV R4"
# endif
# if (defined(__sun__) || defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
" Solaris"
# endif
# if (defined(__sun__) || defined(sun) || defined(__sun)) && !defined(__SVR4) && !defined(__svr4__)
" SunOS"
# endif
# if defined(_WIN32) && !defined(_WIN64)
" Windows32"
# endif
# if defined(_WIN32) && defined(_WIN64)
" Windows64"
# endif
# if __MVS__ || __TOS_MVS__
" z/OS"
# endif
# if defined(__GLIBC__) && !defined(__UCLIBC__)
" glibc"
# endif
# if __UCLIBC__
" uclibc"
# endif
# if defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__ANDROID__) && !defined(__BIONIC__)
" musl"
# endif
//# if _MIPSEL || __MIPSEL__ || __ARMEL__ || __THUMBEL__
// " little-endian"
//# endif
//
//# if _MIPSEB || __MIPSEB__ || __ARMEB__ || __THUMBEB__
// " big-endian"
//# endif
# if __PIE__ || __pie__
" PIE"
# endif
,
*((uint8_t*)&testNumber) == 0x34 ? "little-endian" : "big-endian"
);
}
void printCommonFlags()
{
printf
(
"Common flags:%s\n",""
# ifdef NO_EXTENDED_PRODUCT_LIST
" NO_EXTENDED_PRODUCT_LIST"
# endif // NO_EXTENDED_PRODUCT_LIST
# ifdef NO_BASIC_PRODUCT_LIST
" NO_BASIC_PRODUCT_LIST"
# endif // NO_BASIC_PRODUCT_LIST
# ifdef USE_MSRPC
" USE_MSRPC"
# endif // USE_MSRPC
# ifdef _CRYPTO_OPENSSL
" _CRYPTO_OPENSSL"
# endif // _CRYPTO_OPENSSL
# ifdef _CRYPTO_POLARSSL
" _CRYPTO_POLARSSL"
# endif // _CRYPTO_POLARSSL
# ifdef _CRYPTO_WINDOWS
" _CRYPTO_WINDOWS"
# endif // _CRYPTO_WINDOWS
# if defined(_OPENSSL_SOFTWARE) && defined(_CRYPTO_OPENSSL)
" _OPENSSL_SOFTWARE"
# endif // _OPENSSL_SOFTWARE
# if defined(_USE_AES_FROM_OPENSSL) && defined(_CRYPTO_OPENSSL)
" _USE_AES_FROM_OPENSSL"
# endif // _USE_AES_FROM_OPENSSL
# if defined(_OPENSSL_NO_HMAC) && defined(_CRYPTO_OPENSSL)
" OPENSSL_HMAC=0"
# endif // _OPENSSL_NO_HMAC
# ifdef _PEDANTIC
" _PEDANTIC"
# endif // _PEDANTIC
# ifdef INCLUDE_BETAS
" INCLUDE_BETAS"
# endif // INCLUDE_BETAS
# if __minix__ || defined(NO_TIMEOUT)
" NO_TIMEOUT=1"
# endif // __minix__ || defined(NO_TIMEOUT)
);
}
void printClientFlags()
{
printf
(
"vlmcs flags:%s\n",""
# ifdef NO_DNS
" NO_DNS=1"
# endif
# if !defined(NO_DNS)
# if defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)
" DNS_PARSER=internal"
# else // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
" DNS_PARSER=OS"
# endif // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
# endif // !defined(NO_DNS)
# if defined(DISPLAY_WIDTH)
" TERMINAL_WIDTH=" DISPLAY_WIDTH
# endif
);
}
void printServerFlags()
{
printf
(
"vlmcsd flags:%s\n",""
# ifdef NO_LOG
" NO_LOG"
# endif // NO_LOG
# ifdef NO_RANDOM_EPID
" NO_RANDOM_EPID"
# endif // NO_RANDOM_EPID
# ifdef NO_INI_FILE
" NO_INI_FILE"
# endif // NO_INI_FILE
# if !defined(NO_INI_FILE) && defined(INI_FILE)
" INI=" INI_FILE
# endif // !defined(NO_INI_FILE)
# ifdef NO_PID_FILE
" NO_PID_FILE"
# endif // NO_PID_FILE
# ifdef NO_USER_SWITCH
" NO_USER_SWITCH"
# endif // NO_USER_SWITCH
# ifdef NO_HELP
" NO_HELP"
# endif // NO_HELP
# ifdef NO_CUSTOM_INTERVALS
" NO_CUSTOM_INTERVALS"
# endif // NO_CUSTOM_INTERVALS
# ifdef NO_SOCKETS
" NO_SOCKETS"
# endif // NO_SOCKETS
# ifdef NO_CL_PIDS
" NO_CL_PIDS"
# endif // NO_CL_PIDS
# ifdef NO_LIMIT
" NO_LIMIT"
# endif // NO_LIMIT
# ifdef NO_SIGHUP
" NO_SIGHUP"
# endif // NO_SIGHUP
# ifdef NO_PROCFS
" NOPROCFS=1"
# endif // NO_PROCFS
# ifdef USE_THREADS
" THREADS=1"
# endif // USE_THREADS
# ifdef USE_AUXV
" AUXV=1"
# endif // USE_AUXV
# if defined(CHILD_HANDLER) || __minix__
" CHILD_HANDLER=1"
# endif // defined(CHILD_HANDLER) || __minix__
# if !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
" SIMPLE_SOCKETS"
# endif // !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
# if (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
" SUPPORT_WINE"
# endif // (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
# if !HAVE_FREEBIND
" NO_FREEBIND"
# endif //!HAVE_FREEBIND
# if !HAVE_GETIFADDR
" !HAVE_GETIFADDR"
# endif // !HAVE_GETIFADDR
# if HAVE_GETIFADDR && defined(GETIFADDRS_MUSL)
" GETIFADDRS=musl"
# endif // HAVE_GETIFADDR && defined(GETIFADDRS_MUSL)
# if defined(NO_PRIVATE_IP_DETECT)
" NO_PRIVATE_IP_DETECT"
# endif // defined(NO_PRIVATE_IP_DETECT)
);
}
#endif // NO_VERSION_INFORMATION

View File

@ -6,15 +6,24 @@
#endif // CONFIG
#include CONFIG
#include <errno.h>
#include "types.h"
#include "kms.h"
typedef int (*PRINTFUNC)(const char *const fmt, ...);
void printerrorf(const char *const fmt, ...);
int printerrorf(const char *const fmt, ...);
int errorout(const char* fmt, ...);
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p);
void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p);
#ifndef NO_VERSION_INFORMATION
void printPlatform();
void printCommonFlags();
void printServerFlags();
void printClientFlags();
#endif // NO_VERSION_INFORMATION
#ifndef NO_LOG
int logger(const char *const fmt, ...);
#endif //NO_LOG

200
rpc.c
View File

@ -95,9 +95,9 @@ static void CheckRpcRequest(const RPC_REQUEST64 *const Request, const unsigned i
}
if (Ctx != *Ndr64Ctx)
kmsMajorVersion = LE16(((WORD*)Request->Ndr.Data)[1]);
kmsMajorVersion = (uint_fast8_t)LE16(((WORD*)Request->Ndr.Data)[1]);
else
kmsMajorVersion = LE16(((WORD*)Request->Ndr64.Data)[1]);
kmsMajorVersion = (uint_fast8_t)LE16(((WORD*)Request->Ndr64.Data)[1]);
if (kmsMajorVersion > 6)
{
@ -176,25 +176,33 @@ static unsigned int checkRpcRequestSize(const RPC_REQUEST64 *const Request, cons
if (requestSize < sizeof(REQUEST_V4) + (Ctx != *Ndr64Ctx ? sizeof(RPC_REQUEST) : sizeof(RPC_REQUEST64))) return 0;
// Get KMS major version
uint_fast16_t _v;
uint16_t majorIndex, minor;
DWORD version;
if (Ctx != *Ndr64Ctx)
_v = LE16(((WORD*)Request->Ndr.Data)[1]) - 4;
{
version = LE32(*(DWORD*)Request->Ndr.Data);
}
else
_v = LE16(((WORD*)Request->Ndr64.Data)[1]) - 4;
{
version = LE32(*(DWORD*)Request->Ndr64.Data);
}
majorIndex = (uint16_t)(version >> 16) - 4;
minor = (uint16_t)(version & 0xffff);
// Only KMS v4, v5 and v6 are supported
if (_v >= vlmcsd_countof(_Versions))
if (majorIndex >= vlmcsd_countof(_Versions) || minor)
{
# ifndef NO_LOG
logger("Fatal: KMSv%i unsupported\n", _v + 4);
logger("Fatal: KMSv%hu.%hu unsupported\n", (unsigned short)majorIndex + 4, (unsigned short)minor);
# endif // NO_LOG
return 0;
}
// Could check for equality but allow bigger requests to support buggy RPC clients (e.g. wine)
// Buffer overrun is check by caller.
return (requestSize >= _Versions[_v].RequestSize);
return (requestSize >= _Versions[majorIndex].RequestSize);
}
@ -205,10 +213,9 @@ static unsigned int checkRpcRequestSize(const RPC_REQUEST64 *const Request, cons
*
* The RPC packet size (excluding header) is actually in Response->AllocHint
*/
static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const Response, const DWORD RpcAssocGroup_unused, const SOCKET sock_unused, WORD* NdrCtx, WORD* Ndr64Ctx, BYTE packetType, const char* const ipstr)
static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const Response, const DWORD RpcAssocGroup_unused, const SOCKET sock_unused, WORD* NdrCtx, WORD* Ndr64Ctx, BYTE isValid, const char* const ipstr)
{
uint_fast16_t _v;
int ResponseSize;
int ResponseSize; // <0 = Errorcode (HRESULT)
WORD Ctx = LE16(Request->ContextId);
BYTE* requestData;
BYTE* responseData;
@ -226,28 +233,45 @@ static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const
responseData = (BYTE*)&Response->Ndr64.Data;
}
_v = LE16(((WORD*)requestData)[1]) - 4;
ResponseSize = 0x8007000D; // Invalid Data
if (!(ResponseSize = _Versions[_v].CreateResponse(requestData, responseData, ipstr)))
if (isValid)
{
return 0;
uint16_t majorIndex = LE16(((WORD*)requestData)[1]) - 4;
if (!(ResponseSize = _Versions[majorIndex].CreateResponse(requestData, responseData, ipstr))) ResponseSize = 0x8007000D;
}
if (Ctx != *Ndr64Ctx)
{
Response->Ndr.DataSizeMax = LE32(0x00020000);
Response->Ndr.DataLength = Response->Ndr.DataSizeIs = LE32(ResponseSize);
len = ResponseSize + sizeof(Response->Ndr);
if (ResponseSize < 0)
{
Response->Ndr.DataSizeMax = Response->Ndr.DataLength = 0;
len = sizeof(Response->Ndr) - sizeof(Response->Ndr.DataSizeIs);
}
else
{
Response->Ndr.DataSizeMax = LE32(0x00020000);
Response->Ndr.DataLength = Response->Ndr.DataSizeIs = LE32(ResponseSize);
len = ResponseSize + sizeof(Response->Ndr);
}
}
else
{
Response->Ndr64.DataSizeMax = LE64(0x00020000ULL);
Response->Ndr64.DataLength = Response->Ndr64.DataSizeIs = LE64((uint64_t)ResponseSize);
len = ResponseSize + sizeof(Response->Ndr64);
if (ResponseSize < 0)
{
Response->Ndr64.DataSizeMax = Response->Ndr64.DataLength = 0;
len = sizeof(Response->Ndr64) - sizeof(Response->Ndr64.DataSizeIs);
}
else
{
Response->Ndr64.DataSizeMax = LE64(0x00020000ULL);
Response->Ndr64.DataLength = Response->Ndr64.DataSizeIs = LE64((uint64_t)ResponseSize);
len = ResponseSize + sizeof(Response->Ndr64);
}
}
pRpcReturnCode = ((BYTE*)&Response->Ndr) + len;
UA32(pRpcReturnCode) = 0; //LE32 not needed for 0
UA32(pRpcReturnCode) = ResponseSize < 0 ? LE32(ResponseSize) : 0;
len += sizeof(DWORD);
// Pad zeros to 32-bit align (seems not neccassary but Windows RPC does it this way)
@ -370,11 +394,12 @@ static int rpcBind(const RPC_BIND_REQUEST *const Request, RPC_BIND_RESPONSE* Res
getsockname(sock, (struct sockaddr*)&addr, &socklen) ||
getnameinfo((struct sockaddr*)&addr, socklen, NULL, 0, (char*)Response->SecondaryAddress, sizeof(Response->SecondaryAddress), NI_NUMERICSERV))
{
portNumberSize = Response->SecondaryAddressLength = 0;
portNumberSize = 0;
Response->SecondaryAddressLength = 0;
}
else
{
portNumberSize = strlen((char*)Response->SecondaryAddress) + 1;
portNumberSize = (uint_fast8_t)strlen((char*)Response->SecondaryAddress) + 1;
Response->SecondaryAddressLength = LE16(portNumberSize);
}
@ -518,16 +543,17 @@ void rpcServer(const SOCKET sock, const DWORD RpcAssocGroup, const char* const i
if (!_recv(sock, requestBuffer, request_len)) return;
// Request is invalid
if (!_Actions[_a].CheckRequestSize(requestBuffer, request_len, &NdrCtx, &Ndr64Ctx)) return;
BYTE isValid = (BYTE)_Actions[_a].CheckRequestSize(requestBuffer, request_len, &NdrCtx, &Ndr64Ctx);
if (rpcRequestHeader.PacketType != RPC_PT_REQUEST && !isValid) return;
// Unable to create a valid response from request
if (!(response_len = _Actions[_a].GetResponse(requestBuffer, rpcResponse, RpcAssocGroup, sock, &NdrCtx, &Ndr64Ctx, rpcRequestHeader.PacketType, ipstr))) return;
if (!(response_len = _Actions[_a].GetResponse(requestBuffer, rpcResponse, RpcAssocGroup, sock, &NdrCtx, &Ndr64Ctx, rpcRequestHeader.PacketType != RPC_PT_REQUEST ? rpcRequestHeader.PacketType : isValid, ipstr))) return;
response_len += sizeof(RPC_HEADER);
memcpy(rpcResponseHeader, &rpcRequestHeader, sizeof(RPC_HEADER));
rpcResponseHeader->FragLength = LE16(response_len);
rpcResponseHeader->FragLength = LE16((WORD)response_len);
rpcResponseHeader->PacketType = _Actions[_a].ResponsePacketType;
if (rpcResponseHeader->PacketType == RPC_PT_ALTERCONTEXT_ACK)
@ -560,26 +586,26 @@ static int checkRpcHeader(const RPC_HEADER *const Header, const BYTE desiredPack
(uint32_t)desiredPacketType,
Header->PacketType
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
if (Header->DataRepresentation != BE32(0x10000000))
{
p("Fatal: RPC response does not conform to Microsoft's limited support of DCE RPC\n");
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
if (Header->AuthLength != 0)
{
p("Fatal: RPC response requests authentication\n");
status = !0;
status = RPC_S_UNKNOWN_AUTHN_TYPE;
}
// vlmcsd does not support fragmented packets (not yet neccassary)
if ( (Header->PacketFlags & (RPC_PF_FIRST | RPC_PF_LAST)) != (RPC_PF_FIRST | RPC_PF_LAST) )
{
p("Fatal: RPC packet flags RPC_PF_FIRST and RPC_PF_LAST are not both set.\n");
status = !0;
status = RPC_S_CANNOT_SUPPORT;
}
if (Header->PacketFlags & RPC_PF_CANCEL_PENDING) p("Warning: %s should not be set\n", "RPC_PF_CANCEL_PENDING");
@ -591,7 +617,7 @@ static int checkRpcHeader(const RPC_HEADER *const Header, const BYTE desiredPack
if (Header->VersionMajor != 5 || Header->VersionMinor != 0)
{
p("Fatal: Expected RPC version 5.0 and got %u.%u\n", Header->VersionMajor, Header->VersionMinor);
status = !0;
status = RPC_S_INVALID_VERS_OPTION;
}
return status;
@ -639,7 +665,7 @@ static int checkRpcResponseHeader(const RPC_HEADER *const ResponseHeader, const
(uint32_t)LE32(ResponseHeader->CallId)
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
return status;
@ -685,7 +711,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
RequestHeader = (RPC_HEADER*)_Request;
RpcRequest = (RPC_REQUEST64*)(_Request + sizeof(RPC_HEADER));
createRpcRequestHeader(RequestHeader, RPC_PT_REQUEST, size);
createRpcRequestHeader(RequestHeader, RPC_PT_REQUEST, (WORD)size);
// Increment CallId for next Request
CallId++;
@ -695,7 +721,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
if (useNdr64)
{
RpcRequest->ContextId = LE16(1); // We negotiate NDR64 always as context 1
RpcRequest->AllocHint = LE32(requestSize + sizeof(RpcRequest->Ndr64));
RpcRequest->AllocHint = LE32((DWORD)(requestSize + sizeof(RpcRequest->Ndr64)));
RpcRequest->Ndr64.DataLength = LE64((uint64_t)requestSize);
RpcRequest->Ndr64.DataSizeIs = LE64((uint64_t)requestSize);
memcpy(RpcRequest->Ndr64.Data, KmsRequest, requestSize);
@ -703,9 +729,9 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
else
{
RpcRequest->ContextId = 0; // We negotiate NDR32 always as context 0
RpcRequest->AllocHint = LE32(requestSize + sizeof(RpcRequest->Ndr));
RpcRequest->Ndr.DataLength = LE32(requestSize);
RpcRequest->Ndr.DataSizeIs = LE32(requestSize);
RpcRequest->AllocHint = LE32((DWORD)(requestSize + sizeof(RpcRequest->Ndr)));
RpcRequest->Ndr.DataLength = LE32((DWORD)requestSize);
RpcRequest->Ndr.DataSizeIs = LE32((DWORD)requestSize);
memcpy(RpcRequest->Ndr.Data, KmsRequest, requestSize);
}
@ -713,44 +739,44 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
{
int bytesread;
if (!_send(sock, _Request, size))
if (!_send(sock, _Request, (int)size))
{
errorout("\nFatal: Could not send RPC request\n");
status = !0;
printerrorf("\nFatal: Could not send RPC request\n");
status = RPC_S_COMM_FAILURE;
break;
}
if (!_recv(sock, &ResponseHeader, sizeof(RPC_HEADER)))
{
errorout("\nFatal: No RPC response received from server\n");
status = !0;
printerrorf("\nFatal: No RPC response received from server\n");
status = RPC_S_COMM_FAILURE;
break;
}
if ((status = checkRpcResponseHeader(&ResponseHeader, RequestHeader, RPC_PT_RESPONSE, &errorout))) break;
if ((status = checkRpcResponseHeader(&ResponseHeader, RequestHeader, RPC_PT_RESPONSE, &printerrorf))) break;
size = useNdr64 ? sizeof(RPC_RESPONSE64) : sizeof(RPC_RESPONSE);
if (size > LE16(ResponseHeader.FragLength) - sizeof(ResponseHeader))
size = LE16(ResponseHeader.FragLength) - sizeof(ResponseHeader);
if (!_recv(sock, &_Response, size))
if (!_recv(sock, &_Response, (int)size))
{
errorout("\nFatal: RPC response is incomplete\n");
status = !0;
printerrorf("\nFatal: RPC response is incomplete\n");
status = RPC_S_COMM_FAILURE;
break;
}
if (_Response.CancelCount != 0)
{
errorout("\nFatal: RPC response cancel count is not 0\n");
status = !0;
printerrorf("\nFatal: RPC response cancel count is not 0\n");
status = RPC_S_CALL_CANCELLED;
}
if (_Response.ContextId != (useNdr64 ? LE16(1) : 0))
{
errorout("\nFatal: RPC response context id %u is not bound\n", (unsigned int)LE16(_Response.ContextId));
status = !0;
printerrorf("\nFatal: RPC response context id %u is not bound\n", (unsigned int)LE16(_Response.ContextId));
status = RPC_X_SS_CONTEXT_DAMAGED;
}
int_fast8_t sizesMatch;
@ -760,7 +786,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
*responseSize = (size_t)LE64(_Response.Ndr64.DataLength);
responseSize2 = (size_t)LE64(_Response.Ndr64.DataSizeIs);
if (!*responseSize || !_Response.Ndr64.DataSizeMax)
if (/*!*responseSize ||*/ !_Response.Ndr64.DataSizeMax)
{
status = (int)LE32(_Response.Ndr64.status);
break;
@ -773,7 +799,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
*responseSize = (size_t)LE32(_Response.Ndr.DataLength);
responseSize2 = (size_t)LE32(_Response.Ndr.DataSizeIs);
if (!*responseSize || !_Response.Ndr.DataSizeMax)
if (/*!*responseSize ||*/ !_Response.Ndr.DataSizeMax)
{
status = (int)LE32(_Response.Ndr.status);
break;
@ -784,12 +810,12 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
if (!sizesMatch)
{
errorout("\nFatal: NDR data length (%u) does not match NDR data size (%u)\n",
printerrorf("\nFatal: NDR data length (%u) does not match NDR data size (%u)\n",
(uint32_t)*responseSize,
(uint32_t)LE32(_Response.Ndr.DataSizeIs)
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
*KmsResponse = (BYTE*)vlmcsd_malloc(*responseSize + MAX_EXCESS_BYTES);
@ -798,14 +824,14 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
memset(*KmsResponse, 0, *responseSize + MAX_EXCESS_BYTES);
// Read up to 16 bytes more than bytes expected to detect faulty KMS emulators
if ((bytesread = recv(sock, (char*)*KmsResponse, *responseSize + MAX_EXCESS_BYTES, 0)) < (int)*responseSize)
if ((bytesread = recv(sock, (char*)*KmsResponse, (int)(*responseSize) + MAX_EXCESS_BYTES, 0)) < (int)*responseSize)
{
errorout("\nFatal: No or incomplete KMS response received. Required %u bytes but only got %i\n",
printerrorf("\nFatal: No or incomplete KMS response received. Required %u bytes but only got %i\n",
(uint32_t)*responseSize,
(int32_t)(bytesread < 0 ? 0 : bytesread)
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
break;
}
@ -816,7 +842,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
if (len + pad != LE32(_Response.AllocHint))
{
errorout("\nWarning: RPC stub size is %u, should be %u (probably incorrect padding)\n", (uint32_t)LE32(_Response.AllocHint), (uint32_t)(len + pad));
printerrorf("\nWarning: RPC stub size is %u, should be %u (probably incorrect padding)\n", (uint32_t)LE32(_Response.AllocHint), (uint32_t)(len + pad));
}
else
{
@ -825,7 +851,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
{
if (*(*KmsResponse + *responseSize + sizeof(*pReturnCode) + i))
{
errorout("\nWarning: RPC stub data not padded to zeros according to Microsoft standard\n");
printerrorf("\nWarning: RPC stub data not padded to zeros according to Microsoft standard\n");
break;
}
}
@ -834,8 +860,6 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const KmsRequest, const
pReturnCode = (DWORD*)(*KmsResponse + *responseSize + pad);
status = LE32(UA32(pReturnCode));
if (status) errorout("\nWarning: RPC stub data reported Error %u\n", (uint32_t)status);
break;
}
@ -874,12 +898,12 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
WORD ctxIndex = 0;
WORD i;
WORD CtxBTFN = (WORD)~0, CtxNDR64 = (WORD)~0;
BYTE _Request[rpcBindSize];
BYTE* _Request = (BYTE*)alloca(rpcBindSize);
RequestHeader = (RPC_HEADER*)_Request;
bindRequest = (RPC_BIND_REQUEST* )(_Request + sizeof(RPC_HEADER));
createRpcRequestHeader(RequestHeader, packetType, rpcBindSize);
createRpcRequestHeader(RequestHeader, packetType, (WORD)rpcBindSize);
RequestHeader->PacketFlags |= UseMultiplexedRpc ? RPC_PF_MULTIPLEX : 0;
bindRequest->AssocGroup = 0;
@ -912,16 +936,16 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
CtxBTFN = ctxIndex;
}
if (!_send(sock, _Request, rpcBindSize))
if (!_send(sock, _Request, (int)rpcBindSize))
{
errorout("\nFatal: Sending RPC bind request failed\n");
return !0;
printerrorf("\nFatal: Sending RPC bind request failed\n");
return RPC_S_COMM_FAILURE;
}
if (!_recv(sock, &ResponseHeader, sizeof(RPC_HEADER)))
{
errorout("\nFatal: Did not receive a response from server\n");
return !0;
printerrorf("\nFatal: Did not receive a response from server\n");
return RPC_S_COMM_FAILURE;
}
if ((status = checkRpcResponseHeader
@ -929,7 +953,7 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
&ResponseHeader,
RequestHeader,
packetType == RPC_PT_BIND_REQ ? RPC_PT_BIND_ACK : RPC_PT_ALTERCONTEXT_ACK,
&errorout
&printerrorf
)))
{
return status;
@ -940,9 +964,9 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
if (!_recv(sock, bindResponse, LE16(ResponseHeader.FragLength) - sizeof(RPC_HEADER)))
{
errorout("\nFatal: Incomplete RPC bind acknowledgement received\n");
printerrorf("\nFatal: Incomplete RPC bind acknowledgement received\n");
free(bindResponseBytePtr);
return !0;
return RPC_S_COMM_FAILURE;
}
else
{
@ -958,12 +982,12 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
if (bindResponse->NumResults != bindRequest->NumCtxItems)
{
errorout("\nFatal: Expected %u CTX items but got %u\n",
printerrorf("\nFatal: Expected %u CTX items but got %u\n",
(uint32_t)LE32(bindRequest->NumCtxItems),
(uint32_t)LE32(bindResponse->NumResults)
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
for (i = 0; i < ctxItems; i++)
@ -975,7 +999,7 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
{
if (!IsNullGuid((BYTE*)&bindResponse->Results[i].TransferSyntax))
{
errorout(
printerrorf(
"\nWarning: Rejected transfer syntax %s did not return NULL Guid\n",
transferSyntaxName
);
@ -983,7 +1007,7 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
if (bindResponse->Results[i].SyntaxVersion)
{
errorout(
printerrorf(
"\nWarning: Rejected transfer syntax %s did not return syntax version 0 but %u\n",
transferSyntaxName,
LE32(bindResponse->Results[i].SyntaxVersion)
@ -992,14 +1016,14 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
if (bindResponse->Results[i].AckReason == RPC_ABSTRACTSYNTAX_UNSUPPORTED)
{
errorout(
printerrorf(
"\nWarning: Transfer syntax %s does not support KMS activation\n",
transferSyntaxName
);
}
else if (bindResponse->Results[i].AckReason != RPC_SYNTAX_UNSUPPORTED)
{
errorout(
printerrorf(
"\nWarning: Rejected transfer syntax %s did not return ack reason RPC_SYNTAX_UNSUPPORTED\n",
transferSyntaxName
);
@ -1012,12 +1036,12 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
{
if (bindResponse->Results[i].AckResult != RPC_BIND_ACK)
{
errorout("\nWarning: BTFN did not respond with RPC_BIND_ACK or RPC_BIND_NACK\n");
printerrorf("\nWarning: BTFN did not respond with RPC_BIND_ACK or RPC_BIND_NACK\n");
}
if (bindResponse->Results[i].AckReason != LE16(3))
{
errorout("\nWarning: BTFN did not return expected feature mask 0x3 but 0x%X\n", (unsigned int)LE16(bindResponse->Results[i].AckReason));
printerrorf("\nWarning: BTFN did not return expected feature mask 0x3 but 0x%X\n", (unsigned int)LE16(bindResponse->Results[i].AckReason));
}
if (verbose) printf("... BTFN ");
@ -1029,38 +1053,38 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
// NDR32 or NDR64 Ctx
if (bindResponse->Results[i].AckResult != RPC_BIND_ACCEPT)
{
errorout(
printerrorf(
"\nFatal: transfer syntax %s returned an invalid status, neither RPC_BIND_ACCEPT nor RPC_BIND_NACK\n",
transferSyntaxName
);
status = !0;
status = RPC_S_PROTOCOL_ERROR;
}
if (!IsEqualGUID(&bindResponse->Results[i].TransferSyntax, &bindRequest->CtxItems[i].TransferSyntax))
{
errorout(
printerrorf(
"\nFatal: Transfer syntax of RPC bind request and response does not match\n"
);
status = !0;
status = RPC_S_UNSUPPORTED_TRANS_SYN;
}
if (bindResponse->Results[i].SyntaxVersion != bindRequest->CtxItems[i].SyntaxVersion)
{
errorout("\nFatal: Expected transfer syntax version %u for %s but got %u\n",
printerrorf("\nFatal: Expected transfer syntax version %u for %s but got %u\n",
(uint32_t)LE32(bindRequest->CtxItems[0].SyntaxVersion),
transferSyntaxName,
(uint32_t)LE32(bindResponse->Results[0].SyntaxVersion)
);
status = !0;
status = RPC_S_UNSUPPORTED_TRANS_SYN;
}
// The ack reason field is actually undefined here but Microsoft sets this to 0
if (bindResponse->Results[i].AckReason != 0)
{
errorout(
printerrorf(
"\nWarning: Ack reason should be 0 but is %u\n",
LE16(bindResponse->Results[i].AckReason)
);
@ -1087,8 +1111,8 @@ RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, BYTE packetType, const
if (!RpcFlags.HasNDR64 && !RpcFlags.HasNDR32)
{
errorout("\nFatal: Could neither negotiate NDR32 nor NDR64 with the RPC server\n");
status = !0;
printerrorf("\nFatal: Could neither negotiate NDR32 nor NDR64 with the RPC server\n");
status = RPC_S_NO_PROTSEQS;
}
return status;

145
rpc.h
View File

@ -8,6 +8,148 @@
#include "types.h"
//#if _MSC_VER
//typedef signed char int_fast8_t;
//typedef unsigned char BYTE;
//typedef UINT_PTR size_t;
//typedef unsigned long DWORD;
//#define STDIN_FILENO 0
//#endif
#if !defined(_WIN32) && !defined(__CYGWIN__)
#define RPC_S_OK 0
#define RPC_S_INVALID_ARG 87
#define RPC_S_OUT_OF_MEMORY 14
#define RPC_S_OUT_OF_THREADS 164
#define RPC_S_INVALID_LEVEL RPC_S_INVALID_ARG
#define RPC_S_BUFFER_TOO_SMALL 122
#define RPC_S_INVALID_SECURITY_DESC 1338
#define RPC_S_ACCESS_DENIED 5
#define RPC_S_SERVER_OUT_OF_MEMORY 1130
#define RPC_S_ASYNC_CALL_PENDING 997
#define RPC_S_UNKNOWN_PRINCIPAL 1332
#define RPC_S_TIMEOUT 1460
#define RPC_S_INVALID_STRING_BINDING 1700
#define RPC_S_WRONG_KIND_OF_BINDING 1701
#define RPC_S_INVALID_BINDING 1702
#define RPC_S_PROTSEQ_NOT_SUPPORTED 1703
#define RPC_S_INVALID_RPC_PROTSEQ 1704
#define RPC_S_INVALID_STRING_UUID 1705
#define RPC_S_INVALID_ENDPOINT_FORMAT 1706
#define RPC_S_INVALID_NET_ADDR 1707
#define RPC_S_NO_ENDPOINT_FOUND 1708
#define RPC_S_INVALID_TIMEOUT 1709
#define RPC_S_OBJECT_NOT_FOUND 1710
#define RPC_S_ALREADY_REGISTERED 1711
#define RPC_S_TYPE_ALREADY_REGISTERED 1712
#define RPC_S_ALREADY_LISTENING 1713
#define RPC_S_NO_PROTSEQS_REGISTERED 1714
#define RPC_S_NOT_LISTENING 1715
#define RPC_S_UNKNOWN_MGR_TYPE 1716
#define RPC_S_UNKNOWN_IF 1717
#define RPC_S_NO_BINDINGS 1718
#define RPC_S_NO_PROTSEQS 1719
#define RPC_S_CANT_CREATE_ENDPOINT 1720
#define RPC_S_OUT_OF_RESOURCES 1721
#define RPC_S_SERVER_UNAVAILABLE 1722
#define RPC_S_SERVER_TOO_BUSY 1723
#define RPC_S_INVALID_NETWORK_OPTIONS 1724
#define RPC_S_NO_CALL_ACTIVE 1725
#define RPC_S_CALL_FAILED 1726
#define RPC_S_CALL_FAILED_DNE 1727
#define RPC_S_PROTOCOL_ERROR 1728
#define RPC_S_PROXY_ACCESS_DENIED 1729
#define RPC_S_UNSUPPORTED_TRANS_SYN 1730
#define RPC_S_UNSUPPORTED_TYPE 1732
#define RPC_S_INVALID_TAG 1733
#define RPC_S_INVALID_BOUND 1734
#define RPC_S_NO_ENTRY_NAME 1735
#define RPC_S_INVALID_NAME_SYNTAX 1736
#define RPC_S_UNSUPPORTED_NAME_SYNTAX 1737
#define RPC_S_UUID_NO_ADDRESS 1739
#define RPC_S_DUPLICATE_ENDPOINT 1740
#define RPC_S_UNKNOWN_AUTHN_TYPE 1741
#define RPC_S_MAX_CALLS_TOO_SMALL 1742
#define RPC_S_STRING_TOO_LONG 1743
#define RPC_S_PROTSEQ_NOT_FOUND 1744
#define RPC_S_PROCNUM_OUT_OF_RANGE 1745
#define RPC_S_BINDING_HAS_NO_AUTH 1746
#define RPC_S_UNKNOWN_AUTHN_SERVICE 1747
#define RPC_S_UNKNOWN_AUTHN_LEVEL 1748
#define RPC_S_INVALID_AUTH_IDENTITY 1749
#define RPC_S_UNKNOWN_AUTHZ_SERVICE 1750
#define EPT_S_INVALID_ENTRY 1751
#define EPT_S_CANT_PERFORM_OP 1752
#define EPT_S_NOT_REGISTERED 1753
#define RPC_S_NOTHING_TO_EXPORT 1754
#define RPC_S_INCOMPLETE_NAME 1755
#define RPC_S_INVALID_VERS_OPTION 1756
#define RPC_S_NO_MORE_MEMBERS 1757
#define RPC_S_NOT_ALL_OBJS_UNEXPORTED 1758
#define RPC_S_INTERFACE_NOT_FOUND 1759
#define RPC_S_ENTRY_ALREADY_EXISTS 1760
#define RPC_S_ENTRY_NOT_FOUND 1761
#define RPC_S_NAME_SERVICE_UNAVAILABLE 1762
#define RPC_S_INVALID_NAF_ID 1763
#define RPC_S_CANNOT_SUPPORT 1764
#define RPC_S_NO_CONTEXT_AVAILABLE 1765
#define RPC_S_INTERNAL_ERROR 1766
#define RPC_S_ZERO_DIVIDE 1767
#define RPC_S_ADDRESS_ERROR 1768
#define RPC_S_FP_DIV_ZERO 1769
#define RPC_S_FP_UNDERFLOW 1770
#define RPC_S_FP_OVERFLOW 1771
#define RPC_X_NO_MORE_ENTRIES 1772
#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL 1773
#define RPC_X_SS_CHAR_TRANS_SHORT_FILE 1774
#define RPC_X_SS_IN_NULL_CONTEXT 1775
#define RPC_X_SS_CONTEXT_DAMAGED 1777
#define RPC_X_SS_HANDLES_MISMATCH 1778
#define RPC_X_SS_CANNOT_GET_CALL_HANDLE 1779
#define RPC_X_NULL_REF_POINTER 1780
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE 1781
#define RPC_X_BYTE_COUNT_TOO_SMALL 1782
#define RPC_X_BAD_STUB_DATA 1783
#define RPC_S_CALL_IN_PROGRESS 1791
#define RPC_S_NO_MORE_BINDINGS 1806
#define RPC_S_NO_INTERFACES 1817
#define RPC_S_CALL_CANCELLED 1818
#define RPC_S_BINDING_INCOMPLETE 1819
#define RPC_S_COMM_FAILURE 1820
#define RPC_S_UNSUPPORTED_AUTHN_LEVEL 1821
#define RPC_S_NO_PRINC_NAME 1822
#define RPC_S_NOT_RPC_ERROR 1823
#define RPC_S_UUID_LOCAL_ONLY 1824
#define RPC_S_SEC_PKG_ERROR 1825
#define RPC_S_NOT_CANCELLED 1826
#define RPC_X_INVALID_ES_ACTION 1827
#define RPC_X_WRONG_ES_VERSION 1828
#define RPC_X_WRONG_STUB_VERSION 1829
#define RPC_X_INVALID_PIPE_OBJECT 1830
#define RPC_X_WRONG_PIPE_ORDER 1831
#define RPC_X_WRONG_PIPE_VERSION 1832
#define RPC_S_COOKIE_AUTH_FAILED 1833
#define RPC_S_GROUP_MEMBER_NOT_FOUND 1898
#define EPT_S_CANT_CREATE 1899
#define RPC_S_INVALID_OBJECT 1900
#define RPC_S_SEND_INCOMPLETE 1913
#define RPC_S_INVALID_ASYNC_HANDLE 1914
#define RPC_S_INVALID_ASYNC_CALL 1915
#define RPC_X_PIPE_CLOSED 1916
#define RPC_X_PIPE_DISCIPLINE_ERROR 1917
#define RPC_X_PIPE_EMPTY 1918
#define RPC_S_ENTRY_TYPE_MISMATCH 1922
#define RPC_S_NOT_ALL_OBJS_EXPORTED 1923
#define RPC_S_INTERFACE_NOT_EXPORTED 1924
#define RPC_S_PROFILE_NOT_ADDED 1925
#define RPC_S_PRF_ELT_NOT_ADDED 1926
#define RPC_S_PRF_ELT_NOT_REMOVED 1927
#define RPC_S_GRP_ELT_NOT_ADDED 1928
#define RPC_S_GRP_ELT_NOT_REMOVED 1929
#endif // !defined(_WIN32) && !_defined(__CYGWIN__)
typedef struct {
BYTE VersionMajor;
BYTE VersionMinor;
@ -124,6 +266,7 @@ typedef struct {
} /*__packed*/ RPC_RESPONSE64;
//#define RpcCtx SOCKET
typedef SOCKET RpcCtx;
typedef int RpcStatus;
@ -171,7 +314,7 @@ typedef union _RPC_FLAGS
extern RPC_FLAGS RpcFlags;
void rpcServer(const RpcCtx socket, const DWORD RpcAssocGroup, const char* const ipstr);
void rpcServer(const SOCKET sock, 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);

View File

@ -14,6 +14,10 @@ int_fast8_t DisconnectImmediately = FALSE;
const char *const cIPv4 = "IPv4";
const char *const cIPv6 = "IPv6";
#ifdef IS_LIBRARY
char ErrorMessage[MESSAGE_BUFFER_SIZE];
#endif // IS_LIBRARY
#ifndef USE_MSRPC
int_fast8_t UseMultiplexedRpc = TRUE;
int_fast8_t UseRpcNDR64 = TRUE;
@ -24,6 +28,10 @@ int_fast8_t UseRpcBTFN = TRUE;
const char *defaultport = "1688";
#endif // NO_SOCKETS
#if !defined(NO_PRIVATE_IP_DETECT)
uint32_t PublicIPProtectionLevel = 0;
#endif
KmsResponseParam_t KmsResponseParameters[MAX_KMSAPPS];
#if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
@ -43,6 +51,7 @@ uint32_t MaxTasks = SEM_VALUE_MAX;
#endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
#ifndef NO_LOG
int_fast8_t LogDateAndTime = TRUE;
char *fn_log = NULL;
int_fast8_t logstdout = 0;
#ifndef NO_VERBOSE_LOG
@ -51,10 +60,14 @@ int_fast8_t logverbose = 0;
#endif // NO_LOG
#ifndef NO_SOCKETS
#ifndef _WIN32
int_fast8_t nodaemon = 0;
#endif // _WIN32
int_fast8_t InetdMode = 0;
#else
#ifndef _WIN32
int_fast8_t nodaemon = 1;
#endif // _WIN32
int_fast8_t InetdMode = 1;
#endif
@ -64,8 +77,12 @@ uint16_t Lcid = 0;
#endif
#ifndef NO_SOCKETS
#ifdef SIMPLE_SOCKETS
SOCKET s_server;
#else
SOCKET *SocketList;
int numsockets = 0;
#endif
#if !defined(NO_LIMIT) && !__minix__
#ifndef _WIN32 // Posix
@ -92,6 +109,10 @@ CRITICAL_SECTION logmutex;
#endif // USE_THREADS
#endif // NO_LOG
#if HAVE_FREEBIND
int_fast8_t freebind = FALSE;
#endif // HAVE_FREEBIND

View File

@ -33,7 +33,9 @@
#endif
#include <signal.h>
#if !_MSC_VER
#include <unistd.h>
#endif
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
@ -42,10 +44,10 @@
#include <limits.h>
#include <ctype.h>
#include <stdarg.h>
#include <semaphore.h>
//#include <semaphore.h>
#include "types.h"
#define MAX_KMSAPPS 3
#define MAX_KMSAPPS 4
typedef struct
{
const char* Epid;
@ -74,10 +76,16 @@ extern const char *const Version;
#define UINT_MAX 4294967295
#endif
#define MESSAGE_BUFFER_SIZE 4096
#ifdef IS_LIBRARY
extern char ErrorMessage[MESSAGE_BUFFER_SIZE];
#endif // IS_LIBRARY
extern int global_argc, multi_argc;
extern CARGV global_argv, multi_argv;
#ifndef _WIN32
extern int_fast8_t nodaemon;
#endif // _WIN32
extern DWORD VLActivationInterval;
extern DWORD VLRenewalInterval;
extern int_fast8_t DisconnectImmediately;
@ -96,6 +104,10 @@ extern int_fast8_t UseRpcBTFN;
extern const char *defaultport;
#endif // NO_SOCKETS
#if !defined(NO_PRIVATE_IP_DETECT)
extern uint32_t PublicIPProtectionLevel;
#endif
#if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
extern int_fast8_t IsRestarted;
#endif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
@ -109,6 +121,7 @@ extern uint32_t MaxTasks;
#endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
#ifndef NO_LOG
extern int_fast8_t LogDateAndTime;
extern char *fn_log;
extern int_fast8_t logstdout;
#ifndef NO_VERBOSE_LOG
@ -122,8 +135,12 @@ extern uint16_t Lcid;
#endif
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)
#if defined(SIMPLE_SOCKETS)
extern SOCKET s_server;
#else // !defined(SIMPLE_SOCKETS)
extern SOCKET *SocketList;
extern int numsockets;
#endif // !defined(SIMPLE_SOCKETS)
#if !defined(NO_LIMIT) && !__minix__
@ -152,5 +169,9 @@ extern CRITICAL_SECTION logmutex;
#endif // USE_THREADS
#endif // NO_LOG
#if HAVE_FREEBIND
extern int_fast8_t freebind;
#endif // HAVE_FREEBIND
#endif // INCLUDED_SHARED_GLOBALS_H

3
strip_binaries Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
find binaries -xdev -name 'vlmcs*' ! -name '*-NetBSD-*' ! -name '*-Windows-*' ! -name '*-cygwin-*' ! -name '*-MacOSX-*' ! -name '*-iOS-*' -exec sstrip -z {} \;

90
types.h
View File

@ -1,29 +1,66 @@
#ifndef __types_h
#define __types_h
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef CONFIG
#define CONFIG "config.h"
#endif // CONFIG
#include CONFIG
#define ANDROID_API_LEVEL ANDROID_HELPER1(__ANDROID_API__)
#define ANDROID_HELPER1(s) ANDROID_HELPER2(s)
#define ANDROID_HELPER2(s) #s
#if !defined(_WIN32) && !__CYGWIN__
#define __declspec(x) __attribute__((__visibility__("default")))
#endif
#if !defined(EXTERNAL)
#define EXTERNAL dllimport
#endif
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
//#ifdef __sun__
//#include <alloca.h>
//#endif
#ifdef __ANDROID__
#include <android/api-level.h>
#endif // __ANDROID__
#ifndef _WIN32
#include <netinet/in.h>
#endif // _WIN32
#if __linux__ // Some versions of uclibc do not define IP_FREEBIND in the correct header file
#ifndef IP_FREEBIND
#define IP_FREEBIND 15
#endif // IP_FREEBIND
#endif // __linux__
#if (IP_BINDANY || IP_FREEBIND || IPV6_BINDANY || IP_NONLOCALOK) && !defined(NO_FREEBIND) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
#define HAVE_FREEBIND 1
#endif
#if !defined(NO_GETIFADDRS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS) && !defined(NO_SOCKETS) && !defined(NO_PRIVATE_IP_DETECT)
#define HAVE_GETIFADDR 1
#endif
#ifndef alloca
#ifdef __GNUC__
#define alloca(x) __builtin_alloca(x)
#endif // __GNUC__
#endif // alloca
#ifndef alloca
#if _MSC_VER
#define alloca _malloca
#endif // _MSC_VER
#endif // alloca
#ifndef alloca
#ifdef __has_builtin // clang feature test
@ -34,8 +71,15 @@
#endif // alloca
#ifndef alloca
#if !_MSC_VER
#include <alloca.h>
#else
#include <malloc.h>
//#define alloca _malloca
#endif
//#define alloca _malloca
//#endif // _MSC_VER
#endif // alloca
#ifndef __packed
#if _MSC_VER
@ -46,12 +90,20 @@
#endif
#ifndef __pure
#if _MSC_VER
#define __pure
#else
#define __pure __attribute__((pure))
#endif
#endif
#ifndef __noreturn
#if _MSC_VER
#define __noreturn __declspec(noreturn)
#else
#define __noreturn __attribute__((noreturn))
#endif
#endif
#define restrict __restrict
@ -119,7 +171,7 @@ typedef uint8_t ProdListIndex_t;
// Stupid MingW just uses rand() from msvcrt.dll which uses RAND_MAX of 0x7fff
#if RAND_MAX < 0x7fffffff
#define rand32(x) ((uint32_t)((rand(x) << 17) | (rand(x) << 2) | (rand(x) & 3)))
#define rand32() ((uint32_t)((rand() << 17) | (rand() << 2) | (rand() & 3)))
#elif RAND_MAX < 0xffffffff
#define rand32(x) ((uint32_t)((rand(x) << 1) | (rand(x) & 1)))
#else
@ -156,6 +208,7 @@ typedef uint8_t ProdListIndex_t;
#endif // USE_MSRPC
#include <windows.h>
//#include <VersionHelpers.h>
typedef char* sockopt_t;
@ -184,6 +237,7 @@ typedef char* sockopt_t;
#elif defined(__CYGWIN__)
#include <windows.h>
// Resolve conflicts between OpenSSL and MS Crypto API
#ifdef _CRYPTO_OPENSSL
#undef OCSP_RESPONSE
@ -245,11 +299,11 @@ typedef void* sockopt_t;
#undef IsEqualGUID
#define IsEqualGUID(a, b) ( !memcmp(a, b, sizeof(GUID)) )
#ifndef __stdcall
#if !defined(__stdcall) && !_MSC_VER
#define __stdcall
#endif
#ifndef __cdecl
#if !defined(__cdecl) && !_MSC_VER
#define __cdecl
#endif
@ -261,6 +315,18 @@ typedef struct {
} CLDATA, *const PCLDATA;
#ifdef _MSC_VER
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define vlmcsd_snprintf _snprintf
#define vlmcsd_vsnprintf _vsnprintf
#define vlmcsd_unlink DeleteFile
#define vlmcsd_strtoll strtol // TODO: Get some 64-bit strtoll
#else // !_MSC_VER
#define vlmcsd_snprintf snprintf
#define vlmcsd_vsnprintf vsnprintf
#define vlmcsd_strtoll strtoll
#define vlmcsd_unlink unlink
#endif // !_MSC_VER
#endif // __types_h

15
vlmcs.1
View File

@ -1,5 +1,5 @@
.mso www.tmac
.TH VLMCS 1 "February 2015" "Hotbird64" "KMS Activation Manual"
.TH VLMCS 1 "May 2016" "Hotbird64" "KMS Activation Manual"
.LO 1
.SH NAME
@ -11,7 +11,7 @@ vlmcs \- a client for testing and/or charging KMS servers
\fItarget\fR can be one of the following:
.RS
.PP
\fIhostname\fR|\fIipaddress\fR[:\fItcp-port\fR] or to query a specific KMS server (example: vlmcs kms.example.com:1688).
\fIhostname\fR|\fIipaddress\fR[:\fItcp-port\fR] to query a specific KMS server (example: vlmcs kms.example.com:1688).
.br
\fR.\fIdomain\fR to automatically detect KMS servers via DNS for \fIdomain\fR (example: vlmcs .example.com). Please note the dot before \fIdomain\fR.
.br
@ -44,6 +44,9 @@ can also be used to "charge" a KMS server. A Microsoft KMS server sends correct
.IP "\fB-h\fR or \fB-?"
Show help.
.IP "\fB-V\fR"
Displays extended version information. This includes the compiler used to build vlmcs, the intended platform and flags (compile time options) to build vlmcs. If you have the source code of vlmcsd, you can type \fBmake help\fR (or \fBgmake help\fR on systems that do not use the GNU version of \fBmake\fR(1) by default) to see the meaning of those flags.
.IP \fB-x
Show valid
.IR application s
@ -72,11 +75,11 @@ 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, is 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-m"
Let the client pretend to be a virtual machine. Early versions of Microsoft's

View File

@ -11,7 +11,7 @@ SYNOPSIS
target can be one of the following:
hostname|ipaddress[:tcp-port] or to query a specific KMS server
hostname|ipaddress[:tcp-port] to query a specific KMS server
(example: vlmcs kms.example.com:1688).
.domain to automatically detect KMS servers via DNS for domain
(example: vlmcs .example.com). Please note the dot before
@ -52,6 +52,14 @@ OPTIONS
Show help.
-V Displays extended version information. This includes the com
piler used to build vlmcs, the intended platform and flags (com
pile time options) to build vlmcs. 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.
-x Show valid applications that can be used with -l.
@ -59,24 +67,37 @@ OPTIONS
-v Be verbose. Instead of just displaying the returned ePID and the
HwId (protocol v6 only) vlmcsd shows all details of the query
HwId (protocol v6 only) vlmcsd shows all details of the query
and the response.
-l application
Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is
Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is
not complete. You may supply GUIDs with -a, -k and -s to specify
applications that are not listed with -x. The -l option is used
applications that are not listed with -x. The -l option is used
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, is
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.
-m Let the client pretend to be a virtual machine. Early versions
@ -302,4 +323,4 @@ SEE ALSO
Hotbird64 February 2015 VLMCS(1)
Hotbird64 May 2016 VLMCS(1)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:21 2016 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -55,7 +55,7 @@ can be one of the following:</p>
<p style="margin-left:22%; margin-top: 1em"><i>hostname</i>|<i>ipaddress</i>[:<i>tcp-port</i>]
or to query a specific KMS server (example: vlmcs
to query a specific KMS server (example: vlmcs
kms.example.com:1688). <br>
.<i>domain</i> to automatically detect KMS servers via DNS
for <i>domain</i> (example: vlmcs .example.com). Please note
@ -121,6 +121,23 @@ server in a home environment.</p>
<td width="3%">
<p><b>-V</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Displays extended version information. This includes the
compiler used to build vlmcs, the intended platform and
flags (compile time options) to build vlmcs. If you have the
source code of vlmcsd, you can type <b>make help</b> (or
<b>gmake help</b> on systems that do not use the GNU version
of <b>make</b>(1) by default) to see the meaning of those
flags.</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-x</b></p></td>
<td width="8%"></td>
<td width="78%">
@ -166,14 +183,30 @@ 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, is 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>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">

Binary file not shown.

View File

@ -11,7 +11,7 @@ SYNOPSIS
target can be one of the following:
hostname|ipaddress[:tcp-port] or to query a specific KMS server
hostname|ipaddress[:tcp-port] to query a specific KMS server
(example: vlmcs kms.example.com:1688).
.domain to automatically detect KMS servers via DNS for domain
(example: vlmcs .example.com). Please note the dot before
@ -52,6 +52,14 @@ OPTIONS
Show help.
-V Displays extended version information. This includes the com
piler used to build vlmcs, the intended platform and flags (com
pile time options) to build vlmcs. 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.
-x Show valid applications that can be used with -l.
@ -59,24 +67,37 @@ OPTIONS
-v Be verbose. Instead of just displaying the returned ePID and the
HwId (protocol v6 only) vlmcsd shows all details of the query
HwId (protocol v6 only) vlmcsd shows all details of the query
and the response.
-l application
Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is
Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is
not complete. You may supply GUIDs with -a, -k and -s to specify
applications that are not listed with -x. The -l option is used
applications that are not listed with -x. The -l option is used
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, is
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.
-m Let the client pretend to be a virtual machine. Early versions
@ -302,4 +323,4 @@ SEE ALSO
Hotbird64 February 2015 VLMCS(1)
Hotbird64 May 2016 VLMCS(1)

173
vlmcs.c
View File

@ -8,15 +8,24 @@
#endif
#include "vlmcs.h"
#if _MSC_VER
#include <Shlwapi.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#if _MSC_VER
#include "wingetopt.h"
#else
#include <getopt.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
#ifndef _WIN32
#include <sys/ioctl.h>
#include <termios.h>
@ -39,18 +48,23 @@
#define VLMCS_OPTION_GRAB_INI 1
#define VLMCS_OPTION_NO_GRAB_INI 2
#define kmsVersionMinor 0 // Currently constant. May change in future KMS versions
//#define kmsVersionMinor 0 // Currently constant. May change in future KMS versions
#ifndef IS_LIBRARY
// Function Prototypes
static void CreateRequestBase(REQUEST *Request);
// KMS Parameters
#ifndef NO_VERBOSE_LOG
static int_fast8_t verbose = FALSE;
#endif
static int_fast8_t VMInfo = FALSE;
static int_fast8_t dnsnames = TRUE;
static int FixedRequests = 0;
static BYTE LicenseStatus = 0x02;
static DWORD LicenseStatus = 0x02;
static const char *CMID = NULL;
static const char *CMID_prev = NULL;
static const char *WorkstationName = NULL;
@ -60,6 +74,8 @@ static int_fast8_t ReconnectForEachRequest = FALSE;
static int AddressFamily = AF_UNSPEC;
static int_fast8_t incompatibleOptions = 0;
static const char* fn_ini_client = NULL;
static int_fast16_t kmsVersionMinor = 0;
static const char* ePidGroup[] = { "Windows", "Office2010", "Office2013", "Office2016" };
#ifndef NO_DNS
static int_fast8_t NoSrvRecordPriority = FALSE;
@ -78,7 +94,7 @@ typedef struct
} LicensePack;
typedef char iniFileEpidLines[3][256];
typedef char iniFileEpidLines[4][256];
// Well known "license packs"
static const LicensePack LicensePackList[] =
@ -160,7 +176,9 @@ __noreturn static void clientUsage(const char* const programName)
"Options:\n\n"
# ifndef NO_VERBOSE_LOG
" -v Be verbose\n"
# endif
" -l <app>\n"
" -4 Force V4 protocol\n"
" -5 Force V5 protocol\n"
@ -170,7 +188,8 @@ __noreturn static void clientUsage(const char* const programName)
# endif // USE_MSRPC
" -e Show some valid examples\n"
" -x Show valid Apps\n"
" -d no DNS names, use Netbios names (no effect if -w is used)\n\n"
" -d no DNS names, use Netbios names (no effect if -w is used)\n"
" -V show version information and exit\n\n"
"Advanced options:\n\n"
@ -179,6 +198,7 @@ __noreturn static void clientUsage(const char* const programName)
" -k <KmsGUID> Use custom KMS GUID\n"
" -c <ClientGUID> Use custom Client GUID. Default: Use random\n"
" -o <PreviousClientGUID> Use custom Prevoius Client GUID. Default: ZeroGUID\n"
" -K <ProtocolVersion> Use a specific (possibly invalid) protocol version\n"
" -w <Workstation> Use custom workstation name. Default: Use random\n"
" -r <RequiredClientCount> Fake required clients\n"
" -n <Requests> Fixed # of requests (Default: Enough to charge)\n"
@ -290,7 +310,7 @@ __noreturn static void showProducts(PRINTFUNC p)
for (currentProduct = ExtendedProductList; currentProduct->name; currentProduct++)
{
uint_fast8_t len = strlen(currentProduct->name);
uint_fast8_t len = (uint_fast8_t)strlen(currentProduct->name);
if (len > longestString)
longestString = len;
@ -352,6 +372,35 @@ __noreturn static void examples(const char* const programName)
exit(0);
}
static void parseProtocolVersion(void)
{
char *endptr_major, *endptr_minor, *period = strchr(optarg, (int)'.');
if (!period)
{
errorout("Fatal: Protocol version must be in the format #.#\n");
exit(!0);
}
long major = strtol(optarg, &endptr_major, 10);
long minor = strtol(period + 1, &endptr_minor, 10);
if ((*endptr_major && *endptr_major != '.') || *endptr_minor || *optarg == '.' || !period[1])
{
errorout("Fatal: Protocol version must be in the format #.#\n");
exit(!0);
}
if (major < 0 || major > 0xffff || minor < 0 || minor > 0xffff)
{
errorout("Fatal: Major and minor protocol version number must be between 0 and 65535\n");
exit(!0);
}
ActiveLicensePack.kmsVersionMajor = (int)major;
kmsVersionMinor = (int_fast16_t)minor;
}
#else // NO_HELP
@ -420,7 +469,7 @@ static BOOL findLicensePackByName(const char* const name, LicensePack* const lp)
#endif // Both Lists are available
}
static const char* const client_optstring = "+N:B:i:l:a:s:k:c:w:r:n:t:g:G:o:pPTv456mexd";
static const char* const client_optstring = "+N:B:i:l:a:s:k:c:w:r:n:t:g:G:o:K:pPTv456mexdV";
//First pass. We handle only "-l". Since -a -k -s -4 -5 and -6 are exceptions to -l, we process -l first
@ -498,7 +547,7 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
case 'i':
switch(getOptionArgumentInt(o, 4, 6))
switch(getOptionArgumentInt((char)o, 4, 6))
{
case 4:
AddressFamily = AF_INET;
@ -524,13 +573,13 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
case 'n': // Fixed number of Requests (regardless, whether they are required)
incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;
FixedRequests = getOptionArgumentInt(o, 1, INT_MAX);
FixedRequests = getOptionArgumentInt((char)o, 1, INT_MAX);
break;
case 'r': // Fake minimum required client count
incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;
ActiveLicensePack.N_Policy = getOptionArgumentInt(o, 1, INT_MAX);
ActiveLicensePack.N_Policy = getOptionArgumentInt((char)o, 0, INT_MAX);
break;
case 'c': // use a specific client GUID
@ -556,7 +605,7 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
case 'g': // Set custom "grace" time in minutes (default 30 days)
BindingExpiration = getOptionArgumentInt(o, 0, INT_MAX);
BindingExpiration = getOptionArgumentInt((char)o, 0, INT_MAX);
break;
case 's': // Set specfic SKU ID
@ -577,6 +626,12 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;
ActiveLicensePack.kmsVersionMajor = o - 0x30;
kmsVersionMinor = 0;
break;
case 'K': // Use specific protocol (may be invalid)
parseProtocolVersion();
break;
case 'd': // Don't use DNS names
@ -584,11 +639,15 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
dnsnames = FALSE;
break;
# ifndef NO_VERBOSE_LOG
case 'v': // Be verbose
verbose = TRUE;
break;
# endif // NO_VERBOSE_LOG
case 'm': // Pretend to be a virtual machine
VMInfo = TRUE;
@ -600,14 +659,15 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
if (strlen(WorkstationName) > 63)
{
errorout("\007WARNING! Truncating Workstation name to 63 characters (%s).\n", WorkstationName);
errorout("\007WARNING! Truncating workstation name to 63 characters (%s).\n", WorkstationName);
}
break;
case 't':
LicenseStatus = getOptionArgumentInt(o, 0, 6) & 0xff;
LicenseStatus = getOptionArgumentInt((char)o, 0, 0x7fffffff);
if ((unsigned int)LicenseStatus > 6) errorout("Warning: Correct license status is 0 <= license status <= 6.\n");
break;
# ifndef USE_MSRPC
@ -623,6 +683,21 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;
break;
# ifndef NO_VERSION_INFORMATION
case 'V':
# if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printf("vlmcs %s %i-bit\n", Version, sizeof(void*) == 4 ? 31 : (int)sizeof(void*) << 3);
# else
printf("vlmcs %s %i-bit\n", Version, (int)sizeof(void*) << 3);
# endif // defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printPlatform();
printCommonFlags();
printClientFlags();
exit(0);
# endif // NO_VERSION_INFORMATION
default:
clientUsage(programName);
}
@ -651,8 +726,10 @@ static void checkRpcLevel(const REQUEST* request, RESPONSE* response)
if (UseRpcBTFN && UseRpcNDR64 && RpcFlags.HasNDR64 && !RpcFlags.HasBTFN)
errorout("\nWARNING: Server's RPC protocol has NDR64 but no BTFN.\n");
# ifndef NO_BASIC_PRODUCT_LIST
if (!IsEqualGuidLEHE(&request->KMSID, &ProductList[15].guid) && UseRpcBTFN && !RpcFlags.HasBTFN)
errorout("\nWARNING: A server with pre-Vista RPC activated a product other than Office 2010.\n");
# endif // NO_BASIC_PRODUCT_LIST
}
#endif // USE_MSRPC
@ -670,7 +747,7 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
if (!result.TimeStampOK) errorout("\n\007ERROR: Time stamps of request and response do not match.\n");
if (!result.VersionOK) errorout("\n\007ERROR: Protocol versions of request and response do not match.\n");
if (!result.HmacSha256OK) errorout("\n\007ERROR: Keyed-Hash Message Authentication Code (HMAC) is incorrect.\n");
if (!result.IVnotSuspicious) errorout("\nWARNING: Response uses an IV following KMSv5 rules in KMSv6 protocol.\n");
if (!result.IVnotSuspicious) errorout("\nWARNING: The KMS server is an emulator because the response uses an IV following KMSv5 rules in KMSv6 protocol.\n");
if (result.effectiveResponseSize != result.correctResponseSize)
{
@ -690,7 +767,9 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
}
// Read KMSPID from Response
# ifndef NO_VERBOSE_LOG
if (!verbose)
# endif // NO_VERBOSE_LOG
{
printf(" -> %s", ePID);
@ -705,6 +784,7 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
printf("\n");
}
# ifndef NO_VERBOSE_LOG
else
{
printf(
@ -715,6 +795,7 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
logResponseVerbose(ePID, hwid, response, &printf);
printf("\n");
}
# endif // NO_VERBOSE_LOG
}
@ -760,6 +841,7 @@ static void connectRpc(RpcCtx *s)
if (!NoSrvRecordPriority) sortSrvRecords(serverlist, numServers);
# ifndef NO_VERBOSE_LOG
if (verbose /*&& !ServerListAlreadyPrinted*/)
{
for (i = 0; i < numServers; i++)
@ -775,6 +857,7 @@ static void connectRpc(RpcCtx *s)
printf("\n");
//ServerListAlreadyPrinted = TRUE;
}
# endif // NO_VERBOSE_LOG
}
else // Just use the server supplied on the command line
{
@ -794,16 +877,21 @@ static void connectRpc(RpcCtx *s)
if (*s == INVALID_RPCCTX) continue;
if (verbose)
printf("\nPerforming RPC bind ...\n");
# ifndef NO_VERBOSE_LOG
if (verbose) printf("\nPerforming RPC bind ...\n");
if (rpcBindClient(*s, verbose))
# else
if (rpcBindClient(*s, FALSE))
# endif
{
errorout("Warning: Could not bind RPC\n");
continue;
}
# ifndef NO_VERBOSE_LOG
if (verbose) printf("... successful\n");
# endif
return;
}
@ -814,8 +902,9 @@ static void connectRpc(RpcCtx *s)
# endif // DNS
}
#endif // IS_LIBRARY
static int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQUEST *baseRequest, RESPONSE_RESULT *result, BYTE *const hwid)
int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQUEST *baseRequest, RESPONSE_RESULT *result, BYTE *const hwid)
{
size_t requestSize, responseSize;
BYTE *request, *response;
@ -823,7 +912,7 @@ static int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQU
result->mask = 0;
if (LE16(baseRequest->MajorVer) == 4)
if (LE16(baseRequest->MajorVer) < 5)
request = CreateRequestV4(&requestSize, baseRequest);
else
request = CreateRequestV6(&requestSize, baseRequest);
@ -833,13 +922,13 @@ static int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQU
if (LE16(((RESPONSE*)(response))->MajorVer) == 4)
{
RESPONSE_V4 response_v4;
*result = DecryptResponseV4(&response_v4, responseSize, response, request);
*result = DecryptResponseV4(&response_v4, (const int)responseSize, response, request);
memcpy(baseResponse, &response_v4.ResponseBase, sizeof(RESPONSE));
}
else
{
RESPONSE_V6 response_v6;
*result = DecryptResponseV6(&response_v6, responseSize, response, request, hwid);
*result = DecryptResponseV6(&response_v6, (int)responseSize, response, request, hwid);
memcpy(baseResponse, &response_v6.ResponseBase, sizeof(RESPONSE));
}
@ -851,6 +940,7 @@ static int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQU
return status;
}
#ifndef IS_LIBRARY
static int sendRequest(RpcCtx *const s, REQUEST *const request, RESPONSE *const response, hwid_t hwid, RESPONSE_RESULT *const result)
{
@ -919,7 +1009,7 @@ static void newIniBackupFile(const char* const restrict fname)
if (fclose(f))
{
errorout("Fatal: Cannot write to %s: %s\n", fname, strerror(errno));
unlink(fname);
vlmcsd_unlink(fname);
exit(!0);
}
}
@ -928,7 +1018,9 @@ static void newIniBackupFile(const char* const restrict fname)
static void updateIniFile(iniFileEpidLines* const restrict lines)
{
int_fast8_t lineWritten[_countof(*lines)];
# if !_MSC_VER
struct stat statbuf;
# endif
uint_fast8_t i;
int_fast8_t iniFileExistedBefore = TRUE;
unsigned int lineNumber;
@ -940,6 +1032,13 @@ static void updateIniFile(iniFileEpidLines* const restrict lines)
strcpy(fn_bak, fn_ini_client);
strcat(fn_bak, "~");
# if _MSC_VER
if (!PathFileExists(fn_ini_client))
{
iniFileExistedBefore = FALSE;
newIniBackupFile(fn_bak);
}
# else
if (stat(fn_ini_client, &statbuf))
{
if (errno != ENOENT)
@ -953,9 +1052,10 @@ static void updateIniFile(iniFileEpidLines* const restrict lines)
newIniBackupFile(fn_bak);
}
}
# endif
else
{
unlink(fn_bak); // Required for Windows. Most Unix systems don't need it.
vlmcsd_unlink(fn_bak); // Required for Windows. Most Unix systems don't need it.
if (rename(fn_ini_client, fn_bak))
{
errorout("Fatal: Cannot create %s: %s\n", fn_bak, strerror(errno));
@ -989,7 +1089,7 @@ static void updateIniFile(iniFileEpidLines* const restrict lines)
{
for (i = 0; i < _countof(*lines); i++)
{
if (*(*lines)[i] && !strncasecmp(sourceLine, (*lines)[i], GUID_STRING_LENGTH))
if (*(*lines)[i] && !strncasecmp(sourceLine, (*lines)[i], strlen(ePidGroup[i])))
{
if (lineWritten[i]) break;
@ -1029,17 +1129,18 @@ static void updateIniFile(iniFileEpidLines* const restrict lines)
exit(!0);
}
if (!iniFileExistedBefore) unlink(fn_bak);
if (!iniFileExistedBefore) vlmcsd_unlink(fn_bak);
free(fn_bak);
}
static void grabServerData()
{
RpcCtx s = INVALID_RPCCTX;
WORD MajorVer = 6;
iniFileEpidLines lines;
int_fast8_t Licenses[_countof(lines)] = { 0, 15, 14 };
static int_fast8_t Licenses[_countof(lines)] = { 0, 16, 17, 19 };
uint_fast8_t i;
RESPONSE response;
RESPONSE_RESULT result;
@ -1072,29 +1173,26 @@ static void grabServerData()
continue;
}
printf("%i of %i", (int)(i + 7 - MajorVer), (int)(9 - MajorVer));
printf("%i of %i", (int)(i + 7 - MajorVer), (int)(10 - MajorVer));
displayResponse(result, &request, &response, hwid);
char guidBuffer[GUID_STRING_LENGTH + 1];
char ePID[3 * PID_BUFFER_SIZE];
uuid2StringLE(&request.AppID, guidBuffer);
if (!ucs2_to_utf8(response.KmsPID, ePID, PID_BUFFER_SIZE, 3 * PID_BUFFER_SIZE))
{
memset(ePID + 3 * PID_BUFFER_SIZE - 3, 0, 3);
}
snprintf(lines[i], sizeof(lines[0]), "%s = %s", guidBuffer, ePID);
vlmcsd_snprintf(lines[i], sizeof(lines[0]), "%s = %s", ePidGroup[i], ePID);
if (response.MajorVer > 5)
{
len = strlen(lines[i]);
snprintf (lines[i] + len, sizeof(lines[0]) - len, "/ %02X %02X %02X %02X %02X %02X %02X %02X", hwid[0], hwid[1], hwid[2], hwid[3], hwid[4], hwid[5], hwid[6], hwid[7]);
vlmcsd_snprintf (lines[i] + len, sizeof(lines[0]) - len, " / %02X %02X %02X %02X %02X %02X %02X %02X", hwid[0], hwid[1], hwid[2], hwid[3], hwid[4], hwid[5], hwid[6], hwid[7]);
}
len = strlen(lines[i]);
snprintf(lines[i] + len, sizeof(lines[0]) - len, "\n");
vlmcsd_snprintf(lines[i] + len, sizeof(lines[0]) - len, "\n");
}
@ -1110,7 +1208,7 @@ static void grabServerData()
}
int client_main(const int argc, CARGV argv)
int client_main(int argc, CARGV argv)
{
#if defined(_WIN32) && !defined(USE_MSRPC)
@ -1174,7 +1272,7 @@ int client_main(const int argc, CARGV argv)
int requests;
RpcCtx s = INVALID_RPCCTX;
for (requests = 0, RequestsToGo = ActiveLicensePack.N_Policy - 1; RequestsToGo; requests++)
for (requests = 0, RequestsToGo = ActiveLicensePack.N_Policy == 1 ? 1 : ActiveLicensePack.N_Policy - 1; RequestsToGo; requests++)
{
RESPONSE response;
REQUEST request;
@ -1276,10 +1374,10 @@ static void CreateRequestBase(REQUEST *Request)
{
int len, len2;
unsigned int index = rand() % _countof(ClientDnsNames.first);
len = utf8_to_ucs2(Request->WorkstationName, ClientDnsNames.first[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);
len = (int)utf8_to_ucs2(Request->WorkstationName, ClientDnsNames.first[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);
index = rand() % _countof(ClientDnsNames.second);
len2 = utf8_to_ucs2(Request->WorkstationName + len, ClientDnsNames.second[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);
len2 = (int)utf8_to_ucs2(Request->WorkstationName + len, ClientDnsNames.second[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);
index = rand() % _countof(ClientDnsNames.tld);
utf8_to_ucs2(Request->WorkstationName + len + len2, ClientDnsNames.tld[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);
@ -1298,13 +1396,14 @@ static void CreateRequestBase(REQUEST *Request)
Request->WorkstationName[size] = 0;
}
//Show Details
# ifndef NO_VERBOSE_LOG
if (verbose)
{
printf("\nRequest Parameters\n==================\n\n");
logRequestVerbose(Request, &printf);
printf("\n");
}
# endif // NO_VERBOSE_LOG
}
#endif // IS_LIBRARY

View File

@ -10,6 +10,12 @@
#include <winsock2.h>
#endif // defined(USE_MSRPC) && defined(_WIN32)
#include "types.h"
#ifndef USE_MSRPC
#include "rpc.h"
#else // USE_MSRPC
#include "msrpc-client.h"
#endif // USE_MSRPC
#include "kms.h"
#if MULTI_CALL_BINARY < 1
#define client_main main
@ -17,5 +23,7 @@
int client_main(int argc, CARGV argv);
#endif
int SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQUEST *baseRequest, RESPONSE_RESULT *result, BYTE *const hwid);
#endif /* VLMCS_H_ */

File diff suppressed because it is too large Load Diff

292
vlmcsd-floppy.7 Normal file
View File

@ -0,0 +1,292 @@
.mso www.tmac
.TH "VLMCSD-FLOPPY" 7 "June 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.
.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

530
vlmcsd-floppy.7.dos.txt Normal file
View File

@ -0,0 +1,530 @@
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.
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 June 2016 VLMCSD-FLOPPY(7)

809
vlmcsd-floppy.7.html Normal file
View File

@ -0,0 +1,809 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!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
&minus; 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>
<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&minus;F2 to
ALT&minus;F6. To return to the console on /dev/tty1, press
ALT&minus;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&minus;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
vlmcsd-floppy.7.pdf Normal file

Binary file not shown.

530
vlmcsd-floppy.7.unix.txt Normal file
View File

@ -0,0 +1,530 @@
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.
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 June 2016 VLMCSD-FLOPPY(7)

View File

@ -1,4 +1,4 @@
.TH VLMCSD 7 "June 2014" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD 7 "March 2016" "Hotbird64" "KMS Activation Manual"
.SH NAME
vlmcsd\ \-\ a guide to KMS activation using vlmcsd
@ -41,6 +41,14 @@ Office 2013: http://technet.microsoft.com/en-us/library/dn385360.aspx
.PP
These lists only include products that Microsoft sells to corporations via volume license contracts. For Windows there are inofficial GVLKs that work with consumer-only versions of Windows. Here is a list:
.PP
TX9XD\-98N7V\-6WMQ6\-BX7FG\-H8Q99 - Windows 10 Home
.br
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

View File

@ -76,6 +76,10 @@ DESCRIPTION
via volume license contracts. For Windows there are inofficial GVLKs
that work with consumer-only versions of Windows. Here is a list:
TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 - Windows 10 Home
3KHY7-WNT83-DGQKR-F7HPR-844BM - Windows 10 Home N
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH - Windows 10 Home Single Language
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR - Windows 10 Home Country Specific
789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media
Center
M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core
@ -219,4 +223,4 @@ SEE ALSO
Hotbird64 June 2014 VLMCSD(7)
Hotbird64 March 2016 VLMCSD(7)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:21 2016 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -169,8 +169,16 @@ inofficial GVLKs that work with consumer-only versions of
Windows. Here is a list:</p>
<p style="margin-left:11%; margin-top: 1em">789NJ&minus;TQK6T&minus;6XTH8&minus;J39CJ&minus;J8D3P
- Windows 8.1 Professional with Media Center <br>
<p style="margin-left:11%; margin-top: 1em">TX9XD&minus;98N7V&minus;6WMQ6&minus;BX7FG&minus;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 -

Binary file not shown.

View File

@ -76,6 +76,10 @@ DESCRIPTION
via volume license contracts. For Windows there are inofficial GVLKs
that work with consumer-only versions of Windows. Here is a list:
TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 - Windows 10 Home
3KHY7-WNT83-DGQKR-F7HPR-844BM - Windows 10 Home N
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH - Windows 10 Home Single Language
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR - Windows 10 Home Country Specific
789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media
Center
M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core
@ -219,4 +223,4 @@ SEE ALSO
Hotbird64 June 2014 VLMCSD(7)
Hotbird64 March 2016 VLMCSD(7)

View File

@ -1,5 +1,5 @@
.mso www.tmac
.TH VLMCSD 8 "September 2015" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD 8 "September 2016" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
@ -27,6 +27,9 @@ All options that do no require an argument may be combined with a single dash, f
.IP "\fB-h\fR or \fB-?\fR"
Displays help.
.IP "\fB-V\fR"
Displays extended version information. This includes the compiler 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 \fBmake help\fR (or \fBgmake help\fR on systems that do not use the GNU version of \fBmake\fR(1) by default) to see the meaning of those flags.
.IP "\fB-L\fR \fIipaddress\fR[:\fIport\fR]"
Instructs vlmcsd to listen on \fIipaddress\fR with optional \fIport\fR (default 1688). You can use this option more than once. If you do not specify \fB-L\fR 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.
.PP
@ -36,14 +39,38 @@ 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-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"
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-4\fR and \fB-6\fR"
Used to control the use of IPv4 and IPv4 if you did not use -L. If you specify both \fB-4\fR and \fB-6\fR or none, vlmcsd uses both protocols. If you specify only one, that protocol will be used only. \fBThese options are deprecated and will be removed.\fR
.IP "\fB-I\fR"
This option is deprecated and does nothing. It is provided for compatibility with svn681 and earlier versions only. It will be removed in a future release.
.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"
Timeout the TCP connection with the client after \fIseconds\fR seconds. After sending an activation request. RPC keeps the TCP connection for a while. The default is 30 seconds. You may specify a shorter period to free ressources on your device faster. This is useful for devices with limited main memory or if you used \fB-m\fR to limit the concurrent clients that may request activation. Microsoft RPC clients disconnect after 30 seconds by default. Setting \fIseconds\fR to a greater value does not make much sense.
@ -70,6 +97,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
@ -79,9 +109,6 @@ The native Windows version never daemonizes and always behaves as if \fB-D\fR ha
.IP "\fB-e\fR"
If specified, vlmcsd ignores \fB-l\fR and writes all logging output to \fBstdout\fR(3). This is mainly useful for testing and debugging and often combined with \fB-D\fR.
.IP "\fB-f\fR"
This flag combines \fB-D\fR and \fB-e\fR. So typing "vlmcsd -f" is identical to "vlmcsd -De". The purpose of \fB-f\fR is to provide compatibility with previous versions of vlmcsd. \fBThis option is deprecated and will be removed.\fR
.IP "\fB-v\fR"
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 logging is used. Thus \fB-v\fR does not make sense if not used with \fB-l\fR, \fB-e\fR or \fB-f\fR.
@ -108,7 +135,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.
@ -135,15 +165,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.
@ -220,7 +250,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.
@ -228,7 +258,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"
@ -243,7 +273,10 @@ 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 INTENTIONAL BUGS
vlmcsd activates non-VL (retail) and beta/preview versions of Windows.
.br
vlmcsd always reports enough active clients to satisfy the N count policy of the request.
.SH AUTHOR
Written by crony12, Hotbird64 and vityan666.

View File

@ -52,79 +52,154 @@ OPTIONS
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
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
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
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
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.
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
[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.
-4 and -6
Used to control the use of IPv4 and IPv4 if you did not use -L.
If you specify both -4 and -6 or none, vlmcsd uses both proto
cols. If you specify only one, that protocol will be used only.
These options are deprecated and will be removed.
-I This option is deprecated and does nothing. It is provided for
compatibility with svn681 and earlier versions only. It will be
removed in a future release.
-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
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
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
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.
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
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
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
-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
-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
@ -132,61 +207,65 @@ OPTIONS
-N0 and -N1
Disables (-N0) or enables (-N1) the use of the NDR64 transfer
syntax in the RPC protocol. Unlike Microsoft vlmcsd supports
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
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
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
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
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
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
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.
-D Normally vlmcsd daemonizes and runs in background (except the
native Windows version). If -D is specified, vlmcsd does not
-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
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
stdout(3). This is mainly useful for testing and debugging and
often combined with -D.
-f This flag combines -D and -e. So typing "vlmcsd -f" is identical
to "vlmcsd -De". The purpose of -f is to provide compatibility
with previous versions of vlmcsd. This option is deprecated and
will be removed.
-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
@ -239,19 +318,24 @@ OPTIONS
-3 ePID
Use ePID as Office 2013/2016 ePID (including Project and Visio).
If specified, -r is disregarded for Office 2013/2016.
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)
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
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
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
@ -260,14 +344,14 @@ OPTIONS
-i filename
Use configuration file (aka ini file) filename. Most configura
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
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
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.
@ -277,121 +361,123 @@ OPTIONS
- 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 the application-guid
for the KMS request
- 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
-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
-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
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
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
identically to -r2. 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.
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. 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.
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
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
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
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 -
Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033.
-R renewal-interval
Instructs clients to renew activation every 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
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
-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
-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
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
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
-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
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,
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
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
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
-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
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
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.
@ -399,20 +485,20 @@ OPTIONS
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
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
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
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
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.
@ -421,51 +507,54 @@ SIGNALS
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
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
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
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
— 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
— 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
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
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, 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.
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.
@ -475,7 +564,7 @@ FILES
EXAMPLES
vlmcsd -f
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.
@ -501,18 +590,20 @@ EXAMPLES
BUGS
An ePID specified in an ini file must not contain spaces.
The maximum number of -L options in the command line or listen state
ments in the inifile is the platform default for FD_SETSIZE. This is 64
on Windows and 1024 on most Unixes.
INTENTIONAL BUGS
vlmcsd activates non-VL (retail) and beta/preview versions of Windows.
vlmcsd always reports enough active clients to satisfy the N count pol
icy of the request.
AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from
Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
@ -521,4 +612,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD(8)
Hotbird64 September 2016 VLMCSD(8)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -30,6 +30,7 @@
<a href="#FILES">FILES</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#INTENTIONAL BUGS">INTENTIONAL BUGS</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#CREDITS">CREDITS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
@ -112,6 +113,27 @@ is optional. Thus &quot;vlmcsd -r 2&quot; and &quot;vlmcsd
<p style="margin-left:22%;">Displays help.</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="3%">
<p><b>-V</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Displays extended version information. This includes the
compiler 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 <b>make help</b> (or
<b>gmake help</b> on systems that do not use the GNU version
of <b>make</b>(1) by default) to see the meaning of those
flags.</p> </td></tr>
</table>
<p style="margin-left:11%;"><b>-L</b>
<i>ipaddress</i>[:<i>port</i>]</p>
@ -142,6 +164,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
@ -149,30 +255,19 @@ 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>-4</b> and <b>-6</b></p>
<p style="margin-left:11%;"><b>-F0</b> and <b>-F1</b></p>
<p style="margin-left:22%;">Used to control the use of IPv4
and IPv4 if you did not use -L. If you specify both
<b>-4</b> and <b>-6</b> or none, vlmcsd uses both protocols.
If you specify only one, that protocol will be used only.
<b>These options are deprecated and will be removed.</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="3%">
<p><b>-I</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>This option is deprecated and does nothing. It is
provided for compatibility with svn681 and earlier versions
only. It will be removed in a future release.</p></td></tr>
</table>
<p style="margin-left:22%;">Allow (<b>-F1</b>) or disallow
(<b>-F0</b>) binding to IP addresses that are currently not
configured on your system. The default is <b>-F0</b>.
<b>-F1</b> allows you to bind to an IP address that may be
configured after you started <b>vlmcsd</b>. <b>vlmcsd</b>
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.</p>
<p style="margin-left:11%;"><b>-t</b> <i>seconds</i></p>
@ -276,6 +371,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">
@ -321,21 +428,6 @@ combined with <b>-D</b>.</p></td></tr>
<td width="3%">
<p><b>-f</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>This flag combines <b>-D</b> and <b>-e</b>. So typing
&quot;vlmcsd -f&quot; is identical to &quot;vlmcsd
-De&quot;. The purpose of <b>-f</b> is to provide
compatibility with previous versions of vlmcsd. <b>This
option is deprecated and will be removed.</b></p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-v</b></p></td>
<td width="8%"></td>
<td width="78%">
@ -410,9 +502,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>
@ -457,14 +555,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>
@ -484,17 +582,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>
@ -759,11 +859,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>
@ -782,7 +886,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
@ -819,11 +923,16 @@ 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>INTENTIONAL BUGS
<a name="INTENTIONAL BUGS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">vlmcsd
activates non-VL (retail) and beta/preview versions of
Windows. <br>
vlmcsd always reports enough active clients to satisfy the N
count policy of the request.</p>
<h2>AUTHOR
<a name="AUTHOR"></a>

Binary file not shown.

View File

@ -52,79 +52,154 @@ OPTIONS
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
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
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
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
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.
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
[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.
-4 and -6
Used to control the use of IPv4 and IPv4 if you did not use -L.
If you specify both -4 and -6 or none, vlmcsd uses both proto
cols. If you specify only one, that protocol will be used only.
These options are deprecated and will be removed.
-I This option is deprecated and does nothing. It is provided for
compatibility with svn681 and earlier versions only. It will be
removed in a future release.
-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
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
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
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.
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
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
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
-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
-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
@ -132,61 +207,65 @@ OPTIONS
-N0 and -N1
Disables (-N0) or enables (-N1) the use of the NDR64 transfer
syntax in the RPC protocol. Unlike Microsoft vlmcsd supports
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
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
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
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
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
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
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.
-D Normally vlmcsd daemonizes and runs in background (except the
native Windows version). If -D is specified, vlmcsd does not
-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
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
stdout(3). This is mainly useful for testing and debugging and
often combined with -D.
-f This flag combines -D and -e. So typing "vlmcsd -f" is identical
to "vlmcsd -De". The purpose of -f is to provide compatibility
with previous versions of vlmcsd. This option is deprecated and
will be removed.
-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
@ -239,19 +318,24 @@ OPTIONS
-3 ePID
Use ePID as Office 2013/2016 ePID (including Project and Visio).
If specified, -r is disregarded for Office 2013/2016.
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)
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
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
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
@ -260,14 +344,14 @@ OPTIONS
-i filename
Use configuration file (aka ini file) filename. Most configura
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
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
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.
@ -277,121 +361,123 @@ OPTIONS
- 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 the application-guid
for the KMS request
- 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
-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
-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
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
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
identically to -r2. 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.
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. 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.
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
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
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
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 -
Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033.
-R renewal-interval
Instructs clients to renew activation every 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
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
-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
-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
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
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
-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
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,
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
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
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
-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
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
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.
@ -399,20 +485,20 @@ OPTIONS
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
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
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
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
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.
@ -421,51 +507,54 @@ SIGNALS
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
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
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
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
— 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
— 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
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
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, 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.
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.
@ -475,7 +564,7 @@ FILES
EXAMPLES
vlmcsd -f
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.
@ -501,18 +590,20 @@ EXAMPLES
BUGS
An ePID specified in an ini file must not contain spaces.
The maximum number of -L options in the command line or listen state
ments in the inifile is the platform default for FD_SETSIZE. This is 64
on Windows and 1024 on most Unixes.
INTENTIONAL BUGS
vlmcsd activates non-VL (retail) and beta/preview versions of Windows.
vlmcsd always reports enough active clients to satisfy the N count pol
icy of the request.
AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from
Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid.
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
@ -521,4 +612,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD(8)
Hotbird64 September 2016 VLMCSD(8)

1518
vlmcsd.c

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,7 @@ extern char *fn_log;
//int main(int argc, CARGV);
extern void cleanup();
#ifdef _NTSERVICE
int newmain();
#endif
#if MULTI_CALL_BINARY < 1
#define server_main main
@ -47,6 +45,13 @@ int server_main(int argc, CARGV argv);
#define INI_PARAM_PORT 14
#define INI_PARAM_RPC_NDR64 15
#define INI_PARAM_RPC_BTFN 16
#define INI_PARAM_FREEBIND 17
#define INI_PARAM_PUBLIC_IP_PROTECTION_LEVEL 18
#define INI_PARAM_LOG_DATE_AND_TIME 19
#define INI_PARAM_WINDOWS 20
#define INI_PARAM_OFFICE2010 21
#define INI_PARAM_OFFICE2013 22
#define INI_PARAM_OFFICE2016 23
#define INI_FILE_PASS_1 1
#define INI_FILE_PASS_2 2

View File

@ -12,29 +12,40 @@
#
# 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 custom TCP port
# Command line: -P
# ***The Port directive only works if vlmcsd was compiled to use MS RPC
# ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets
# ***Use Listen otherwise
;Port = 1688
;Port = 1234
# Listen on all IPv4 addresses (default port 1688)
# Command line: -L (and compatibility options -4, -6, -P)
# Does not work with MS RPC, use Port=
# Command line: -L
# Does not work with MS RPC or simple sockets, use Port=
;Listen = 0.0.0.0:1688
# Listen on all IPv6 addresses (default port 1688)
# Command line: -L (and compatibility options -4, -6, -P)
# 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
# Randomize ePIDs at program start up (only those that are not explicitly specified)
# Command line: -r
;RandomizationLevel = 1
@ -63,6 +74,10 @@
# 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
@ -84,9 +99,9 @@
;group = vlmcsdgroup
# Disable or enable the NDR64 transfer syntax in RPC (default enabled)
# Command line: -n
# Command line: -N0 and -B1
;UseNDR64 = true
# Disable or enable bind time feature negotiation in RPC (default enabled)
# Command line: -b
# Command line: -B0 and -B1
;UseBTFN = true

View File

@ -1,4 +1,4 @@
.TH VLMCSD.INI 5 "September 2015" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD.INI 5 "September 2016" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
@ -34,10 +34,10 @@ Lines, that start with '#' or ';' are treated as comments. Empty lines are ignor
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:
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, \fB-P\fR, \fB-4\fR or \fB-6\fR on the command line, all \fBListen\fR keywords in the ini file will be ignored. The \fBListen\fR keyword cannot be used on Windows and Cygwin if vlmcsd has been compiled to use Microsoft RPC.
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:
@ -48,7 +48,23 @@ Listen = 0.0.0.0:1234
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
.IP "\fBPort\fR"
Can only be used on Windows and Cygwin if vlmcsd has been compiled to use Microsoft RPC. Causes vlmcsd to listen on that port instead of 1688. On all non-Windows operating systems or if vlmcsd has been compiled to use its own RPC implementation, you must use \fBListen\fR instead.
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 "\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.
@ -57,7 +73,7 @@ Can be TRUE or FALSE. Specifies whether you want to use the NDR64 transfer synta
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.
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.
@ -77,6 +93,9 @@ Write a pid file. The \fIargument\fR is the full pathname of a pid file. The pid
.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 "\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).
@ -84,7 +103,7 @@ Set this to either TRUE or FALSE. The default is FALSE. If set to TRUE, more det
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: ActivationInterval = 3h. 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.
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.
@ -92,24 +111,20 @@ Run vlmcsd as another, preferrably less privileged, user. The \fIargument\fR can
.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.
.SH "SPECIAL KEYWORDS"
Any valid GUID is being treated as a special \fBkeyword\fR in the ini file. It is used to select a specfic ePID and HwId for an application GUID. The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. KMS currently knows only 3 application GUIDs:
.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.
55c92734\-d682\-4d71\-983e\-d6ec3f16059f\ (Windows)
.br
59a52881\-a989\-479d\-af46\-f275c6370663\ (Office 2010)
.br
0ff1ce15\-a989\-479d\-af46\-f275c6370663\ (Office 2013)
.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.
To use specific ePIDs for Windows, Office 2010 and Office 2013/2016 you could add the following lines to vlmcsd.ini:
.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.
.SM "55c92734\-d682\-4d71\-983e\-d6ec3f16059f\ =\ 55041\-00206\-184\-207146\-03\-1062\-6002.0000\-3322013"
.br
.SM "59a52881\-a989\-479d\-af46\-f275c6370663\ =\ 55041\-00096\-216\-598637\-03\-17418\-6002.0000\-3312013"
.br
.SM "0ff1ce15\-a989\-479d\-af46\-f275c6370663\ =\ 55041\-00206-234\-742099\-03\-9217\-6002.0000\-2942013"
.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.
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.
.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.

View File

@ -66,7 +66,9 @@ SYNTAX
KEYWORDS
The following keywords are defined:
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
@ -77,10 +79,10 @@ KEYWORDS
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, -P, -4 or -6 on the command line, all Listen keywords in
the ini file will be ignored. The Listen keyword cannot be used
on Windows and Cygwin if vlmcsd has been compiled to use Micro
soft RPC.
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:
@ -89,11 +91,36 @@ KEYWORDS
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used on Windows and Cygwin if vlmcsd has been com
piled to use Microsoft RPC. Causes vlmcsd to listen on that port
instead of 1688. On all non-Windows operating systems or if vlm
csd has been compiled to use its own RPC implementation, you
must use Listen instead.
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.
UseNDR64
@ -111,56 +138,68 @@ KEYWORDS
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.
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
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
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
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
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
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
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
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.
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
@ -177,12 +216,12 @@ KEYWORDS
RenewalInterval
This is the same as specifying -R on the command line. See vlm
csd(8) for details. The default is 7 days. Example: Activation
Interval = 3h. 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 recommen
dation to the client. Older KMS clients did follow the recommen
dation from a KMS server or emulator. Newer clients do not.
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
@ -207,42 +246,50 @@ KEYWORDS
changed on the fly by sending SIGHUP to vlmcsd.
SPECIAL KEYWORDS
Any valid GUID is being treated as a special keyword in the ini file.
It is used to select a specfic ePID and HwId for an application GUID.
The argument has the form ePID [ / HwId ]. KMS currently knows only 3
application GUIDs:
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.
55c92734-d682-4d71-983e-d6ec3f16059f (Windows)
59a52881-a989-479d-af46-f275c6370663 (Office 2010)
0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013)
To use specific ePIDs for Windows, Office 2010 and Office 2013/2016 you
could add the following lines to vlmcsd.ini:
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.
55c92734-d682-4d71-983e-d6ec3f16059f = 55041-00206-184-207146-03-1062-6002.0000-3322013
59a52881-a989-479d-af46-f275c6370663 = 55041-00096-216-598637-03-17418-6002.0000-3312013
0ff1ce15-a989-479d-af46-f275c6370663 = 55041-00206-234-742099-03-9217-6002.0000-2942013
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
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
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
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
the -H option in vlmcsd(8) ecxept that you must not enclose a HWID in
quotes even if it contains spaces.
@ -256,7 +303,7 @@ AUTHOR
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
@ -265,4 +312,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD.INI(5)
Hotbird64 September 2016 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!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>
@ -137,7 +137,9 @@ Binary arguments are case-insensitive.</p>
<p style="margin-left:11%; margin-top: 1em">The following
<i>keyword</i>s are defined:</p>
<i>keyword</i>s are defined (not all keywords may be
available depending on the operating system and the options
used when <b>vlmcsd</b>(8) was compiled):</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
@ -161,11 +163,11 @@ the <i>ipaddress</i> 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 <b>-L</b> option in
<b>vlmcsd</b>(8) for more info about the syntax. If you use
<b>-L</b>, <b>-P</b>, <b>-4</b> or <b>-6</b> on the command
line, all <b>Listen</b> keywords in the ini file will be
ignored. The <b>Listen</b> keyword cannot be used on Windows
and Cygwin if vlmcsd has been compiled to use Microsoft
RPC.</p> </td></tr>
<b>-L</b> or <b>-P</b> on the command line, all
<b>Listen</b> keywords in the ini file will be ignored. The
<b>Listen</b> keyword cannot be used if vlmcsd has been
compiled to use Microsoft RPC (Windows and Cygwin only) or
simple sockets.</p></td></tr>
</table>
<p style="margin-left:22%; margin-top: 1em">Examples:</p>
@ -187,14 +189,44 @@ Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688</p>
<td width="78%">
<p style="margin-top: 1em">Can only be used on Windows and
Cygwin if vlmcsd has been compiled to use Microsoft RPC.
Causes vlmcsd to listen on that port instead of 1688. On all
non-Windows operating systems or if vlmcsd has been compiled
to use its own RPC implementation, you must use
<b>Listen</b> instead.</p></td></tr>
<p style="margin-top: 1em">Can only be used if vlmcsd has
been compiled to use simple sockets or on Windows and Cygwin
if <b>vlmcsd</b>(8) has been compiled to use Microsoft RPC.
Otherwise you must use <b>Listen</b> instead. Causes vlmcsd
to listen on that port instead of 1688.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>FreeBind</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. If TRUE,
you can use the <b>Listen</b> keyword with IP addresses that
are currently not defined on your system. <b>vlmcsd</b>(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.</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>
<p style="margin-left:11%;"><b>UseNDR64</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. Specifies
@ -214,7 +246,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">
@ -283,6 +317,19 @@ 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>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
@ -303,8 +350,8 @@ details. The default is 2 hours. Example: ActivationInterval
<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
@ -357,46 +404,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>

Binary file not shown.

View File

@ -66,7 +66,9 @@ SYNTAX
KEYWORDS
The following keywords are defined:
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
@ -77,10 +79,10 @@ KEYWORDS
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, -P, -4 or -6 on the command line, all Listen keywords in
the ini file will be ignored. The Listen keyword cannot be used
on Windows and Cygwin if vlmcsd has been compiled to use Micro
soft RPC.
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:
@ -89,11 +91,36 @@ KEYWORDS
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used on Windows and Cygwin if vlmcsd has been com
piled to use Microsoft RPC. Causes vlmcsd to listen on that port
instead of 1688. On all non-Windows operating systems or if vlm
csd has been compiled to use its own RPC implementation, you
must use Listen instead.
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.
UseNDR64
@ -111,56 +138,68 @@ KEYWORDS
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.
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
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
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
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
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
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
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
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.
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
@ -177,12 +216,12 @@ KEYWORDS
RenewalInterval
This is the same as specifying -R on the command line. See vlm
csd(8) for details. The default is 7 days. Example: Activation
Interval = 3h. 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 recommen
dation to the client. Older KMS clients did follow the recommen
dation from a KMS server or emulator. Newer clients do not.
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
@ -207,42 +246,50 @@ KEYWORDS
changed on the fly by sending SIGHUP to vlmcsd.
SPECIAL KEYWORDS
Any valid GUID is being treated as a special keyword in the ini file.
It is used to select a specfic ePID and HwId for an application GUID.
The argument has the form ePID [ / HwId ]. KMS currently knows only 3
application GUIDs:
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.
55c92734-d682-4d71-983e-d6ec3f16059f (Windows)
59a52881-a989-479d-af46-f275c6370663 (Office 2010)
0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013)
To use specific ePIDs for Windows, Office 2010 and Office 2013/2016 you
could add the following lines to vlmcsd.ini:
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.
55c92734-d682-4d71-983e-d6ec3f16059f = 55041-00206-184-207146-03-1062-6002.0000-3322013
59a52881-a989-479d-af46-f275c6370663 = 55041-00096-216-598637-03-17418-6002.0000-3312013
0ff1ce15-a989-479d-af46-f275c6370663 = 55041-00206-234-742099-03-9217-6002.0000-2942013
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
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
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
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
the -H option in vlmcsd(8) ecxept that you must not enclose a HWID in
quotes even if it contains spaces.
@ -256,7 +303,7 @@ AUTHOR
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ...
@ -265,4 +312,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD.INI(5)
Hotbird64 September 2016 VLMCSD.INI(5)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 -->
<!-- CreationDate: Thu Oct 6 01:17:00 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

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