vlmcsd-1112-2019-10-20-Hotbird64

This commit is contained in:
Rouben 2018-10-23 23:40:18 -04:00
parent 28a50f7bba
commit cd488aeb85
No known key found for this signature in database
GPG Key ID: 8032EA4BFC7DEEC0
39 changed files with 7175 additions and 3782 deletions

View File

@ -1,142 +1,149 @@
#
#
# Sample vlmcsd.ini
#
# An ini file for vlmcsd is normally not required. It is for advanced users only.
# vlmcsd uses an ini file only if specified using the -i option in the command line parameters.
# There is no default ini file because vlmcsd is designed to run on many platforms.
#
# Every line starting with a number sign (#) or semicolon (;) is treated as a comment.
# If a key word is used more than once, the last occurrence is used. The only exception
# to this is Listen. You can use Listen=<ip address>[:port] more than once.
#
# Set ePID/HwId for Windows explicitly
;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
;Office2010 = 06401-00096-199-222222-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
# Set ePID/HwId for Windows China Government (Enterprise G/GN) explicitly
;WinChinaGov = 06401-03858-000-555555-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
# Use a compatible VPN device to create a hidden local IPv4 address
# Command line: -O
# VPN = <VPN adapter name>[=<IPv4 address>][/<CIDR mask>][:<DHCP lease duration>]
# Use VPN adapter "KMS Mirror" give it IP address 192.168.123.100 with a lease duration of one day and make entire 192.168.128.x a hidden local IPv4 address.
;VPN = KMS Mirror=192.168.123.100/24:1d
# Use custom TCP port
# Command line: -P
# ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets
# ***Use Listen otherwise
;Port = 1234
# Listen on all IPv4 addresses (default port 1688)
# 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
;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
# Use a specific culture (1033 = English US) in ePIDs even if the ePID is randomized
# Command line: -C
;LCID = 1033
# Set a maximum of 4 workers (forked processes or threads)
# Command line: -m
;MaxWorkers = 4
# Disconnect users after 30 seconds of inactivity
# Command line: -t
;ConnectionTimeout = 30
# Disconnect clients immediately after each request
# Command line: -d and -k
;DisconnectClientsImmediately = yes
# Write a pid file (a file containing the process id of vlmcsd)
# Command line: -p
;PidFile = /var/run/vlmcsd.pid
# Load a KMS data file
# Command line: -j
;KmsData = /etc/vlmcsd.kmd
# Write log to /var/log/vlmcsd.log
# Command line: -l (-e and -f also override this directive)
;LogFile = /var/log/vlmcsd.log
# Don't include date and time in logs (default is true)
# Command line: -T0 and -T1
;LogDateAndTime = false
# Create a verbose log
# Command line: -v and -q
;LogVerbose = true
# Whitelist known products
# Command line: -K0, -K1, -K2, -K3
;WhiteListingLevel = 0
# Check that the client time is within +/- 4 hours of the system time
# Command line: -c0, -c1
;CheckClientTime = false
# Maintain a list of CMIDs
# Command line: -M0, -M1
;MaintainClients = false
# Start with empty CMID list (Requires MaintainClients = true)
# Command line: -E0, -E1
;StartEmpty = false
# Set activation interval to 2 hours
# Command line: -A
;ActivationInterval = 2h
# Set renewal interval to 7 days
# Command line: -R
;RenewalInterval = 7d
# Exit vlmcsd if warning of certain level has been reached
# Command line: -x
# 0 = Never
# 1 = Exit, if any listening socket could not be established or TAP error occurs
;ExitLevel = 0
# Run program as user vlmcsduser
# Command line: -u
;user = vlmcsduser
# Run program as group vlmcsdgroup
# Command line: -g
;group = vlmcsdgroup
# Disable or enable the NDR64 transfer syntax in RPC (default enabled)
# Command line: -N0 and -N1
;UseNDR64 = true
# Disable or enable bind time feature negotiation in RPC (default enabled)
# Command line: -B0 and -B1
;UseBTFN = true
#
#
# Sample vlmcsd.ini
#
# An ini file for vlmcsd is normally not required. It is for advanced users only.
# vlmcsd uses an ini file only if specified using the -i option in the command line parameters.
# There is no default ini file because vlmcsd is designed to run on many platforms.
#
# Every line starting with a number sign (#) or semicolon (;) is treated as a comment.
# If a key word is used more than once, the last occurrence is used. The only exception
# to this is Listen. You can use Listen=<ip address>[:port] more than once.
#
# Set ePID/HwId for Windows explicitly
;Windows = 06401-00206-471-111111-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
# Set ePID for Office 2010 (including Visio and Project) explicitly
;Office2010 = 06401-00096-199-222222-03-1033-17763.0000-2822018
# Set ePID/HwId for Office 2013 (including Visio and Project) explicitly
;Office2013 = 06401-00206-234-333333-03-1033-17763.0000-2822018 / 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-17763.0000-2822018 / 01 02 03 04 05 06 07 08
# Set ePID/HwId for Office 2019 (including Visio and Project) explicitly
;Office2019 = 06401-00206-666-666666-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
# Set ePID/HwId for Windows China Government (Enterprise G/GN) explicitly
;WinChinaGov = 06401-03858-000-555555-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
# Use a compatible VPN device to create a hidden local IPv4 address
# Command line: -O
# VPN = <VPN adapter name>[=<IPv4 address>][/<CIDR mask>][:<DHCP lease duration>]
# Use VPN adapter "KMS Mirror" give it IP address 192.168.123.100 with a lease duration of one day and make entire 192.168.128.x a hidden local IPv4 address.
;VPN = KMS Mirror=192.168.123.100/24:1d
# Use custom TCP port
# Command line: -P
# ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets
# ***Use Listen otherwise
;Port = 1234
# Listen on all IPv4 addresses (default port 1688)
# 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
;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
# Use a specific host build in ePIDs even if the ePID is randomized
# Command line: -H
;HostBuild = 17763
# Use a specific culture (1033 = English US) in ePIDs even if the ePID is randomized
# Command line: -C
;LCID = 1033
# Set a maximum of 4 workers (forked processes or threads)
# Command line: -m
;MaxWorkers = 4
# Disconnect users after 30 seconds of inactivity
# Command line: -t
;ConnectionTimeout = 30
# Disconnect clients immediately after each request
# Command line: -d and -k
;DisconnectClientsImmediately = yes
# Write a pid file (a file containing the process id of vlmcsd)
# Command line: -p
;PidFile = /var/run/vlmcsd.pid
# Load a KMS data file
# Command line: -j
;KmsData = /etc/vlmcsd.kmd
# Write log to /var/log/vlmcsd.log
# Command line: -l (-e and -f also override this directive)
;LogFile = /var/log/vlmcsd.log
# Don't include date and time in logs (default is true)
# Command line: -T0 and -T1
;LogDateAndTime = false
# Create a verbose log
# Command line: -v and -q
;LogVerbose = true
# Whitelist known products
# Command line: -K0, -K1, -K2, -K3
;WhiteListingLevel = 0
# Check that the client time is within +/- 4 hours of the system time
# Command line: -c0, -c1
;CheckClientTime = false
# Maintain a list of CMIDs
# Command line: -M0, -M1
;MaintainClients = false
# Start with empty CMID list (Requires MaintainClients = true)
# Command line: -E0, -E1
;StartEmpty = false
# Set activation interval to 2 hours
# Command line: -A
;ActivationInterval = 2h
# Set renewal interval to 7 days
# Command line: -R
;RenewalInterval = 7d
# Exit vlmcsd if warning of certain level has been reached
# Command line: -x
# 0 = Never
# 1 = Exit, if any listening socket could not be established or TAP error occurs
;ExitLevel = 0
# Run program as user vlmcsduser
# Command line: -u
;user = vlmcsduser
# Run program as group vlmcsdgroup
# Command line: -g
;group = vlmcsdgroup
# Disable or enable the NDR64 transfer syntax in RPC (default enabled)
# Command line: -N0 and -N1
;UseNDR64 = true
# Disable or enable bind time feature negotiation in RPC (default enabled)
# Command line: -B0 and -B1
;UseBTFN = true

Binary file not shown.

Binary file not shown.

2908
hotbird64-mass-build/make_bs Executable file

File diff suppressed because it is too large Load Diff

69
hotbird64-mass-build/make_dyson Executable file
View File

@ -0,0 +1,69 @@
#!/bin/sh
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
#export CAT=2
if [ `uname -s` != "SunOS" ]; then
echo "This is no SunOS operating system."
exit 3
fi
cd "$( dirname "$0" )"
make -C .. clean
SOLARIS_VERSION=`uname -v`
MAKEFLAGS="-Bj"
REUSEOBJFLAGS="-j"
cd ../src
BINDIR="../bin"
MANDIR="../man"
CF="-flto=12 -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants -Wno-char-subscripts"
LF="-static-libgcc -fwhole-program -Wl,--hash-style=sysv,--build-id=none,-z,norelro"
export PROGRAM_NAME=$BINDIR/vlmcsd-Solaris-x64
export CLIENT_NAME=$BINDIR/vlmcs-Solaris-x64
export MULTI_NAME=$BINDIR/vlmcsdmulti-Solaris-x64
make $MAKEFLAGS DNS_PARSER=OS CFLAGS="$CF" CC=gcc LDFLAGS="$LF" allmulti
export PROGRAM_NAME=$BINDIR/vlmcsd-Solaris-x64-threads
make $MAKEFLAGS DNS_PARSER=OS CFLAGS="$CF" CC=gcc LDFLAGS="$LF" THREADS=1 vlmcsd
export PROGRAM_NAME=$BINDIR/vlmcsd-Solaris-x86
export CLIENT_NAME=$BINDIR/vlmcs-Solaris-x86
export MULTI_NAME=$BINDIR/vlmcsdmulti-Solaris-x86
make $MAKEFLAGS DNS_PARSER=OS CFLAGS="$CF" PLATFORMFLAGS="-m32" CC=gcc LDFLAGS="$LF" allmulti
export PROGRAM_NAME=$BINDIR/vlmcsd-Solaris-x86-threads
make $MAKEFLAGS DNS_PARSER=OS CFLAGS="$CF" PLATFORMFLAGS="-m32" CC=gcc LDFLAGS="$LF" THREADS=1 vlmcsd
scp -p $BINDIR/* root@ubuntu64.internal:x/binaries/Solaris/intel
cd ..
BINDIR="./bin"
MANDIR="./man"
mkdir /tmp/vlmcsd
cp -af $MANDIR/*.1 $MANDIR/*.5 $MANDIR/*.7 $MANDIR/*.8 /tmp/vlmcsd
xz /tmp/vlmcsd/*
sudo mkdir -p /usr/local/man/man1
sudo mkdir -p /usr/local/man/man5
sudo mkdir -p /usr/local/man/man7
sudo mkdir -p /usr/local/man/man8
sudo cp -af /tmp/vlmcsd/*.1.xz /usr/local/man/man1
sudo cp -af /tmp/vlmcsd/*.5.xz /usr/local/man/man5
sudo cp -af /tmp/vlmcsd/*.7.xz /usr/local/man/man7
sudo cp -af /tmp/vlmcsd/*.8.xz /usr/local/man/man8
rm -fr /tmp/vlmcsd
sudo cp -af $BINDIR/vlmcsd-Solaris-x86 /usr/local/bin/vlmcsd
sudo cp -af $BINDIR/vlmcs-Solaris-x86 /usr/local/bin/vlmcs

View File

@ -12,7 +12,7 @@ cd ../src
VERSION="$(uname -r | sed -e 's/-.*//')"
MAKE="gmake"
BINDIR="../bin"
PATH=/usr/local/bin:$PATH
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
@ -22,16 +22,16 @@ 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"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-gcc CC=gcc6 CFLAGS="$CF" LDFLAGS="$LF"
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF" allmulti
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-gcc CC=gcc6 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads-gcc THREADS=1 CC=gcc6 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads-gcc THREADS=1 CC=gcc6 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-gcc CC=gcc9 CFLAGS="$CF" LDFLAGS="$LF"
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x64 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64 CC=clang-devel CFLAGS="$CFCLANG" LDFLAGS="$LF" allmulti
$MAKE $MAKEFLAGS MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86 CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86 PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86 CC=clang-devel CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
$MAKE $MAKEFLAGS allmulti CAT=2 MULTI_NAME=$BINDIR/vlmcsdmulti-FreeBSD-$VERSION-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-gcc CC=gcc9 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads-gcc THREADS=1 CC=gcc9 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-threads THREADS=1 CC=clang-devel CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads THREADS=1 CC=clang-devel CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
$MAKE $MAKEFLAGS CAT=2 vlmcsd PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-threads-gcc THREADS=1 CC=gcc9 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x64-openssl1.0.1-EXPERIMENTAL CC=clang-devel CFLAGS="$CFCLANG" LDFLAGS="$LF"
$MAKE $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=$BINDIR/vlmcs-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=$BINDIR/vlmcsd-FreeBSD-$VERSION-x86-openssl1.0.1-EXPERIMENTAL CC=clang-devel CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
cd ../bin

View File

@ -12,6 +12,58 @@ BINDIR="../bin"
MANDIR="../man"
cd ../src
mkdir -p ../binaries/Linux/intel/glibc
mkdir -p ../binaries/Linux/intel/uclibc
mkdir -p ../binaries/Linux/intel/static
mkdir -p ../binaries/Linux/intel/musl
mkdir -p ../binaries/Linux/sparc/glibc
mkdir -p ../binaries/Linux/s390/glibc
mkdir -p ../binaries/Android/arm/bionic
mkdir -p ../binaries/Android/arm/static
mkdir -p ../binaries/Android/intel/bionic
mkdir -p ../binaries/Android/intel/static
mkdir -p ../binaries/Android/mips/bionic
mkdir -p ../binaries/Android/mips/static
mkdir -p ../binaries/Linux/arm/little-endian/glibc
mkdir -p ../binaries/Linux/arm/little-endian/musl
mkdir -p ../binaries/Linux/arm/little-endian/uclibc
mkdir -p ../binaries/Linux/arm/little-endian/static
mkdir -p ../binaries/Linux/arm/big-endian/uclibc
mkdir -p ../binaries/Linux/arm/big-endian/static
mkdir -p ../binaries/Linux/mips/little-endian/glibc
mkdir -p ../binaries/Linux/mips/little-endian/uclibc
mkdir -p ../binaries/Linux/mips/little-endian/static
mkdir -p ../binaries/Linux/mips/little-endian/musl
mkdir -p ../binaries/Linux/mips/big-endian/uclibc
mkdir -p ../binaries/Linux/mips/big-endian/static
mkdir -p ../binaries/Linux/mips/big-endian/glibc
mkdir -p ../binaries/Linux/mips/big-endian/musl
mkdir -p ../binaries/Linux/ppc/little-endian/glibc
mkdir -p ../binaries/Linux/ppc/big-endian/glibc
mkdir -p ../binaries/Linux/ppc/big-endian/uclibc
mkdir -p ../binaries/Linux/ppc/big-endian/musl
mkdir -p ../binaries/Linux/ppc/big-endian/static
mkdir -p ../binaries/MacOSX/intel
mkdir -p ../binaries/MacOSX/ppc
mkdir -p ../binaries/iOS/arm
mkdir -p ../binaries/FreeBSD/intel
mkdir -p ../binaries/NetBSD/intel
mkdir -p ../binaries/OpenBSD/intel
mkdir -p ../binaries/DragonFly/intel
mkdir -p ../binaries/Solaris/intel
mkdir -p ../binaries/Windows/intel
mkdir -p ../binaries/Minix/intel
mkdir -p ../binaries/Hurd/intel
## IBM S/390
export CFLAGS="$SMALLCC"
@ -22,17 +74,17 @@ export FEATURES=full
export CC=s390x-linux-gnu-gcc
export VERBOSE=3
export MULTI_NAME=$BINDIR/vlmcsdmulti-s390-glibc
export CLIENT_NAME=$BINDIR/vlmcs-s390-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-s390-glibc
export MULTI_NAME=~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390-glibc
export CLIENT_NAME=~/x/binaries/Linux/s390/glibc/vlmcs-s390-glibc
export PROGRAM_NAME=~/x/binaries/Linux/s390/glibc/vlmcsd-s390-glibc
make -B -j`nproc` allmulti
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
export MULTI_NAME=$BINDIR/vlmcsdmulti-s390x-glibc
export CLIENT_NAME=$BINDIR/vlmcs-s390x-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-s390x-glibc
export MULTI_NAME=~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390x-glibc
export CLIENT_NAME=~/x/binaries/Linux/s390/glibc/vlmcs-s390x-glibc
export PROGRAM_NAME=~/x/binaries/Linux/s390/glibc/vlmcsd-s390x-glibc
make -B -j`nproc` allmulti
@ -44,9 +96,9 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mcpu=v7"
export LDFLAGS="$SMALLLD"
export CC=sparc64-linux-gnu-gcc
export MULTI_NAME=$BINDIR/vlmcsdmulti-sparc64v9-glibc
export CLIENT_NAME=$BINDIR/vlmcs-sparc64v9-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-sparc64v9-glibc
export MULTI_NAME=~/x/binaries/Linux/sparc/glibc/vlmcsdmulti-sparc64v9-glibc
export CLIENT_NAME=~/x/binaries/Linux/sparc/glibc/vlmcs-sparc64v9-glibc
export PROGRAM_NAME=~/x/binaries/Linux/sparc/glibc/vlmcsd-sparc64v9-glibc
make -B -j`nproc` allmulti
@ -59,16 +111,16 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64-linux-gnuabi64-gcc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64-glibc
export MULTI_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcsdmulti-mips64-glibc
export CLIENT_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcs-mips64-glibc
export PROGRAM_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcsd-mips64-glibc
make -B -j`nproc` allmulti
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64mm-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64mm-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64mm-glibc
export MULTI_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcsdmulti-mips64mm-glibc
export CLIENT_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcs-mips64mm-glibc
export PROGRAM_NAME=~/x/binaries/Linux/mips/big-endian/glibc/vlmcsd-mips64mm-glibc
make -B -j`nproc` allmulti
@ -80,45 +132,24 @@ export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64el-linux-gnuabi64-gcc
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64el-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64el-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64el-glibc
export MULTI_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcsdmulti-mips64el-glibc
export CLIENT_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcs-mips64el-glibc
export PROGRAM_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcsd-mips64el-glibc
make -B -j`nproc` allmulti
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=$BINDIR/vlmcsdmulti-mips64elmm-glibc
export CLIENT_NAME=$BINDIR/vlmcs-mips64elmm-glibc
export PROGRAM_NAME=$BINDIR/vlmcsd-mips64elmm-glibc
export MULTI_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcsdmulti-mips64elmm-glibc
export CLIENT_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcs-mips64elmm-glibc
export PROGRAM_NAME=~/x/binaries/Linux/mips/little-endian/glibc/vlmcsd-mips64elmm-glibc
make -B -j`nproc` allmulti
cd $BINDIR
sstrip -z *
if [ "$1" == "nocopy" ]; then
exit 0
fi
cd $MANDIR
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
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
cd $BINDIR
scp -p vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc ubuntu64.internal:x/binaries/Linux/s390/glibc
scp -p vlmcsdmulti-sparc64v9-glibc vlmcs-sparc64v9-glibc vlmcsd-sparc64v9-glibc ubuntu64.internal:x/binaries/Linux/sparc/glibc
scp -p vlmcsdmulti-mips64-glibc vlmcs-mips64-glibc vlmcsd-mips64-glibc vlmcsdmulti-mips64mm-glibc vlmcs-mips64mm-glibc vlmcsd-mips64mm-glibc ubuntu64.internal:x/binaries/Linux/mips/big-endian/glibc
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
scp -p -P 2222 ~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390-glibc ~/x/binaries/Linux/s390/glibc/vlmcs-s390-glibc ~/x/binaries/Linux/s390/glibc/vlmcsd-s390-glibc ~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390x-glibc ~/x/binaries/Linux/s390/glibc/vlmcs-s390x-glibc ~/x/binaries/Linux/s390/glibc/vlmcsd-s390x-glibc s390:vlmcsd
scp -p -P 2222 ~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390-glibc ~/x/binaries/Linux/s390/glibc/vlmcsdmulti-s390x-glibc s390:/usr/local/sbin

154
hotbird64-mass-build/make_nonbs Executable file
View File

@ -0,0 +1,154 @@
#!/bin/bash
if [ $(id -u) != 0 ]; then
echo "Must be root to run this"
exit 5
fi
cd "$( dirname "$0" )"
IS64ONLY=0
if [ "$(uname -r|grep Microsoft)" != "" ]; then
IS64ONLY=1
echo "Warning 32-bit toolchains do not run."
fi
export VLMCSD_VERSION=$(git describe)
export VERBOSE=3
export DNS_PARSER=internal
MAKEFLAGS="-j200 -B"
REUSEOBJFLAGS="-j200"
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 vlmcs vlmcsdmulti vlmcsd 2>/dev/null
rm -fr ../binaries
mkdir -p ../../debian/root/x/binaries/Linux/intel/glibc
mkdir -p ../../debian/root/x/binaries/Linux/intel/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/intel/static
mkdir -p ../../debian/root/x/binaries/Linux/intel/musl
mkdir -p ../../debian/root/x/binaries/Linux/sparc/glibc
mkdir -p ../../debian/root/x/binaries/Linux/s390/glibc
mkdir -p ../../debian/root/x/binaries/Android/arm/bionic
mkdir -p ../../debian/root/x/binaries/Android/arm/static
mkdir -p ../../debian/root/x/binaries/Android/intel/bionic
mkdir -p ../../debian/root/x/binaries/Android/intel/static
mkdir -p ../../debian/root/x/binaries/Android/mips/bionic
mkdir -p ../../debian/root/x/binaries/Android/mips/static
mkdir -p ../../debian/root/x/binaries/Linux/arm/little-endian/glibc
mkdir -p ../../debian/root/x/binaries/Linux/arm/little-endian/musl
mkdir -p ../../debian/root/x/binaries/Linux/arm/little-endian/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/arm/little-endian/static
mkdir -p ../../debian/root/x/binaries/Linux/arm/big-endian/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/arm/big-endian/static
mkdir -p ../../debian/root/x/binaries/Linux/mips/little-endian/glibc
mkdir -p ../../debian/root/x/binaries/Linux/mips/little-endian/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/mips/little-endian/static
mkdir -p ../../debian/root/x/binaries/Linux/mips/little-endian/musl
mkdir -p ../../debian/root/x/binaries/Linux/mips/big-endian/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/mips/big-endian/static
mkdir -p ../../debian/root/x/binaries/Linux/mips/big-endian/glibc
mkdir -p ../../debian/root/x/binaries/Linux/mips/big-endian/musl
mkdir -p ../../debian/root/x/binaries/Linux/ppc/little-endian/glibc
mkdir -p ../../debian/root/x/binaries/Linux/ppc/big-endian/glibc
mkdir -p ../../debian/root/x/binaries/Linux/ppc/big-endian/uclibc
mkdir -p ../../debian/root/x/binaries/Linux/ppc/big-endian/musl
mkdir -p ../../debian/root/x/binaries/Linux/ppc/big-endian/static
mkdir -p ../../debian/root/x/binaries/MacOSX/intel
mkdir -p ../../debian/root/x/binaries/MacOSX/ppc
mkdir -p ../../debian/root/x/binaries/iOS/arm
mkdir -p ../../debian/root/x/binaries/FreeBSD/intel
mkdir -p ../../debian/root/x/binaries/NetBSD/intel
mkdir -p ../../debian/root/x/binaries/OpenBSD/intel
mkdir -p ../../debian/root/x/binaries/DragonFly/intel
mkdir -p ../../debian/root/x/binaries/Solaris/intel
mkdir -p ../../debian/root/x/binaries/Windows/intel
mkdir -p ../../debian/root/x/binaries/Minix/intel
mkdir -p ../../debian/root/x/binaries/Hurd/intel
../../bin/prepare-debian
OLDHOME=$HOME
export HOME=/root
chroot ../../debian /root/x/hotbird64-mass-build/make_bs
chroot ../../debian /root/x/hotbird64-mass-build/make_multilib_linux
export HOME=$OLDHOME
rm -f *_all.c vlmcsd.o vlmcs.o vlmcsdmulti.o 2> /dev/null
export STAGING_DIR=.
cd ../src
pwd
# Linux x32 glibc
export FEATURES=full
export MULTI_NAME=../../debian/root/x/binaries/Linux/intel/glibc/vlmcsdmulti-x32-glibc
export CLIENT_NAME=../../debian/root/x/binaries/Linux/intel/glibc/vlmcs-x32-glibc
export PROGRAM_NAME=../../debian/root/x/binaries/Linux/intel/glibc/vlmcsd-x32-glibc
export CC=gcc
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=16 -fwhole-program -mx32 -march=nocona -mtune=generic"
export LDFLAGS="-fuse-ld=bfd $SMALLLD -Wl,--hash-style=gnu"
export THREADS=0
export NOPROCFS=0
export AUXV=1
make DNS_PARSER=OS $MAKEFLAGS allmulti
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $?
fi
# Linux x32 glibc threads
export FEATURES=full
export PROGRAM_NAME=../../debian/root/x/binaries/Linux/intel/glibc/vlmcsd-x32-glibc-threads
export CC=gcc
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=16 -fwhole-program -mx32 -march=nocona -mtune=generic"
export LDFLAGS="-fuse-ld=bfd $SMALLLD -Wl,--hash-style=gnu -lpthread"
export THREADS=1
export NOPROCFS=0
export AUXV=1
make DNS_PARSER=OS $MAKEFLAGS $PROGRAM_NAME
if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME
exit $?
fi
cd ..
make alldocs
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 man/vlmcs.1 man/vlmcsdmulti.1 /usr/local/man/man1/
cp -a man/vlmcsd-floppy.7 man/vlmcsd.7 /usr/local/man/man7/
cp -a man/vlmcsd.8 /usr/local/man/man8/
cp -a man/vlmcsd.ini.5 /usr/local/man/man5/
pbzip2 -f -9 /usr/local/man/man7/vlmcsd-floppy.7 /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
mandb >/dev/null 2>&1

View File

@ -49,10 +49,10 @@ PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $MAKEFLAGS allmulti MULTI
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj allmulti SAFE_MODE=1 MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-ppc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-ppc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-threads-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-threads-gcc CC=gcc-6 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x86-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x86-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-gcc CC=gcc-7 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x86-threads-gcc CC=gcc-7 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS allmulti MULTI_NAME=$BINDIR/vlmcsdmulti-MacOSX-x64-gcc CLIENT_NAME=$BINDIR/vlmcs-MacOSX-x64-gcc PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-gcc CC=gcc-7 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
make $MAKEFLAGS vlmcsd THREADS=1 PROGRAM_NAME=$BINDIR/vlmcsd-MacOSX-x64-threads-gcc CC=gcc-7 CFLAGS="$CFGCC" PLATFORMFLAGS="-m64 -march=core2 -mmacosx-version-min=10.11" && \
# Sign the iOS binaries
#ldid -S *iOS*

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

Binary file not shown.

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

Binary file not shown.

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

Binary file not shown.

View File

@ -1,5 +1,5 @@
.mso www.tmac
.TH VLMCSD 8 "June 2017" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD 8 "October 2018" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
@ -173,31 +173,10 @@ The actual security context switch is performed after the TCP sockets have been
.IP
However if you use an ini, pid or log file, you must ensure that the unprivileged user has access to these files. You can always log to \fBsyslog\fR(3) from an unprivileged account on most platforms (see \fB-l\fR).
.IP "\fB-w\fR \fIePID\fR"
Use \fIePID\fR as Windows ePID. If specified, \fB-r\fR is disregarded for Windows.
.IP "\fB-a\fR \fICSVLK\fR = \fIePID\fR [ / \fIHwId\fR ]"
Use \fIePID\fR and \fIHwId\fR for a specific \fICSVLK\fR. When you use it, \fB-r\fR is disregarded for this \fICSVLK\fR. If vlmcsd uses the default vlmcsd.kmd database, you can use the following \fICSVLK\fRs: Windows, WinChinaGov, Office2010, Office2013, Office2016 and Office2019. The \fB-a\fR option requires that database version 1.6 or later is used.
.IP "\fB-0\fR \fIePID\fR"
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 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-G\fR \fIePID\fR"
Use \fIePID\fR as Windows China Government ePID. If specified, \fB-r\fR is disregarded for Windows China Government Editions (Enterprise G/GN).
.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.
\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. The following commands are identical:
vlmcsd -H 0123456789ABCDEF
.br
vlmcsd -H 01:23:45:67:89:ab:cd:ef
.br
vlmcsd -H "01 23 45 67 89 AB CD EF"
\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 "\fB-i\fR \fIfilename\fR"
Use configuration file (aka ini file) \fIfilename\fR. Most configuration 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 \fBvlmcsd.ini\fR(5) for the format of the configuration file.
@ -237,6 +216,9 @@ for a list of valid \fILCID\fRs. Please note that some of them are not recognize
Most other KMS emulators use a fixed \fILCID\fR of 1033 (English - US). To achive the same behavior in vlmcsd use \fB-C 1033\fR.
.IP "\fB-H\fR \fIHostBuild\fR"
Do not randomize the host build number in the ePID and use \fIHostBuild\fR instead, for instance 17763 for Windows Server 2019 / Windows 10 1809.
.IP "\fB-K0\fR, \fB-K1\fR, \fB-K2\fR and \fB-K3\fR"
Sets the whitelisting level to determine which products vlmcsd activates or refuses. The default is \fB-K0\fR.
@ -358,7 +340,7 @@ Written by crony12, Hotbird64 and vityan666.
With contributions from DougQaid.
.SH CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
.SH SEE ALSO
\fBvlmcsd.ini\fR(5), \fBvlmcsd\fR(7), \fBvlmcs\fR(1), \fBvlmcsdmulti\fR(1)

View File

@ -414,69 +414,40 @@ OPTIONS
(see -l).
-w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for
Windows.
-0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010.
-3 ePID
Use ePID as Office 2013 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2013.
-6 ePID
Use ePID as Office 2016 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2016.
-G ePID
Use ePID as Windows China Government ePID. If specified, -r is
disregarded for Windows China Government Editions (Enterprise
G/GN).
-H HwId
Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a
HWID from the command line.
-a CSVLK = ePID [ / HwId ]
Use ePID and HwId for a specific CSVLK. When you use it, -r is
disregarded for this CSVLK. If vlmcsd uses the default vlm-
csd.kmd database, you can use the following CSVLKs: Windows,
WinChinaGov, Office2010, Office2013, Office2016 and Office2019.
The -a option requires that database version 1.6 or later is
used.
HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The
following commands are identical:
vlmcsd -H 0123456789ABCDEF
vlmcsd -H 01:23:45:67:89:ab:cd:ef
vlmcsd -H "01 23 45 67 89 AB CD EF"
hex digit will be ignored. This is for better readability.
-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.
-j filename
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con-
tains all detailed product names. This is especially useful if
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con-
tains all detailed product names. This is especially useful if
you are logging KMS requests. If you don't log, there is no need
to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
@ -486,112 +457,118 @@ 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 an ePID for the KMS
- 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
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
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, -G, -0, -3 and -6 when
KMS request. Consider using -r0 or -w, -G, -0, -3 and -6 when
starting vlmcsd by an internet superserver.
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
very easy emulator detection.
-C LCID
Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the
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.
-H HostBuild
Do not randomize the host build number in the ePID and use Host-
Build instead, for instance 17763 for Windows Server 2019 / Win-
dows 10 1809.
-K0, -K1, -K2 and -K3
Sets the whitelisting level to determine which products vlmcsd
Sets the whitelisting level to determine which products vlmcsd
activates or refuses. The default is -K0.
-K0: activate all products with an unknown, retail or
-K0: activate all products with an unknown, retail or
beta/preview KMS ID.
-K1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
-K2: activate products with an unknown KMS ID but refuse
-K2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
-K3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
new version of vlmcsd is available.
-c0 and -c1
-c1 causes vlmcsd to check if the client time differs no more
-c1 causes vlmcsd to check if the client time differs no more
than four hours from the system time. -c0 (the default) disables
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
four hours from each other. If both requests succeed, the server
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
system time after you started vlmcsd.
-M0 and -M1
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre-
vent emulator detection. By maintaing a CMID list, vlmcsd
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre-
vent emulator detection. By maintaing a CMID list, vlmcsd
reports current active clients exactly like a genuine KMS emula-
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over-
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over-
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
reports current active clients as good as possible. If no client
sends an "overcharge request", it is not possible to detect vlm-
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
resources use it only if you really need it.
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main-
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main-
tain any state in memory.
@ -599,82 +576,82 @@ OPTIONS
These options are ignored if you do not also specify -M1. If you
use -E0 (the default), vlmcsd starts up as a fully "charged" KMS
server. Clients activate immediately. -E1 lets you start up vlm-
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
reached, clients end up in HRESULT 0xC004F038 "The count
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
-R renewal-interval
Instructs clients to renew activation every renewal-interval.
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.
@ -682,20 +659,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.
@ -704,53 +681,53 @@ 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 vlmcsd runs as a 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-
vlmcsd can answer activation requests for the following products: Win-
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1703),
Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Win-
dows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010,
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 products may work as long as the KMS protocol
does not change. A complete list of fully supported products can be
2016, Visio 2016. Newer products 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.
@ -762,24 +739,24 @@ FILES
EXAMPLES
vlmcsd -De
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
activation.
vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm-
Starts vlmcsd as a daemon and logs everything to /var/log/vlm-
csd.log.
vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri-
only. This is useful for routers that have a public and a pri-
vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and
Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd".
@ -789,13 +766,13 @@ BUGS
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-
borus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...
SEE ALSO
@ -803,4 +780,4 @@ SEE ALSO
Hotbird64 June 2017 VLMCSD(8)
Hotbird64 October 2018 VLMCSD(8)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -616,55 +616,22 @@ unprivileged user has access to these files. You can always
log to <b>syslog</b>(3) from an unprivileged account on most
platforms (see <b>-l</b>).</p>
<p style="margin-left:11%;"><b>-w</b> <i>ePID</i></p>
<p style="margin-left:11%;"><b>-a</b> <i>CSVLK</i> =
<i>ePID</i> [ / <i>HwId</i> ]</p>
<p style="margin-left:22%;">Use <i>ePID</i> as Windows
ePID. If specified, <b>-r</b> is disregarded for
Windows.</p>
<p style="margin-left:11%;"><b>-0</b> <i>ePID</i></p>
<p style="margin-left:22%;">Use <i>ePID</i> as Office 2010
ePID (including Project and Visio). If specified, <b>-r</b>
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
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>-G</b> <i>ePID</i></p>
<p style="margin-left:22%;">Use <i>ePID</i> as Windows
China Government ePID. If specified, <b>-r</b> is
disregarded for Windows China Government Editions
(Enterprise G/GN).</p>
<p style="margin-left:11%;"><b>-H</b> <i>HwId</i></p>
<p style="margin-left:22%;">Use <i>HwId</i> for all
products. All HWIDs in the ini file (see <b>-i</b>) will not
be used. In an ini file you can specify a seperate HWID for
each <i>application-guid</i>. This is not possible when
entering a HWID from the command line.</p>
<p style="margin-left:22%;">Use <i>ePID</i> and <i>HwId</i>
for a specific <i>CSVLK</i>. When you use it, <b>-r</b> is
disregarded for this <i>CSVLK</i>. If vlmcsd uses the
default vlmcsd.kmd database, you can use the following
<i>CSVLK</i>s: Windows, WinChinaGov, Office2010, Office2013,
Office2016 and Office2019. The <b>-a</b> option requires
that database version 1.6 or later is used.</p>
<p style="margin-left:22%; margin-top: 1em"><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.
The following commands are identical:</p>
<p style="margin-left:22%; margin-top: 1em">vlmcsd -H
0123456789ABCDEF <br>
vlmcsd -H 01:23:45:67:89:ab:cd:ef <br>
vlmcsd -H &quot;01 23 45 67 89 AB CD EF&quot;</p>
hex digit will be ignored. This is for better
readability.</p>
<p style="margin-left:11%;"><b>-i</b> <i>filename</i></p>
@ -769,6 +736,13 @@ them are not recognized by .NET Framework 4.0.</p>
emulators use a fixed <i>LCID</i> of 1033 (English - US). To
achive the same behavior in vlmcsd use <b>-C 1033</b>.</p>
<p style="margin-left:11%;"><b>-H</b> <i>HostBuild</i></p>
<p style="margin-left:22%;">Do not randomize the host build
number in the ePID and use <i>HostBuild</i> instead, for
instance 17763 for Windows Server 2019 / Windows 10
1809.</p>
<p style="margin-left:11%;"><b>-K0</b>, <b>-K1</b>,
<b>-K2</b> and <b>-K3</b></p>
@ -1181,8 +1155,8 @@ DougQaid.</p>
<p style="margin-left:11%; margin-top: 1em">Thanks to
CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad,
Ratiborus, ...</p>
abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>

Binary file not shown.

View File

@ -414,69 +414,40 @@ OPTIONS
(see -l).
-w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for
Windows.
-0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010.
-3 ePID
Use ePID as Office 2013 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2013.
-6 ePID
Use ePID as Office 2016 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2016.
-G ePID
Use ePID as Windows China Government ePID. If specified, -r is
disregarded for Windows China Government Editions (Enterprise
G/GN).
-H HwId
Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a
HWID from the command line.
-a CSVLK = ePID [ / HwId ]
Use ePID and HwId for a specific CSVLK. When you use it, -r is
disregarded for this CSVLK. If vlmcsd uses the default vlm-
csd.kmd database, you can use the following CSVLKs: Windows,
WinChinaGov, Office2010, Office2013, Office2016 and Office2019.
The -a option requires that database version 1.6 or later is
used.
HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The
following commands are identical:
vlmcsd -H 0123456789ABCDEF
vlmcsd -H 01:23:45:67:89:ab:cd:ef
vlmcsd -H "01 23 45 67 89 AB CD EF"
hex digit will be ignored. This is for better readability.
-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.
-j filename
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con-
tains all detailed product names. This is especially useful if
Use KMS data file filename. By default vlmcsd only contains the
minimum product data that is required to perform all operations
correctly. You may use a more complete KMS data file that con-
tains all detailed product names. This is especially useful if
you are logging KMS requests. If you don't log, there is no need
to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you
If vlmcsd has been compiled to use a default KMS data file, you
may use -j- to ignore the default configuration file.
@ -486,112 +457,118 @@ 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 an ePID for the KMS
- 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
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
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, -G, -0, -3 and -6 when
KMS request. Consider using -r0 or -w, -G, -0, -3 and -6 when
starting vlmcsd by an internet superserver.
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
-r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. -r2
should be treated as debugging option only because it allows
very easy emulator detection.
-C LCID
Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the
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.
-H HostBuild
Do not randomize the host build number in the ePID and use Host-
Build instead, for instance 17763 for Windows Server 2019 / Win-
dows 10 1809.
-K0, -K1, -K2 and -K3
Sets the whitelisting level to determine which products vlmcsd
Sets the whitelisting level to determine which products vlmcsd
activates or refuses. The default is -K0.
-K0: activate all products with an unknown, retail or
-K0: activate all products with an unknown, retail or
beta/preview KMS ID.
-K1: activate products with a retail or beta/preview KMS ID
but refuse to activate products with an unknown KMS ID.
-K2: activate products with an unknown KMS ID but refuse
-K2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
-K3: activate only products with a known volume license RTM
KMS ID and refuse all others.
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
The SKU ID is not checked. Like a genuine KMS server vlmcsd
activates a product that has a random or unknown SKU ID. If you
select -K1 or -K3, vlmcsd also checks the Application ID for
correctness. If Microsoft introduces a new KMS ID for a new
product, you cannot activate it if you used -K1 or -K3 until a
new version of vlmcsd is available.
-c0 and -c1
-c1 causes vlmcsd to check if the client time differs no more
-c1 causes vlmcsd to check if the client time differs no more
than four hours from the system time. -c0 (the default) disables
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
this check. -c1 is useful to prevent emulator detection. A
client that tries to detect an emulator could simply send two
subsequent request with two time stamps that differ more than
four hours from each other. If both requests succeed, the server
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
is an emulator. If you specify -c1 on a system with no reliable
time source, activations will fail. It is ok to set the correct
system time after you started vlmcsd.
-M0 and -M1
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre-
vent emulator detection. By maintaing a CMID list, vlmcsd
Disables (-M0) or enables (-M1) maintaining a list of client
machine IDs (CMIDs). The default is -M0. -M1 is useful to pre-
vent emulator detection. By maintaing a CMID list, vlmcsd
reports current active clients exactly like a genuine KMS emula-
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over-
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
tor. This includes bug compatibility to the extent that you can
permanently kill a genuine KMS emulator by sending an "over-
charge request" with a required client count of 376 or more and
then request activation for 671 clients. vlmcsd can be reset
from this condition by restarting it. If -M0 is used, vlmcsd
reports current active clients as good as possible. If no client
sends an "overcharge request", it is not possible to detect vlm-
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
csd as an emulator with -M0. -M1 requires the allocation of a
buffer that is about 50 kB in size. On hardware with few memory
resources use it only if you really need it.
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main-
If you start vlmcsd from an internet superserver, -M1 cannot be
used. Since vlmcsd exits after each activation, it cannot main-
tain any state in memory.
@ -599,82 +576,82 @@ OPTIONS
These options are ignored if you do not also specify -M1. If you
use -E0 (the default), vlmcsd starts up as a fully "charged" KMS
server. Clients activate immediately. -E1 lets you start up vlm-
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
csd with an empty CMID list. Activation will start when the
required minimum clients (25 for Windows Client OSses, 5 for
Windows Server OSses and Office) have registered with the KMS
server. As long as the minimum client count has not been
reached, clients end up in HRESULT 0xC004F038 "The count
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
reported by your Key Management Service (KMS) is insufficient.
Please contact your system administrator". You may use vlmcs(1)
or another KMS client emulator to "charge" vlmcsd. -E1 does not
improve emulator detection prevention. It's primary purpose is
to help developers of KMS clients to test "charging" a KMS
server.
-R renewal-interval
Instructs clients to renew activation every renewal-interval.
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.
@ -682,20 +659,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.
@ -704,53 +681,53 @@ 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 vlmcsd runs as a 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-
vlmcsd can answer activation requests for the following products: Win-
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1703),
Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Win-
dows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010,
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 products may work as long as the KMS protocol
does not change. A complete list of fully supported products can be
2016, Visio 2016. Newer products 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.
@ -762,24 +739,24 @@ FILES
EXAMPLES
vlmcsd -De
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests
activation.
vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm-
Starts vlmcsd as a daemon and logs everything to /var/log/vlm-
csd.log.
vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri-
only. This is useful for routers that have a public and a pri-
vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and
Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd".
@ -789,13 +766,13 @@ BUGS
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-
borus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...
SEE ALSO
@ -803,4 +780,4 @@ SEE ALSO
Hotbird64 June 2017 VLMCSD(8)
Hotbird64 October 2018 VLMCSD(8)

View File

@ -1,4 +1,4 @@
.TH VLMCSD.INI 5 "May 2017" "Hotbird64" "KMS Activation Manual"
.TH VLMCSD.INI 5 "October 2018" "Hotbird64" "KMS Activation Manual"
.LO 8
.SH NAME
@ -111,7 +111,10 @@ Can be TRUE or FALSE. Specifies whether you want to use bind time feature negoti
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.
Use a specific culture id (LCID) even if the ePID is randomized. The \fIargument\fR must be a number between 1 and 32767. While any number in that range is valid, you should use an offcial LCID. A list of assigned LCIDs can be found at http://msdn.microsoft.com/en\-us/goglobal/bb964664.aspx. On the command line you control this setting with option \fB-C\fR.
.IP "\fBHostBuild\fR"
Use a specific host build number in the ePID even if it is randomized. The \fIargument\fR must be a number between 1 and 65535. While you can use any number you should only use build numbers that a released build numbers of Windows Servers, e.g. 17763 for Windows Server 2019.
.IP "\fBMaxWorkers\fR"
The \fIargument\fR specifies the maximum number of worker processes or threads that will be used to serve activation requests concurrently. This is the same as specifying \fB-m\fR on the command line. Minimum is 1. The maximum is platform specific and is at least 32767 but is likely to be greater on most systems. The default is no limit.
@ -178,20 +181,8 @@ 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.
.IP "\fBWindows\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Windows activations. If specified, \fBRandomizationLevel\fR for Windows activitations will be ignored.
.IP "\fBOffice2010\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2010 activations. If specified, \fBRandomizationLevel\fR for Office 2010 activitations will be ignored.
.IP "\fBOffice2013\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2013 activations. If specified, \fBRandomizationLevel\fR for Office 2013 activitations will be ignored.
.IP "\fBOffice2016\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for Office 2016 activations. If specified, \fBRandomizationLevel\fR for Office 2016 activitations will be ignored.
.IP "\fBWinChinaGov\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for China Government Editions of Windows (Enterprise G/GN). If specified, \fBRandomizationLevel\fR for Windows China Government activitations will be ignored.
.IP "\fB<csvlk-name>\fR"
The \fIargument\fR has the form \fIePID\fR [ / \fIHwId\fR ]. Always use \fIePID\fR and \fIHwId\fR for activations with \fB<csvlk-name>\fR. If specified, \fBRandomizationLevel\fR for the \fB<csvlk-name>\fR will be ignored. With the default vlmcsd.kmd database you can use the following \fB<csvlk-name>\fRs: Windows, Office2010, Office2013, Office2016, Office2019 and WinChinaGov. While vlmcsd is compatible with older databases, you must use at least database version 1.6 for this feature to work.
.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.
@ -209,7 +200,7 @@ If you are specifying an optional HWID it follows the same syntax as in the \fB\
\fBvlmcsd\fR(8) was written by crony12, Hotbird64 and vityan666. With contributions from DougQaid.
.SH CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
.SH SEE ALSO
\fBvlmcsd\fR(8), \fBvlmcsd\fR(7), \fBvlmcs\fR(1), \fBvlmcsdmulti\fR(1)

View File

@ -238,6 +238,14 @@ KEYWORDS
control this setting with option -C.
HostBuild
Use a specific host build number in the ePID even if it is ran-
domized. The argument must be a number between 1 and 65535.
While you can use any number you should only use build numbers
that a released build numbers of Windows Servers, e.g. 17763 for
Windows Server 2019.
MaxWorkers
The argument specifies the maximum number of worker processes or
threads that will be used to serve activation requests concur-
@ -422,35 +430,15 @@ KEYWORDS
changed on the fly by sending SIGHUP to vlmcsd.
Windows
<csvlk-name>
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Windows activations. If specified, RandomizationLevel
for Windows activitations will be ignored.
Office2010
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2010 activations. If specified, Randomization-
Level for Office 2010 activitations will be ignored.
Office2013
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2013 activations. If specified, Randomization-
Level for Office 2013 activitations will be ignored.
Office2016
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2016 activations. If specified, Randomization-
Level for Office 2016 activitations will be ignored.
WinChinaGov
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for China Government Editions of Windows (Enterprise G/GN).
If specified, RandomizationLevel for Windows China Government
activitations will be ignored.
HwId for activations with <csvlk-name>. If specified, Randomiza-
tionLevel for the <csvlk-name> will be ignored. With the default
vlmcsd.kmd database you can use the following <csvlk-name>s:
Windows, Office2010, Office2013, Office2016, Office2019 and
WinChinaGov. While vlmcsd is compatible with older databases,
you must use at least database version 1.6 for this feature to
work.
VALID EPIDS
@ -486,8 +474,8 @@ AUTHOR
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati-
borus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...
SEE ALSO
@ -495,4 +483,4 @@ SEE ALSO
Hotbird64 May 2017 VLMCSD.INI(5)
Hotbird64 October 2018 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@ -388,6 +388,15 @@ the command line you control this setting with option
<b>-C</b>.</p> </td></tr>
</table>
<p style="margin-left:11%;"><b>HostBuild</b></p>
<p style="margin-left:22%;">Use a specific host build
number in the ePID even if it is randomized. The
<i>argument</i> must be a number between 1 and 65535. While
you can use any number you should only use build numbers
that a released build numbers of Windows Servers, e.g. 17763
for Windows Server 2019.</p>
<p style="margin-left:11%;"><b>MaxWorkers</b></p>
<p style="margin-left:22%;">The <i>argument</i> specifies
@ -630,46 +639,19 @@ Windows version of vlmcsd. See <b>-g</b> in
by sending SIGHUP to vlmcsd.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>Windows</b></p>
<p style="margin-left:11%;"><b>&lt;csvlk-name&gt;</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>
<p style="margin-left:11%;"><b>WinChinaGov</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 China Government Editions of Windows
(Enterprise G/GN). If specified, <b>RandomizationLevel</b>
for Windows China Government activitations will be
ignored.</p>
and <i>HwId</i> for activations with
<b>&lt;csvlk-name&gt;</b>. If specified,
<b>RandomizationLevel</b> for the <b>&lt;csvlk-name&gt;</b>
will be ignored. With the default vlmcsd.kmd database you
can use the following <b>&lt;csvlk-name&gt;</b>s: Windows,
Office2010, Office2013, Office2016, Office2019 and
WinChinaGov. While vlmcsd is compatible with older
databases, you must use at least database version 1.6 for
this feature to work.</p>
<h2>VALID EPIDS
<a name="VALID EPIDS"></a>
@ -728,8 +710,8 @@ contributions from DougQaid.</p>
<p style="margin-left:11%; margin-top: 1em">Thanks to
CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad,
Ratiborus, ...</p>
abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>

Binary file not shown.

View File

@ -238,6 +238,14 @@ KEYWORDS
control this setting with option -C.
HostBuild
Use a specific host build number in the ePID even if it is ran-
domized. The argument must be a number between 1 and 65535.
While you can use any number you should only use build numbers
that a released build numbers of Windows Servers, e.g. 17763 for
Windows Server 2019.
MaxWorkers
The argument specifies the maximum number of worker processes or
threads that will be used to serve activation requests concur-
@ -422,35 +430,15 @@ KEYWORDS
changed on the fly by sending SIGHUP to vlmcsd.
Windows
<csvlk-name>
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Windows activations. If specified, RandomizationLevel
for Windows activitations will be ignored.
Office2010
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2010 activations. If specified, Randomization-
Level for Office 2010 activitations will be ignored.
Office2013
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2013 activations. If specified, Randomization-
Level for Office 2013 activitations will be ignored.
Office2016
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for Office 2016 activations. If specified, Randomization-
Level for Office 2016 activitations will be ignored.
WinChinaGov
The argument has the form ePID [ / HwId ]. Always use ePID and
HwId for China Government Editions of Windows (Enterprise G/GN).
If specified, RandomizationLevel for Windows China Government
activitations will be ignored.
HwId for activations with <csvlk-name>. If specified, Randomiza-
tionLevel for the <csvlk-name> will be ignored. With the default
vlmcsd.kmd database you can use the following <csvlk-name>s:
Windows, Office2010, Office2013, Office2016, Office2019 and
WinChinaGov. While vlmcsd is compatible with older databases,
you must use at least database version 1.6 for this feature to
work.
VALID EPIDS
@ -486,8 +474,8 @@ AUTHOR
CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati-
borus, ...
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87,
qad, Ratiborus, ...
SEE ALSO
@ -495,4 +483,4 @@ SEE ALSO
Hotbird64 May 2017 VLMCSD.INI(5)
Hotbird64 October 2018 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sat Jun 17 00:53:29 2017 -->
<!-- CreationDate: Sat Oct 20 09:49:39 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

Binary file not shown.

View File

@ -544,7 +544,7 @@ static void getDefaultDataFile()
char* fn_exe_copy = vlmcsd_strdup(fn_exe);
strncpy(fileName, dirname(fn_exe_copy), 512);
free(fn_exe_copy);
strncat(fileName, "/vlmcsd.kmd", 512);
strncat(fileName, "/vlmcsd.kmd", 500);
fn_data = vlmcsd_strdup(fileName);
}
#endif // !_WIN32
@ -593,30 +593,14 @@ void loadKmsData()
fclose(file);
# if !defined(NO_LOG) && !defined(NO_SOCKETS)
if (!InetdMode) logger("Read KMS data file %s\n", fn_data);
if (!InetdMode) logger("Read KMS data file version %u.%u %s\n", (unsigned int)KmsData->MajorVer, (unsigned int)KmsData->MinorVer, fn_data);
# endif // NO_LOG
}
if (KmsData->CsvlkCount < MIN_CSVLK)
{
printerrorf("Warning: Legacy database: Some products are missing.\n");
}
}
# endif // NO_EXTERNAL_DATA
# if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
if (KmsData->CsvlkCount > MIN_CSVLK)
{
KmsResponseParameters = (KmsResponseParam_t*)realloc(KmsResponseParameters, KmsData->CsvlkCount * sizeof(KmsResponseParam_t));
if (!KmsResponseParameters) OutOfMemory();
memset(KmsResponseParameters + MIN_CSVLK, 0, (KmsData->CsvlkCount - MIN_CSVLK) * sizeof(KmsResponseParam_t));
}
# endif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
# ifndef UNSAFE_DATA_LOAD
if (((BYTE*)KmsData)[size - 1] != 0) dataFileFormatError();
# endif // UNSAFE_DATA_LOAD
@ -652,7 +636,7 @@ void loadKmsData()
# endif // NO_RANDOM_EPID
}
uint32_t totalItemCount = KmsData->AppItemCount + KmsData->KmsItemCount + KmsData->SkuItemCount;
const uint32_t totalItemCount = KmsData->AppItemCount + KmsData->KmsItemCount + KmsData->SkuItemCount;
# ifndef NO_EXTERNAL_DATA
if (

2287
src/kms.c

File diff suppressed because it is too large Load Diff

View File

@ -278,12 +278,15 @@ typedef struct
};
} DataPointer_t;
#define KMS_OPTIONS_USENDR64 1 << 0
typedef struct VlmcsdHeader
{
BYTE Magic[4];
VERSION_INFO;
uint8_t CsvlkCount;
uint8_t Reserved[3];
uint8_t Flags;
uint8_t Reserved[2];
union
{
@ -358,7 +361,8 @@ void CleanUpClientLists();
extern RequestCallback_t CreateResponseBase;
#ifdef _PEDANTIC
uint16_t IsValidLcid(const uint16_t Lcid);
uint16_t IsValidLcid(const uint16_t lcid);
uint16_t IsValidHostBuild(const uint16_t hostBuild);
#endif // _PEDANTIC
#endif // __kms_h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -99,7 +99,7 @@ static int_fast8_t getSocketList(struct addrinfo **saList, const char *const add
{
int status;
char *szHost, *szPort;
size_t len = strlen(addr) + 1;
const size_t len = strlen(addr) + 1;
// Don't alloca too much
if (len > 264) return FALSE;
@ -156,7 +156,7 @@ int_fast8_t isDisconnected(const SOCKET s)
if (!setBlockingEnabled(s, FALSE)) return TRUE;
int n = recv(s, buffer, 1, MSG_PEEK);
const int n = recv(s, buffer, 1, MSG_PEEK);
if (!setBlockingEnabled(s, TRUE)) return TRUE;
if (n == 0) return TRUE;
@ -200,7 +200,7 @@ static int_fast8_t isPrivateIPAddress(struct sockaddr* addr, socklen_t* length)
case AF_INET:
{
uint32_t ipv4addr = BE32(((struct sockaddr_in*)addr)->sin_addr.s_addr);
const uint32_t ipv4addr = BE32(((struct sockaddr_in*)addr)->sin_addr.s_addr);
if
(
@ -244,11 +244,7 @@ SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fas
if (ip2str(szAddr, sizeof(szAddr), sa->ai_addr, (socklen_t)sa->ai_addrlen))
{
if (showHostName)
printf("Connecting to %s (%s) ... ", addr, szAddr);
else
printf("Connecting to %s ... ", szAddr);
showHostName ? printf("Connecting to %s (%s) ... ", addr, szAddr) : printf("Connecting to %s ... ", szAddr);
fflush(stdout);
}
@ -394,7 +390,7 @@ void getPrivateIPAddresses(int* numAddresses, char*** ipAddresses)
DWORD dwRetVal;
ULONG outBufLen = 16384;
ULONG flags = GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME;
const 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);
@ -438,7 +434,7 @@ void getPrivateIPAddresses(int* numAddresses, char*** ipAddresses)
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);
const int error = getnameinfo(currentAddress->Address.lpSockaddr, currentAddress->Address.iSockaddrLength, ipAddress, 64, NULL, 0, NI_NUMERICHOST);
if (error)
{
@ -683,7 +679,7 @@ __pure int_fast8_t checkProtocolStack(const int addressfamily)
SOCKET s; // = INVALID_SOCKET;
s = socket(addressfamily, SOCK_STREAM, 0);
int_fast8_t success = (s != INVALID_SOCKET);
const int_fast8_t success = (s != INVALID_SOCKET);
socketclose(s);
return success;
@ -768,7 +764,7 @@ static void serveClient(const SOCKET s_client, const DWORD RpcAssocGroup)
# if !defined(NO_LOG) && defined(_PEDANTIC)
int result =
const int result =
setsockopt(s_client, SOL_SOCKET, SO_RCVTIMEO, (sockopt_t)&to, sizeof(to)) ||
setsockopt(s_client, SOL_SOCKET, SO_SNDTIMEO, (sockopt_t)&to, sizeof(to));

View File

@ -29,7 +29,7 @@
/* Forwards */
static int checkRpcHeader(const RPC_HEADER *const Header, const BYTE desiredPacketType, const PRINTFUNC p);
static int checkRpcHeader(const RPC_HEADER *const header, const BYTE desiredPacketType, const PRINTFUNC p);
/* Data definitions */
@ -254,7 +254,7 @@ static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const
# ifndef SIMPLE_RPC
WORD Ctx = LE16(Request->ContextId);
const WORD Ctx = LE16(Request->ContextId);
if (Ctx == *NdrCtx)
{
@ -282,7 +282,7 @@ static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const
if (isValid)
{
uint16_t majorIndex = LE16(((WORD*)requestData)[1]) - 4;
const uint16_t majorIndex = LE16(((WORD*)requestData)[1]) - 4;
if (!((ResponseSize = _Versions[majorIndex].CreateResponse(requestData, responseData, ipstr)))) ResponseSize = 0x8007000D;
}
@ -329,7 +329,7 @@ static int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const
len += sizeof(DWORD);
// Pad zeros to 32-bit align (seems not neccassary but Windows RPC does it this way)
int pad = ((~len & 3) + 1) & 3;
const int pad = ((~len & 3) + 1) & 3;
memset(pRpcReturnCode + sizeof(DWORD), 0, pad);
len += pad;
@ -348,8 +348,8 @@ static void CheckRpcBindRequest(const RPC_BIND_REQUEST *const Request, const uns
uint_fast8_t i, HasTransferSyntaxNDR32 = FALSE;
char guidBuffer1[GUID_STRING_LENGTH + 1], guidBuffer2[GUID_STRING_LENGTH + 1];
uint32_t CapCtxItems = (len - sizeof(*Request) + sizeof(Request->CtxItems)) / sizeof(Request->CtxItems);
DWORD NumCtxItems = LE32(Request->NumCtxItems);
const uint32_t CapCtxItems = (len - sizeof(*Request) + sizeof(Request->CtxItems)) / sizeof(Request->CtxItems);
const DWORD NumCtxItems = LE32(Request->NumCtxItems);
if (NumCtxItems < CapCtxItems) // Can't be too small because already handled by RpcBindSize
logger("Warning: Excess bytes in RPC bind request.\n");
@ -410,7 +410,7 @@ static unsigned int checkRpcBindSize(const RPC_BIND_REQUEST *const Request, cons
{
if (RequestSize < sizeof(RPC_BIND_REQUEST)) return FALSE;
unsigned int numCtxItems = LE32(Request->NumCtxItems);
const unsigned int numCtxItems = LE32(Request->NumCtxItems);
if (RequestSize < sizeof(RPC_BIND_REQUEST) - sizeof(Request->CtxItems[0]) + numCtxItems * sizeof(Request->CtxItems[0])) return FALSE;
@ -432,7 +432,7 @@ static unsigned int checkRpcBindSize(const RPC_BIND_REQUEST *const Request, cons
static int rpcBind(const RPC_BIND_REQUEST *const Request, RPC_BIND_RESPONSE* Response, const DWORD RpcAssocGroup, const SOCKET sock, WORD* NdrCtx, WORD* Ndr64Ctx, BYTE packetType, const char* const ipstr_unused)
{
unsigned int i;
DWORD numCtxItems = LE32(Request->NumCtxItems);
const DWORD numCtxItems = LE32(Request->NumCtxItems);
int_fast8_t IsNDR64possible = FALSE;
uint_fast8_t portNumberSize;
@ -504,7 +504,7 @@ static int rpcBind(const RPC_BIND_REQUEST *const Request, RPC_BIND_RESPONSE* Res
memset(&result->TransferSyntax, 0, sizeof(GUID));
# ifndef SIMPLE_RPC
int isInterfaceUUID = IsEqualGUID(&Request->CtxItems[i].InterfaceUUID, (GUID*)InterfaceUuid);
const int isInterfaceUUID = IsEqualGUID(&Request->CtxItems[i].InterfaceUUID, (GUID*)InterfaceUuid);
if (isInterfaceUUID) nackReason = RPC_SYNTAX_UNSUPPORTED;
# else // SIMPLE_RPC
# define isInterfaceUUID TRUE
@ -809,7 +809,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const kmsRequest, const
RPC_REQUEST64 *RpcRequest;
RPC_RESPONSE64 _Response;
int status;
int_fast8_t useNdr64 = RpcFlags.HasNDR64 && UseClientRpcNDR64 && firstPacketSent;
const int_fast8_t useNdr64 = RpcFlags.HasNDR64 && UseClientRpcNDR64 && firstPacketSent;
size_t size = sizeof(RPC_HEADER) + (useNdr64 ? sizeof(RPC_REQUEST64) : sizeof(RPC_REQUEST)) + requestSize;
size_t responseSize2;
@ -949,8 +949,8 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const kmsRequest, const
DWORD *pReturnCode;
size_t len = *responseSize + (useNdr64 ? sizeof(_Response.Ndr64) : sizeof(_Response.Ndr)) + sizeof(*pReturnCode);
size_t pad = ((~len & 3) + 1) & 3;
const size_t len = *responseSize + (useNdr64 ? sizeof(_Response.Ndr64) : sizeof(_Response.Ndr)) + sizeof(*pReturnCode);
const size_t pad = ((~len & 3) + 1) & 3;
if (len + pad != LE32(_Response.AllocHint))
{
@ -982,7 +982,7 @@ RpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const kmsRequest, const
}
static int_fast8_t IsNullGuid(BYTE* guidPtr)
static int_fast8_t IsNullGuid(const BYTE* guidPtr)
{
int_fast8_t i;
@ -1005,8 +1005,8 @@ static RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, const BYTE packe
RPC_BIND_REQUEST *bindRequest;
RPC_BIND_RESPONSE *bindResponse;
int status;
WORD ctxItems = 1 + (packetType == RPC_PT_BIND_REQ ? UseClientRpcNDR64 + UseClientRpcBTFN : 0);
size_t rpcBindSize = (sizeof(RPC_HEADER) + sizeof(RPC_BIND_REQUEST) + (ctxItems - 1) * sizeof(bindRequest->CtxItems[0]));
const WORD ctxItems = 1 + (packetType == RPC_PT_BIND_REQ ? UseClientRpcNDR64 + UseClientRpcBTFN : 0);
const size_t rpcBindSize = (sizeof(RPC_HEADER) + sizeof(RPC_BIND_REQUEST) + (ctxItems - 1) * sizeof(bindRequest->CtxItems[0]));
WORD ctxIndex = 0;
WORD i;
WORD CtxBTFN = RPC_INVALID_CTX, CtxNDR64 = RPC_INVALID_CTX;

View File

@ -104,8 +104,14 @@ const char *fn_exe = NULL;
#ifndef NO_RANDOM_EPID
int_fast8_t RandomizationLevel = 1;
uint16_t Lcid = 0;
uint16_t HostBuild = 0;
#endif
#if !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
uint8_t IsNDR64Defined = FALSE;
#endif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)
#ifdef SIMPLE_SOCKETS
SOCKET s_server;

View File

@ -48,7 +48,7 @@
#include "types.h"
#include "kms.h"
#define MIN_CSVLK 5
//#define MIN_CSVLK 6
typedef struct
{
const char* Epid;
@ -162,9 +162,14 @@ extern int_fast8_t logverbose;
#endif
#endif
#if !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
extern uint8_t IsNDR64Defined;
#endif
#ifndef NO_RANDOM_EPID
extern int_fast8_t RandomizationLevel;
extern uint16_t Lcid;
extern uint16_t HostBuild;
#endif
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)

View File

@ -84,7 +84,7 @@
#include "wintap.h"
#endif
static const char* const optstring = "N:B:m:t:w:0:3:6:H:A:R:u:G:g:L:p:i:P:l:r:U:W:C:c:F:O:o:x:T:K:E:M:j:SseDdVvqkZ";
static const char* const optstring = "a:N:B:m:t:A:R:u:g:L:p:i:H:P:l:r:U:W:C:c:F:O:o:x:T:K:E:M:j:SseDdVvqkZ";
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
static uint_fast8_t maxsockets = 0;
@ -119,11 +119,6 @@ char* IniFileErrorBuffer = NULL;
static IniFileParameter_t IniFileParameterList[] =
{
{ "Windows", INI_PARAM_WINDOWS },
{ "Office2010", INI_PARAM_OFFICE2010 },
{ "Office2013", INI_PARAM_OFFICE2013 },
{ "Office2016", INI_PARAM_OFFICE2016 },
{ "WinChinaGov", INI_PARAM_WINCHINAGOV },
# ifndef NO_SOCKETS
{ "ExitLevel", INI_PARAM_EXIT_LEVEL },
# endif // NO_SOCKETS
@ -144,6 +139,7 @@ static IniFileParameter_t IniFileParameterList[] =
# ifndef NO_RANDOM_EPID
{ "RandomizationLevel", INI_PARAM_RANDOMIZATION_LEVEL },
{ "LCID", INI_PARAM_LCID },
{ "HostBuild", INI_PARAM_HOST_BUILD },
# endif // NO_RANDOM_EPID
# if !defined(NO_SOCKETS) && (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS) || defined(HAVE_GETIFADDR))
{ "Port", INI_PARAM_PORT },
@ -270,21 +266,17 @@ static __noreturn void usage()
"\nUsage:\n"
" %s [ options ]\n\n"
"Where:\n"
# ifndef NO_CL_PIDS
" -w <ePID>\t\talways use <ePID> for Windows\n"
" -0 <ePID>\t\talways use <ePID> for Office2010\n"
" -3 <ePID>\t\talways use <ePID> for Office2013\n"
" -6 <ePID>\t\talways use <ePID> for Office2016\n"
" -G <ePID>\t\talways use <ePID> for Win China Gov\n"
" -H <HwId>\t\talways use hardware Id <HwId>\n"
# endif // NO_CL_PIDS
# if !defined(_WIN32) && !defined(NO_USER_SWITCH)
" -u <user>\t\tset uid to <user>\n"
" -g <group>\t\tset gid to <group>\n"
# endif // !defined(_WIN32) && !defined(NO_USER_SWITCH)
# ifndef NO_CL_PIDS
" -a <csvlk>=<epid>\tuse <epid> for <csvlk>\n"
# endif // NO_CL_PIDS
# ifndef NO_RANDOM_EPID
" -r 0|1|2\t\tset ePID randomization level (default 1)\n"
" -C <LCID>\t\tuse fixed <LCID> in random ePIDs\n"
" -H <build>\t\tuse fixed <build> number in random ePIDs\n"
# endif // NO_RANDOM_EPID
# if !defined(NO_PRIVATE_IP_DETECT)
# if HAVE_GETIFADDR
@ -334,7 +326,7 @@ static __noreturn void usage()
# endif // _WIN32
# endif // NO_SOCKETS
# ifndef NO_STRICT_MODES
" -K 0|1|2|3\t\tset whitelisting level for KMS IDs (default -K0)\n"
" -K 0|1|2|3\t\tset white-listing level for KMS IDs (default -K0)\n"
" -c0, -c1\t\tdisable/enable client time checking (default -c0)\n"
# ifndef NO_CLIENT_LIST
" -M0, -M1\t\tdisable/enable maintaining clients (default -M0)\n"
@ -392,7 +384,8 @@ static __noreturn void usage()
__pure static BOOL getTimeSpanFromIniFile(DWORD* result, const char *const restrict argument)
{
DWORD val = timeSpanString2Minutes(argument);
const DWORD val = timeSpanString2Minutes(argument);
if (!val)
{
IniFileErrorMessage = "Incorrect time span.";
@ -408,7 +401,7 @@ __pure static BOOL getTimeSpanFromIniFile(DWORD* result, const char *const restr
__pure static DWORD getTimeSpanFromCommandLine(const char *const restrict arg, const char optchar)
{
DWORD val = timeSpanString2Minutes(arg);
const DWORD val = timeSpanString2Minutes(arg);
if (!val)
{
@ -422,6 +415,71 @@ __pure static DWORD getTimeSpanFromCommandLine(const char *const restrict arg, c
#endif // NO_CUSTOM_INTERVALS
#if !defined(NO_INI_FILE) || !defined (NO_CL_PIDS)
static __pure int isControlCharOrSlash(const char c)
{
if ((unsigned char)c < '!') return TRUE;
if (c == '/') return TRUE;
return FALSE;
}
static void iniFileLineNextWord(const char **s)
{
while (**s && isspace((int)**s)) (*s)++;
}
static BOOL setHwIdFromIniFileLine(const char **s, const uint32_t index, const uint8_t overwrite)
{
iniFileLineNextWord(s);
if (**s == '/')
{
if (!overwrite && KmsResponseParameters[index].HwId) return TRUE;
BYTE* HwId = (BYTE*)vlmcsd_malloc(sizeof(((RESPONSE_V6 *)0)->HwId));
hex2bin(HwId, *s + 1, sizeof(((RESPONSE_V6 *)0)->HwId));
KmsResponseParameters[index].HwId = HwId;
}
return TRUE;
}
static BOOL setEpidFromIniFileLine(const char **s, const uint32_t index, const char *ePidSource, const uint8_t overwrite)
{
iniFileLineNextWord(s);
const char *savedPosition = *s;
uint_fast16_t i;
for (i = 0; !isControlCharOrSlash(**s); i++)
{
if (utf8_to_ucs2_char((const unsigned char*)*s, (const unsigned char**)s) == (WCHAR)~0)
{
return FALSE;
}
}
if (i < 1 || i >= PID_BUFFER_SIZE) return FALSE;
if (!overwrite && KmsResponseParameters[index].Epid) return TRUE;
const size_t size = *s - savedPosition + 1;
char* epidbuffer = (char*)vlmcsd_malloc(size);
memcpy(epidbuffer, savedPosition, size - 1);
epidbuffer[size - 1] = 0;
KmsResponseParameters[index].Epid = epidbuffer;
#ifndef NO_LOG
KmsResponseParameters[index].EpidSource = ePidSource;
#endif //NO_LOG
return TRUE;
}
#endif // !defined(NO_INI_FILE) || !defined (NO_CL_PIDS)
#ifndef NO_INI_FILE
static void ignoreIniFileParameter(uint_fast8_t iniFileParameterId)
{
@ -463,103 +521,12 @@ static BOOL getIniFileArgumentInt(unsigned int *result, const char *const argume
}
static __pure int isControlCharOrSlash(const char c)
{
if ((unsigned char)c < '!') return TRUE;
if (c == '/') return TRUE;
return FALSE;
}
static void iniFileLineNextWord(const char **s)
{
while (**s && isspace((int)**s)) (*s)++;
}
static BOOL setHwIdFromIniFileLine(const char **s, const uint32_t index)
{
iniFileLineNextWord(s);
if (**s == '/')
{
if (KmsResponseParameters[index].HwId) return TRUE;
BYTE* HwId = (BYTE*)vlmcsd_malloc(sizeof(((RESPONSE_V6 *)0)->HwId));
hex2bin(HwId, *s + 1, sizeof(((RESPONSE_V6 *)0)->HwId));
KmsResponseParameters[index].HwId = HwId;
}
return TRUE;
}
static BOOL setEpidFromIniFileLine(const char **s, const uint32_t index)
{
iniFileLineNextWord(s);
const char *savedPosition = *s;
uint_fast16_t i;
for (i = 0; !isControlCharOrSlash(**s); i++)
{
if (utf8_to_ucs2_char((const unsigned char*)*s, (const unsigned char**)s) == (WCHAR)~0)
{
return FALSE;
}
}
if (i < 1 || i >= PID_BUFFER_SIZE) return FALSE;
if (KmsResponseParameters[index].Epid) return TRUE;
size_t size = *s - savedPosition + 1;
char* epidbuffer = (char*)vlmcsd_malloc(size);
memcpy(epidbuffer, savedPosition, size - 1);
epidbuffer[size - 1] = 0;
KmsResponseParameters[index].Epid = epidbuffer;
#ifndef NO_LOG
KmsResponseParameters[index].EpidSource = fn_ini;
#endif //NO_LOG
return TRUE;
}
static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
{
unsigned int result;
BOOL success = TRUE;
const char *s = (const char*)iniarg;
switch (id)
{
case INI_PARAM_WINDOWS:
setEpidFromIniFileLine(&s, EPID_INDEX_WINDOWS);
setHwIdFromIniFileLine(&s, EPID_INDEX_WINDOWS);
break;
case INI_PARAM_OFFICE2010:
setEpidFromIniFileLine(&s, EPID_INDEX_OFFICE2010);
setHwIdFromIniFileLine(&s, EPID_INDEX_OFFICE2010);
break;
case INI_PARAM_OFFICE2013:
setEpidFromIniFileLine(&s, EPID_INDEX_OFFICE2013);
setHwIdFromIniFileLine(&s, EPID_INDEX_OFFICE2013);
break;
case INI_PARAM_OFFICE2016:
setEpidFromIniFileLine(&s, EPID_INDEX_OFFICE2016);
setHwIdFromIniFileLine(&s, EPID_INDEX_OFFICE2016);
break;
case INI_PARAM_WINCHINAGOV:
setEpidFromIniFileLine(&s, EPID_INDEX_WINCHINAGOV);
setHwIdFromIniFileLine(&s, EPID_INDEX_WINCHINAGOV);
break;
# ifndef NO_TAP
case INI_PARAM_VPN:
@ -610,6 +577,11 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
if (success) RandomizationLevel = (int_fast8_t)result;
break;
case INI_PARAM_HOST_BUILD:
success = getIniFileArgumentInt(&result, iniarg, 0, 65535);
if (success) HostBuild = (uint16_t)result;
break;
# endif // NO_RANDOM_EPID
# if (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS) || defined(HAVE_GETIFADDR)) && !defined(NO_SOCKETS)
@ -728,6 +700,7 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
case INI_PARAM_RPC_NDR64:
success = getIniFileArgumentBool(&UseServerRpcNDR64, iniarg);
if (success) IsNDR64Defined = TRUE;
break;
case INI_PARAM_RPC_BTFN:
@ -800,6 +773,56 @@ static BOOL getIniFileArgument(const char **s)
return TRUE;
}
static char* GetNextString(char* s)
{
return s + strlen(s) + 1;
}
static int8_t GetCsvlkIndexFromName(const char *s)
{
int8_t i;
for (i = 0; i < KmsData->CsvlkCount; i++)
{
const char *csvlkName = GetNextString(KmsData->CsvlkData[i].EPid);
if (!strncasecmp(csvlkName, s, strlen(csvlkName)))
{
return i;
}
}
return -1;
}
static BOOL handleIniFileEpidParameter(const char *s, uint8_t allowIniFileDirectives, const char *ePidSource)
{
int_fast16_t i;
if (allowIniFileDirectives)
{
for (i = 0; i < (int_fast16_t)vlmcsd_countof(IniFileParameterList); i++)
{
if (!strncasecmp(IniFileParameterList[i].Name, s, strlen(IniFileParameterList[i].Name)))
{
return TRUE;
}
}
}
i = GetCsvlkIndexFromName(s);
if (i >= 0)
{
if (!getIniFileArgument(&s)) return FALSE;
if (!setEpidFromIniFileLine(&s, i, ePidSource, !allowIniFileDirectives)) return FALSE;
if (!setHwIdFromIniFileLine(&s, i, !allowIniFileDirectives)) return FALSE;
return TRUE;
}
IniFileErrorMessage = "Unknown keyword.";
return FALSE;
}
static BOOL handleIniFileParameter(const char *s)
{
@ -809,14 +832,13 @@ static BOOL handleIniFileParameter(const char *s)
{
if (strncasecmp(IniFileParameterList[i].Name, s, strlen(IniFileParameterList[i].Name))) continue;
if (!IniFileParameterList[i].Id) return TRUE;
if (!getIniFileArgument(&s)) return FALSE;
return setIniFileParameter(IniFileParameterList[i].Id, s);
}
IniFileErrorMessage = "Unknown keyword.";
return FALSE;
IniFileErrorMessage = NULL;
return TRUE;
}
@ -844,6 +866,11 @@ static BOOL readIniFile(const uint_fast8_t pass)
FILE *restrict f;
BOOL result = TRUE;
if (pass == INI_FILE_PASS_2 && KmsData->MinorVer < 6)
{
return TRUE;
}
IniFileErrorBuffer = (char*)vlmcsd_malloc(INIFILE_ERROR_BUFFERSIZE);
if (!((f = fopen(fn_ini, "r")))) return FALSE;
@ -855,18 +882,18 @@ static BOOL readIniFile(const uint_fast8_t pass)
iniFileLineNextWord(&s);
if (*s == ';' || *s == '#' || !*s) continue;
# ifndef NO_SOCKETS
if (pass == INI_FILE_PASS_1)
# endif // NO_SOCKETS
{
if (handleIniFileParameter(s)) continue;
lineParseError = TRUE;/*!checkGuidInIniFileLine(&s, &appIndex) ||
!setEpidFromIniFileLine(&s, appIndex) ||
!setHwIdFromIniFileLine(&s, appIndex);*/
lineParseError = TRUE;
}
else if (pass == INI_FILE_PASS_2)
{
if (handleIniFileEpidParameter(s, TRUE, fn_ini)) continue;
lineParseError = TRUE;
}
# if !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)
else if (pass == INI_FILE_PASS_2)
else if (pass == INI_FILE_PASS_3)
{
lineParseError = !setupListeningSocketsFromIniFile(s);
}
@ -1020,7 +1047,7 @@ static int daemonizeAndSetSignalAction()
#else // _WIN32
static BOOL terminationHandler(const DWORD fdwCtrlType)
static BOOL __stdcall terminationHandler(const DWORD fdwCtrlType)
{
// What a lame substitute for Unix signal handling
switch (fdwCtrlType)
@ -1043,7 +1070,7 @@ static DWORD daemonizeAndSetSignalAction()
if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)terminationHandler, TRUE))
{
#ifndef NO_LOG
DWORD rc = GetLastError();
const DWORD rc = GetLastError();
logger("Warning: Could not register Windows signal handler: Error %u\n", rc);
#endif // NO_LOG
}
@ -1073,10 +1100,6 @@ __pure static char* getCommandLineArg(char *const restrict arg)
static void parseGeneralArguments() {
int o;
#ifndef NO_CL_PIDS
BYTE* HwId;
#endif // NO_CL_PIDS
for (opterr = 0; (o = getopt(global_argc, (char* const*)global_argv, (const char*)optstring)) > 0; ) switch (o)
{
# if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
@ -1097,50 +1120,7 @@ static void parseGeneralArguments() {
# ifndef NO_CL_PIDS
case 'w':
KmsResponseParameters[EPID_INDEX_WINDOWS].Epid = getCommandLineArg(optarg);
# ifndef NO_LOG
KmsResponseParameters[EPID_INDEX_WINDOWS].EpidSource = "command line";
# endif // NO_LOG
break;
case '0':
KmsResponseParameters[EPID_INDEX_OFFICE2010].Epid = getCommandLineArg(optarg);
# ifndef NO_LOG
KmsResponseParameters[EPID_INDEX_OFFICE2010].EpidSource = "command line";
# endif // NO_LOG
break;
case '3':
KmsResponseParameters[EPID_INDEX_OFFICE2013].Epid = getCommandLineArg(optarg);
# ifndef NO_LOG
KmsResponseParameters[EPID_INDEX_OFFICE2013].EpidSource = "command line";
# endif // NO_LOG
break;
case '6':
KmsResponseParameters[EPID_INDEX_OFFICE2016].Epid = getCommandLineArg(optarg);
# ifndef NO_LOG
KmsResponseParameters[EPID_INDEX_OFFICE2016].EpidSource = "command line";
# endif // NO_LOG
break;
case 'G':
KmsResponseParameters[EPID_INDEX_WINCHINAGOV].Epid = getCommandLineArg(optarg);
# ifndef NO_LOG
KmsResponseParameters[EPID_INDEX_WINCHINAGOV].EpidSource = "command line";
# endif // NO_LOG
break;
case 'H':
HwId = (BYTE*)vlmcsd_malloc(sizeof(((RESPONSE_V6 *)0)->HwId));
hex2bin(HwId, optarg, sizeof(((RESPONSE_V6 *)0)->HwId));
KmsResponseParameters[EPID_INDEX_WINDOWS].HwId =
KmsResponseParameters[EPID_INDEX_OFFICE2010].HwId =
KmsResponseParameters[EPID_INDEX_OFFICE2013].HwId =
KmsResponseParameters[EPID_INDEX_WINCHINAGOV].HwId =
KmsResponseParameters[EPID_INDEX_OFFICE2016].HwId = HwId;
case 'a':
break;
# endif // NO_CL_PIDS
@ -1341,6 +1321,19 @@ static void parseGeneralArguments() {
# endif // _PEDANTIC
break;
case 'H':
HostBuild = (uint16_t)getOptionArgumentInt((char)o, 0, 0xffff);
ignoreIniFileParameter(INI_PARAM_HOST_BUILD);
# ifdef _PEDANTIC
if (!IsValidHostBuild(HostBuild))
{
printerrorf("Warning: %u is not a known released Windows Server build >= 2008.\n");
}
# endif // _PEDANTIC
break;
# endif // NO_RANDOM_PID
# if !defined(NO_USER_SWITCH) && !defined(_WIN32)
@ -1393,6 +1386,7 @@ static void parseGeneralArguments() {
# ifndef SIMPLE_RPC
case 'N':
if (!getArgumentBool(&UseServerRpcNDR64, optarg)) usage();
IsNDR64Defined = TRUE;
ignoreIniFileParameter(INI_PARAM_RPC_NDR64);
break;
@ -1461,8 +1455,8 @@ static void writePidFile()
logger("Warning: Cannot write pid file '%s'. %s.\n", fn_pid, strerror(errno));
}
# endif // NO_LOG
}
}
}
#else
#define writePidFile()
#endif // !defined(NO_PID_FILE)
@ -1569,8 +1563,8 @@ static void allocateSemaphore(void)
{
printerrorf("Warning: Could not create semaphore: %s\n", vlmcsd_strerror(errno));
MaxTasks = SEM_VALUE_MAX;
}
}
}
}
# endif // THREADS or CYGWIN
@ -1583,7 +1577,7 @@ static void allocateSemaphore(void)
}
# endif // _WIN32
}
}
}
#endif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__
@ -1596,15 +1590,15 @@ int setupListeningSockets()
char** privateIPList = NULL;
int numPrivateIPs = 0;
if (PublicIPProtectionLevel & 1) getPrivateIPAddresses(&numPrivateIPs, &privateIPList);
uint_fast8_t allocsockets = (uint_fast8_t)(maxsockets ? (maxsockets + numPrivateIPs) : ((PublicIPProtectionLevel & 1) ? numPrivateIPs : 2));
const uint_fast8_t allocsockets = (uint_fast8_t)(maxsockets ? (maxsockets + numPrivateIPs) : ((PublicIPProtectionLevel & 1) ? numPrivateIPs : 2));
# else // !HAVE_GETIFADDR
uint_fast8_t allocsockets = maxsockets ? maxsockets : 2;
# endif // !HAVE_GETIFADDR
SocketList = (SOCKET*)vlmcsd_malloc((size_t)allocsockets * sizeof(SOCKET));
int_fast8_t haveIPv4Stack = checkProtocolStack(AF_INET);
int_fast8_t haveIPv6Stack = checkProtocolStack(AF_INET6);
const int_fast8_t haveIPv4Stack = checkProtocolStack(AF_INET);
const int_fast8_t haveIPv6Stack = checkProtocolStack(AF_INET6);
// Reset getopt since we've alread used it
optReset();
@ -1627,7 +1621,7 @@ int setupListeningSockets()
# ifndef NO_INI_FILE
if (maxsockets && !numsockets)
{
if (fn_ini && !readIniFile(INI_FILE_PASS_2))
if (fn_ini && !readIniFile(INI_FILE_PASS_3))
{
# ifdef INI_FILE
if (strcmp(fn_ini, INI_FILE))
@ -1662,7 +1656,7 @@ int setupListeningSockets()
if (haveIPv6Stack) addListeningSocket("::");
if (haveIPv4Stack) addListeningSocket("0.0.0.0");
# endif // !HAVE_GETIFADDR
}
}
if (!numsockets)
{
@ -1698,11 +1692,6 @@ int server_main(int argc, CARGV argv)
int newmain()
{
# if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
KmsResponseParameters = (KmsResponseParam_t*)vlmcsd_malloc(sizeof(KmsResponseParam_t) * MIN_CSVLK);
memset(KmsResponseParameters, 0, sizeof(KmsResponseParam_t) * MIN_CSVLK);
# endif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
// Initialize thread synchronization objects for Windows and Cygwin
# ifdef USE_THREADS
@ -1762,7 +1751,7 @@ int newmain()
# ifndef NO_LOG
logstdout = 0;
# endif // !NO_LOG
}
}
# endif // !defined(_WIN32) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)
@ -1780,6 +1769,67 @@ int newmain()
loadKmsData();
# if !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
if
(
!IsNDR64Defined
)
{
UseServerRpcNDR64 = !!KmsData->Flags & KMS_OPTIONS_USENDR64;
# ifndef NO_RANDOM_EPID
if (HostBuild&&RandomizationLevel)
{
UseServerRpcNDR64 = HostBuild > 7601;
}
# endif
}
# endif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
# if !defined(NO_INI_FILE) || !defined(NO_CL_PIDS)
if (KmsData->MinorVer < 6)
{
printerrorf("Warning: Need database version 1.6 or greater to set custom ePids\n");
}
# endif // !defined(NO_INI_FILE) || !defined(NO_CL_PIDS)
# if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
KmsResponseParameters = (KmsResponseParam_t*)vlmcsd_malloc(sizeof(KmsResponseParam_t) * KmsData->CsvlkCount);
memset(KmsResponseParameters, 0, sizeof(KmsResponseParam_t) * KmsData->CsvlkCount);
# endif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)
#ifndef NO_CL_PIDS
optReset();
int o;
for (opterr = 0; (o = getopt(global_argc, (char* const*)global_argv, (const char*)optstring)) > 0; ) switch (o)
{
case 'a':
if (KmsData->MinorVer < 6 || !handleIniFileEpidParameter(optarg, FALSE, "command line"))
{
usage();
}
break;
default:
break;
}
#endif // NO_CL_PIDS
# ifndef NO_INI_FILE
if (fn_ini && !readIniFile(INI_FILE_PASS_2))
{
# ifdef INI_FILE
if (strcmp(fn_ini, INI_FILE))
# endif // INI_FILE
printerrorf("Warning: Can't read %s: %s\n", fn_ini, strerror(errno));
}
# endif // NO_INI_FILE
# ifndef NO_CLIENT_LIST
if (MaintainClients) InitializeClientLists();
# endif // !NO_CLIENT_LIST
@ -1842,7 +1892,7 @@ int newmain()
{
printerrorf("Fatal: %s for %s failed: %s\n", "setuid", uname, strerror(errno));
return errno;
}
}
# ifndef NO_SIGHUP
}
# endif // NO_SIGHUP

View File

@ -48,10 +48,7 @@ int server_main(int argc, CARGV argv);
#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_PARAM_HOST_BUILD 20
#define INI_PARAM_WHITELISTING_LEVEL 24
#define INI_PARAM_CHECK_CLIENT_TIME 25
#define INI_PARAM_MAINTAIN_CLIENTS 26
@ -59,10 +56,10 @@ int server_main(int argc, CARGV argv);
#define INI_PARAM_DATA_FILE 28
#define INI_PARAM_VPN 29
#define INI_PARAM_EXIT_LEVEL 30
#define INI_PARAM_WINCHINAGOV 31
#define INI_FILE_PASS_1 1
#define INI_FILE_PASS_2 2
#define INI_FILE_PASS_3 3
typedef struct IniFileParameter
{

View File

@ -262,7 +262,7 @@ static int DevCtl(DWORD code, void* data, DWORD len)
{
if (!DeviceIoControl(TapHandle, code, data, len, data, len, &len, NULL))
{
DWORD error = GetLastError();
const DWORD error = GetLastError();
printerrorf("Fatal: VPN adapter error: %s\n", win_strerror(error));
exit(error);
}
@ -278,7 +278,7 @@ static DWORD WINAPI TapMirror(LPVOID data_unused)
DWORD bytesRead, bytesWritten;
if (!ReadFile(TapHandle, IpPacket, Mtu, &bytesRead, NULL)) break;
uint32_t temp = IpPacket->ip_src;
const uint32_t temp = IpPacket->ip_src;
IpPacket->ip_src = IpPacket->ip_dst;
IpPacket->ip_dst = temp;
@ -289,7 +289,7 @@ static DWORD WINAPI TapMirror(LPVOID data_unused)
# endif // !defined(NO_LOG) && defined(_PEDANTIC)
}
DWORD error = GetLastError();
const DWORD error = GetLastError();
# ifndef NO_LOG
logger("Warning: VPN thread for device \"%s\" exiting: %s\n", ActiveTapName, win_strerror(error));