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

@ -12,19 +12,22 @@
#
# Set ePID/HwId for Windows explicitly
;Windows = 06401-00206-471-111111-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
;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-9600.0000-3622014
;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-9600.0000-3622014 / 01 02 03 04 05 06 07 08
;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-9600.0000-3622014 / 01 02 03 04 05 06 07 08
;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-9600.0000-3622014 / 01 02 03 04 05 06 07 08
;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
@ -59,6 +62,10 @@
# 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

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,46 +414,17 @@ 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
@ -540,6 +511,12 @@ OPTIONS
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
activates or refuses. The default is -K0.
@ -794,8 +771,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
@ -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,46 +414,17 @@ 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
@ -540,6 +511,12 @@ OPTIONS
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
activates or refuses. The default is -K0.
@ -794,8 +771,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
@ -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
@ -113,6 +113,9 @@ The \fIargument\fR must 0, 1 or 2. This specifies the ePID randomization level.
.IP "\fBLCID\fR"
Use a specific culture id (LCID) even if the ePID is randomized. The \fIargument\fR must be a number between 1 and 32767. While any number in that range is valid, you should use an offcial LCID. A list of assigned LCIDs can be found at http://msdn.microsoft.com/en\-us/goglobal/bb964664.aspx. On the command line you control this setting with option \fB-C\fR.
.IP "\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 (

115
src/kms.c
View File

@ -66,16 +66,7 @@ int32_t getProductIndex(const GUID* guid, const PVlmcsdData_t list, const int32_
#ifndef NO_RANDOM_EPID
// HostType and OSBuild
static const struct KMSHostOS { uint16_t Type; uint16_t Build; } HostOS[] =
{
{ 55041, 6002 }, // Windows Server 2008 SP2
{ 55041, 7601 }, // Windows Server 2008 R2 SP1
{ 5426, 9200 }, // Windows Server 2012
{ 6401, 9600 }, // Windows Server 2012 R2
{ 3612, 14393 }, // Windows Server 2016
};
static const uint16_t HostBuilds[] = { 6002, 7601, 9200, 9600, 14393, 17763 };
// Valid language identifiers to be used in the ePID
static const uint16_t LcidList[] = {
@ -89,6 +80,13 @@ static const uint16_t LcidList[] = {
17418, 18442, 19466, 20490, 1089, 1053, 2077, 1114, 1097, 1092, 1098, 1054, 1074, 1058, 1056, 1091, 2115, 1066, 1106, 1076, 1077
};
uint16_t getPlatformId(uint16_t hostBuild)
{
if (hostBuild < 9000) return 55041;
if (hostBuild <= 9500) return 5426;
if (hostBuild <= 10000) return 6401;
return 3612;
}
#ifdef _PEDANTIC
uint16_t IsValidLcid(const uint16_t lcid)
@ -102,6 +100,19 @@ uint16_t IsValidLcid(const uint16_t lcid)
return 0;
}
uint16_t IsValidHostBuild(const uint16_t hostBuild)
{
const uint16_t *hostOS;
for (hostOS = HostBuilds; hostOS < HostBuilds + vlmcsd_countof(HostBuilds); hostOS++)
{
if (hostBuild == *hostOS) return hostBuild;
}
return 0;
}
#endif // _PEDANTIC
#endif // NO_RANDOM_EPID
@ -110,7 +121,7 @@ uint16_t IsValidLcid(const uint16_t lcid)
// FILETIME is 100 nanoseconds from 1601-01-01. Must be 64 bits.
void getUnixTimeAsFileTime(FILETIME *const ts)
{
int64_t unixtime = (int64_t)time(NULL);
const int64_t unixtime = (int64_t)time(NULL);
int64_t *filetime = (int64_t*)ts;
PUT_UA64LE(filetime, (unixtime + 11644473600LL) * 10000000LL);
@ -206,7 +217,7 @@ void InitializeClientLists()
{
for (i = 0; i < KmsData->AppItemCount; i++)
{
uint8_t maxCount = KmsData->AppItemList[i].NCountPolicy;
const uint8_t maxCount = KmsData->AppItemList[i].NCountPolicy;
ClientLists[i].CurrentCount = (maxCount >> 1) - 1;
ClientLists[i].MaxCount = maxCount;
@ -240,22 +251,22 @@ static char* itoc(char *const c, const int i, uint_fast8_t digits)
return c;
}
static int getRandomServerType()
static uint8_t getRandomServerType()
{
# if defined(USE_MSRPC) || defined(SIMPLE_RPC)
return rand() % (int)vlmcsd_countof(HostOS);
return rand() % vlmcsd_countof(HostBuilds);
# else // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
if (!UseServerRpcBTFN)
{
// This isn't possible at all, e.g. KMS host on XP
return rand() % (int)vlmcsd_countof(HostOS);
return rand() % (int)vlmcsd_countof(HostBuilds);
}
// return 9200/9600/14393 if NDR64 is in use, otherwise 6002/7601
if (UseServerRpcNDR64) return (rand() % 3) + 2;
return (rand() % 2);
// return 9200/9600/14393/17763 if NDR64 is in use, otherwise 6002/7601
if (UseServerRpcNDR64) return rand() % ((int)vlmcsd_countof(HostBuilds) - 2) + 2;
return rand() % 2;
# endif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)
}
@ -264,44 +275,45 @@ static int getRandomServerType()
/*
* Generates a random ePID
*/
static void generateRandomPid(int index, char *const szPid, int serverType, int16_t lang)
static void generateRandomPid(const int index, char *const szPid, int16_t lang, uint16_t hostBuild)
{
char numberBuffer[12];
if (serverType < 0 || serverType >= (int)vlmcsd_countof(HostOS))
if (!hostBuild)
{
serverType = getRandomServerType();
hostBuild = HostBuilds[getRandomServerType()];
}
strcpy(szPid, itoc(numberBuffer, HostOS[serverType].Type, 5));
strcpy(szPid, itoc(numberBuffer, getPlatformId(hostBuild), 5));
strcat(szPid, "-");
//if (index > 3) index = 0;
PCsvlkData_t csvlkData = &KmsData->CsvlkData[index];
const PCsvlkData_t csvlkData = &KmsData->CsvlkData[index];
strcat(szPid, itoc(numberBuffer, csvlkData->GroupId, 5));
strcat(szPid, "-");
int keyId = (rand32() % (csvlkData->MaxKeyId - csvlkData->MinKeyId)) + csvlkData->MinKeyId;
const int keyId = (rand32() % (csvlkData->MaxKeyId - csvlkData->MinKeyId)) + csvlkData->MinKeyId;
strcat(szPid, itoc(numberBuffer, keyId / 1000000, 3));
strcat(szPid, "-");
strcat(szPid, itoc(numberBuffer, keyId % 1000000, 6));
strcat(szPid, "-03-");
if (lang < 0) lang = LcidList[rand() % vlmcsd_countof(LcidList)];
if (lang < 1) lang = LcidList[rand() % vlmcsd_countof(LcidList)];
strcat(szPid, itoc(numberBuffer, lang, 0));
strcat(szPid, "-");
strcat(szPid, itoc(numberBuffer, HostOS[serverType].Build, 0));
strcat(szPid, itoc(numberBuffer, hostBuild, 0));
strcat(szPid, ".0000-");
# define minTime ((time_t)1470175200) /* Release Date Win 2016 */
# define minTime ((time_t)1538490811) /* Release Date Win 2019 */
time_t maxTime;
time(&maxTime);
# ifndef BUILD_TIME
# define BUILD_TIME 1481079869
# define BUILD_TIME 1538922811
# endif
if (maxTime < (time_t)BUILD_TIME) // Just in case the system time is < 10/17/2013 1:00 pm
@ -310,7 +322,7 @@ static void generateRandomPid(int index, char *const szPid, int serverType, int1
time_t kmsTime = (rand32() % (maxTime - minTime)) + minTime;
struct tm *pidTime = gmtime(&kmsTime);
strcat(szPid, itoc(numberBuffer, pidTime->tm_yday, 3));
strcat(szPid, itoc(numberBuffer, pidTime->tm_yday + 1, 3));
strcat(szPid, itoc(numberBuffer, pidTime->tm_year + 1900, 4));
}
@ -323,8 +335,7 @@ void randomPidInit()
{
uint32_t i;
int serverType = getRandomServerType();
int16_t lang = Lcid ? Lcid : LcidList[rand() % vlmcsd_countof(LcidList)];
const int16_t lang = Lcid ? Lcid : LcidList[rand() % vlmcsd_countof(LcidList)];
for (i = 0; i < KmsData->CsvlkCount; i++)
{
@ -332,7 +343,7 @@ void randomPidInit()
char Epid[PID_BUFFER_SIZE];
generateRandomPid(i, Epid, serverType, lang);
generateRandomPid(i, Epid, lang, HostBuild);
KmsResponseParameters[i].Epid = (const char*)vlmcsd_strdup(Epid);
#ifndef NO_LOG
@ -389,7 +400,7 @@ static void logRequest(const REQUEST *const baseRequest)
#ifndef IS_LIBRARY
static void getEpidFromString(RESPONSE *const Response, const char *const pid)
{
size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);
const size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);
Response->PIDSize = LE32(((unsigned int)length + 1) << 1);
}
@ -406,9 +417,9 @@ static void getEpid(RESPONSE *const baseResponse, const char** EpidSource, const
#ifndef NO_RANDOM_EPID
if (RandomizationLevel == 2)
{
char szPid[PID_BUFFER_SIZE];
generateRandomPid(index, szPid, -1, Lcid ? Lcid : -1);
pid = szPid;
char ePid[PID_BUFFER_SIZE];
generateRandomPid(index, ePid, Lcid, HostBuild);
pid = ePid;
#ifndef NO_LOG
*EpidSource = "randomized on every request";
@ -525,8 +536,8 @@ static HRESULT __stdcall CreateResponseBaseCallback(const REQUEST *const baseReq
#endif // NO_LOG
char* ePid;
DWORD minClients = LE32(baseRequest->N_Policy);
DWORD required_clients = minClients < 1 ? 1 : minClients << 1;
const DWORD minClients = LE32(baseRequest->N_Policy);
const DWORD required_clients = minClients < 1 ? 1 : minClients << 1;
int32_t index = getProductIndex(&baseRequest->KMSID, KmsData->KmsItemList, KmsData->KmsItemCount, NULL, &ePid);
@ -543,7 +554,7 @@ static HRESULT __stdcall CreateResponseBaseCallback(const REQUEST *const baseReq
if (CheckClientTime)
{
time_t requestTime = (time_t)fileTimeToUnixTime(&baseRequest->ClientTime);
const time_t requestTime = (time_t)fileTimeToUnixTime(&baseRequest->ClientTime);
if (llabs(requestTime - time(NULL)) > 60 * 60 * 4)
{
@ -577,12 +588,12 @@ static HRESULT __stdcall CreateResponseBaseCallback(const REQUEST *const baseReq
}
# ifndef NO_CLIENT_LIST
int32_t appIndex = index < 0 ? 0 : KmsData->KmsItemList[index].AppIndex;
const int32_t appIndex = index < 0 ? 0 : KmsData->KmsItemList[index].AppIndex;
# endif // NO_CLIENT_LIST
# endif // !NO_STRICT_MODES
int32_t ePidIndex = index < 0 ? 0 : KmsData->KmsItemList[index].EPidIndex;
const int32_t ePidIndex = index < 0 ? 0 : KmsData->KmsItemList[index].EPidIndex;
# if !defined(NO_STRICT_MODES)
@ -653,7 +664,7 @@ static HRESULT __stdcall CreateResponseBaseCallback(const REQUEST *const baseReq
# endif // !NO_CLIENT_LIST
# endif // !defined(NO_STRICT_MODES)
{
uint8_t minimum_answer_clients = (uint8_t)KmsData->CsvlkData[ePidIndex].MinActiveClients;
const uint8_t minimum_answer_clients = (uint8_t)KmsData->CsvlkData[ePidIndex].MinActiveClients;
baseResponse->Count = LE32(required_clients > minimum_answer_clients ? required_clients : minimum_answer_clients);
//if (LE32(baseRequest->N_Policy) > LE32(baseResponse->Count)) baseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);
}
@ -701,11 +712,11 @@ size_t CreateResponseV4(REQUEST_V4 *const request_v4, BYTE *const responseBuffer
HRESULT hResult;
if (FAILED(hResult = CreateResponseBase(&request_v4->RequestBase, &Response->ResponseBase, NULL, ipstr))) return hResult;
DWORD pidSize = LE32(Response->ResponseBase.PIDSize);
const DWORD pidSize = LE32(Response->ResponseBase.PIDSize);
BYTE* postEpidPtr = responseBuffer + V4_PRE_EPID_SIZE + pidSize;
memmove(postEpidPtr, &Response->ResponseBase.CMID, V4_POST_EPID_SIZE);
size_t encryptSize = V4_PRE_EPID_SIZE + V4_POST_EPID_SIZE + pidSize;
const size_t encryptSize = V4_PRE_EPID_SIZE + V4_POST_EPID_SIZE + pidSize;
AesCmacV4(responseBuffer, encryptSize, responseBuffer + encryptSize);
return encryptSize + sizeof(Response->MAC);
@ -782,7 +793,7 @@ size_t CreateResponseV6(REQUEST_V6 *restrict request_v6, BYTE *const responseBuf
#endif
static const BYTE DefaultHwid[8] = { HWID };
int_fast8_t v6 = LE16(request_v6->MajorVer) > 5;
const int_fast8_t v6 = LE16(request_v6->MajorVer) > 5;
AesCtx aesCtx;
AesInitKey(&aesCtx, v6 ? AesKeyV6 : AesKeyV5, v6, AES_KEY_BYTES);
@ -820,9 +831,9 @@ size_t CreateResponseV6(REQUEST_V6 *restrict request_v6, BYTE *const responseBuf
if (FAILED(hResult = CreateResponseBase(&request_v6->RequestBase, baseResponse, Response->HwId, ipstr))) return hResult;
// Convert the fixed sized struct into variable sized
DWORD pidSize = LE32(baseResponse->PIDSize);
const DWORD pidSize = LE32(baseResponse->PIDSize);
BYTE* postEpidPtr = responseBuffer + V6_PRE_EPID_SIZE + pidSize;
size_t post_epid_size = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;
const size_t post_epid_size = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;
memmove(postEpidPtr, &baseResponse->CMID, post_epid_size);
@ -918,13 +929,13 @@ static uint8_t checkPidLength(const RESPONSE *const responseBase)
*/
RESPONSE_RESULT DecryptResponseV4(RESPONSE_V4* response_v4, const int responseSize, BYTE* const rawResponse, const BYTE* const rawRequest)
{
int copySize =
const int copySize =
V4_PRE_EPID_SIZE +
(LE32(((RESPONSE_V4*)rawResponse)->ResponseBase.PIDSize) <= PID_BUFFER_SIZE << 1 ?
LE32(((RESPONSE_V4*)rawResponse)->ResponseBase.PIDSize) :
PID_BUFFER_SIZE << 1);
int messageSize = copySize + V4_POST_EPID_SIZE;
const int messageSize = copySize + V4_POST_EPID_SIZE;
memcpy(response_v4, rawResponse, copySize);
memcpy(&response_v4->ResponseBase.CMID, rawResponse + copySize, responseSize - copySize);
@ -1035,7 +1046,7 @@ RESPONSE_RESULT DecryptResponseV6(RESPONSE_V6* response_v6, int responseSize, BY
responseSize -= copySize1;
AesCtx Ctx;
int_fast8_t v6 = LE16(((RESPONSE_V6*)response)->MajorVer) > 5;
const int_fast8_t v6 = LE16(((RESPONSE_V6*)response)->MajorVer) > 5;
AesInitKey(&Ctx, v6 ? AesKeyV6 : AesKeyV5, v6, AES_KEY_BYTES);
AesDecryptCbc(&Ctx, NULL, response + copySize1, responseSize);
@ -1076,7 +1087,7 @@ RESPONSE_RESULT DecryptResponseV6(RESPONSE_V6* response_v6, int responseSize, BY
response_v6->ResponseBase.KmsPID[PID_BUFFER_SIZE - 1] = 0;
// Copy part 2
size_t copySize2 = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;
const size_t copySize2 = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;
memcpy(&response_v6->ResponseBase.CMID, response + copySize1, copySize2);
// Decrypting the response is finished here. Now we check the results for validity
@ -1084,7 +1095,7 @@ RESPONSE_RESULT DecryptResponseV6(RESPONSE_V6* response_v6, int responseSize, BY
// as a debug tool for KMS emulators.
REQUEST_V6* request_v6 = (REQUEST_V6*)rawRequest;
DWORD decryptSize = sizeof(request_v6->IV) + sizeof(request_v6->RequestBase) + sizeof(request_v6->Pad);
const DWORD decryptSize = sizeof(request_v6->IV) + sizeof(request_v6->RequestBase) + sizeof(request_v6->Pad);
AesDecryptCbc(&Ctx, NULL, request_v6->IV, decryptSize);

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;
@ -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))
@ -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
@ -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

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));