[
  {
    "path": ".gitignore",
    "content": "VisualStudio/\nbin/\nbuild/\nbuildroot-configs/\nfloppy/\nhotbird64-mass-build/\nlib/\nsrc/VisualStudio-Linux-Remote/\n*.vcxproj*\n*.html\n*.pdf\n*.txt\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"debian\"]\n\tpath = debian\n\turl = https://github.com/Wind4/vlmcsd-debian.git\n[submodule \"docker\"]\n\tpath = docker\n\turl = https://github.com/Wind4/vlmcsd-docker.git\n"
  },
  {
    "path": "GNUmakefile",
    "content": ".NOTPARALLEL:\n\nMAX_THREADS ?= 16\n\nPROGRAM_NAME ?= bin/vlmcsd\nCLIENT_NAME ?= bin/vlmcs\nMULTI_NAME ?= bin/vlmcsdmulti\nOBJ_NAME ?= build/libkms-static.o\nA_NAME ?= lib/libkms.a\n\nBASE_PROGRAM_NAME=$(notdir $(PROGRAM_NAME))\nBASE_CLIENT_NAME=$(notdir $(CLIENT_NAME))\nBASE_MULTI_NAME=$(notdir $(MULTI_NAME))\nBASE_DLL_NAME=$(notdir $(DLL_NAME))\nBASE_A_NAME=$(notdir $(A_NAME))\n\nTARGETPLATFORM := $(shell LANG=en_US.UTF-8 $(CC) -v 2>&1 | grep '^Target: ' | cut -f 2 -d ' ')\n\nifneq (,$(findstring darwin,$(TARGETPLATFORM)))\n  DARWIN := 1\n  UNIX := 1\nendif\n\nifneq (,$(findstring android,$(TARGETPLATFORM)))\n  ANDROID := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring minix,$(TARGETPLATFORM)))\n  MINIX := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring mingw,$(TARGETPLATFORM)))\n  MINGW := 1\n  WIN := 1\n  PE := 1 \nendif\n\nifneq (,$(findstring cygwin,$(TARGETPLATFORM)))\n  CYGWIN := 1\n  WIN := 1\n  PE := 1\nendif\n\nifneq (,$(findstring cygnus,$(TARGETPLATFORM)))\n  CYGWIN := 1\n  WIN := 1\n  PE := 1\nendif\n\nifneq (,$(findstring freebsd,$(TARGETPLATFORM)))\n  FREEBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring netbsd,$(TARGETPLATFORM)))\n  NETBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring openbsd,$(TARGETPLATFORM)))\n  OPENBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring solaris,$(TARGETPLATFORM)))\n  SOLARIS := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring linux,$(TARGETPLATFORM)))\n  LINUX := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring gnu,$(TARGETPLATFORM)))\nifeq (,$(findstring linux,$(TARGETPLATFORM)))\n  UNIX := 1\n  HURD := 1\n  ELF := 1\nendif\nendif\n\nifeq ($(CYGWIN),1)\n  DLL_NAME ?= lib/cygkms.dll\nelse ifeq ($(WIN),1)\n  DLL_NAME ?= lib/libkms.dll\nelse ifeq ($(DARWIN),1)\n  DLL_NAME ?= lib/libkms.dylib\nelse\n  DLL_NAME ?= lib/libkms.so\nendif\n\n.DEFAULT:\n\t+@(test -d bin || mkdir bin) & (test -d lib || mkdir lib) & (test -d build || mkdir build)\n\t+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)\n\nall:\n\t+@(test -d bin || mkdir bin) & (test -d lib || mkdir lib) & (test -d build || mkdir build)\n\t+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)\n\nclean:\n\t+@$(MAKE) -j$(MAX_THREADS) -C src $@ FROM_PARENT=1 PROGRAM_NAME=$(PROGRAM_NAME) CLIENT_NAME=$(CLIENT_NAME) MULTI_NAME=$(MULTI_NAME) DLL_NAME=$(DLL_NAME) A_NAME=$(A_NAME)\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\nalldocs:\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\ndosdocs:\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\nunixdocs:\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\nhtmldocs:\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\npdfdocs:\n\t+@$(MAKE) -j$(MAX_THREADS) -C man $@\n\nGNUmakefile:\n\nhelp:\n\t@echo \"Type\"\n\t@echo \"    ${MAKE}               - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME)\"\n\t@echo \"    ${MAKE} clean         - to remove all targets and temporary files\"\n\t@echo \"    ${MAKE} pdfdocs       - Create PDF versions of the documentation (Requires groff with PDF support).\"\n\t@echo \"    ${MAKE} htmldocs      - Create HTML versions of the documentation.\"\n\t@echo \"    ${MAKE} unixdocs      - Create Unix TXT versions of the documentation.\"\n\t@echo \"    ${MAKE} dosdocs       - Create DOS/Windows TXT versions of the documentation.\"\n\t@echo \"    ${MAKE} alldocs       - Create all versions of the documentation.\"\n\t@echo \"    ${MAKE} vlmcsd        - to build KMS server $(PROGRAM_NAME)\"\n\t@echo \"    ${MAKE} vlmcs         - to build KMS client $(CLIENT_NAME)\"\n\t@echo \"    ${MAKE} vlmcsdmulti   - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) in a single multi-call binary $(MULTI_NAME)\"\n\t@echo \"    ${MAKE} libkms        - to build the shared library $(DLL_NAME)\"\n\t@echo \"    ${MAKE} libkms-static - to build the static library $(A_NAME)\"\n\t@echo \"\"\n\t@echo \"Options\"\n\t@echo \"    CONFIG=<x>                   Compile <x> as instead of config.h.\"\n\t@echo \"    INI=<x>                      Compile $(BASE_PROGRAM_NAME) with default ini file <x>\"\n\t@echo \"    DATA=<x>                     Compile $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) with default KMS data file <x>\"\n\t@echo \"    PROGRAM_NAME=<x>             Use <x> as output file name for the KMS server. Defaults to vlmcsd.\"\n\t@echo \"    CLIENT_NAME=<x>              Use <x> as output file name for the KMS client. Defaults to vlmcs.\"\n\t@echo \"    MULTI_NAME=<x>               Use <x> as output file name for the multi-call binary. Defaults to vlmcsdmulti.\"\n\t@echo \"    DEPENDENCIES=1               Create dependency files.\"\n\t@echo \"    CRYPTO=openssl               Use openssl for SHA256/HMAC calculations.\"\n\t@echo \"    CRYPTO=openssl_with_aes      EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (hardware, e.g. AES-NI on x86).\"\n\t@echo \"    CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software).\"\n\t@echo \"    CRYPTO=polarssl              Use polarssl instead of internal crypto code for SHA256/HMAC calculations.\"\n\t@echo \"    CRYPTO=windows               Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations.\"\n\t@echo \"    MSRPC=1                      Use Microsoft RPC instead of vlmcsd's internal RPC. Only works with Windows and Cygwin targets.\"\n\t@echo \"    CC=<x>                       Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work.\"\n\t@echo \"    AR=<x>                       Use <x> instead of ar to build $(BASE_A_NAME). Set to gcc-ar if you want to use gcc's LTO feature.\"\n\t@echo \"    COMPILER_LANGUAGE=<x>        May be c or c++.\"\n\t@echo \"    TERMINAL_WIDTH=<x>           Assume a fixed terminal width of <x> columns. Use in case of problems only.\"  \n\t@echo \"    VLMCSD_VERSION=<x>           Sets <x> as your version identifier. Defaults to \\\"private build\\\".\"\n\t@echo \"    CFLAGS=<x>                   Pass <x> as additional arguments to the compiler.\"\n\t@echo \"    LDFLAGS=<x>                  Pass <x> as additional arguments to the linker.\"\n\t@echo \"    PLATFORMFLAGS=<x>            Pass <x> as additional arguments to the compiler and the linker.\"\n\t@echo \"    BASECFLAGS=<x>               Pass only <x> as arguments to the compiler (advanced users only).\"\n\t@echo \"    BASELDFLAGS=<x>              Pass only <x> as arguments to the linker (advanced users only).\"\n\t@echo \"    STRIP=0                      Don't strip debug information from $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) (for developers).\"\n\t@echo \"    VERBOSE=1                    Be verbose when making targets.\"\n\t@echo \"    VERBOSE=3                    Show name of compiler.\"\n\t@echo \"    THREADS=1                    Use threads instead of fork(). Automatically set for native Windows. Recommended for Cygwin.\"\n\t@echo \"    HWID=<x>                     Use <x> as the default HWID (when it can't be found in an ini file).\"\n\t@echo \"    FEATURES=full                Compile $(BASE_PROGRAM_NAME) with all features (default).\"\n\t@echo \"    FEATURES=most                Compile $(BASE_PROGRAM_NAME) without rarely used features.\"\n\t@echo \"    FEATURES=embedded            Compile $(BASE_PROGRAM_NAME) with typical features for embedded systems.\"\n\t@echo \"    FEATURES=autostart           Removes features typically not needed if you place $(BASE_PROGRAM_NAME) in an autostart script.\"\n\t@echo \"    FEATURES=inetd               Compile $(BASE_PROGRAM_NAME) for running through an internet superserver only.\"\n\t@echo \"    FEATURES=minimum             Compiles only basic features of $(BASE_PROGRAM_NAME).\"\n\t@echo \"    FEATURES=fixedepids          $(BASE_PROGRAM_NAME) only uses bultin internal ePIDs.\"\n\t@echo \"\"\n\t@echo \"Useful CFLAGS to save memory when running $(BASE_PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=)\"\n\t@echo \"    -DNO_STRICT_MODES            Don't support enhanced emulator detection prevention.\"\n\t@echo \"    -DNO_CLIENT_LIST             Don't support maintaining a client list (CMIDs).\"\n\t@echo \"    -DNO_VERBOSE_LOG             Don't support verbose logging. Removes -v option.\"\n\t@echo \"    -DNO_LOG                     Don't add support for logging. Implies -DNO_VERBOSE_LOG.\"\n\t@echo \"    -DNO_RANDOM_EPID             Don't support random ePIDs.\"\n\t@echo \"    -DNO_INI_FILE                Don't support reading ePIDs/HWIDs from a file.\"\n\t@echo \"    -DNO_PID_FILE                Don't support writing a PID file. Removes -p option.\"\n\t@echo \"    -DNO_USER_SWITCH             Don't support changing uid/gid after program start. Removes -u and -g options.\"\n\t@echo \"    -DNO_HELP                    Don't support command line help.\"\n\t@echo \"    -DNO_CUSTOM_INTERVALS        Don't support custom intervals for retry and refresh activation. Removes -A and -R options.\"\n\t@echo \"    -DNO_FREEBIND                Don't support binding to foreign IP addresses. Removes -F0 and -F1 options. Only affects FreeBSD and Linux.\"\n\t@echo \"    -DNO_SOCKETS                 Don't support standalone operation. Requires an internet superserver to start $(BASE_PROGRAM_NAME).\"\n\t@echo \"    -DSIMPLE_SOCKETS             Compile $(BASE_PROGRAM_NAME) with basic socket support only. Removes -L option.\"\n\t@echo \"    -DSIMPLE_RPC                 Don't support RPC with NDR64 and BTFN in $(BASE_PROGRAM_NAME) (but do in $(BASE_CLIENT_NAME)). Makes emulator detection easy.\"\n\t@echo \"    -DNO_TAP                     Compile $(BASE_PROGRAM_NAME) without VPN support (Windows and Cygwin only).\"\n\t@echo \"    -DNO_CL_PIDS                 Don't support specifying ePIDs and HwId from the command line in $(BASE_PROGRAM_NAME).\"\n\t@echo \"    -DNO_LIMIT                   Don't support limiting concurrent clients in $(BASE_PROGRAM_NAME).\"\n\t@echo \"    -DNO_SIGHUP                  Don't support SIGHUP handling in $(BASE_PROGRAM_NAME).\"\n\t@echo \"    -DNO_VERSION_INFORMATION     Don't support displaying version information in $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME). Removes -V option.\"\n\t@echo \"    -DNO_PRIVATE_IP_DETECT       Don't support protection against clients with public IP addresses in $(BASE_PROGRAM_NAME)\"\t\n\t@echo \"    -DSMALL_AES                  Use a smaller (saves about 200 bytes) but slower implementation of AES.\"\n\t@echo \"    -DNO_EXTERNAL_DATA           Don't support loading an external database. Mutually exclusive with -DNO_INTERNAL_DATA\"\n\t@echo \"    -DNO_INTERNAL_DATA           Don't compile an internal database. Mutually exclusive with -DNO_EXTERNAL_DATA\"\n\t@echo \"    -DUNSAFE_DATA_LOAD           Don't check the KMS data file for integrity. Saves some bytes but is dangerous.\"\n\t@echo \"\"\n\t@echo \"Troubleshooting options\"\n\t@echo \"    CAT=1                        Combine all sources in a single in-memory file and compile directly to target.\"\n\t@echo \"    NOPROCFS=1                   Don't rely on a properly mounted proc filesystem in /proc.\"\n\t@echo \"    AUXV=1                       Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)\"\n\t@echo \"    NOLPTHREAD=1                 Disable detection if -lpthread is required (for use with Android NDK).\"\n\t@echo \"    NOLRESOLV=1                  Disable detection if -lresolv is required  (for use with Android NDK).\"\n\t@echo \"    NOLIBS=1                     Do not attempt to autodetect any library dependencies.\"\n\t@echo \"    OPENSSL_HMAC=0               Compile for openssl versions that don't have HMAC support (required on some embedded devices).\"\n\t@echo \"    NO_TIMEOUT=1                 Do not set timeouts for sockets (for systems that don't support it).\"\n\t@echo \"    CHILD_HANDLER=1              Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT).\"\n\t@echo \"    NO_DNS=1                     Compile $(BASE_CLIENT_NAME) without support for detecting KMS servers via DNS.\"\n\t@echo \"    NO_GETIFADDRS=1              Compile $(BASE_PROGRAM_NAME) without using getifaddrs().\"\n\t@echo \"    GETIFADDRS=musl              Compile $(BASE_PROGRAM_NAME) with its own implementation of getifaddrs() based on musl.\"\n\t@echo \"    DNS_PARSER=internal          Use $(BASE_CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows).\"\n\t@echo \"\"\n\t@echo \"Other useful CFLAGS\"\n\t@echo \"    -DNO_COMPILER_UAA            Do not use compiler support for byte swapping and unaligned access\"\n\t@echo \"    -DFULL_INTERNAL_DATA         Embed full internal KMS data in $(BASE_PROGRAM_NAME).\"\n\t@echo \"    -DSUPPORT_WINE               Add code that the Windows version of $(BASE_PROGRAM_NAME) runs on Wine if MSRPC=1\"\n\t@echo \"    -D_PEDANTIC                  Report rare error/warning conditions instead of silently ignoring them.\"\n\t@echo \"    -DFD_SETSIZE=<x>             Allow <x> -L statements in $(BASE_PROGRAM_NAME) (default: 64 on Windows, 1024 on most Unixes).\"\n\n"
  },
  {
    "path": "Makefile",
    "content": "# Let BSD make switch to GNU make\nall ${.TARGETS}:\n\t@echo \"================================================================\"\n\t@echo \" PLEASE USE THE GNU VERSION OF MAKE (gmake) INSTEAD OF ${MAKE}  \"\n\t@echo \"================================================================\"\n\t@echo \"\"\n\t@gmake $@\n"
  },
  {
    "path": "README",
    "content": "To view the documentation cd to the directory containing the distribution\nfiles and type\n\nman man/vlmcsd.8\n\tto see documentation for vlmcsd\n\nman man/vlmcs.1\n\tto see documentation for vlmcs\n\nman man/vlmcsd.7\n\tto see general documentation for kms\n\nIf you don't have man, you may also use the .txt, .html and .pdf files\nin the man directory\n"
  },
  {
    "path": "README.compile-and-pre-built-binaries",
    "content": "Compilation and pre-built binaries FAQ\n======================================\n\nWhat is the best pre-built binary for my system or device?\n----------------------------------------------------------\n\nNone. The best binary is compiled by yourself using a toolchain that is\noptimized for your system or device in every respect.\n\n\nHow do I compile my own binary?\n-------------------------------\n\nOn a full blown desktop system this is relativly easy. If not already done so,\ninstall a C compiler (e.g. gcc or clang) through your packet manager, e.g.\n\"sudo apt-get install gcc\" (Debian/Ubuntu) or \"sudo yum install gcc\"\n(RedHat/Fedora).\n\nThen cd to your vlmcsd directory and type \"make\". vlmcs and vlmcsd will\nbe built right away for your local system.\n\nIf you installed gcc and it is not the default compiler for your OS or\ndistribution, you may need to type \"make CC=gcc\" to explicitly select a\nspecific C compiller.\n\n\nHow do I compile a binary for my embedded device?\n-------------------------------------------------\n\nWhat you need is cross-compiling toolchain for your device. It consists of a\nC compiler, libraries, header files and some tools (called binutils). The\ntoolchain must match the device in processor architecture, endianess, ABI,\nlibrary and header files version, library configuration, ...\n\nIf the endianess or ABI differs or the version of some library between\ntoolchain and device differs too much, the resulting binary does not run\non your device.\n\nOnce you have a proper toolchain (probably found on the Internet for download),\nunpack it to any directory and type\n\n     \"make CC=/path/to/toolchain/bindir/c-compiler-binary\"\n\nBuilding vlmcsd for using a cross-compiling toolchain is as easy as building\nvlmcsd for your local machine. The only question is, whether this you have\na toolchain that actually matches your device.\n\nWhenever you change any parameter of the make command line, you must \"clean\"\nthe source directory from intermediate files and output from previous runs\nof make. You can do so by typeing \"make clean\" or force make to behave as if\nthe directory were clean by adding -B to the command line, e.g.\n\n     \"make -B CC=/path/to/toolchain/bindir/c-compiler-binary\"\n\n\nI have downloaded several promising toolchains for my device but they all\ndon't work. Can I create my own toolchain?\n-------------------------------------------------------------------------\n\nYou can use tools like buildroot or OpenWRT. Both are able to create toolchains\nfor many embedded devices. But this is out of the scope of this document.\nIf you are unable to walk through thousands of configuration options and make\nthe right choice, you may probably want to try the pre-built binaries.\n\n\nHow to choose a pre-built binary?\n---------------------------------\n\nThe directory structure for the binaries is\n\nbinaries\n+\n+--<operating system>\n   +\n   +--<cpu arch>\n      +\n      +--<endianess> (omitted if CPU or OS does not allow multi-endianess)\n         +\n         +--<C-library>\n\n<C-library> can also be \"static\". That means no special library is required.\nStatic binaries are much bigger and need more RAM than dynamic binaries but\nare more likely to run on your system. Use a static binary only, if none of\nthe dynmic binaries run.\n\nDon't get confused when a binary is named after an OS or a specific device,\ne.g. the name contains \"openwrt\", \"tomato\" or \"Fritzbox\". This does not mean\nthat the binary will run only on that OS or on that device. It is a hint only\nwhere I got or built the toolchain from.\n\n\nHow to determine the endianess of my system?\n--------------------------------------------\n\n- All Intel CPUs (x86, x32, x64) are little-endian only\n- Windows is little-endian only even if the CPU support big-endian\n- big-endian ARM is extremely uncommon. You can safely assume little-endian\n- little-endian PowerPC virtually does not exist since only newer POWER7\n  and POWER8 CPUs support it. Always assume big-endian.\n- For MIPS both little-endian and big-endian are common. Most Broadcomm and\n  TI chips run little-endian. Most Atheros and Ikanos CPUs run big-endian.\n\nTry typing\n     echo -n I | od -o | awk 'FNR==1{ print substr($2,6,1)}'\n\nThis returns 1 for little-endian systems and 0 for big-endian systems. However\nsome devices do not have the od command and thus this method won't work.\n\n\n\n"
  },
  {
    "path": "README.openssl",
    "content": "IMPORTANT\n=========\n\n1. Do not use any of the OpenSSL binaries\n2. Do not compile OpenSSL binaries yourself\n\n(except for doing some research into the deep internals of OpenSSL)\n\nREASONS\n=======\n\nAll OpenSSL binaries included are highly experimental and are likely to fail\nin many cases. To get some real benefit from OpenSSL (or PolarSSL) it should\nhandle all crypting/hashing.\n\nHowever this is not possible because Microsoft has slightly altered AES\nencryption in KMSv6 and uses a non-AES variant of the Rijndael CMAC in\nKMSv4. OpenSSL is not able to handle this if you use it correctly.\n\nThis means OpenSSL can be used safely only for SHA256 and HMAC SHA256\ncalculations used in KMSv5 and KMSv6 but the code size benefit is only\n100 to 300 bytes (depending on the architecture).\n\nTo benefit more from OpenSSL (getting it performing the AES stuff) I do\nthe first phase of AES encryption/decryption (called key expansion) with my\nown code. I then poke the expanded key into internal OpenSSL structs to make\nit behave in a way not intended by the OpenSSL developers but in a way to\nperform non-standard AES crypting as required by KMSv4 and KMSv6. KMSv5 is\nthe only protocol that could use OpenSSL without hacking the OpenSSL internals.\n\nThat means vlmcsd still needs about 40% of the internal AES code plus some\nOpenSSL hacking code to poke the expanded key into OpenSSL.\n\nThe entire OpenSSL hacking does not work in every case because the internal\nOpenSSL structs differ depending on the OpenSSL version, OpenSSL configuration\nat compile time (whether it is configured to use compiled C code or assembler\ncode), CPU architecture and CPU features (whether it can perform AES in\nhardware).\n\nSUMMARY\n=======\n\nIf you use OpenSSL in a safe way (compile with CRYPTO=openssl), there is not\nmuch benefit from it. The binary may become bigger or smaller and you\ndefinitely need more RAM when you run vlmcsd or vlmcs.\n\nIf you use hacked OpenSSL (compile with CRYPTO=openssl_with_aes or\nCRYPTO=openssl_with_aes_soft) you risk malfunction of vlmcs/vlmcsd even if it\nperformed correctly several times before.\n\nBoth vlmcs and vlmcsd do not have more features when compiled with OpenSSL\nsupport. It may be faster (especially on CPUs with hardware assisted AES) but\nuses more memory and may fail or perform unreliably.\n\n\n"
  },
  {
    "path": "etc/vlmcsd.ini",
    "content": "#\r\n# \r\n# Sample vlmcsd.ini\r\n#\r\n# An ini file for vlmcsd is normally not required. It is for advanced users only.\r\n# vlmcsd uses an ini file only if specified using the -i option in the command line parameters.\r\n# There is no default ini file because vlmcsd is designed to run on many platforms.\r\n#\r\n# Every line starting with a number sign (#) or semicolon (;) is treated as a comment.\r\n# If a key word is used more than once, the last occurrence is used. The only exception\r\n# to this is Listen. You can use Listen=<ip address>[:port] more than once.\r\n#\r\n\r\n# Set ePID/HwId for Windows explicitly\r\n;Windows = 06401-00206-471-111111-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08\r\n\r\n# Set ePID for Office 2010 (including Visio and Project) explicitly\r\n;Office2010 = 06401-00096-199-222222-03-1033-17763.0000-2822018\r\n\r\n# Set ePID/HwId for Office 2013 (including Visio and Project) explicitly\r\n;Office2013 = 06401-00206-234-333333-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08\r\n\r\n# Set ePID/HwId for Office 2016 (including Visio and Project) explicitly\r\n;Office2016 = 06401-00206-437-444444-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08\r\n\r\n# Set ePID/HwId for Office 2019 (including Visio and Project) explicitly\r\n;Office2019 = 06401-00206-666-666666-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08\r\n\r\n# Set ePID/HwId for Windows China Government (Enterprise G/GN) explicitly\r\n;WinChinaGov = 06401-03858-000-555555-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08\r\n\r\n# Use a compatible VPN device to create a hidden local IPv4 address\r\n# Command line: -O\r\n# VPN = <VPN adapter name>[=<IPv4 address>][/<CIDR mask>][:<DHCP lease duration>]\r\n# 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.\r\n;VPN = KMS Mirror=192.168.123.100/24:1d\r\n\r\n# Use custom TCP port\r\n# Command line: -P \r\n# ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets\r\n# ***Use Listen otherwise\r\n;Port = 1234\r\n\r\n# Listen on all IPv4 addresses (default port 1688)\r\n# Command line: -L\r\n# Does not work with MS RPC or simple sockets, use Port=\r\n;Listen = 0.0.0.0:1688\r\n\r\n# Listen on all IPv6 addresses (default port 1688)\r\n# Command line: -L\r\n;Listen = [::]:1688\r\n\r\n# Listen on all private IP addresses and reject incoming requests from public IP addresses\r\n# Command line: -o\r\n# PublicIPProtectionLevel = 3\r\n\r\n# Allow binding to foreign IP addresses\r\n# Command line: -F0 and -F1\r\n;FreeBind = true\r\n\r\n# Randomize ePIDs at program start up (only those that are not explicitly specified)\r\n# Command line: -r\r\n;RandomizationLevel = 1\r\n\r\n# Use a specific host build in ePIDs even if the ePID is randomized\r\n# Command line: -H\r\n;HostBuild = 17763\r\n\r\n# Use a specific culture (1033 = English US) in ePIDs even if the ePID is randomized\r\n# Command line: -C\r\n;LCID = 1033\r\n\r\n# Set a maximum of 4 workers (forked processes or threads)\r\n# Command line: -m\r\n;MaxWorkers = 4\r\n\r\n# Disconnect users after 30 seconds of inactivity\r\n# Command line: -t\r\n;ConnectionTimeout = 30\r\n\r\n# Disconnect clients immediately after each request\r\n# Command line: -d and -k\r\n;DisconnectClientsImmediately = yes\r\n\r\n# Write a pid file (a file containing the process id of vlmcsd)\r\n# Command line: -p\r\n;PidFile = /var/run/vlmcsd.pid\r\n\r\n# Load a KMS data file\r\n# Command line: -j\r\n;KmsData = /etc/vlmcsd.kmd\r\n\r\n# Write log to /var/log/vlmcsd.log\r\n# Command line: -l (-e and -f also override this directive)\r\n;LogFile = /var/log/vlmcsd.log\r\n\r\n# Don't include date and time in logs (default is true)\r\n# Command line: -T0 and -T1\r\n;LogDateAndTime = false\r\n\r\n# Create a verbose log\r\n# Command line: -v and -q\r\n;LogVerbose = true\r\n\r\n# Whitelist known products\r\n# Command line: -K0, -K1, -K2, -K3\r\n;WhiteListingLevel = 0\r\n\r\n# Check that the client time is within +/- 4 hours of the system time\r\n# Command line: -c0, -c1\r\n;CheckClientTime = false\r\n\r\n# Maintain a list of CMIDs\r\n# Command line: -M0, -M1\r\n;MaintainClients = false\r\n\r\n# Start with empty CMID list (Requires MaintainClients = true)\r\n# Command line: -E0, -E1\r\n;StartEmpty = false\r\n\r\n# Set activation interval to 2 hours\r\n# Command line: -A\r\n;ActivationInterval = 2h\r\n\r\n# Set renewal interval to 7 days\r\n# Command line: -R\r\n;RenewalInterval = 7d\r\n\r\n# Exit vlmcsd if warning of certain level has been reached\r\n# Command line: -x\r\n# 0 = Never\r\n# 1 = Exit, if any listening socket could not be established or TAP error occurs\r\n;ExitLevel = 0\r\n\r\n# Run program as user vlmcsduser\r\n# Command line: -u\r\n;user = vlmcsduser\r\n\r\n# Run program as group vlmcsdgroup\r\n# Command line: -g\r\n;group = vlmcsdgroup \r\n\r\n# Disable or enable the NDR64 transfer syntax in RPC (default enabled)\r\n# Command line: -N0 and -N1\r\n;UseNDR64 = true\r\n\r\n# Disable or enable bind time feature negotiation in RPC (default enabled)\r\n# Command line: -B0 and -B1\r\n;UseBTFN = true\r\n"
  },
  {
    "path": "man/GNUmakefile",
    "content": "################################################################################\n\n.PHONY: clean\n\n\nPDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf vlmcsd-floppy.7.pdf\nHTMLDOCS = $(PDFDOCS:.pdf=.html)\nUNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)\nDOSDOCS = $(PDFDOCS:.pdf=.dos.txt)\n\n%.pdf : %\n  ifeq ($(shell uname), Darwin)\n\tgroff -Tps -mandoc -c $< | pstopdf -i -o $@\n  else\n\tgroff -Tpdf -mandoc -c $< > $@\n  endif\n\n%.html : %\n\tgroff -Thtml -mandoc -c $< > $@ \n\n%.unix.txt : %\n\tgroff -P -c -Tascii -mandoc -c $< | col -bx > $@\n\n%.dos.txt : %.unix.txt\n#\tunix2dos -n $< $@\n#\tsed -e 's/$$/\\r/' $< > $@\n\tawk 'sub(\"$$\", \"\\r\")' $< > $@\n\nalldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)\n\npdfdocs : $(PDFDOCS)\n\ndosdocs : $(DOSDOCS)\n\nunixdocs : $(UNIXDOCS)\n\nhtmldocs : $(HTMLDOCS)\n\nclean:\n\trm -f $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS)\n\nhelp:\n\t@echo \"Help is available by typing 'make help' in directory $(shell realpath `pwd`/..). Use 'cd ..' to get there.\"\n\n"
  },
  {
    "path": "man/vlmcs.1",
    "content": ".mso www.tmac\n.TH VLMCS 1 \"November 2016\" \"Hotbird64\" \"KMS Activation Manual\"\n.LO 1\n\n.SH NAME\nvlmcs \\- a client for testing and/or charging KMS servers\n\n.SH SYNOPSIS\n\\fBvlmcs\\fR [ \\fIoptions\\fR ] [ \\fItarget\\fR ] [ \\fIoptions\\fR ]\n.PP\n\\fItarget\\fR can be one of the following:\n.RS\n.PP\n\\fIhostname\\fR|\\fIipaddress\\fR[:\\fItcp-port\\fR] to query a specific KMS server (example: vlmcs kms.example.com:1688).\n.br\n\\fR.\\fIdomain\\fR to automatically detect KMS servers via DNS for \\fIdomain\\fR (example: vlmcs .example.com). Please note the dot before \\fIdomain\\fR.\n.br\n\\fI-\\fR (a single dash) to detect KMS servers in your own domain.\n.RE\n\nIf you use \\fIipaddress\\fR:\\fIport\\fR as the \\fItarget\\fR, the \\fIipaddress\\fR must be enclosed in brackets\nif it contains colons, e.g. [2001:db8:dead:beef::1]:1688. If you use a link-local IPv6 address on Unix systems, you must append a percent sign and the\ninterface identifier of the source interface, for example fe80::dead:beef%eth0.\n.PP\nIf you omit the \\fItarget\\fR, 127.0.0.1:1688 will be used except if you use \\fB-i6\\fR. In this case the default target is [::1]:1688. \n\n.SH DESCRIPTION\n\\fBvlmcs\\fR is a program that can be used to test a KMS server that provides activation for\nseveral Microsoft products. The KMS server may also be an emulator. It supports\nKMS protocol versions 4, 5 and 6.\n.PP\n.B vlmcs\ngenerates one or more activation requests for a Microsoft KMS product and sends\nit to a KMS server. It then analyzes and displays the responses of the KMS server.\n.PP\n.B vlcms\nchecks both the DCE-RPC protocol and the activation message for correctness and\nreports any errors that it finds.\n.PP\n.B vlmcs\ncan also be used to \"charge\" a KMS server. A Microsoft KMS server sends correct activation messages only if it detects a certain minimum of clients (25 for Windows client OSses, 5 otherwise) on the network. This is Microsoft's futile attempt to prevent running a KMS server in a home environment.\n\n.SH OPTIONS\n.IP \"\\fB-h\\fR or \\fB-?\"\nShow help.\n\n.IP \"\\fB-V\\fR\"\nDisplays extended version information. This includes the compiler used to build vlmcs, the intended platform and flags (compile time options) to build vlmcs. If you have the source code of vlmcsd, you can type \\fBmake help\\fR (or \\fBgmake help\\fR on systems that do not use the GNU version of \\fBmake\\fR(1) by default) to see the meaning of those flags.\n\n.IP \\fB-x\nShow valid\n.IR application s\nthat can be used with\n.BR \"-l\" \".\"\n\n.IP \\fB-e\nShow some examples how to use vlmcs correctly.\n\n.IP \\fB-v\nBe verbose. Instead of just displaying the returned ePID and the HwId\n(protocol v6 only) vlmcsd shows all details of the query and the response.\n\n.IP \"\\fB-l\\fR \\fIapplication\"\nRequest activation for a specific\n.IR \"application\" \".\"\nValid applications can be displayed by using\n.BR \"-x\" \".\"\nThe default\n.IR application \" is\"\n.IR \"Windows Vista Business\" \".\"\nThe list of available applications is not complete. You may\nsupply GUIDs with\n.BR \"-a\" \", \" \"-k\" \" and \" \"-s\"\nto specify applications that are not listed with \\fB-x\\fR. The\n.B -l\noption is used as a shortcut for the most common applications.\n\n.IP \"\\fB-K\\fR \\fIprotocol-version\\fR\"\nForce a specific version of the KMS protocol. Valid versions are 4.0, 5.0 and 6.0. The default is to select a suitable version according to the \\fIapplication\\fR selected. You may use \\fB-K\\fR to send an incorrect protocol version to the KMS server and see how it behaves. Genuine KMS servers return HRESULT 0x8007000D if the KMS protocol is not 4.0, 5.0 or 6.0. Emulators should do the same. When sending a request with an incorrect protocol number, vlmcs ignores the minor protocol number (e.g. sends a v4 request for version 4.1). If the major version number is less then 4, it sends a v4 request. If the major version is greater then 6, it sends a v6 request. In any case the \\fIprotocol-version\\fR as specified by \\fB-K\\fR is put in the version fields of the request.\n\n.IP \"\\fB-4\\fR, \\fB-5\\fR and \\fB-6\"\nForce version 4, 5 or 6 of the KMS protocol. These options are actually shortcuts of \\fB-K 4.0\\fR, \\fB-K 5.0\\fR and \\fB-K 6.0\\fR.\n\n.IP \"\\fB-j\\fR \\fIfilename\\fR\"\nUse KMS data file \\fIfilename\\fR. By default vlmcs contains product data that is recent when vlmcs was compiled. You may use a more recent KMS data file that contains additional products.\n\nIf vlmcsd has been compiled to use a default KMS data file, you may use \\fB-j-\\fR to ignore the default configuration file.\n\n.IP \"\\fB-m\"\nLet the client pretend to be a virtual machine. Early versions of Microsoft's\nKMS server did not increase the client count if the request came from a virtual\nmachine. Newer versions ignore this flag.\n\n.IP \"\\fB-d\"\nUse NetBIOS names instead of DNS names. By default vlmcsd generates some random\nDNS names for each request. If you prefer NetBIOS names, you may use\n.IR \"\\fB-d\" \".\"\nA real Microsoft activation client uses DNS names or NetBIOS depending on the\nclient name configuration. KMS servers treat the workstation name as a comment\nthat affects logging only. Clients will be identified by a GUID that can\nbe specified using \\fB-c\\fR. \\fB-d\\fR has no effect if you also specify \\fB-w\\fR.\n\n.IP \"\\fB-a\\fR \\fIapplication-guid\"\nSend requests with a specific\n.IR \"application-guid\" \".\"\nThere are currently only three known valid\n.IR \"application-guid\" \"s:\"\n\n.IP\n55c92734-d682-4d71-983e-d6ec3f16059f (Windows)\n.br\n59a52881-a989-479d-af46-f275c6370663 (Office 2010)\n.br\n0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013)\n\n.IP\nA Microsoft KMS server uses these GUIDs to have seperate counters for the\nalready activated clients. A client that does not contact the KMS server\nwithin 30 days will be deleted from the database. Emulated KMS servers\nare always fully charged.\n\n.IP \"\\fB-k\\fR \\fIkms-guid\\fR\"\nSend requests with a specific\n.IR \"kms-guid\" \".\"\nA Microsoft KMS server uses these GUIDs as a product id to decide whether to\ngrant activation or not. A list of current \\fIkms-guid\\fRs can be found in\nkms.c (table KmsIdList). Emulated KMS servers grant activation unconditionally\nand do not check the \\fIkms-guid\\fR.\n\n.IP \"\\fB-s\\fR \\fIactivation-guid\\fR\"\nThe \\fIactivation-guid\\fR defines the actual product, e.g. \"Windows 8.1 Professional WMC KMSCLIENT edition\". A \\fIactivation-guid\\fR maps 1:1 to a product key. \nHowever, neither a Microsoft KMS server nor emulated servers check this id.\nThe \\fIactivation-guid\\fR is useful in logging to get a specific product description like\n\"Windows 8.1 Professional WMC\". A list of current \\fIactivation-guid\\fRs can be found in\nkms.c (table ExtendedProductList).\n\n.IP \"\\fB-n\\fR \\fIrequests\"\nSend\n.I requests\nrequests to the server. The default is to send at least one request and enough\nsubsequent requests that the server is fully charged afterwards for\nthe \\fIapplication\\-guid\\fR you selected (explicitly with\n.BR \"-a\" \" or implicitly by using \" \"-l\" \").\"\n\n.IP \"\\fB-T\"\nCauses to use a new TCP connection for each request if multiple requests\nare sent with vlmcsd. This is useful when you want to test an emulated KMS\nserver whether it suffers from memory leaks. To test for memory leaks use\n.B -n\nwith a large number of requests (> 100000) and then test twice (with and\nwithout\n.BR \"-T\" \").\"\nThis option may become neccessary for future versions of Microsoft's KMS\nserver because multiple requests with different\n.IR clients-guid s\nfor the same\n.I kms-id-guid\nare impossible in a real KMS szenario over the same TCP connection.\n\n.IP \"\\fB-c\\fR \\fIclient-machine-guid\\fR\"\nNormally vlmcs generates a random \\fIclient-machine-guid\\fR for each request. By using this option you can specify a fixed \\fIclient-machine-guid\\fR\nThis causes a Microsoft KMS not to increment its client count because it\nreceives multiple requests for the same client. Thus do not use\n.BR \"-c\"\nif you want to charge a real KMS server.\n\n.IP \"\\fB-o\\fR \\fIprevious-client-machine-guid\\fR\"\nIf the \\fIclient-machine-guid\\fR changes for some reason, the real KMS client stores a \\fIprevious-client-machine-guid\\fR which is sent\nto the KMS server. This happens rarely and usually 00000000-0000-0000-0000-000000000000 is used. You can use \\fB-o\\fR to specify a different\n\\fIprevious-client-machine-guid\\fR.\n\n.IP \"\\fB-G\\fR \\fIfilename\\fR\"\nGrabs ePIDs and HWIDs from a KMS server and writes the information to \\fIfilename\\fR\nin format suitable to be used as a configuration file (aka ini file) for \\fBvlmcsd\\fR(8).\nThis is especially useful if you have access to a genuine KMS server and want to use\nthe same data with \\fBvlmcsd\\fR(8).\n\nIf \\fIfilename\\fR does not exist, it will be created.\nIf you specify an existing \\fIfilename\\fR, it will be updated to use the information\nreceived from the remote KMS server and a backup \\fIfilename\\fR~ will be created.\n\n\\fB-G\\fR cannot be used with \\fB-l\\fR, \\fB-4\\fR, \\fB-5\\fR, \\fB-6\\fR, \\fB-a\\fR, \\fB-s\\fR, \\fB-k\\fR, \\fB-r\\fR and \\fB-n\\fR\n\n.IP \"\\fB-w\\fR \\fIworkstation-name\"\nSend requests with a specific\n.IR \"workstation-name\" \".\"\nThis disables the random generator for the workstation name. Since it is\na comment only, this option does not have much effect.\n\n.IP \"\\fB-r\\fR \\fIrequired-client-count\"\nAlso known as the \"N count policy\". Tells the KMS server that successful activation requires\n\\fIrequired-client-count\\fR clients. The default is the\n\\fIrequired-client-count\\fR that the product would need if the request\nwas a real activation. A Microsoft KMS server counts clients\nup to the double amount what was specified with \\fB-r\\fR. This option\ncan be used to \"overcharge\" a Microsoft KMS server.\n\n.IP \"\\fB\\-t\\ \\fIstatus\\fR\"\nReports a specific license status to the KMS server. \\fIstatus\\fR is a number\nthat can be from 0 to 6. 0=unlicensed, 1=licensed, 2=OOB grace, 3=OOT grace,\n4=Non-genuinue grace, 5=notification, 6=extended grace. Refer to\n.URL \"http://technet.microsoft.com/en-us/library/ff686879.aspx#_Toc257201371\" \"TechNet\" \"\"\nfor more information. A Microsoft KMS server collects this information for\nstatistics only.\n\n.IP \"\\fB-g\\fR \\fIbinding-expiration\\fR\"\nThis tells the KMS server how long a client will stay in its current license\nstatus. This can be the remaining OOB time (the grace peroid that is granted between installation of a product and when activation is actuall required) or\nthe remaining time when KMS activation must be renewed.\n\\fIbinding-expiration\\fR is specified in minutes. A Microsoft KMS server\napparantly does not use this information.\n\n.IP \"\\fB-i \\fIprotocol-version\\fR\"\nForce the use of Internet protocol \\fIprotocol-version\\fR. Allowed values are 4 (IPv4) and 6 (IPv6). This option is useful only if you specfiy a \\fIhostname\\fR and not an\n\\fIip-address\\fR on the command line.\n\n.IP \"\\fB-p\\fR\"\nDo not set the RPC_PF_MULTIPLEX flag in the RPC bind request. This can be used to test if the KMS server uses the same setting of this flag in the RPC bind respone. Some KMS\nemulators don't set this correctly.\n\n.IP \"\\fB-N0\\fR and \\fB-N1\\fR\"\nDisables (\\fB-N0\\fR) or enables (\\fB-N1\\fR) the NDR64 transfer syntax in the RPC protocol. Disable NDR64 only in case of problems. If NDR64 is not used, vlmcs cannot detect many RPC protocol errors in KMS emulators. If you want to test whether a KMS emulator fully supports NDR64, you must use the \\fB-n\\fR option to send at least two requests. This is because Microsoft's client always sends the first request using NDR32 syntax and subsequent requests using NDR64 syntax.\n\n.IP \"\\fB-B0\\fR and \\fB-B1\\fR\"\nDisables (\\fB-B0\\fR) or enables (\\fB-B1\\fR) bind time feature negotiation (BTFN) in the RPC protocol. Disable BTFN only in case of problems. If BTFN is not used, vlmcs cannot detect many RPC protocol errors in KMS emulators.\n\n.PP\nOptions that do not require an argument can be specified together with a single\ndash, e.g. vlmcs -6mvT. If you specify an option more than once, the last occurence\nwill be in effect.\n\n.SH FILES\n.IP \"\\fBvlmcsd.ini\\fR(5)\"\n\n.SH EXAMPLES\n.IP \"\\fBvlmcs kms.example.com\"\nRequest activation for Windows Vista using v4 protocol from kms.example.com.\nRepeat activation requests until server is charged for all Windows products.\n\n.IP \"\\fBvlmcs -\"\nRequest activation for Windows Vista using v4 protocol from a KMS server that is published via DNS for the current domain.\n\n.IP \"\\fBvlmcs .example.com\"\nRequest activation for Windows Vista using v4 protocol from a KMS server that is published via DNS for domain example.com.\n\n.IP \"\\fBvlmcs -6 -l Office2013 -v -n 1\"\nRequest exactly one activation for Office2013 using v6 protocol from\nlocalhost. Display verbose results.\n\n.IP \"\\fBvlmcs kms.bigcompany.com -G /etc/vlmcsd.ini\"\nGet ePIDs and HWIDs from kms.bigcompany.com and create/update /etc/vlmcsd.ini accordingly.\n\n.SH BUGS\nSome platforms (e.g. Solaris) may have a \\fBman\\fR(7) system that does not handle URLs. URLs may be omitted in the documentation on those platforms. Cygwin, Linux, FreeBSD and Mac OS X are known to work correctly. \n\n.SH AUTHOR\nWritten by Hotbird64\n\n.SH CREDITS\nThanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nosferati87, qad, Ratiborus, vityan666, ...\n\n.SH SEE ALSO\n\\fBvlmcsd\\fR(7), \\fBvlmcsd\\fR(8), \\fBvlmcsdmulti\\fR(1)\n"
  },
  {
    "path": "man/vlmcsd-floppy.7",
    "content": ".mso www.tmac\n.TH \"VLMCSD-FLOPPY\" 7 \"February 2019\" \"Hotbird64\" \"KMS Activation Manual\"\n.LO 8\n\n.SH NAME\nfloppy144.vfd \\- a bootable floppy disk with Linux and \\fBvlmcsd\\fR(8)\n\n.SH DESCRIPTION\n\\fBfloppy144.vfd\\fR is an image of a bootable floppy that contains a minimal version of Linux and \\fBvlmcsd\\fR(8). It requires only 16 MB of RAM. Its primary purpose is to run \\fBvlmcsd\\fR(8) in a small virtual machine which makes it easy to use \\fBvlmcsd\\fR(8) to activate the virtual machine's host computer which is not possible in Windows 8.1 and up. The floppy image is a standard 3,5\" floppy with 1.44 MB storage. It is formatted with a FAT12 filesystem. The floppy can be mounted to apply several customizations.\n\n.SH SUPPORTED HYPERVISORS\nThe floppy image has been tested with the following hypervisors:\n.IP\nVMWare, VirtualBox, Hyper-V and QEMU\n\n.RE\nOthers are likely to work.\n\n.SH SETUP\nCreate a new virtual machine. Assign 16 MB of RAM. Add a floppy drive and attach \\fBfloppy144.vfd\\fR to this drive. Do not create a virtual hard disk. Setup the virtual machine to boot from a floppy drive (VirtualBox has floppy boot disabled by default). If possible, setup a virtual machine with plain old BIOS (not UEFI). If you created an UEFI virtual machine, enable the compatibility support mode (CSM) to allow a BIOS compatible boot. Set number of CPUs to 1. The Linux kernel is not capable of SMP. Remove IDE, SATA, SCSI and USB support if possible. The Linux kernel can't handle this and ignores any devices connected to these buses.\n\nSetup an ethernet card. The following models are supported:\n.IP\nIntel PRO/1000\n.br\nAMD PCNET III\n.br\nAMD PCNET32\n.br\nVMWare vmxnet3 (paravirtualized driver used by VMWare)\n.br\nvirtio (paravirtualized driver used by VirtualBox, QEMU, KVM and lguest)\n\n.RE\nMost hypervisors emulate an Intel PRO/1000 or AMD PCNET32 by default. Selecting a paravirtualized driver slightly improves performance. In VirtualBox you can simply select virtio in the network configuration dialog. VMWare requires that you add or change the VMX file. Use 'ethernet0.virtualDev\\ =\\ \"vmxnet3\"' in your VMWare config file.\n\nIf you are using QEMU, you must also setup a TAP adapter. Port redirection does not work to activate your own computer.\n\n.SH CONFIGURATION\n\\fBfloppy144.vfd\\fR can be customized to fit your needs. This is done by editing the file syslinux.cfg on the floppy image. The floppy image must be mounted. Under Linux you can simply attach \\fBfloppy144.vfd\\fR to a loop device which is mountable like any other block device. For Windows you must use some software that allows mounting a floppy image, e.g.\n.URL http://www.osforensics.com/tools/mount-disk-images.html OSFMount \"\"\n\nOSFMount works under all Windows versions beginning with Windows XP up to Windows 10 (32- and 64-bit).\n\nThe default syslinux.cfg file looks like this:\n.IP\n.br\n.SM\nprompt 0\n.br\n.SM\nTIMEOUT 50\n.br\n.SM\ndefault dhcp\n.br\n\n.SM\nLABEL dhcp\n.br\n.SM\n\\0\\0KERNEL bzImage\n.br\n.SM\n\\0\\0APPEND vga=773 quiet initrd=initrd KBD=us LISTEN=[::]:1688,0.0.0.0:1688 TZ=UTC0 IPV4_CONFIG=DHCP NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd INETD=Y WINDOWS=06401-00206-271-395032-03-1033-9600.0000-1652016 OFFICE2010=06401-00096-199-204970-03-1033-9600.0000-1652016 OFFICE2013=06401-00206-234-921934-03-1033-9600.0000-1652016 HWID=36:4F:46:3A:88:63:D3:5F\n\n.SM\nLABEL static\n.br\n.SM\n\\0\\0KERNEL bzImage\n.br\n.SM\n\\0\\0APPEND vga=773 quiet initrd=initrd KBD=fr LISTEN=[::]:1688,0.0.0.0:1688 TZ=CET-1CEST,M3.5.0,M10.5.0/3 IPV4_CONFIG=STATIC IPV4_ADDRESS=192.168.20.123/24 IPV4_GATEWAY=192.168.20.2 IPV4_DNS1=192.168.20.2 IPV4_DNS2=NONE NTP_SERVER=pool.ntp.org HOST_NAME=vlmcsd ROOT_PASSWORD=vlmcsd USER_NAME=user USER_PASSWORD=vlmcsd GUEST_PASSWORD=vlmcsd INETD=Y\n\n.PP\nThere are two configurations in this files: \\fIdhcp\\fR (for configuring the IPv4 network via DHCP) and \\fIstatic\\fR (for a static IPv4 configuration). The kernel always boots the \\fIdhcp\\fR configuration without asking (lines 'prompt 0' and 'default dhcp'). You can simply change the default configuration to \\fIstatic\\fR and then customize the APPEND line in the \\fIstatic\\fR configuration. For more details how to customize the syslinux.cfg file see \\fBsyslinux\\fR(1).\n\nEach APPPEND line contains one or more items seperated by spaces. \\fBAll items are case-sensitive\\fR. The following parameters can be customized:\n\n.IP \\fBvga=\\fIvesa-video-mode\\fR\nSets the VESA display mode for the virtual machine. The parameter is not optional. If you ommit it, you will not see anything on the screen. 773 means 1024x768 with 256 colors. See\n.URL https://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers Wikipedia \"\"\nfor more video modes. Note that all 16 color (4-bit) modes will not work. Use 8-bit (256 colors), 16-bit (65536 colors), 24-bit and 32-bit (> 16 Million colors) only. All modes above 1280x1024 are non-VESA-standard and vary for all (virtual) graphic cards.\n\n.IP \\fBquiet\\fR\nThis causes the kernel not display the its log during boot. You may omit \\fBquiet\\fR but it doesn't make much sense. The boot log is actually very verbose and scrolls away from screen quickly. If any errors occur during boot, they will be displayed even if \\fBquiet\\fR is present in the APPEND line. You may evaluate the complete boot log later by using the dmesg command or the menu on /dev/tty8.\n\n.IP \"\\fBinitrd=\\fIinitial-ram-disk-file\\fR\"\nThis defines the initial ram disk that the kernel will read. There is only one initial ram disk on the floppy thus leave \\fIinitrd=initrd\\fR as it is.\n\n.IP \"\\fBKBD=\\fIkeyboard-layout-name\\fR\"\nThis allows you to select the keyboard layout. \\fIkeyboard-layout-name\\fR is usually the ISO 3166-1 (top level domain) code for a country. A list of valid \\fIkeyboard-layout-name\\fRs can be accessed via the menu system on /dev/tty8 (press ALT-F8). Note, that this is a keyboard driver only. There is no Unicode font support in \\fBfloppy144.vfd\\fR (due to the fact that the kernel uses a generic VESA framebuffer device only). Characters beyond ASCII work for Western European languages only but not Eastern European, Greek, Cyrillic, Arabic, Hebrew, CJK and other languages. There is no need in \\fBfloppy144.vfd\\fR to enter any characters outside ASCII. The purpose of the keyboard maps are that you will find characters like dash, backslash, brackets, braces, etc. at the usual place on your keyboard.\n\n.IP \"\\fBLISTEN=\\fRPRIVATE[:\\fItcp-port\\fR] | \\fIip-address\\fR[:\\fItcp-port\\fR][,\\fIip-address\\fR[:\\fItcp-port\\fR]][,...]\"\nOne or more combinations of IP addresses and optional TCP port seperated by commas that \\fBvlmcsd\\fR(8) should listen on or PRIVATE to listen on all private IP addresses only. The default port is 1688. If you use an explicit port number, append it to the IP address seperated by a colon. If you use a port number and the IP address contains colons, you must enclose the IP address in brackets. For example \\fI192.168.0.2,[fd00::dead:beef]:5678\\fR causes \\fBvlmcsd\\fR(8) to listen on 192.168.0.2 port 1688 and fd00::dead:beef port 5678.\n\n.IP \"\\fBWINDOWS=\\fIepid\\fR\"\nDefines the ePID that is used for Windows activations. If you ommit this parameter, vlmcsd generates a random ePID when it is started.\n\n.IP \"\\fBOFFICE2010=\\fIepid\\fR\"\nDefines the ePID that is used for Office 2010 activations. If you ommit this parameter, \\fBvlmcsd\\fR(8) generates a random ePID when it is started.\n\n.IP \"\\fBOFFICE2013=\\fIepid\\fR\"\nDefines the ePID that is used for Office 2016 activations. If you ommit this parameter, \\fBvlmcsd\\fR(8) generates a random ePID when it is started.\n\n.IP \"\\fBOFFICE2016=\\fIepid\\fR\"\nDefines the ePID that is used for Office 2016 activations. If you ommit this parameter, \\fBvlmcsd\\fR(8) generates a random ePID when it is started.\n\n.IP \"\\fBOFFICE2019=\\fIepid\\fR\"\nDefines the ePID that is used for Office 2019 activations. If you ommit this parameter, \\fBvlmcsd\\fR(8) generates a random ePID when it is started.\n\n.IP \"\\fBWINCHINAGOV=\\fIepid\\fR\"\nDefines the ePID that is used for Windows China Government Edition activations (Enterprise G/GN). If you ommit this parameter, \\fBvlmcsd\\fR(8) generates a random ePID when it is started.\n\n.IP \"\\fBHWID=\\fIhwid\\fR\"\nDefines the HwId that is sent to clients. \\fIhwid\\fR must be specified as 16 hex digits that are interpreted as a series of 8 bytes (big endian). Any character that is not a hex digit will be ignored. This is for better readability.\n\n.IP \"\\fBTZ=\\fIposix-time-zone-string\\fR\"\nSet the time zone to \\fIposix-time-zone-string\\fR. It must conform to the\n.URL http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html POSIX\nspecification. Simplified time zone strings like \"Europe/London\" or \"America/Detroit\" are not allowed. This has the very simple reason that there is no space on the floppy to store the time zone database.\n\nThe string \\fICET-1CEST,M3.5.0,M10.5.0/3\\fR (most countries in Europe) reads as follows:\n.RS 7\n.IP \\fICET\\fR 10\nThe standard (winter) time zone has the name CET.\n.IP \\fI-1\\fR 10\nThe standard time zone is one hour east of UTC. Negative numbers are east of UTC. Positive numbers are west of UTC.\n.IP \\fICEST\\fR 10\nThe daylight saving (summer) time zone has the name CEST.\n.IP \\fIM3.5.0\\fR 10\nDaylight saving time starts in the 3rd month (March) on the 5th (=last) occurence of weekday 0 (Sunday) at 2 o'clock (2 o'clock is a default value).\n.IP \\fIM10.5.0/3\\fR 10\nDaylight saving time ends in the 10th month (October) on the 5th (=last) occurence of weekday 0 (Sunday) at 3 o'clock.\n.RE\n.IP\nIf you don't have daylight saving time, things are easier. For Chinese Standard Time for example, just use \\fICST-8\\fR as the time zone string.\n\nOn a Linux desktop system, you can use a command like \\fBstrings\\ /usr/share/zoneinfo/America/New_York\\ |\\ tail\\ -n1\\fR. This should return \\fIEST5EDT,M3.2.0,M11.1.0\\fR. You can use the returned string for the \\fBTZ=\\fIposix-time-zone-string\\fR parameter.\n\n.IP \"\\fBIPV4_CONFIG=\\fRDHCP | STATIC\\fR\"\nThis determines how you want to configure IPv4 networking. If you use \\fBIPV4_CONFIG=\\fRSTATIC, you must supply additional paramaters to the APPEND command line.\n\n.IP \"\\fBIPV4_ADDRESS=\\fIipv4-address\\fR/\\fICIDR-mask\\fR\"\nUse \\fIipv4-address\\fR with netmask \\fICIDR-mask\\fR for static IPv4 configuration. The netmask must not be ommitted. For IPv4 address 192.168.12.17 with a netmask of 255.255.255.0 use \\fI192.168.12.17/24\\fR. For IPv4 address 10.4.0.8 with a netmask of 255.255.0.0 use 10.4.0.8/16. This paramater is ignored, if you used \\fBIPV4_CONFIG=\\fRDHCP.\n\n.IP \"\\fBIPV4_GATEWAY=\\fIipv4-address\\fR | NONE\"\nUse \\fIipv4-address\\fR as the default gateway. This is usually the IPv4 address of your router. You may specify NONE explicitly for no gateway. In this case your virtual machine is only visible on its local LAN. This paramater is ignored, if you used \\fBIPV4_CONFIG=\\fRDHCP.\n\n.IP \"\\fBIPV4_DNS1=\\fIipv4-address\\fR | NONE\"\nUse \\fIipv4-address\\fR as the primary name server. In home networks this is often the IPv4 address of your router. You may specify NONE explicitly. If you specified NONE for both \\fBIPV4_DNS1=\\fR and \\fBIPV4_DNS2=\\fR, your virtual machine cannot resolve host names to IP addresses. While \\fBvlmcsd\\fR(8) works perfectly without DNS servers, you must use IP addresses when referring to a host, e.g. for specifying an NTP server. This paramater is ignored, if you used \\fBIPV4_CONFIG=\\fRDHCP.\n\n.IP \"\\fBIPV4_DNS2=\\fIipv4-address\\fR | NONE\"\nUse \\fIipv4-address\\fR as the secondary name server. It serves as a backup if the primary name server is not available. Home networks often don't have a secondary name server. In this case set this to NONE. This paramater is ignored, if you used \\fBIPV4_CONFIG=\\fRDHCP.\n\n.IP \"\\fBNTP_SERVER=\\fIhost-name\\fR | \\fIipv4-address\\fR | NONE\"\nThis sets the name of a time server using the NTP protocol. If your virtualization environment reliably provides time, you can set this to NONE. Don't use a public time service like pool.ntp.org or time.nist.gov if you have a (at least somewhat reliable) NTP server in your LAN.\n\n.IP \"\\fBHOST_NAME=\\fIhost-name\\fR\"\nSets the local host name for your virtual machine. It can be a single name or a fully-qualified domain name FQDN. If you used \\fBIPV4_CONFIG=\\fRDHCP and your DHCP server returns a domain name, the domain part of an FQDN will be replaced by that name. This host name or host part of an FQDN will not replaced by a host name returned via DHCP. The host name is not important for the operation of \\fBfloppy144.vfd\\fR.\n\n.IP \"\\fBROOT_PASSWORD=\\fIpassword\\fR\"\nSets the password of the root user.\n\n.IP \"\\fBUSER_NAME=\\fIusername\\fR\"\nSets the name of for a general user with no special privileges. This user can login but can't do much.\n\n.IP \"\\fBUSER_PASSWORD=\\fIpassword\\fR\"\nSets the password for the user defined by \\fBUSER_NAME=\\fIusername\\fR.\n\n.IP \"\\fBGUEST_PASSWORD=\\fIpassword\\fR\"\nSets the password for the pre-defined guest user. This user has the same priviliges (none) as the user defined by \\fBUSER_NAME=\\fIusername\\fR.\n\n.IP \"\\fBINETD=\\fRY | N\"\n\\fBINETD=\\fRY specifies that \\fBinetd\\fR(8) should automatically be started. That means you can telnet and ftp to your virtual machine.\n\n.IP \"\\fBVLMCSD_EXTRA_ARGS=\\fR\\fIcomma-seperated-argument-list\\fR\"\nAllows you to specify additional command line options that will be passed to \\fBvlmcsd\\fR(8). Instead of spaces you use commas between arguments. Example: \\fBVLMCSD_EXTRA_ARGS=\\fR\\-c1,-K3,-M1\n\n.SH OPERATION\n\n.SS Diskless System\nThe \\fBfloppy144.vfd\\fR virtual machine is a diskless system that works entirely from RAM. The file system is actually a RAM disk that is created from the \\fBinitrd\\fR(4) file on the floppy image.\n\nAnything you'll do from inside the virtual machine, for instance editing a config file, will be lost when you reboot the machine. So, if you ever asked yourself if \\fBrm -fr /\\fR (root privileges required) really deletes all files from all mounted partitions, the \\fBfloppy144.vfd\\fR VM is the right place to test it (Yes, it does).\n\nThe VM uses a RAM disk, because the Linux kernel had to be stripped down to essential features to fit on a 1.44 MB floppy. It has no floppy driver, no disk file system drivers and no block layer (cannot use disks of any type).\n\n.SS System startup\nThe kernel boots up very quickly and the init script (/sbin/init) waits 5 seconds. In these 5 seconds you can:\n.IP\nPress 'm' to manually enter the time zone and the IPv4 parameters. These will be queried interactively.\n.br\nPress 't' to manually enter the time zone only.\n.br\nPress 's' to escape to a shell.\n.RE\n\nIf you don't want to 5 seconds for continuing the init process, you can press any other key to speed things up. At the end of the init script you should see that\\fBvlmcsd\\fR(8) has started. You should also see the IP addresses and all user names and passwords.\n\n.SS Logging into the system\nThere are 5 local logins provided on /dev/tty2 to /dev/tty6. To switch to these logins, simply press ALT\\-F2 to ALT\\-F6. To return to the console on /dev/tty1, press ALT\\-F1. If \\fBinetd\\fR(8) is running you can also use \\fBtelnet\\fR(1). This allows you use a terminal program (e.g. putty) that can utilize your keyboard layout, can be resized and has full UTF-8 support. The local terminals support US keyboard layout only. Please be aware that \\fBtelnet\\fR(1) is unencrypted and everything including passwords is transmitted in clear text. There is not enough space for an ssh server like \\fBsshd\\fR(8) or \\fBdropbear\\fR(8).\n\nThe floppy image only provides basic Unix commands. Type \\fIbusybox\\fR or \\fIll /bin\\fR to get a list. The only editor available is \\fBvi\\fR(1). If you don't like vi, you may transfer config files via \\fBftp\\fR(1) edit them with the editor of your choice and transfer them back to the \\fBfloppy144.vfd\\fR VM.\n\n.SS The menu system\nYou'll find a menu system on /dev/tty8 (press ALT\\-F8 to see it). It allows you performing some administrative tasks and to view various system information. It is mainly for users that do not have much experience with Unix commands.\n\n.IP \"\\fB1) (Re)start vlmcsd\\fR\"\nStarts or restarts \\fBvlmcsd\\fR(8). This is useful if you changed \\fB/etc/vlmcsd.ini\\fR(5).\n\n.IP \"\\fB2) Stop vlmcsd\\fR\"\nStops \\fBvlmcsd\\fR(8).\n\n.IP \"\\fB3) (Re)start inetd\\fR\"\nStarts or restarts \\fBinetd\\fR(8). If \\fBinetd\\fR(8) is restarted, current clients connected via \\fBtelnet\\fR(1) or \\fBftp\\fR(1) will \\fBnot\\fR be dropped. They can continue their sessions. This is useful if you changed \\fB/etc/inetd.conf\\fR(5).\n\n.IP \"\\fB4) Stop inet\\fR\"\nStops \\fBinetd\\fR(8). All clients connected via \\fBtelnet\\fR(1) or \\fBftp\\fR(1) will be dropped immediately.\n\n.IP \"\\fB5) Change the time zone\\fR\"\nJust in case you missed pressing 't' during system startup. This also restarts \\fBvlmcsd\\fR(8) if it was running to notify it that the time zone has changed. Restarting \\fBvlmcsd\\fR(8) allows currently connected clients to finish their activation.\n\n.IP \"\\fBk) Change keyboard layout\\fR\"\nThis allows you to select a different keyboard layout.\n\n.IP \"\\fB6) Show all kernel boot parameters\\fR\"\nShows all parameters passed to the kernel via syslinux.cfg. If you experience any unexpected behavior, you can use this to check if your APPEND line in syslinux.cfg is correct. The output is piped through \\fBless(1)\\fR. So press 'q' to return to the menu.\n\n.IP \"\\fB7) Show boot log (dmesg)\\fR\"\nShows the boot log of the kernel. The output is piped through \\fBless(1)\\fR. So press 'q' to return to the menu.\n\n.IP \"\\fB8) Show TCP/IP configuration\\fR\"\nShows the TCP/IP configuration, listening sockets and current TCP and UDP connections. Useful, if you problems with net connectivity. The output is piped through \\fBless(1)\\fR. So press 'q' to return to the menu.\n\n.IP \"\\fB9) Show running processes\\fR\"\nShows all processes including memory and CPU usage. Display will updated every second. Press 'q' or CTRL-C to return to the menu.\n\n.IP \"\\fBs) Shutdown\\fR\"\nShuts down the \\fBfloppy144.vfd\\fR virtual machine. Proper shutdown is not required. It is ok to use a hard power off in your virtualization program.\n\n.IP \"\\fBr) Reboot\\fR\"\nReboots the \\fBfloppy144.vfd\\fR virtual machine. Proper reboot is not required. It is ok to use a hard reset in your virtualization program.\n\n.SH PERMANENT CHANGES OF INITRD\nIf you want to change any file or script of the file system (e.g. the init script /sbin/init or /etc/vlmcsd.ini), you'll need to mount the floppy image, unpack the \\fBinitrd\\fR(4) file, make any modfications you like, create a new \\fBinitrd\\fR(4) file and copy it to the mounted floppy.\n\nTo unpack the \\fBinitrd\\fR(4) file you'll need \\fBxz\\fR(1) (or \\fBlzma\\fR(1) on older unix-like OSses) and \\fBcpio\\fR(1). These can be installed using your package manager on all major distros. It is ok to use the BSD version of \\fBcpio\\fR(1). No need to get the GNU version for BSD users.\nProvided the floppy is mounted in /mnt/floppy do the following:\n.IP \"Create an empty directory\"\nmkdir ~/vlmcsd-floppy-initrd\n.IP \"cd into that directory\"\ncd ~/vlmcsd-floppy-initrd\n.IP \"Unpack initrd\"\ncat /mnt/floppy/initrd | unlzma | cpio -i\n\n.RE\nAfter applying your changes build a new \\fBinitrd\\fR(4) file:\n\n.IP \"cd into your directory\"\ncd ~/vlmcsd-floppy-initrd\n.IP \"Create the packed file\"\nfind . | cpio -o -H newc | lzma > /mnt/floppy/initrd\n\n.RE\nDo not try to use 'lzma -9' to achive better compression. The kernel can't read the resulting file. While customizing the \\fBinitrd\\fR(4) file works on almost any unix-like OS, it does not work on Windows even not with Cygwin. The reason is that the NTFS file system can't handle uids and gids. These cannot be preserved when unpacking the \\fBcpio\\fR(1) archive to NTFS. If you use the WSL subsystem of Windows 10 Redstone (Anniversary Update) and later, you must make sure to unpack the \\fBinitrd\\fR(4) file to a directory on VolFs (normally everything that is \\fBnot\\fR mounted under /mnt). The \\fBinitrd\\fR(4) file can be on a VolFs or DriveFs.\n\n.SH FAQ\n.SS On what distro is the floppy image based?\nNone. Besides the boot loader \\fBldlinux.sys\\fR, there are only three binaries: The Linux kernel \\fBbzImage\\fR, \\fBbusybox\\fR(1) and \\fBvlmcsdmulti-x86-musl-static\\fR. \\fBbzImage\\fR and \\fBbusybox\\fR(1) have been compiled with carefully selected configuration parameters not found in any distro. This was neccesary to fit everything on a 1.44 MB floppy.\n\n.SS Why is a rather old Linux kernel (3.12) used?\nLinux 3.12 is the last kernel that can be booted with 16 MB of RAM. Beginning with Linux 3.13 it requires much more memory (about 80 MB) to boot. The floppy image is regularly tested with newer kernels. Everything works except that you need to assign much more main memory to the virtual machine.\n\n.SS Can the floppy be booted on bare metal?\nBasically yes. However, only Intel Pro/1000 and AMD PCNET32 ethernet cards are supported by the kernel. In addition there is no USB support compiled into the kernel. That means you can only use an IBM AT or IBM PS/2 keyboard which are not available on newer hardware. \n\n.SH FILES\n\\fBsyslinux.cfg\\fR, \\fBvlmcsd.ini\\fR(5)\n\n.SH BUGS\nIPv6 cannot be configured with static or manual parameters.\n.br\nDHCPv6 is not supported.\n.br\n\\'ip route add ...' does not work. Use 'route add ...' instead.\n\n.SH AUTHOR\n\\fBfloppy144.vfd\\fR has been created by Hotbird64\n\n.SH CREDITS\nLinus Torvalds et al. for the Linux kernel\n.br\nErik Andersen et al. for the original uClibc\n.br\nWaldemar Brodkorb et al. for uClibc-ng\n.br\nDenys Vlasenko et al. for BusyBox\n.br\nH. Peter Anvin et al. for SYSLINUX\n\n.SH SEE ALSO\n\\fBvlmcsd\\fR(8), \\fBvlmcsd.ini\\fR(5), \\fBinitrd\\fR(4), \\fBbusybox\\fR(1), \\fBsyslinux(1)\\fR\n"
  },
  {
    "path": "man/vlmcsd.7",
    "content": ".TH VLMCSD 7 \"March 2016\" \"Hotbird64\" \"KMS Activation Manual\"\n\n.SH NAME\nvlmcsd\\ \\-\\ a guide to KMS activation using vlmcsd\n\n.SH SYNOPSIS\n.B vlmcsd\n[\n.IR \"options\" \" ]\n\n.SH DESCRIPTION\nThis manual describes the concepts of Microsoft KMS activation using \\fBvlmcsd\\fR. For detailed usage of \\fBvlmcsd\\fR see \\fBvlmcsd\\fR(8).\n\n.SS What is KMS?\nKMS is a way to activate Microsoft products that was designed for medium and large businesses. In a standard SOHO environment you enter a product key during installation and then activate your product over the Internet. This is done by sending a request to a server at microsoft.com which then either grants or refuses activation.\n.PP\nBy entering a special key called General Volume License Key (\\fBGVLK\\fR), a.k.a \"KMS client key\", the product no longer asks the Microsoft server for activation but a user-defined server (called the KMS server) which usually resides in a company's intranet. \\fBvlmcsd\\fR is an independent open source implementation of a KMS server that is available for everyone while Microsoft gives their KMS server only to corporations that signed a so called \"Select contract\". In addition \\fBvlmcsd\\fR never refuses activation while the Microsoft KMS server only activates the products the customer has paid for.\n.PP\nProduct activation using \\fBvlmcsd\\fR is performed in three easy steps:\n.IP 1) 3\nRun \\fBvlmcsd\\fR (or any other KMS emulator) on a computer in your network. This will be your KMS server. New users should simply run the program without any parameters. The defaults should fit the needs of most users.\n.IP 2) 3\nInstall your product and enter the GVLK when you are asked for a key\n.IP 3) 3\nConfigure your client (the machine where you installed your product) to use your KMS server.\n.PP\nHowever, when it comes to the details, some things turn out to be more difficult than you might think.\n.PP\nThe most important thing to know is that KMS activation is not permanent. The computer remains activated for 180 days (30 or 45 days with consumer-only products). KMS activation however is not an evaluation license. You can repeat the activation anytime and as often as you like to extend activation to another 180 days. This normally happens automatically. For this to work, you have to ensure that a KMS server is always reachable for the clients on your network.\n.PP\nBeginning with Windows 8.1 the KMS server must be a different computer than the client. You cannot use \\fBvlmcsd\\fR on the same computer where you want to activate a product. If you have only one computer, you can run \\fBvlmcsd\\fR in a virtual machine. \\fBvlmcsd\\fR is also designed to run on \"always-on devices\", for example a router. The router becomes your KMS server then.\n\n.SS How to get a GVLK?\nThat is relatively simple. The GVLKs are published on Microsoft's Technet web site.\n.PP\nWindows: http://technet.microsoft.com/en-us/library/jj612867.aspx\n.br\nOffice 2010: http://technet.microsoft.com/en-us/library/ee624355(v=office.14).aspx#section2_3\n.br\nOffice 2013: http://technet.microsoft.com/en-us/library/dn385360.aspx\n.PP\nThese lists only include products that Microsoft sells to corporations via volume license contracts. For Windows there are inofficial GVLKs that work with consumer-only versions of Windows. Here is a list:\n.PP\nTX9XD\\-98N7V\\-6WMQ6\\-BX7FG\\-H8Q99 - Windows 10 Home\n.br\n3KHY7\\-WNT83\\-DGQKR\\-F7HPR\\-844BM - Windows 10 Home N\n.br\n7HNRX\\-D7KGG\\-3K4RQ\\-4WPJ4\\-YTDFH - Windows 10 Home Single Language\n.br\nPVMJN\\-6DFY6\\-9CCP6\\-7BKTT\\-D3WVR - Windows 10 Home Country Specific\n.br\n789NJ\\-TQK6T\\-6XTH8\\-J39CJ\\-J8D3P - Windows 8.1 Professional with Media Center\n.br\nM9Q9P\\-WNJJT\\-6PXPY\\-DWX8H\\-6XWKK - Windows 8.1 Core\n.br\n7B9N3\\-D94CG\\-YTVHR\\-QBPX3\\-RJP64 - Windows 8.1 Core N\n.br\nBB6NG\\-PQ82V\\-VRDPW\\-8XVD2\\-V8P66 - Windows 8.1 Core Single Language\n.br\nNCTT7\\-2RGK8\\-WMHRF\\-RY7YQ\\-JTXG3 - Windows 8.1 Core Country Specific\n.br\nGNBB8\\-YVD74\\-QJHX6\\-27H4K\\-8QHDG - Windows 8 Professional with Media Center\n.br\nBN3D2\\-R7TKB\\-3YPBD\\-8DRP2\\-27GG4 - Windows 8 Core\n.br\n8N2M2\\-HWPGY\\-7PGT9\\-HGDD8\\-GVGGY - Windows 8 Core N\n.br\n2WN2H\\-YGCQR\\-KFX6K\\-CD6TF\\-84YXQ - Windows 8 Core Single Language\n.br\n4K36P\\-JN4VD\\-GDC6V\\-KDT89\\-DYFKP - Windows 8 Core Country Specific\n.PP\nThe above keys require activation renewal every 45 days (Win 8.1) or 30 days (Win 8). All GVLKs from the Microsoft Technet web site require renewal every 180 days.\n\n.SS What are SLMGR and OSPP and how to use them?\nYou will need these utilities later. So please continue reading this section.\n.PP\nThese are two Visual Basic script utilities that are used to control Microsoft's Software Protection system. To use them open a Windows Command Prompt. slmgr.vbs is for Windows. ospp.vbs is for Office 2010 and 2013. These utilities are installed with Windows and Office and you don't need to download them.\n.PP\nslmgr.vbs resides in the system32 directory. So you just have to type \"slmgr\" in the Windows Command prompt to use it. To use ospp.vbs you'll have to change the current directory to your Office installation. This is usually something like \"C:\\eProgram\\ Files\\eMicrosoft\\ Office\\eOffice14\". You may type \"slmgr\" or \"cscript ospp.vbs\" without parameters to see help for these commands but this produces some rather confusing output for newbies.\n\n.SS How to get the GVLK into the product?\nNormally every product asks you to enter a key during installation. At this time simply enter the GVLK. If you skipped this step or entered some other key which later turned out to be non-working, you can use \"slmgr\\ /ipk\\ \\fIGVLK\\fR\" (Windows) or \"cscript ospp.vbs\\ /inpkey:\\fIGVLK\\fR\" (Office) at any time.\n.IP \\fBExamples\\fR\nslmgr\\ /ipk GCRJD\\-8NW9H\\-F2CDX\\-CCM8D\\-9D6T9\n.br\ncscript ospp.vbs\\ /inpkey:YC7DK\\-G2NP3\\-2QQC3\\-J6H88\\-GVGXT\n\n.SS Why doesn't Office accpet a GVLK?\nYou'll have to install a volume license (VL) version of Office. Office versions downloaded from MSDN and/or Technet are non-VL.\n\n.SS How to configure a client to use a KMS server?\nAfter you have installed a GVLK you can set your product to use your KMS server. \\fBvlmcsd\\fR or another KMS server must already be running on your server machine.\n.IP \"\\fBWindows\\fR\" 5\n.PP\nType \"slmgr\\ /skms\\ \\fIkms-server\\fR[:\\fItcp-port\\fR]\". Example: \"slmgr\\ /skms\\ 192.168.1.17:1688\"\n\n.IP \"\\fBOffice\\fR\" 5\n.IP 1) 3\nType \"cscript ospp.vbs\\ /sethst:\\fIkms-server\\fR\". Example \"cscript ospp.vbs\\ /sethst:192.168.1.17\"\n.IP 2) 3\nType \"cscript ospp.vbs\\ /setprt:\\fItcp-port\\fR\". Example: cscript ospp.vbs\\ /setprt:1688\n.PP\n\\fItcp-port\\fR is usually 1688 unless you instructed \\fBvlmcsd\\fR to use a different port which is rarely necessary.\n\n.SS How to activate my product?\nIf you have installed a product with GVLK and pointed it to working KMS server like \\fBvlmcsd\\fR, activation occurs automatically. This may take a while.\n.IP \"You may type\"\nslmgr\\ /ato\n.br\n\\-or\\-\n.br\ncscript ospp.vbs\\ /act\n.PP\nat any time to speed up that process. You may repeat these commands later to extend your activation for another 180 (45) days.\n\n.SS Does vlmcsd work correctly?\nIf something does not work, it may have the cause that \\fRvlmcsd\\fR does not work correctly although this is unlikely. You can test this with the KMS client \\fBvlmcs\\fR(1). First type \"vlmcs\" on the same machine where you started \\fBvlmcsd\\fR. If things are ok, you should see something like this:\n.IP\nConnecting to 127.0.0.1:1688 ... successful\n.br\nSending\\ activation\\ request\\ (KMS\\ V4)\\ 1\\ of\\ 1\\ \\-> 06401\\-00206\\-296\\-206344\\-03\\-5179\\-9600.0000\\-3432013\n.PP\nIf anything goes wrong, you'll see an error message. Next try \"vlmcs \\fIkms-server\\fR\" from another machine where \\fIkms-server\\fR is the hostname or IP address of your KMS server. If that fails while it works locally, you'll most likely have to configure your firewall that it accepts incoming connections on TCP port 1688.\n\n.SS Is there an easier way than using OSPP and SLMGR?\nYes and no. KMS activation was designed for large corporations. Thus Microsoft designed KMS in a way that corporations can configure their network infrastructure to fully automate KMS activation. Since this involves DHCP and DNS, it is not that easy to accomplish that for home users. However, if you are using an open source router firmware like OpenWRT or DD-WRT, it is easy to customize DHCP and DNS.\n.IP 1) 3\nConfigure DHCP that it assigns a DNS domain name to your clients (if it doesn't already), e.g. my-home-net.local\n.IP 2) 3\nCreate zone my-home-net.local in your DNS server (if it doesn't exist already).\n.IP 3) 3\nAdd the following records to your DNS\n\n_vlmcs._tcp.my-home-net.local. 10800 IN SRV 100 100 kms1.my-home-net.local.\n.br\nkms1.my-home-net.local. 10800 IN A 192.168.1.17\n\nReplace 192.168.1.17 with the IP address of your KMS server. If you don't like a cache time of 10800 seconds (3 hours), replace it with another number.\n.PP\nThis causes that clients will find the KMS server automatically.\n\n.SH AUTHOR\nThis manual page was written by Hotbird64.\n.SH SEE ALSO\n\\fBvlmcsd\\fR(8), \\fBvlmcs\\fR(1)\n"
  },
  {
    "path": "man/vlmcsd.8",
    "content": ".mso www.tmac\n.TH VLMCSD 8 \"February 2019\" \"Hotbird64\" \"KMS Activation Manual\"\n.LO 8\n\n.SH NAME\nvlmcsd \\- a fully Microsoft compatible KMS server\n\n.SH SYNOPSIS\n.B vlmcsd\n[\n.IR \"options\" \" ]\n\n.SH DESCRIPTION\n\\fBvlmcsd\\fR is a fully Microsoft compatible KMS server that provides product activation services to clients. It is meant as a drop-in replacement for a Microsoft KMS server (Windows computer with KMS key entered). It currently supports KMS protocol versions 4, 5 and 6.\n.PP\n\\fBvlmcsd\\fR is designed to run on POSIX compatible operating systens. It only requires a basic C library with a BSD-style sockets API and either \\fBfork\\fR(2) or \\fBpthreads\\fR(7). That allows it to run on most embedded systems like routers, NASes, mobile phones, tablets, TVs, settop boxes, etc. Some efforts have been made that it also runs on Windows.\n.PP\nAlthough \\fBvlmcsd\\fR does neither require an activation key nor a payment to anyone, it is not meant to run illegal copies of Windows. Its purpose is to ensure that owners of legal copies can use their software without restrictions, e.g. if you buy a new computer or motherboard and your key will be refused activation from Microsoft servers due to hardware changes.\n.PP\n\\fBvlmcsd\\fR may be started via an internet superserver like \\fBinetd\\fR(8) or \\fBxinetd\\fR(8) as well as an advanced init system like \\fBsystemd\\fR(8) or \\fBlaunchd\\fR(8) using socket based activation. If \\fBvlmcsd\\fR detects that \\fBstdin\\fR(3) is a socket, it assumes that there is already a connected client on stdin that wants to be activated.\n\nAll options that control setting up listening sockets will be ignored when in inetd mode. The sockets will be set up by your internet superserver. You also cannot limit the number of simultanous clients (option \\fB-m\\fR). You need to configure the limit in your internet superserver.\n\nThe followong features that require that vlmcsd is permanently loaded will not work if started from an internet superserver:\n\n.IP\nYou cannot maintain a client list (option \\fB-M1\\fR)\n\n.IP\nEPID Randomization Level 1 (option \\fB-r1\\fR) works like Level 2 (\\fB-r2\\fR). You may want to use Level 0 (\\fB-r0\\fR) or custom EPIDs (options \\fB-w\\fR, \\fB-G\\fR, \\fB-0\\fR, \\fB-3\\fR and \\fB-6\\fR) instead.\n\n.SH OPTIONS\nSince vlmcsd can be configured at compile time, some options may not be available on your system.\n.PP\nAll options that do no require an argument may be combined with a single dash, for instance \"vlmcsd -D -e\" is identical to \"vlmcsd -De\". For all options that require an argument a space between the option and the option argument is optional. Thus \"vlmcsd -r 2\" and \"vlmcsd -r2\" are identical too.\n\n.IP \"\\fB-h\\fR or \\fB-?\\fR\"\nDisplays help.\n\n.IP \"\\fB-V\\fR\"\nDisplays extended version information. This includes the compiler used to build vlmcsd, the intended platform and flags (compile time options) to build vlmcsd. If you have the source code of vlmcsd, you can type \\fBmake help\\fR (or \\fBgmake help\\fR on systems that do not use the GNU version of \\fBmake\\fR(1) by default) to see the meaning of those flags.\n\n.IP \"\\fB-L\\fR \\fIipaddress\\fR[:\\fIport\\fR]\"\nInstructs vlmcsd to listen on \\fIipaddress\\fR with optional \\fIport\\fR (default 1688). You can use this option more than once. If you do not specify \\fB-L\\fR at least once, IP addresses 0.0.0.0 (IPv4) and :: (IPv6) are used. If the IP address contains colons (IPv6) you must enclose the IP address in brackets if you specify the optional port, e.g. [2001:db8::dead:beef]:1688.\n.PP\n.IP\nIf no port is specified, vlmcsd uses the default port according to a preceding \\fB-P\\fR option. If you specify a port, it can be a number (1-65535) or a name (usually found in /etc/services if not provided via LDAP, NIS+ or another name service).\n.PP\n.IP\nIf you specify a link local IPv6 address (fe80::/10, usually starting with fe80::), it must be followed by a percent sign (%) and a scope id (=network interface name or number) on most unixoid OSses including Linux, Android, MacOS X and iOS, e.g. fe80::1234:56ff:fe78:9abc\\fB%eth0\\fR or [fe80::1234:56ff:fe78:9abc\\fB%2\\fR]:1688. Windows (including cygwin) does not require a scope id unless the same link local address is used on more than one network interface. Windows does not accept a name and the scope id must be a number.\n\n.IP \"\\fB-o \\fIlevel\\fR\"\nSets the \\fIlevel\\fR of protection against activations from public IP addresses. The default is \\fB-o0\\fR for no protection.\n\n\\fB-o1\\fR causes vlmcsd not to listen on all IP addresses but on private IP addresses only. IPv4 addresses in the 100.64.0.0/10 range (see RFC6598) are not treated as private since they can be reached from other users of your ISP. Private IPv4 addresses are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 and 127.0.0.0/8. vlmcsd treats all IPv6 addresses not within 2000::/3 as private addresses.\n\nIf \\fB-o1\\fR is combined with \\fB-L\\fR, it will listen on all private IP addresses plus the ones specified by one or more \\fB-L\\fR statements. If \\fB-o1\\fR is combined with \\fB-P\\fR, only the last \\fB-P\\fR statement will be used.\n\nUsing \\fB-o1\\fR does not protect you if you enable NAT port forwarding on your router to your vlmcsd machine. It is identical to using multiple -L statements with all of your private IP addresses. What \\fB-o1\\fR does for you, is automatically enumerating your private IP addresses.\n\n\\fB-o2\\fR does not affect the interfaces, vlmcsd is listening on. When a clients connects, vlmcsd immediately drops the connection if the client has a public IP address. Unlike \\fB-o1\\fR clients will be able to establish a TCP connection but it will be closed without a single byte sent over the connection. This protects against clients with public IP addresses even if NAT port forwarding is used. While \\fB-o2\\fR offers a higher level of protection than \\fB-o1\\fR, the client sees that the KMS TCP port (1688 by default) is actually accepting connections.\n\nIf vlmcsd is compiled to use MS RPC, \\fB-o2\\fR can only offer very poor protection. Control is passed from MS RPC to vlmcsd after the KMS protocol has already been negotiated. Thus a client can always verify that the KMS protocol is available even though it receives an RPC_S_ACCESS_DENIED error message. vlmcsd will issue a warning if \\fB-o2\\fR is used with MS RPC. \\fBFor adaequate protection do not use a MS RPC build of vlmcsd with -o2\\fR.\n\n\\fB-o3\\fR combines \\fB-o1\\fR and \\fB-o2\\fR. vlmcsd listens on private interfaces only and if a public client manages to connect anyway due to NAT port forwarding, it will be immediately dropped.\n\nIf you use any form of TCP level port forwarding (e.g. \\fBnc\\fR(1), \\fBnetcat\\fR(1), \\fBssh\\fR(1) port forwarding or similar) to redirect KMS requests to vlmcsd, there will be no protection even if you use \\fB-o2\\fR or \\fB-o3\\fR. This is due to the simple fact that vlmcsd sees the IP address of the redirector and not the IP address of the client.\n\n\\fB-o1\\fR (and thus \\fB-o3\\fR) is not (yet) available in some scenarios:\n\n.RS 12\nFreeBSD: There is a longtime unfixed\n.URL https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881 bug \"\"\nin the 32-bit ABI of the 64-bit kernel. If you have a 64-bit FreeBSD kernel, you must run the 64-bit version of vlmcsd if you use \\fB-o1\\fR or \\fB-o3\\fR. The 32-bit version causes undefined behavior up to crashing vlmcsd. Other BSDs (NetBSD, OpenBSD, Dragonfly and Mac OS X) work correctly.\n\nIf vlmcsd was started by an internet superserver or was compiled to use Microsoft RPC (Windows only) or simple sockets, \\fB-o1\\fR and \\fB-o3\\fR are not available by design.\n.RE\n\n.IP \"\\fB-P\\fR \\fIport\\fR\"\nUse TCP \\fIport\\fR for all subsequent \\fB-L\\fR statements that do not include an optional port. If you use \\fB-P\\fR and \\fB-L\\fR, \\fB-P\\fR must be specified before \\fB-L\\fR.\n\n.IP \"\\fB-O\\fR \\fIvpn-adapter-name\\fR[=\\fIipv4-address\\fR][/\\fIcidr-mask\\fR][:\\fIdhcp-lease-duration\\fR]\"\nEnables a compatible VPN adapter to create additional local IPv4 addresses (like 127.0.0.1) that appear as remote IPv4 addresses to the system. This allows product activation using a local instance of vlmcsd. This feature is only available in Windows and Cygwin builds of vlmcsd since it is not of any use on other operating systems. Compatible VPN adapters are Tap-windows version 8.2 or higher (from OpenVPN) and the TeamViewer VPN adapter. There are two special \\fIvpn-adapter-name\\fRs. A single period (.) instructs vlmcsd to use the first available compatible VPN adapter. A single dash (\\-) disables the use of a VPN adapter if one has been configured in \\fBvlmcsd.ini\\fR(5). The \\fIvpn-adapter-name\\fR is \\fBnot\\fR case-sensitive. If the \\fIvpn-adapter-name\\fR contains spaces (e.g. Ethernet 3), you must enclose it in quotes.\n\nThe default \\fIipv4-address\\fR is 10.10.10.9 and the default \\fIcidr-mask\\fR is 30. If you are using the default values, your VPN adapter uses an IPv4 address of 10.10.10.9 and you can set your activation client to use the easy to remember address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs /sethst:10.10.10.10).\n\nThe \\fIdhcp-lease-duration\\fR is a number optionally followed by s, m, h, d or w to indicate seconds, minutes, hours, days or weeks. The default \\fIdhcp-lease-duration\\fR is 1d (one day). It is normally not required to change this value.\n\nIt is advised not to manually configure your OpenVPN TAP or TeamViewer VPN adapter in \"Network Connections\". If you set the IPv4 configuration manually anyway, the IPv4 address and the subnet mask must match the \\fB-O\\fR parameter. It is safe leave the IPv4 configuration to automatic (DHCP). vlmcsd will wait up to four seconds for the DHCP configuration to complete before binding to and listenin on any interfaces.\n\nYou should be aware that only one program can use a VPN adapter at a time. If you use the TeamViewer VPN adapter for example, you will not be able to use the VPN feature of TeamViewer as long as vlmcsd is running. The same applies to OpenVPN TAP adapters that are in use by other programs (for example OpenVPN, QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid conflicts is to install Tap-Windows from OpenVPN, cd to C:\\\\Program Files\\\\TAP-Windows\\\\bin and run addtap.bat to install an additional TAP adapter. Go to \"Network Connections\" and rename the new adapter to \"vlmcsd\" and specify \\fB-O vlmcsd\\fR to use it.\n\nExample: \\fB-O \"Ethernet 7\"=192.168.123.1/24\\fR (uses VPN adapter Ethernet 7 with IPv4 address 192.168.123.1 and have 192.168.123.2 to 192.168.123.254 as additional local (but apparently remote) IPv4 addresses.\n\n.IP \"\\fB-x0\\fR and \\fB-x1\\fR\"\nControls under what circumstances vlmcsd will exit. Using the default of \\fB-x0\\fR vlmcsd stays active as long as it can perform some useful operations. If vlmcsd is run by any form of a watchdog, e.g. NT service manager (Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be desirable to end vlmcsd and let the watchdog restart it. This is especially true if some pre-requisites are not yet met but will be some time later, e.g. network is not yet fully setup.\n\nBy using \\fB-x0\\fR vlmcsd will\n\n.RS 12\nexit if none of the listening sockets specified with \\fB-L\\fR can be used. It continues if at least one socket can be setup for listening.\n\nexit any TAP mirror thread (Windows version only) if there is an error condition while reading or writing from or to the VPN adapter but continue to work without utilizing a VPN adapter.\n.RE\n.IP\nBy using \\fB-x1\\fR vlmcsd will\n\n.RS 12\nexit if not all listening sockets specified with \\fB-L\\fR can be used.\n\nexit completely if there is a problem with a VPN adapter it is using. This can happen for instance if the VPN adapter has been disabled using \"Control Panel - Network - Adapter Settings\" while vlmcsd is using it.\n\n.RE\n.IP\nPlease note that \\fB-x1\\fR is kind of a workaround option. While it may help under some circumstances, it is better to solve the problem at its origin, e.g. properly implementing dependencies in your startup script to ensure all network interfaces and the VPN adapter you will use are completely setup before you start vlmcsd.\n\n.IP \"\\fB-F0\\fR and \\fB-F1\\fR\"\nAllow (\\fB-F1\\fR) or disallow (\\fB-F0\\fR) binding to IP addresses that are currently not configured on your system. The default is \\fB-F0\\fR. \\fB-F1\\fR allows you to bind to an IP address that may be configured after you started \\fBvlmcsd\\fR. \\fBvlmcsd\\fR will listen on that address as soon as it becomes available. This feature is only available under Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows this feature only for the root user (more correctly: processes that have the PRIV_NETINET_BINDANY privilege). Linux does not require a capability for this.\n\n.IP \"\\fB-t\\fR \\fIseconds\\fR\"\nTimeout the TCP connection with the client after \\fIseconds\\fR seconds. After sending an activation request. RPC keeps the TCP connection for a while. The default is 30 seconds. You may specify a shorter period to free ressources on your device faster. This is useful for devices with limited main memory or if you used \\fB-m\\fR to limit the concurrent clients that may request activation. Microsoft RPC clients disconnect after 30 seconds by default. Setting \\fIseconds\\fR to a greater value does not make much sense.\n\n.IP \"\\fB-m\\fR \\fIconcurrent-clients\\fR\"\nLimit the number of clients that will be handled concurrently. This is useful for devices with limited ressources or if you are experiencing DoS attacks that spawn thousands of threads or forked processes. If additional clients connect to vlmcsd, they need to wait until another client disconnects. If you set \\fIconcurrent-clients\\fR to a small value ( <10 ), you should also select a reasonable timeout of 2 or 3 seconds with \\fB-t\\fR. The default is no limit.\n\n.IP \"\\fB-d\\fR\"\nDisconnect each client after processing one activation request. This is a direct violation of DCE RPC but may help if you receive malicous fake RPC requests that block your threads or forked processes. Some other KMS emulators (e.g. py-kms) behave this way.\n\n.IP \"\\fB-k\\fR\"\nDo not disconnect clients after processing an activation request. This selects the default behavior. \\fB-k\\fR is useful only if you used an ini file (see \\fBvlmcsd.ini\\fR(5) and \\fB-i\\fR). If the ini file contains the line \"DisconnectClientsImmediately = true\", you can use this switch to restore the default behavior.\n\n.IP \"\\fB-N0\\fR and \\fB-N1\\fR\nDisables (\\fB-N0\\fR) or enables (\\fB-N1\\fR) the use of the NDR64 transfer syntax in the RPC protocol. Unlike Microsoft vlmcsd supports NDR64 on 32-bit operating systems. Microsoft introduced NDR64 in Windows Vista but their KMS servers started using it with Windows 8. Thus if you choose random ePIDs, vlmcsd will select ePIDs with build numbers 9200 and 9600 if you enable NDR64 and build numbers 6002 and 7601 if you disable NDR64. The default is to enable NDR64.\n\n.IP \"\\fB-B0\\fR and \\fB-B1\\fR\"\nDisables (\\fB-B0\\fR) or enables (\\fB-B1\\fR) bind time feature negotiation (BTFN) in the RPC protocol. All Windows operating systems starting with Vista support BTFN and try to negotiate it when initiating an RPC connection. Thus consider turning it off as a debug / troubleshooting feature only. Some older firewalls that selectively block or redirect RPC traffic may get confused when they detect NDR64 or BTFN.\n\n.IP \"\\fB-l\\fR \\fIfilename\\fR\nUse \\fIfilename\\fR as a log file. The log file records all activations with IP address, Windows workstation name (no reverse DNS lookup), activated product, KMS protocol, time and date. If you do not specify a log file, no log is created. For a live view of the log file\ntype tail -f \\fIfile\\fR.\n.PP\n.IP\nIf you use the special \\fIfilename\\fR \"syslog\", vlmcsd uses \\fBsyslog\\fR(3) for logging. If your system has no syslog service (/dev/log) installed, logging output will go to /dev/console. Syslog logging is not available in the native Windows version. The Cygwin version does support syslog logging.\n\n.IP \"\\fB-T0\\fR and \\fB-T1\\fR\"\nDisable (\\fB-T0\\fR) or enable (\\fB-T1\\fR) the inclusion of date and time in each line of the log. The default is \\fB-T1\\fR. \\fB-T0\\fR is useful if you log to \\fBstdout\\fR(3) which is redirected to another logging mechanism that already includes date and time in its output, for instance \\fBsystemd-journald\\fR(8). If you log to \\fBsyslog\\fR(3), \\fB-T1\\fR is ignored and date and time will never be included in the output sent to \\fBsyslog\\fR(3).\n\n.IP \"\\fB-D\\fR\"\nNormally vlmcsd daemonizes and runs in background (except the native Windows version). If \\fB-D\\fR is specified, vlmcsd does not daemonize and runs in foreground. This is useful for testing and allows you to simply press <Ctrl-C> to exit vlmcsd.\n.PP\n.IP\nThe native Windows version never daemonizes and always behaves as if \\fB-D\\fR had been specified. You may want to install vlmcsd as a service instead. See \\fB-s\\fR.\n\n.IP \"\\fB-e\\fR\"\nIf specified, vlmcsd ignores \\fB-l\\fR and writes all logging output to \\fBstdout\\fR(3). This is mainly useful for testing and debugging and often combined with \\fB-D\\fR.\n\n.IP \"\\fB-v\\fR\"\nUse verbose logging. Logs every parameter of the base request and the base response. It also logs the HWID of the KMS server if KMS protocol version 6 is used. This option is mainly for debugging purposes. It only has an effect if some form of logging is used. Thus \\fB-v\\fR does not make sense if not used with \\fB-l\\fR, \\fB-e\\fR or \\fB-f\\fR.\n\n.IP \"\\fB-q\\fR\"\nDo not use verbose logging. This is actually the default behavior. It only makes sense if you use vlmcsd with an ini file (see \\fB-i\\fR and \\fBvlmcsd.ini\\fR(5)). If the ini file contains the line \"LogVerbose = true\" you can use \\fB-q\\fR to restore the default behavior.\n\n.IP \"\\fB-p\\fR \\fIfilename\\fR\" \nCreate pid file \\fIfilename\\fR. This has nothing to do with KMS ePIDs. A pid file is a file where vlmcsd writes its own process id. This is used by standard init scripts (typically found in /etc/init.d). The default is not to write a pid file.\n\n.IP \"\\fB-u\\fR \\fIuser\\fR and \\fB-g\\fR \\fIgroup\\fR\"\nCauses vlmcsd to run in the specified \\fIuser\\fR and \\fIgroup\\fR security context. The main purpose for this is to drop root privileges after it has been started from the root account. To use this feature from cygwin you must run cyglsa-config and the account from which vlmcsd is started must have the rights \"Act as part of the operating system\" and \"Replace a process\nlevel token\". The native Windows version does not support these options.\n.PP\n.IP\nThe actual security context switch is performed after the TCP sockets have been created. This allows you to use privileged ports (< 1024) when you start vlmcsd from the root account.\n.PP\n.IP\nHowever 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).\n\n.IP \"\\fB-a\\fR \\fICSVLK\\fR = \\fIePID\\fR [ / \\fIHwId\\fR ]\"\nUse \\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.\n\n\\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.\n\n.IP \"\\fB-i\\fR \\fIfilename\\fR\"\nUse 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.\n\nIf vlmcsd has been compiled to use a default configuration file (often /etc/vlmcsd.ini), you may use \\fB-i-\\fR to ignore the default configuration file.\n\n.IP \"\\fB-j\\fR \\fIfilename\\fR\"\nUse KMS data file \\fIfilename\\fR. By default vlmcsd only contains the minimum product data that is required to perform all operations correctly. You may use a more complete KMS data file that contains all detailed product names. This is especially useful if you are logging KMS requests. If you don't log, there is no need to load an external KMS data file.\n\nIf vlmcsd has been compiled to use a default KMS data file, you may use \\fB-j-\\fR to ignore the default configuration file.\n\n.IP \"\\fB-r0\\fR, \\fB-r1\\fR (default) and \\fB-r2\\fR\"\nThese options determine how ePIDs are generated if\n\n- you did not sprecify an ePID in the command line and\n.br\n- you haven't used \\fB-i\\fR or\n.br\n- the file specified by \\fB-i\\fR cannot be opened or\n.br\n- the file specified by \\fB-i\\fR does not contain an ePID for the KMS request\n\n\\fB-r0\\fR means there are no random ePIDs. vlmcsd simply issues default ePIDs that are built into the binary at compile time. \\fBPro:\\fR behaves like real KMS server that also always issues the same ePID. \\fBCon:\\fR Microsoft may start blacklisting again and the default ePID may not work any longer.\n\n\\fB-r1\\fR instructs vlmcsd to generate random ePIDs when the program starts or receives a SIGHUP signal and uses these ePIDs until it is stopped or receives another SIGHUP. Most other KMS emulators generate a new ePID on every KMS request. This is easily detectable. Microsoft could just modify sppsvc.exe in a way that it always sends two identical KMS requests in two RPC requests but over the same TCP connection. If both KMS responses contain the different ePIDs, the KMS server is not genuine. \\fB-r1\\fR is the default mode. \\fB-r1\\fR also ensures that all three ePIDs (Windows, Office 2010 and Office 2013) use the same OS build number and LCID (language id).\n\nIf vlmcsd has been started by an internet superserver, \\fB-r1\\fR works almost identically to \\fB-r2\\fR. The only exception occurs if you send more than one activation request over the same TCP connection. This is simply due to the fact that vlmcsd is started upon a connection request and does not stay in memory after servicing a KMS request. Consider using \\fB-r0\\fR or \\fB-w\\fR, \\fB-G\\fR, \\fB-0\\fR, \\fB-3\\fR and \\fB-6\\fR when starting vlmcsd by an internet superserver.\n\n\\fB-r2\\fR behaves like most other KMS server emulators with random support and generates a new random ePID on every request. \\fB-r2\\fR should be treated as debugging option only because it allows very easy emulator detection.\n\n.IP \"\\fB-C\\fR \\fILCID\\fR\"\nDo not randomize the locale id part of the ePID and use \\fILCID\\fR instead. The \\fILCID\\fR must be specified as a decimal number, e.g. 1049 for \"Russian - Russia\". This option has no effect if the ePID is not randomized at all, e.g. if it is selected from the command line or an ini file.\n\nBy default vlmcsd generates a valid locale id that is recognized by .NET Framework 4.0. This may lead to a locale id which is unlikely to occur in your country, for instance 2155 for \"Quecha - Ecuador\". You may want to select the locale id of your country instead. See\n.URL \"http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx\" \"MSDN\" \"\"\nfor a list of valid \\fILCID\\fRs. Please note that some of them are not recognized by .NET Framework 4.0.\n\nMost other KMS emulators use a fixed \\fILCID\\fR of 1033 (English - US). To achive the same behavior in vlmcsd use \\fB-C 1033\\fR.\n\n.IP \"\\fB-H\\fR \\fIHostBuild\\fR\"\nDo not randomize the host build number in the ePID and use \\fIHostBuild\\fR instead, for instance 17763 for Windows Server 2019 / Windows 10 1809.\n\n.IP \"\\fB-K0\\fR, \\fB-K1\\fR, \\fB-K2\\fR and \\fB-K3\\fR\"\nSets the whitelisting level to determine which products vlmcsd activates or refuses. The default is \\fB-K0\\fR.\n\n.RS 12\n\\fB-K0\\fR: activate all products with an unknown, retail or beta/preview KMS ID.\n.br\n\\fB-K1\\fR: activate products with a retail or beta/preview KMS ID but refuse to activate products with an unknown KMS ID.\n.br\n\\fB-K2\\fR: activate products with an unknown KMS ID but refuse products with a retail or beta/preview KMS ID.\n.br\n\\fB-K3\\fR: activate only products with a known volume license RTM KMS ID and refuse all others.\n.RE\n\n.IP \"\"\nThe SKU ID is not checked. Like a genuine KMS server vlmcsd activates a product that has a random or unknown SKU ID. If you select \\fB-K1\\fR or \\fB-K3\\fR, vlmcsd also checks the Application ID for correctness. If Microsoft introduces a new KMS ID for a new product, you cannot activate it if you used \\fB-K1\\fR or \\fB-K3\\fR until a new version of vlmcsd is available.\n\n.IP \"\\fB-c0\\fR and \\fB-c1\\fR\"\n\\fB-c1\\fR causes vlmcsd to check if the client time differs no more than four hours from the system time. \\fB-c0\\fR (the default) disables this check. \\fB-c1\\fR is useful to prevent emulator detection. A client that tries to detect an emulator could simply send two subsequent request with two time stamps that differ more than four hours from each other. If both requests succeed, the server is an emulator. If you specify \\fB-c1\\fR on a system with no reliable time source, activations will fail. It is ok to set the correct system time after you started vlmcsd.\n\n.IP \"\\fB-M0\\fR and \\fB-M1\\fR\"\nDisables (\\fB-M0\\fR) or enables (\\fB-M1\\fR) maintaining a list of client machine IDs (CMIDs). The default is \\fB-M0\\fR. \\fB-M1\\fR is useful to prevent emulator detection. By maintaing a CMID list, vlmcsd reports current active clients exactly like a genuine KMS emulator. This includes bug compatibility to the extent that you can permanently kill a genuine KMS emulator by sending an \"overcharge request\" with a required client count of 376 or more and then request activation for 671 clients. vlmcsd can be reset from this condition by restarting it. If \\fB-M0\\fR is used, vlmcsd reports current active clients as good as possible. If no client sends an \"overcharge request\", it is not possible to detect vlmcsd as an emulator with \\fB-M0\\fR. \\fB-M1\\fR requires the allocation of a buffer that is about 50 kB in size. On hardware with few memory resources use it only if you really need it.\n\nIf you start vlmcsd from an internet superserver, \\fB-M1\\fR cannot be used. Since vlmcsd exits after each activation, it cannot maintain any state in memory.\n\n.IP \"\\fB-E0\\fR and \\fB-E1\\fR\"\nThese options are ignored if you do not also specify \\fB-M1\\fR. If you use \\fB-E0\\fR (the default), vlmcsd starts up as a fully \"charged\" KMS server. Clients activate immediately. \\fB-E1\\fR lets you start up vlmcsd with an empty CMID list. Activation will start when the required minimum clients (25 for Windows Client OSses, 5 for Windows Server OSses and Office) have registered with the KMS server. As long as the minimum client count has not been reached, clients end up in HRESULT 0xC004F038 \"The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator\". You may use \\fBvlmcs\\fR(1) or another KMS client emulator to \"charge\" vlmcsd. \\fB-E1\\fR does not improve emulator detection prevention. It's primary purpose is to help developers of KMS clients to test \"charging\" a KMS server.\n\n.IP \"\\fB-R\\fR \\fIrenewal-interval\\fR\"\nInstructs clients to renew activation every \\fIrenewal-interval\\fR. The \\fIrenewal-interval\\fR is a number optionally immediately followed by a letter indicating the unit. Valid unit letters are s (seconds), m (minutes), h (hours), d (days) and w (weeks). If you do not specify a letter, minutes is assumed.\n\n\\fB-R3d\\fR for instance instructs clients to renew activation every 3 days. The default \\fIrenewal-interval\\fR is 10080 (identical to 7d and 1w).\n\nDue to poor implementation of Microsofts KMS Client it cannot be guaranteed that activation is renewed on time as specfied by the -R option. Don't care about that. Renewal will happen well before your activation expires (usually 180 days).\n\nEven though you can specify seconds, the granularity of this option is 1 minute. Seconds are rounded down to the next multiple of 60.\n\n.IP \"\\fB-A\\fR \\fIactivation-interval\\fR\"\nInstructs clients to retry activation every \\fIactivation-interval\\fR if it was\nunsuccessful, e.g. because it could not reach the server. The default is 120 (identical to 2h). \\fIactivation-interval\\fR follows the same syntax as \\fIrenewal-interval\\fR in the\n\\fB-R\\fR option.\n\n.IP \"\\fB-s\\fR\"\nInstalls vlmcsd as a Windows service. This option only works with the native Windows version and Cygwin. Combine \\fB-s\\fR 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 vlmcsd\".\n\nIf you use Cygwin, you must include your Cygwin system DLL directory (usually C:\\eCygwin\\ebin or C:\\eCygwin64\\ebin) into the PATH environment variable or the service will not start.\n\nYou 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.\n\nWhen using \\fB-s\\fR the command line is checked for basic syntax errors only. For example \"vlmcsd -s -L 1.2.3.4\" reports no error but the service will not start if 1.2.3.4 is not an IP address on your system.\n\n.IP \"\\fB-S\\fR\"\nUninstalls the vlmcsd service. Works only with the native Windows version and Cygwin. All other options will be ignored if you include -S in the command line.\n\n.IP \"\\fB-U\\fR [\\fIdomain\\fR\\e]\\fIusername\\fR\"\nCan only be used together with \\fB-s\\fR. Starts the service as a different 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.\n\nYou may use \"NT AUTHORITY\\eNetworkService\". This is a pseudo user with low privileges. You may also use \"NT AUTHORITY\\eLocalService\" which has more privileges but these are of no use for running vlmcsd.\n\nMake sure that the user you specify has at least execute permission for your executable. \"NT AUTHORITY\\eNetworkService\" normally has no permission to run binaries from your home directory.\n\nFor your convenience you can use the special username \"/l\" as a shortcut for \"NT AUTHORITY\\eLocalService\" and \"/n\" for \"NT AUTHORITY\\eNetworkService\". \"vlmcsd\\ \\-s\\ \\-U\\ /n\" installs the service to run as \"NT AUTHORITY\\eNetworkService\".\n\n.IP \"\\fB-W\\fR \\fIpassword\\fR\"\nCan only be used together with \\fB-s\\fR. Specifies a \\fIpassword\\fR for the corresponding username you use with -U. SYSTEM, \"NT AUTHORITY\\eNetworkService\", \"NT AUTHORITY\\eLocalService\" do not require a password.\n\nIf you specify a user with even lower privileges than \"NT AUTHORITY\\eNetworkService\", you must specify its password. You also have to grant the \"Log on as a service\" right to that user.\n\n.SH SIGNALS\nThe following signals differ from the default behavior:\n\n.IP \"\\fBSIGTERM\\fR, \\fBSIGINT\\fR\"\nThese signals cause vlmcsd to exit gracefully. All global semaphores and shared memory pages will be released, the pid file will be unlinked (deleted) and a shutdown message will be logged.\n\n.IP \"\\fBSIGHUP\\fR\"\nCauses 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 \\fBSIGHUP\\fR, e.g. by typing \"killall -SIGHUP vlmcsd\" or \"kill -SIGHUP `cat /var/run/vlmcsd.pid`\".\n\nThe SIGHUP handler has been implemented relatively simple. It is virtually the same as stopping vlmcsd and starting it again immediately with the following exceptions:\n\n.RS\n.IP \"\\(em\" 3\nThe new process does not get a new process id.\n.IP \"\\(em\" 3\nIf you used a pid file, it is not deleted and recreated because the process id stays the same.\n.IP \"\\(em\" 3\nIf 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. Anything else would be a severe security flaw in the OS.\n.RE\n\nSignaling is not available in the native Windows version and in the Cygwin version when vlmcsd runs as a Windows service.\n\n.SH SUPPORTED OPERATING SYSTEMS\n\\fBvlmcsd\\fR compiles and runs on Linux, Windows (no Cygwin required but explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or unixoid OSses may work with unmodified sources or may require minor porting efforts.\n\n.SH SUPPORTED PRODUCTS\n\\fBvlmcsd\\fR can answer activation requests for the following products: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1809), Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010, Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016, Office 2019, Project 2019, Visio 2019. 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 \\fB-x\\fR option of \\fBvlmcs\\fR(1).\n.PP\nWindows Vista, Windows 7, Office, Project and Visio must be volume license versions.\n\n.SH FILES\n.IP \"\\fBvlmcsd.ini\\fR(5)\"\n\n.SH EXAMPLES\n.IP \"\\fBvlmcsd -De\\fR\"\nStarts \\fBvlmcsd\\fR in foreground. Useful if you use it for the first time and want to see what's happening when a client requests activation.\n\n.IP \"\\fBvlmcsd -l /var/log/vlmcsd.log\\fR\"\nStarts \\fBvlmcsd\\fR as a daemon and logs everything to /var/log/vlmcsd.log.\n\n.IP \"\\fBvlmcsd -L 192.168.1.17\"\nStarts \\fBvlmcsd\\fR as a daemon and listens on IP address 192.168.1.17 only. This is useful for routers that have a public and a private IP address to prevent your KMS server from becoming public.\n\n.IP \"\\fBvlmcsd -s -U /n -l C:\\elogs\\evlmcsd.log\"\nInstalls \\fBvlmcsd\\fR as a Windows service with low privileges and logs everything to C:\\elogs\\evlmcsd.log when the service is started with \"net start vlmcsd\".\n\n.SH BUGS\nAn ePID specified in an ini file must not contain spaces.\n\n.SH AUTHOR\nWritten by crony12, Hotbird64 and vityan666.\nWith contributions from DougQaid.\n\n.SH CREDITS\nThanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...\n\n.SH SEE ALSO\n\\fBvlmcsd.ini\\fR(5), \\fBvlmcsd\\fR(7), \\fBvlmcs\\fR(1), \\fBvlmcsdmulti\\fR(1)\n"
  },
  {
    "path": "man/vlmcsd.ini.5",
    "content": ".TH VLMCSD.INI 5 \"October 2018\" \"Hotbird64\" \"KMS Activation Manual\"\n.LO 8\n\n.SH NAME\n\\fBvlmcsd.ini\\fR \\- vlmcsd KMS emulator configuration file\n\n.SH SYNOPSIS\n.B vlmcsd.ini\n\n.SH DESCRIPTION\n\\fBvlmcsd.ini\\fR (or simply called the \"ini file\") is a configuration file for \\fBvlmcsd\\fR(8). By default vlmcsd does not use a configuration file. It is completely optional and for advanced users only. You must use the \\fB-i\\fR option on the vlmcsd command line to use an ini file. There is no default name or default location for the ini file.\n.PP\nEverything, that can be configured in the ini file, may also be specified on the command line. Any configuration option specified on the command line takes precedence over the respective configuration line in the ini file.\n.PP\n\\fBBenefits of a configuration file\\fR\n.PP\nWhile you can use the configuration file to simply modify the default behavior of vlmcsd, it can also be used to change the configuration of vlmcsd after you sent a HUP \\fBsignal\\fR(7). Whenever you send SIGHUP, the configuration file will be re-read. Any changes you made to the ini file will be reflected after vlmcsd received the hangup signal.\n.PP\n\\fBDifferences between command line and configuration file\\fR\n.PP\nIf you specify an illegal option or option argument on the command line, vlmcsd displays help and exits. If you specify an incorrect \\fIkeyword\\fR or \\fIargument\\fR in the ini file, vlmcsd displays a warning with some information, ignores the respective line and continues. This is intentional and prevents vlmcsd from aborting after a SIGHUP if the configuration was modified incorrectly.\n\n.SH SYNTAX\nvlmcsd.ini is a UTF-8 encoded text file with each line being in the format \\fIkeyword\\fR = \\fIargument\\fR. The \\fIkeyword\\fR is not case-sensitive. The \\fIargument\\fR is treated literally. It is neither required nor allowed to enclose the \\fIargument\\fR in any form of quote characters except when quote characters are part of the argument itself. Whitespace characters are ignored only\n\n- at the beginning of a line\n.br\n- between the \\fIkeyword\\fR and '='\n.br\n- between '=' and the \\fIargument\\fR\n\nLines, that start with '#' or ';' are treated as comments. Empty lines are ignored as well. If a \\fIkeyword\\fR is repeated in another line, vlmcsd will use the \\fIargument\\fR of the last occurence of the \\fIkeyword\\fR. An exception to this is the Listen \\fIkeyword\\fR which can be specified multiple times and causes vlmcsd to listen on more than one IP address and/or port.\n.PP\nSome \\fIargument\\fRs are binary arguments that need to be either TRUE or FALSE. You can use \"Yes\", \"On\" or \"1\" as an alias for TRUE and \"No\", \"Off\" or \"0\" as an alias for FALSE. Binary arguments are case-insensitive.\n\n.SH KEYWORDS\nThe following \\fIkeyword\\fRs are defined (not all keywords may be available depending on the operating system and the options used when \\fBvlmcsd\\fR(8) was compiled):\n\n.IP \"\\fBListen\\fR\"\nThis defines on what combinations of IP addresses and ports vlmcsd should listen. \\fBListen\\fR can be specified more than once. The \\fIargument\\fR has the form \\fIipaddress\\fR[:\\fIport\\fR]. If you omit the \\fIport\\fR, the default port of 1688 is used. If the \\fIipaddress\\fR contains colons and a \\fIport\\fR is used, you must enclose the \\fIipaddress\\fR in brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4 and all IPv6 addresses. See the \\fB-L\\fR option in \\fBvlmcsd\\fR(8) for more info about the syntax. If you use \\fB-L\\fR or \\fB-P\\fR on the command line, all \\fBListen\\fR keywords in the ini file will be ignored. The \\fBListen\\fR keyword cannot be used if vlmcsd has been compiled to use Microsoft RPC (Windows and Cygwin only) or simple sockets.  \n\nExamples:\n\nListen = 192.168.1.123:1688\n.br\nListen = 0.0.0.0:1234\n.br\nListen = [fe80::1721:12ff:fe81:d36b%eth0]:1688\n\n.IP \"\\fBPort\\fR\"\nCan only be used if vlmcsd has been compiled to use simple sockets or on Windows and Cygwin if \\fBvlmcsd\\fR(8) has been compiled to use Microsoft RPC. Otherwise you must use \\fBListen\\fR instead. Causes vlmcsd to listen on that port instead of 1688.\n\n.IP \"\\fBFreeBind\\fR\"\nCan be TRUE or FALSE. If TRUE, you can use the \\fBListen\\fR keyword with IP addresses that are currently not defined on your system. \\fBvlmcsd\\fR(8) will start listening on these IP addresses as soon as they become available. This keyword is only available under Linux and FreeBSD because no other OS currently supports that feature. FreeBSD supports this only for IPv4 and requires the PRIV_NETINET_BINDANY privilege which is normally assigned to proccesses of the root user.\n\n.IP \"\\fBPublicIPProtectionLevel\\fR\"\nSet the level of protection against KMS activations from public IP addresses.\n\n0 = No protection (default)\n.br\n1\\ =\\ Listen on private IP addresses only (plus those specified by one or more \\fBListen\\fR statements)\n.br\n2\\ =\\ Disconnect clients with public IP addresses without activating\n.br\n3\\ =\\ Combines 1 and 2\n\nFor details on public IP protection levels see \\fBvlmcsd\\fR(8) command line option \\fB-o\\fR.\n\n.IP \"\\fBVPN\\fR\"\nHas to be in the form \\fIvpn-adapter-name\\fR[=\\fIipv4-address\\fR][/\\fIcidr-mask\\fR][:\\fIdhcp-lease-duration\\fR].\n\nEnables a compatible VPN adapter to create additional local IPv4 addresses (like 127.0.0.1) that appear as remote IPv4 addresses to the system. This allows product activation using a local instance of vlmcsd. This feature is only available in Windows and Cygwin builds of vlmcsd since it is not of any use on other operating systems. Compatible VPN adapters are Tap-windows version 8.2 or higher (from OpenVPN) and the TeamViewer VPN adapter. There is a special \\fIvpn-adapter-name\\fR. A single period (.) instructs vlmcsd to use the first available compatible VPN adapter. The \\fIvpn-adapter-name\\fR is \\fBnot\\fR case-sensitive. If the \\fIvpn-adapter-name\\fR contains spaces (e.g. Ethernet 3), do \\fBnot\\fR enclose it in quotes.\n\nThe default \\fIipv4-address\\fR is 10.10.10.9 and the default \\fIcidr-mask\\fR is 30. If you are using the default values, your VPN adapter uses an IPv4 address of 10.10.10.9 and you can set your activation client to use the easy to remember address 10.10.10.10 (e.g. slmgr /skms 10.10.10.10 or cscript ospp.vbs /sethst:10.10.10.10).\n\nThe \\fIdhcp-lease-duration\\fR is a number optionally followed by s, m, h, d or w to indicate seconds, minutes, hours, days or weeks. The default \\fIdhcp-lease-duration\\fR is 1d (one day). It is normally not required to change this value.\n\nIt is advised not to manually configure your OpenVPN TAP or TeamViewer VPN adapter in \"Network Connections\". If you set the IPv4 configuration manually anyway, the IPv4 address and the subnet mask must match the \\fBVPN=\\fR directive. It is safe leave the IPv4 configuration to automatic (DHCP). vlmcsd will wait up to four seconds for the DHCP configuration to complete before binding to and listenin on any interfaces.\n\nYou should be aware that only one program can use a VPN adapter at a time. If you use the TeamViewer VPN adapter for example, you will not be able to use the VPN feature of TeamViewer as long as vlmcsd is running. The same applies to OpenVPN TAP adapters that are in use by other programs (for example OpenVPN, QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid conflicts is to install Tap-Windows from OpenVPN, cd to C:\\\\Program Files\\\\TAP-Windows\\\\bin and run addtap.bat to install an additional TAP adapter. Go to \"Network Connections\" and rename the new adapter to \"vlmcsd\" and specify \\fBVPN=vlmcsd\\fR to use it.\n\n.IP \"\\fBExitLevel\"\nCan be either 0 (the default) or 1. Controls under what circumstances vlmcsd will exit. Using the default of \\fB0\\fR vlmcsd stays active as long as it can perform some useful operations. If vlmcsd is run by any form of a watchdog, e.g. NT service manager (Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be desirable to end vlmcsd and let the watchdog restart it. This is especially true if some pre-requisites are not yet met but will be some time later, e.g. network is not yet fully setup.\n\nBy using \\fBExitLevel = 0\\fR vlmcsd will\n\n.RS 12\nexit if none of the listening sockets specified with \\fB-L\\fR can be used. It continues if at least one socket can be setup for listening.\n\nexit any TAP mirror thread (Windows version only) if there is an error condition while reading or writing from or to the VPN adapter but continue to work without utilizing a VPN adapter.\n.RE\n.IP\nBy using \\fBExitLevel = 1\\fR vlmcsd will\n\n.RS 12\nexit if not all listening sockets specified with \\fB-L\\fR can be used.\n\nexit completely if there is a problem with a VPN adapter it is using. This may happen for instance if the VPN adapter has been disabled using \"Control Panel - Network - Adapter Settings\" while vlmcsd is using it.\n\n.RE\n.IP\nPlease note that \\fBExitLevel = 1\\fR is kind of a workaround option. While it may help under some circumstances, it is better to solve the problem at its origin, e.g. properly implementing dependencies in your startup script to ensure all network interfaces and the VPN adapter you will use are completely setup before you start vlmcsd.\n\n.IP \"\\fBUseNDR64\\fR\"\nCan be TRUE or FALSE. Specifies whether you want to use the NDR64 transfer syntax. See options \\fB-n0\\fR and \\fB-n1\\fR in \\fBvlmcsd\\fR(8). The default is TRUE.\n\n.IP \"\\fBUseBTFN\\fR\"\nCan be TRUE or FALSE. Specifies whether you want to use bind time feature negotiation in RPC. See options \\fB-b0\\fR and \\fB-b1\\fR in \\fBvlmcsd\\fR(8). The default is TRUE.\n\n.IP \"\\fBRandomizationLevel\\fR\"\nThe \\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.\n\n.IP \"\\fBLCID\\fR\"\nUse 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.\n\n.IP \"\\fBHostBuild\\fR\"\nUse 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.\n\n.IP \"\\fBMaxWorkers\\fR\"\nThe \\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.\n\n.IP \"\\fBConnectionTimeout\\fR\"\nUsed to control when the vlmcsd disconnects idle TPC connections. The default is 30 seconds. This is the same setting as \\fB-t\\fR on the command line.\n\n.IP \"\\fBDisconnectClientsImmediately\\fR\"\nSet this to TRUE to disconnect a client after it got an activation response regardless whether a timeout has occured or not. The default is FALSE. Setting this to TRUE is non-standard behavior. Use only if you are experiencing DoS or DDoS attacks. On the command line you control this behavior with options \\fB-d\\fR and \\fB-k\\fR.\n\n.IP \"\\fBPidFile\\fR\"\nWrite a pid file. The \\fIargument\\fR is the full pathname of a pid file. The pid file contains is single line containing the process id of the vlmcsd process. It can be used to stop (SIGTERM) or restart (SIGHUP) vlmcsd. This directive can be overriden using \\fB-p\\fR on the command line.\n\n.IP \"\\fBLogFile\\fR\"\nWrite a log file. The \\fIargument\\fR is the full pathname of a log file. On a unixoid OS and with Cygwin you can use the special filename 'syslog' to log to the syslog facility. This is the same as specifying \\fB-l\\fR on the command line.\n\n.IP \"\\fBKmsData\\fR\"\nUse a KMS data file. The \\fIargument\\fR is the full pathname of a KMS data file. By default vlmcsd only contains the minimum product data that is required to perform all operations correctly. You may use a more complete KMS data file that contains all detailed product names. This is especially useful if you are logging KMS requests. If you don't log, there is no need to load an external KMS data file.\n\nYou may use \\fBKmsData\\ =\\ \\-\\fR to prevent the default KMS data file to be loaded.\n\n.IP \"\\fBLogDateAndTime\\fR\"\nCan be TRUE or FALSE. The default is TRUE. If set to FALSE, logging output does not include date and time. This is useful if you log to \\fBstdout\\fR(3) which is redirected to another logging mechanism that already includes date and time in its output, for instance \\fBsystemd-journald\\fR(8). If you log to \\fBsyslog\\fR(3), \\fBLogDateAndTime\\fR is ignored and date and time will never be included in the output sent to \\fBsyslog\\fR(3). Using the command line you control this setting with options \\fB-T0\\fR and \\fB-T1\\fR.\n\n.IP \"\\fBLogVerbose\\fR\"\nSet this to either TRUE or FALSE. The default is FALSE. If set to TRUE, more details of each activation will be logged. You use \\fB-v\\fR and \\fB-q\\fR in the command line to control this setting. \\fBLogVerbose\\fR has an effect only if you specify a log file or redirect logging to \\fBstdout\\fR(3).\n\n.IP \"\\fBWhitelistingLevel\\fR\"\nCan be 0, 1, 2 or 3. The default is 0. Sets the whitelisting level to determine which products vlmcsd activates or refuses.\n\n.RS 12\n\\fB0\\fR: activate all products with an unknown, retail or beta/preview KMS ID.\n.br\n\\fB1\\fR: activate products with a retail or beta/preview KMS ID but refuse to activate products with an unknown KMS ID.\n.br\n\\fB2\\fR: activate products with an unknown KMS ID but refuse products with a retail or beta/preview KMS ID.\n.br\n\\fB3\\fR: activate only products with a known volume license RTM KMS ID and refuse all others.\n.RE\n\n.IP \"\"\nThe SKU ID is not checked. Like a genuine KMS server vlmcsd activates a product that has a random or unknown SKU ID. If you select \\fB1\\fR or \\fB3\\fR, vlmcsd also checks the Application ID for correctness. If Microsoft introduces a new KMS ID for a new product, you cannot activate it if you used \\fB1\\fR or \\fB3\\fR until a new version of vlmcsd is available.\n\n.IP \"\\fBCheckClientTime\\fR\"\nCan be TRUE or FALSE. The default is FALSE. If you set this to TRUE \\fBvlmcsd\\fR(8) checks if the client time differs no more than four hours from the system time. This is useful to prevent emulator detection. A client that tries to detect an emulator could simply send two subsequent request with two time stamps that differ more than four hours from each other. If both requests succeed, the server is an emulator. If you set this to TRUE on a system with no reliable time source, activations will fail. It is ok to set the correct system time after you started \\fBvlmcsd\\fR(8).\n\n.IP \"\\fBMaintainClients\\fR\"\nCan be TRUE or FALSE (the default). Disables (FALSE) or enables (TRUE) maintaining a list of client machine IDs (CMIDs). TRUE is useful to prevent emulator detection. By maintaing a CMID list, \\fBvlmcsd\\fR(8) reports current active clients exactly like a genuine KMS emulator. This includes bug compatibility to the extent that you can permanently kill a genuine KMS emulator by sending an \"overcharge request\" with a required client count of 376 or more and then request activation for 671 clients. \\fBvlmcsd\\fR(8) can be reset from this condition by restarting it. If FALSE is used, \\fBvlmcsd\\fR(8) reports current active clients as good as possible. If no client sends an \"overcharge request\", it is not possible to detect \\fBvlmcsd\\fR(8) as an emulator with \\fBMaintainClients\\fR\\~=\\~FALSE. Maintaining clients requires the allocation of a buffer that is about 50 kB in size. On hardware with few memory resources use it only if you really need it.\n\nIf you start \\fBvlmcsd\\fR(8) from an internet superserver, this setting cannot be used. Since \\fBvlmcsd\\fR(8) exits after each activation, it cannot maintain any state in memory.\n\n.IP \"\\fBStartEmpty\\fR\"\nThis setting is ignored if you do not also specify \\fBMaintainClients\\fR\\~=\\~TRUE. If you specify FALSE (the default), \\fBvlmcsd\\fR(8) starts up as a fully \"charged\" KMS server. Clients activate immediately. \\fBStartEmpty\\fR\\~=\\~TRUE lets you start up \\fBvlmcsd\\fR(8) with an empty CMID list. Activation will start when the required minimum clients (25 for Windows Client OSses, 5 for Windows Server OSses and Office) have registered with the KMS server. As long as the minimum client count has not been reached, clients end up in HRESULT 0xC004F038 \"The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator\". You may use \\fBvlmcs\\fR(1) or another KMS client emulator to \"charge\" \\fBvlmcsd\\fR(8). Setting this parameter to TRUE does not improve emulator detection prevention. It's primary purpose is to help developers of KMS clients to test \"charging\" a KMS server.\n\n.IP \"\\fBActivationInterval\\fR\"\nThis is the same as specifying \\fB-A\\fR on the command line. See \\fBvlmcsd\\fR(8) for details. The default is 2 hours. Example: ActivationInterval\\~=\\~1h\n\n.IP \"\\fBRenewalInterval\\fR\"\nThis is the same as specifying \\fB-R\\fR on the command line. See \\fBvlmcsd\\fR(8) for details. The default is 7 days. Example: RenewalInterval = 3d. Please note that the KMS client decides itself when to renew activation. Even though vlmcsd sends the renewal interval you specify, it is no more than some kind of recommendation to the client. Older KMS clients did follow the recommendation from a KMS server or emulator. Newer clients do not.\n\n.IP \"\\fBUser\\fR\"\nRun vlmcsd as another, preferrably less privileged, user. The \\fIargument\\fR can be a user name or a numeric user id. You must have the required privileges (capabilities on Linux) to change the security context of a process without providing any credentials (a password in most cases). On most unixoid OSses 'root' is the only user who has these privileges in the default configuration. This setting is not available in the native Windows version of vlmcsd. See \\fB-u\\fR in \\fBvlmcsd\\fR(8). This setting cannot be changed on the fly by sending SIGHUP to vlmcsd.\n\n.IP \"\\fBGroup\\fR\"\nRun 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.\n\n.IP \"\\fB<csvlk-name>\\fR\"\nThe \\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.\n\n.SH \"VALID EPIDS\"\nThe 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.\n\nEven if you can use \"Activated by cool hacker guys\" as an ePID, you may wish to use ePIDs that cannot be detected as non-MS ePIDs. If you don't know how these \"valid\" ePIDs look like exactly, do not use GUIDS in vlmcsd.ini. vlmcsd provides internal mechanisms to generate valid ePIDs.\n\nIf you use non-ASCII characters in your ePID (you shouldn't do anyway), these must be in UTF-8 format. This is especially important when you run vlmcsd on Windows or cygwin because UTF-8 is not the default encoding for most editors.\n\nIf you are specifying an optional HWID it follows the same syntax as in the \\fB\\-H\\fR option in \\fBvlmcsd\\fR(8) ecxept that you must not enclose a HWID in quotes even if it contains spaces.\n\n.SH FILES\n.IP \"\\fBvlmcsd.ini\\fR(5)\"\n\n.SH AUTHOR\n\\fBvlmcsd\\fR(8) was written by crony12, Hotbird64 and vityan666. With contributions from DougQaid.\n\n.SH CREDITS\nThanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...\n\n.SH SEE ALSO\n\\fBvlmcsd\\fR(8), \\fBvlmcsd\\fR(7), \\fBvlmcs\\fR(1), \\fBvlmcsdmulti\\fR(1)\n"
  },
  {
    "path": "man/vlmcsdmulti.1",
    "content": ".TH VLMCSDMULTI 1 \"February 2015\" \"Hotbird64\" \"KMS Activation Manual\"\n.LO 1\n\n.SH NAME\nvlmcsdmulti \\- a multi-call binary containing \\fBvlmcs\\fR(1) and \\fBvlmcsd\\fR(8)\n\n.SH SYNOPSIS\n\\fBvlmcsdmulti\\fR vlmcs [ \\fIoptions\\fR ] [ \\fIhostname\\fR|\\fIip-address\\fR[:\\fIport\\fR] ] [ \\fIoptions\\fR ] | vlmcsd [ \\fIoptions\\fR ]\n\n.SH DESCRIPTION\n\\fBvlmcsdmulti\\fR is a multi-call binary that contains \\fBvlmcs\\fR(1) and \\fBvlmcsd\\fR(8) in a single binary. Since both programs share a lot of code and data, the combined binary is significantly smaller than the sum of both files.\n.PP\n\\fBvlmcsdmulti\\fR should not be called directly. Instead you may want to create symbolic links named vlmcs and vlmcsd which point to \\fBvlmcsdmulti\\fR. You then use these links to call the respective program. You may however call \\fBvlmcsdmulti\\fR followed by a complete command line of either \\fBvlmcs\\fR(1) or \\fBvlmcsd\\fR(8).\n.SS Creating symbolic links in unixoid operating systems\ncd to the directory containing \\fBvlmcsdmulti\\fR and type\n.PP\nln -s vlmcsdmulti vlmcsd\n.br\nln -s vlmcsdmulti vlmcs\n.PP\nYou may use a destination directory, e.g.\n.PP\nln -s vlmcsdmulti /usr/local/sbin/vlmcsd\n.br\nln -s vlmcsdmulti /usr/local/bin/vlmcs\n.PP\nEnsure that \\fBvlmcsdmulti\\fR has execute permissions. You can do that by typing \"chmod 755 vlmcsdmulti\". See \\fBchmod\\fR(1) for details.\n.SS Creating symbolic links in Windows (Vista and higher only)\ncd to the directory containing \\fBvlmcsdmulti\\fR and type\n.PP\nmklink vlmcsd.exe vlmcsdmulti.exe\n.br\nmklink vlmcs.exe vlmcsdmulti.exe\n.PP\nYou may use a destination directory, e.g.\n.PP\nmklink C:\\\\tools\\\\vlmcsd.exe vlmcsdmulti.exe\n.br\nmklink C:\\\\tools\\\\vlmcs.exe vlmcsdmulti.exe\n.SS Memory considerations\nWhile you definitely save disk space by using \\fBvlmcsdmulti\\fR you will need more RAM when you run \\fBvlmcsdmulti\\fR as a daemon (KMS server) instead of vlmcsd. You should consider running \\fBvlmcsdmulti\\fR via an internet superserver like \\fBinetd\\fR(8) or \\fBxinetd\\fR(8). \n\n.SH BUGS\n\\fBvlmcsdmulti\\fR has the same bugs as \\fBvlmcs\\fR(1) and \\fBvlmcsd\\fR(8).\n\n.SH AUTHOR\nWritten by Hotbird64\n\n.SH CREDITS\nThanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nosferati87, qad, vityan666, ...\n\n.SH SEE ALSO\n\\fBvlmcs\\fR(1)\\fB, vlmcsd\\fR(8)\\fB, vlmcsd\\fR(7)\n"
  },
  {
    "path": "src/GNUmakefile",
    "content": "################################################################################\n\n.PHONY: clean\n\nPROGRAM_NAME ?= ../bin/vlmcsd\nCLIENT_NAME ?= ../bin/vlmcs\nMULTI_NAME ?= ../bin/vlmcsdmulti\nOBJ_NAME ?= ../build/libkms-static.o\nA_NAME ?= ../lib/libkms.a\nCONFIG ?= config.h\nCOMPILER_LANGUAGE ?= c\n\nBASE_PROGRAM_NAME=$(notdir $(PROGRAM_NAME))\nBASE_CLIENT_NAME=$(notdir $(CLIENT_NAME))\nBASE_MULTI_NAME=$(notdir $(MULTI_NAME))\nBASE_DLL_NAME=$(notdir $(DLL_NAME))\nBASE_A_NAME=$(notdir $(A_NAME))\n\nifeq (1,$(FROM_PARENT))\n\n  CLIENT_NAME_TEST=$(patsubst /%,/,$(CLIENT_NAME))\n  MULTI_NAME_TEST=$(patsubst /%,/,$(MULTI_NAME))\n  DLL_NAME_TEST=$(patsubst /%,/,$(DLL_NAME))\n  A_NAME_TEST=$(patsubst /%,/,$(A_NAME))\n  PROGRAM_NAME_TEST=$(patsubst /%,/,$(PROGRAM_NAME))\n\n  ifneq (/,$(PROGRAM_NAME_TEST))\n    PROGRAM_PREFIX=../\n  endif\n\n  ifneq (/,$(CLIENT_NAME_TEST))\n    CLIENT_PREFIX=../\n  endif\n\n  ifneq (/,$(MULTI_NAME_TEST))\n    MULTI_PREFIX=../\n  endif\n\n  ifneq (/,$(DLL_NAME_TEST))\n    DLL_PREFIX=../\n  endif\n\n  ifneq (/,$(A_NAME_TEST))\n    A_PREFIX=../\n  endif\n\nendif\n\nREAL_PROGRAM_NAME=$(PROGRAM_PREFIX)$(PROGRAM_NAME)\nREAL_CLIENT_NAME=$(CLIENT_PREFIX)$(CLIENT_NAME)\nREAL_MULTI_NAME=$(MULTI_PREFIX)$(MULTI_NAME)\nREAL_DLL_NAME=$(DLL_PREFIX)$(DLL_NAME)\nREAL_A_NAME=$(A_PREFIX)$(A_NAME)\n\n\n# crypto library to use for standard algos, could save ~1-2kb ;)\n# can be either 'openssl', 'polarssl' or anything other for internal impl\nCRYPTO ?= internal\n\n# use DNS_PARSER=internal if your OS doesn't supply the DNS parser routines\nDNS_PARSER ?= OS\n\n# You should supply your own version string here\n\nVLMCSD_VERSION ?= $(shell test -d ../.git && git describe)\n\nFEATURES ?= full\nVERBOSE ?= NO\n\n################################################################################\n\nCC ?= gcc\nTARGETPLATFORM := $(shell LANG=en_US.UTF-8 LANGUAGE=en_US $(CC) -v 2>&1 | grep '^Target: ' | cut -f 2 -d ' ')\n\nifneq (,$(findstring darwin,$(TARGETPLATFORM)))\n  DARWIN := 1\n  UNIX := 1\nendif\n\nifneq (,$(findstring android,$(TARGETPLATFORM)))\n  ANDROID := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring minix,$(TARGETPLATFORM)))\n  MINIX := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring mingw,$(TARGETPLATFORM)))\n  MINGW := 1\n  WIN := 1\n  PE := 1 \nendif\n\nifneq (,$(findstring cygwin,$(TARGETPLATFORM)))\n  CYGWIN := 1\n  WIN := 1\n  PE := 1\nendif\n\nifneq (,$(findstring cygnus,$(TARGETPLATFORM)))\n  CYGWIN := 1\n  WIN := 1\n  PE := 1\nendif\n\nifneq (,$(findstring freebsd,$(TARGETPLATFORM)))\n  FREEBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring netbsd,$(TARGETPLATFORM)))\n  NETBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring openbsd,$(TARGETPLATFORM)))\n  OPENBSD := 1\n  UNIX := 1\n  BSD := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring solaris,$(TARGETPLATFORM)))\n  SOLARIS := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring linux,$(TARGETPLATFORM)))\n  LINUX := 1\n  UNIX := 1\n  ELF := 1\nendif\n\nifneq (,$(findstring gnu,$(TARGETPLATFORM)))\nifeq (,$(findstring linux,$(TARGETPLATFORM)))\n  UNIX := 1\n  HURD := 1\n  ELF := 1\nendif\nendif\n\nifeq ($(CYGWIN),1)\n  DLL_NAME ?= ../lib/cygkms.dll\nelse ifeq ($(WIN),1)\n  DLL_NAME ?= ../lib/libkms.dll\nelse ifeq ($(DARWIN),1)\n  DLL_NAME ?= ../lib/libkms.dylib\nelse\n  DLL_NAME ?= ../lib/libkms.so\nendif\n\nBASECFLAGS = -DVLMCSD_COMPILER=\\\"$(notdir $(CC))\\\" -DVLMCSD_PLATFORM=\\\"$(TARGETPLATFORM)\\\" -DCONFIG=\\\"$(CONFIG)\\\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections\nBASELDFLAGS = \nSTRIPFLAGS =\nCLIENTLDFLAGS =\nSERVERLDFLAGS =\n\nifndef SAFE_MODE\n  BASECFLAGS += -fvisibility=hidden -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants\n  \n  ifeq ($(ELF),1)\n    BASELDFLAGS += -Wl,-z,norelro\n  endif\n\n  ifneq (,$(findstring gcc,$(notdir $(CC))))\n    BASECFLAGS += -flto\n  endif\n\nendif\n\nifeq ($(ELF), 1)\n  PICFLAGS += -fPIC\nendif\n\nifeq ($(NOLIBS),1)\n  NOLRESOLV=1\n  NOLPTHREAD=1\nendif\n\nifneq ($(NOLIBS),1)\n  ifeq ($(MINGW),1)\n    BASELDFLAGS += -lws2_32 -liphlpapi -lshlwapi\n  endif\nendif \n\nifneq ($(NOLIBS),1)\n  ifeq ($(CYGWIN),1)\n    BASELDFLAGS += -liphlpapi\n  endif\nendif \n\nifneq ($(NO_DNS),1)\n  ifneq ($(ANDROID),1)\n  ifneq ($(NOLRESOLV),1)\n\n    ifeq ($(MINGW),1)\n      CLIENTLDFLAGS += -ldnsapi\n    endif\n\n    ifeq ($(LINUX),1)\n      CLIENTLDFLAGS += -lresolv\n    endif\n\n    ifeq ($(HURD),1)\n      CLIENTLDFLAGS += -lresolv\n    endif\n\n    ifeq ($(DARWIN),1)\n      CLIENTLDFLAGS += -lresolv\n    endif\n\n    ifeq ($(CYGWIN),1)\n      DNS_PARSER := internal\n      CLIENTLDFLAGS += -lresolv\n    endif\n\n    ifeq ($(OPENBSD),1)\n      DNS_PARSER := internal\n    endif\n\n    ifeq ($(SOLARIS),1)\n      CLIENTLDFLAGS += -lresolv\n    endif\n\n  endif\n  endif\nelse\n  BASECFLAGS += -DNO_DNS\nendif \n\nifneq ($(CAT),2)\n  BASECFLAGS += \"-Wall\"\nendif  \n\nifeq ($(DARWIN), 1)\n  STRIPFLAGS += -Wl,-S -Wl,-x\n  BASECFLAGS += -Wno-deprecated-declarations\nelse ifeq ($(shell uname), SunOS)\n  STRIPFLAGS += -s\n  ifeq ($(notdir $(LD_ALTEXEC)),gld)\n    BASELDFLAGS += -Wl,--gc-sections\n  endif\n  BASELDFLAGS += -lsocket\nelse\n  ifneq ($(CC),tcc)\n  \tBASELDFLAGS += -Wl,--gc-sections\n  endif\n  STRIPFLAGS += -s\nendif\n\nLIBRARY_CFLAGS = -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT -DNO_STRICT_MODES -DNO_CLIENT_LIST -DNO_TAP -UNO_SOCKETS -USIMPLE_RPC\n\nifeq ($(FEATURES), embedded)\n  BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG -DNO_VERSION_INFORMATION\nelse ifeq ($(FEATURES), autostart)\n  BASECFLAGS += -DNO_HELP -DNO_VERSION_INFORMATION\nelse ifeq ($(FEATURES), minimum)\n  BASECFLAGS += -DSIMPLE_RPC -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION -DNO_PRIVATE_IP_DETECT -DSMALL_AES -DNO_STRICT_MODES -DNO_TAP -DNO_CLIENT_LIST -DUNSAFE_DATA_LOAD -DNO_EXTERNAL_DATA -UFULL_INTERNAL_DATA -U_PEDANTIC\nelse ifeq ($(FEATURES), most)\n  BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT\nelse ifeq ($(FEATURES), inetd)\n  BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT -DNO_VERSION_INFORMATION\nelse ifeq ($(FEATURES), fixedepids)\n  BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE\nendif\n\nifdef INI\n  BASECFLAGS += -DINI_FILE=\\\"$(INI)\\\"\nendif\n\nifdef DATA\n  BASECFLAGS += -DDATA_FILE=\\\"$(DATA)\\\"\nendif\n\nifeq ($(NO_GETIFADDRS), 1)\n  BASECFLAGS += -DNO_GETIFADDRS\nendif\n\nifeq ($(THREADS), 1)\n  BASECFLAGS += -DUSE_THREADS\nendif\n\nifeq ($(CHILD_HANDLER), 1)\n  BASECFLAGS += -DCHILD_HANDLER\nendif\n\nifeq ($(NO_TIMEOUT), 1)\n  BASECFLAGS += -DNO_TIMEOUT\nendif\n\nifdef WINDOWS\n  BASECFLAGS += -DEPID_WINDOWS=\\\"$(WINDOWS)\\\"\nendif\n\nifdef OFFICE2010\n  BASECFLAGS += -DEPID_OFFICE2010=\\\"$(OFFICE2010)\\\"\nendif\n\nifdef OFFICE2013\n  BASECFLAGS += -DEPID_OFFICE2013=\\\"$(OFFICE2013)\\\"\nendif\n\nifdef OFFICE2016\n  BASECFLAGS += -DEPID_OFFICE2016=\\\"$(OFFICE2016)\\\"\nendif\n\nifdef HWID\n  BASECFLAGS += -DHWID=$(HWID)\nendif\n\nifdef TERMINAL_WIDTH\n  BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) -DDISPLAY_WIDTH=\\\"$(TERMINAL_WIDTH)\\\"\nendif\n\nifeq ($(NOPROCFS), 1)\n  BASECFLAGS += -DNO_PROCFS\nendif\n\nifeq ($(AUXV), 1)\n  BASECFLAGS += -DUSE_AUXV\nendif\n\nifneq ($(ANDROID), 1)\nifneq ($(MINIX), 1)\nifneq ($(NOLPTHREAD), 1)\nifneq ($(DARWIN), 1)\n\n  ifeq ($(THREADS), 1)\n    SERVERLDFLAGS += -lpthread\n  endif\n  \n  ifeq (,$(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)))  \n    SERVERLDFLAGS += -lpthread\n  endif\n\nendif\nendif\nendif\nendif\n\n$(REAL_MULTI_NAME): BASECFLAGS += -DMULTI_CALL_BINARY=1\n\nall: $(REAL_CLIENT_NAME) $(REAL_PROGRAM_NAME)\n\nallmulti: $(REAL_CLIENT_NAME) $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME)\n\nvlmcsd: $(REAL_PROGRAM_NAME)\n\t+@true\n\nvlmcs: $(REAL_CLIENT_NAME)\n\t+@true\n\nvlmcsdmulti: $(REAL_MULTI_NAME)\n\t+@true\n\nlibkms: $(REAL_DLL_NAME)\n\t+@true\n\nlibkms-static: $(REAL_A_NAME)\n\nifneq ($(strip $(VLMCSD_VERSION)),)\n  BASECFLAGS += -DVERSION=\\\"$(VLMCSD_VERSION),\\ built\\ $(shell date -u '+%Y-%m-%d %H:%M:%S' | sed -e 's/ /\\\\ /g')\\ UTC\\\" \nendif\n\nifdef CAT\n  BASECFLAGS += -DONE_FILE\nendif\n\nSRCS = crypto.c kms.c endian.c output.c shared_globals.c helpers.c\nHEADERS = $(CONFIG) types.h rpc.h vlmcsd.h endian.h crypto.h kms.h network.h output.h shared_globals.h vlmcs.h helpers.h kmsdata.h\nDEPS = $(patsubst %,../build/%,$(MULTI_SRCS:.c=.d))\n\nVLMCSD_SRCS = vlmcsd.c kmsdata.c $(SRCS)\nVLMCSD_OBJS = $(patsubst %,../build/%,$(VLMCSD_SRCS:.c=.o))\n\nVLMCS_SRCS = vlmcs.c kmsdata-full.c $(SRCS)\nVLMCS_OBJS = $(patsubst %,../build/%,$(VLMCS_SRCS:.c=.o))\n\nMULTI_SRCS = vlmcsd.c vlmcs.c vlmcsdmulti.c kmsdata-full.c $(SRCS)\nMULTI_OBJS = $(patsubst %,../build/%,$(SRCS:.c=.o)) ../build/kmsdata-full.o ../build/vlmcsd-m.o ../build/vlmcs-m.o ../build/vlmcsdmulti-m.o\n\nDLL_SRCS = libkms.c vlmcs.c $(SRCS)\nDLL_OBJS = $(patsubst %,../build/%,$(DLL_SRCS:.c=-l.o))\nA_OBJS = $(patsubst %,../build/%,$(DLL_SRCS:.c=-a.o))\n\nPDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf vlmcsd-floppy.7.pdf\nHTMLDOCS = $(PDFDOCS:.pdf=.html)\nUNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)\nDOSDOCS = $(PDFDOCS:.pdf=.dos.txt)\n\nifneq ($(NO_DNS),1)\n\n  VLMCS_SRCS += dns_srv.c\n  MULTI_SRCS += dns_srv.c\n  MULTI_OBJS += ../build/dns_srv.o\n\nifeq ($(DNS_PARSER),internal)\nifneq ($(MINGW),1)\n  VLMCS_SRCS += ns_parse.c ns_name.c\n  MULTI_SRCS += ns_parse.c ns_name.c\n  MULTI_OBJS += ../build/ns_parse.o ../build/ns_name.o\n  BASECFLAGS += \"-DDNS_PARSER_INTERNAL\"\nendif\nendif\n\nendif\n\nifeq ($(MSRPC),1)\n  VLMCSD_SRCS += msrpc-server.c\n  VLMCS_SRCS += msrpc-client.c\n  MULTI_SRCS += msrpc-server.c msrpc-client.c\n  MULTI_OBJS += ../build/msrpc-server-m.o ../build/msrpc-client-m.o\n  DLL_SRCS += msrpc-server.c\n  BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas\n  BASELDFLAGS += -lrpcrt4\nelse\n  SRCS += network.c rpc.c  \nendif\n\nifeq ($(GETIFADDRS),musl)\nifneq ($(NO_GETIFADDRS),1)\n  BASECFLAGS += -DGETIFADDRS_MUSL\n  VLMCSD_SRCS += getifaddrs-musl.c\n  MULTI_SRCS += getifaddrs-musl.c\n  VLMCS_SRCS += getifaddrs-musl.c\n  DLL_SRCS += getifaddrs-musl.c\n  MULTI_OBJS += ../build/getifaddrs-musl.o\nendif\nendif\n\nifeq ($(ANDROID),1)\nifneq ($(NO_GETIFADDRS),1)\n  VLMCSD_SRCS += ifaddrs-android.c\n  MULTI_SRCS += ifaddrs-android.c\n  DLL_SRCS += ifaddrs-android.c\n  MULTI_OBJS += ../build/ifaddrs-android.o\nendif\nendif\n\nifeq \"$(WIN)\" \"1\"\n\tVLMCSD_SRCS += ntservice.c wintap.c\n\tMULTI_SRCS += ntservice.c wintap.c\n\tMULTI_OBJS += ../build/ntservice.o ../build/wintap.o\nendif\n\nifeq ($(CRYPTO), openssl_with_aes)\n\tBASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL\n\tBASELDFLAGS += -lcrypto\n\tSRCS += crypto_openssl.c\nelse ifeq ($(CRYPTO), openssl_with_aes_soft)\n\tBASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL -D_OPENSSL_SOFTWARE\n\tBASELDFLAGS += -lcrypto\n\tSRCS += crypto_openssl.c\nelse ifeq ($(CRYPTO), openssl)\n\tBASECFLAGS += -D_CRYPTO_OPENSSL\n\tBASELDFLAGS += -lcrypto\n\tSRCS += crypto_openssl.c\nelse ifeq ($(CRYPTO), polarssl)\n\tBASECFLAGS += -D_CRYPTO_POLARSSL\n\tBASELDFLAGS += -lpolarssl\nelse ifeq ($(CRYPTO), windows)\n\tBASECFLAGS += -D_CRYPTO_WINDOWS\n\tSRCS += crypto_windows.c\nelse\n\tBASECFLAGS += -D_CRYPTO_INTERNAL\n\tSRCS += crypto_internal.c\nendif\n\nifneq ($(STRIP),0)\n\tBASELDFLAGS += $(STRIPFLAGS)\nendif\n\nifeq ($(OPENSSL_HMAC),0)\n\tBASECFLAGS += -D_OPENSSL_NO_HMAC\nendif\n\nifeq ($(DEPENDENCIES),2)\n    BASECFLAGS += -MMD\nendif\n\nifeq ($(VERBOSE),3)\n    COMPILER := $(shell printf \"%-40s\" $(notdir $(CC)))\n    ARCHIVER := $(shell printf \"%-40s\" $(notdir $(AR)))\nendif\n\nARCMD := AR\n\nifdef CAT\n    LDCMD := CC/LD\nelse\n    LDCMD := LD    \nendif\n\n-include $(MULTI_SRCS:.c=.d)\n\n../build/%.o: %.c \n  ifeq ($(VERBOSE),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< -o $@\n  ifeq ($(DEPENDENCIES),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@\n  endif\n  else\n\t+@echo \"$(COMPILER)\tCC\t$(notdir $@) <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< -o $@\n  ifeq ($(DEPENDENCIES),1)\n\t+@echo \"$(COMPILER)\tDEP\t$*.d <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@\n  endif\n  endif\n\n../build/%-m.o: %.c\n  ifeq ($(VERBOSE),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@\n  endif\n  else\n\t+@echo \"$(COMPILER)\tCC\t$(notdir $@) <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+@echo \"$(COMPILER)\tDEP\t$*.d <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@\n  endif\n  endif\n\n../build/%-a.o: %.c\n  ifeq ($(VERBOSE),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<\n  endif\n  else\n\t+@echo \"$(COMPILER)\tCC\t$(notdir $@) <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+@echo \"$(COMPILER)\tDEP\t$*.d <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<\n  endif\n  endif\n\n../build/%-l.o: %.c\n  ifeq ($(VERBOSE),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<\n  endif\n  else\n\t+@echo \"$(COMPILER)\tCC\t$(notdir $@) <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -o $@ -c $<\n  ifeq ($(DEPENDENCIES),1)\n\t+@echo \"$(COMPILER)\tDEP\t$*.d <- $<\"\n\t+@$(CC) -x$(COMPILER_LANGUAGE) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC -MM -MF $*.d $<\n  endif\n  endif\n\n\nifdef CAT\n  BUILDCOMMAND = cat $^ | $(CC) -x$(COMPILER_LANGUAGE) -o $@ -\n  VLMCSD_PREREQUISITES = $(VLMCSD_SRCS)\n  VLMCS_PREREQUISITES = $(VLMCS_SRCS)\n  MULTI_PREREQUISITES = $(MULTI_SRCS)\n  DLL_PREREQUISITES = $(DLL_SRCS)\n  OBJ_PREREQUISITES = $(DLL_SRCS)\n  A_PREREQUISITES = $(DLL_SRCS)\nelse\n  BUILDCOMMAND = $(CC) -o $@ $^\n  VLMCSD_PREREQUISITES = $(VLMCSD_OBJS)\n  VLMCS_PREREQUISITES = $(VLMCS_OBJS)\n  MULTI_PREREQUISITES = $(MULTI_OBJS)\n  DLL_PREREQUISITES = $(DLL_OBJS)\n  OBJ_PREREQUISITES = $(A_OBJS)\n  A_PREREQUISITES = $(A_OBJS)\nendif\n\nifeq ($(VERBOSE),1)\n  BUILDCOMMANDPREFIX = +\nelse\n  BUILDCOMMANDPREFIX = +@\nendif\n\nINFOCOMMAND = +@echo \"$(COMPILER)\t$(LDCMD)\t$@ <- $(notdir $^)\"\nARINFOCOMMAND = +@echo \"$(ARCHIVER)\t$(ARCMD)\t$@ <. $(notdir $^)\"\n\nVLMCSD_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS)\nVLMCS_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS)\nMULTI_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS) $(SERVERLDFLAGS)\nDLL_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PICFLAGS) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -shared -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC\nOBJ_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC\n  \n$(REAL_PROGRAM_NAME): $(VLMCSD_PREREQUISITES)\n  ifneq ($(VERBOSE),1)\n\t$(INFOCOMMAND)\n  endif\n\t$(VLMCSD_COMMAND)\n\n$(REAL_CLIENT_NAME): $(VLMCS_PREREQUISITES)\n  ifneq ($(VERBOSE),1)\n\t$(INFOCOMMAND)\n  endif\n\t$(VLMCS_COMMAND)\n\n$(REAL_MULTI_NAME): $(MULTI_PREREQUISITES)\n  ifneq ($(VERBOSE),1)\n\t$(INFOCOMMAND)\n  endif\n\t$(MULTI_COMMAND)\n\n$(REAL_DLL_NAME): $(DLL_PREREQUISITES)\n  ifneq ($(VERBOSE),1)\n\t$(INFOCOMMAND)\n  endif\n\t$(DLL_COMMAND)\n\nifndef CAT\n$(OBJ_NAME):\n\t+@echo Cannot make $@ without CAT defined. Please create $(A_NAME)\nelse\n$(OBJ_NAME): $(OBJ_PREREQUISITES)\n  ifneq ($(VERBOSE),1)\n\t$(INFOCOMMAND)\n  endif\n\t$(OBJ_COMMAND)\nendif\n\nifdef CAT\n$(REAL_A_NAME): $(OBJ_NAME)\nelse\n$(REAL_A_NAME): BASECFLAGS += -fvisibility=hidden -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC\n$(REAL_A_NAME): $(A_OBJS)\nendif\n  ifneq ($(VERBOSE),1)\n\t$(ARINFOCOMMAND)\n  endif\n\t+@rm -f $@\n\t$(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^\n\nclean:\n\trm -f $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME) $(REAL_DLL_NAME) $(REAL_CLIENT_NAME)  $(OBJ_NAME) $(REAL_A_NAME) ../bin/* ../build/* *.d\n\ndnsclean:\n\trm -f ../build/dns_srv.o\n\nhelp:\n\t@echo \"Help is available by typing 'make help' in directory $(shell realpath `pwd`/..). Use 'cd ..' to get there.\"\n"
  },
  {
    "path": "src/KMSServer.idl",
    "content": "[\r\n   uuid(51C82175-844E-4750-B0D8-EC255555BC06),\r\n   version(1.0),\r\n]\r\ninterface KMSServer\r\n{\r\n    int RequestActivation\r\n\t(\r\n\t\t[in] int requestSize, \r\n\t\t[in, size_is(requestSize)] unsigned char* request, \r\n\t\t[out] int* responseSize, \r\n\t\t[out, size_is( , *responseSize)] unsigned char** response\r\n\t);\r\n}"
  },
  {
    "path": "src/KMSServer_c_mingw_gcc.c",
    "content": "\r\n\r\n/* this ALWAYS GENERATED file contains the RPC client stubs */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0595 */\r\n/* at Thu Oct 18 15:24:14 2012\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595 \r\n    protocol : dce , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if !defined(_M_IA64) && !defined(_M_AMD64) && !defined(_ARM_)\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n#if _MSC_VER >= 1200\r\n#pragma warning(push)\r\n#endif\r\n\r\n#pragma warning( disable: 4211 )  /* redefine extern to static */\r\n#pragma warning( disable: 4232 )  /* dllimport identity*/\r\n#pragma warning( disable: 4024 )  /* array to pointer mapping*/\r\n#pragma warning( disable: 4100 ) /* unreferenced arguments in x86 call */\r\n\r\n#pragma optimize(\"\", off ) \r\n\r\n#include <string.h>\r\n\r\n#include \"KMSServer_h.h\"\r\n\r\n#define TYPE_FORMAT_STRING_SIZE   43                                \r\n#define PROC_FORMAT_STRING_SIZE   59                                \r\n#define EXPR_FORMAT_STRING_SIZE   1                                 \r\n#define TRANSMIT_AS_TABLE_SIZE    0            \r\n#define WIRE_MARSHAL_TABLE_SIZE   0            \r\n\r\n#if !MULTI_CALL_BINARY\r\n\r\ntypedef struct _KMSServer_MIDL_TYPE_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_TYPE_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_PROC_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_PROC_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_EXPR_FORMAT_STRING\r\n    {\r\n    long          Pad;\r\n    unsigned char  Format[ EXPR_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_EXPR_FORMAT_STRING;\r\n\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax = \r\n{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};\r\n\r\n\r\nextern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;\r\nextern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;\r\nextern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;\r\n\r\n#endif // !MULTI_CALL_BINARY\r\n\r\n#define GENERIC_BINDING_TABLE_SIZE   0            \r\n\r\n\r\n/* Standard interface: KMSServer, ver. 1.0,\r\n   GUID={0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}} */\r\n\r\n\r\n\r\nstatic const RPC_CLIENT_INTERFACE KMSServer___RpcClientInterface =\r\n    {\r\n    sizeof(RPC_CLIENT_INTERFACE),\r\n    {{0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}},{1,0}},\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    0x00000000\r\n    };\r\nRPC_IF_HANDLE KMSServer_v1_0_c_ifspec = (RPC_IF_HANDLE)& KMSServer___RpcClientInterface;\r\n\r\nextern const MIDL_STUB_DESC KMSServer_StubDesc;\r\n\r\nstatic RPC_BINDING_HANDLE KMSServer__MIDL_AutoBindHandle;\r\n\r\n\r\nint RequestActivation( \r\n    /* [in] */ handle_t IDL_handle,\r\n    /* [in] */ int requestSize,\r\n    /* [size_is][in] */ unsigned char *request,\r\n    /* [out] */ int *responseSize,\r\n    /* [size_is][size_is][out] */ unsigned char **response)\r\n{\r\n\r\n    CLIENT_CALL_RETURN _RetVal;\r\n\r\n    _RetVal = NdrClientCall2(\r\n                  ( PMIDL_STUB_DESC  )&KMSServer_StubDesc,\r\n                  (PFORMAT_STRING) &KMSServer__MIDL_ProcFormatString.Format[0],\r\n                  ( unsigned char * )&IDL_handle);\r\n    return ( int  )_RetVal.Simple;\r\n    \r\n}\r\n\r\n\r\n#if !defined(__RPC_WIN32__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n#if !(TARGET_IS_NT50_OR_LATER)\r\n#error You need Windows 2000 or later to run this stub because it uses these features:\r\n#error   /robust command line switch.\r\n#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.\r\n#error This app will fail with the RPC_X_WRONG_STUB_VERSION error.\r\n#endif\r\n\r\n#if !MULTI_CALL_BINARY\r\n/*static*/ const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString =\r\n    {\r\n        0,\r\n        {\r\n\r\n\t/* Procedure RequestActivation */\r\n\r\n\t\t\t0x0,\t\t/* 0 */\r\n\t\t\t0x48,\t\t/* Old Flags:  */\r\n/*  2 */\tNdrFcLong( 0x0 ),\t/* 0 */\r\n/*  6 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x18 ),\t/* x86 Stack size/offset = 24 */\r\n/* 10 */\t0x32,\t\t/* FC_BIND_PRIMITIVE */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 12 */\tNdrFcShort( 0x0 ),\t/* x86 Stack size/offset = 0 */\r\n/* 14 */\tNdrFcShort( 0x8 ),\t/* 8 */\r\n/* 16 */\tNdrFcShort( 0x24 ),\t/* 36 */\r\n/* 18 */\t0x47,\t\t/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */\r\n\t\t\t0x5,\t\t/* 5 */\r\n/* 20 */\t0x8,\t\t/* 8 */\r\n\t\t\t0x7,\t\t/* Ext Flags:  new corr desc, clt corr check, srv corr check, */\r\n/* 22 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 24 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 26 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n\r\n\t/* Parameter IDL_handle */\r\n\r\n/* 28 */\tNdrFcShort( 0x48 ),\t/* Flags:  in, base type, */\r\n/* 30 */\tNdrFcShort( 0x4 ),\t/* x86 Stack size/offset = 4 */\r\n/* 32 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter requestSize */\r\n\r\n/* 34 */\tNdrFcShort( 0x10b ),\t/* Flags:  must size, must free, in, simple ref, */\r\n/* 36 */\tNdrFcShort( 0x8 ),\t/* x86 Stack size/offset = 8 */\r\n/* 38 */\tNdrFcShort( 0x6 ),\t/* Type Offset=6 */\r\n\r\n\t/* Parameter request */\r\n\r\n/* 40 */\tNdrFcShort( 0x2150 ),\t/* Flags:  out, base type, simple ref, srv alloc size=8 */\r\n/* 42 */\tNdrFcShort( 0xc ),\t/* x86 Stack size/offset = 12 */\r\n/* 44 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter responseSize */\r\n\r\n/* 46 */\tNdrFcShort( 0x2013 ),\t/* Flags:  must size, must free, out, srv alloc size=8 */\r\n/* 48 */\tNdrFcShort( 0x10 ),\t/* x86 Stack size/offset = 16 */\r\n/* 50 */\tNdrFcShort( 0x16 ),\t/* Type Offset=22 */\r\n\r\n\t/* Parameter response */\r\n\r\n/* 52 */\tNdrFcShort( 0x70 ),\t/* Flags:  out, return, base type, */\r\n/* 54 */\tNdrFcShort( 0x14 ),\t/* x86 Stack size/offset = 20 */\r\n/* 56 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\n/*static*/ const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString =\r\n    {\r\n        0,\r\n        {\r\n\t\t\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  2 */\t\r\n\t\t\t0x11, 0x0,\t/* FC_RP */\r\n/*  4 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (6) */\r\n/*  6 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 10 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x0,\t\t/*  */\r\n/* 12 */\tNdrFcShort( 0x4 ),\t/* x86 Stack size/offset = 4 */\r\n/* 14 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 16 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n/* 18 */\t\r\n\t\t\t0x11, 0xc,\t/* FC_RP [alloced_on_stack] [simple_pointer] */\r\n/* 20 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x5c,\t\t/* FC_PAD */\r\n/* 22 */\t\r\n\t\t\t0x11, 0x14,\t/* FC_RP [alloced_on_stack] [pointer_deref] */\r\n/* 24 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (26) */\r\n/* 26 */\t\r\n\t\t\t0x12, 0x0,\t/* FC_UP */\r\n/* 28 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (30) */\r\n/* 30 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 32 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 34 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x54,\t\t/* FC_DEREFERENCE */\r\n/* 36 */\tNdrFcShort( 0xc ),\t/* x86 Stack size/offset = 12 */\r\n/* 38 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 40 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\nstatic const unsigned short KMSServer_FormatStringOffsetTable[] =\r\n    {\r\n    0\r\n    };\r\n\r\n//typedef void *(__RPC_API midl_user_allocate_t)(size_t);\r\ntypedef void *(__RPC_API *midl_allocate_t)(size_t);\r\n\r\n/*static*/ const MIDL_STUB_DESC KMSServer_StubDesc =\r\n    {\r\n    (void *)& KMSServer___RpcClientInterface,\r\n    (midl_allocate_t)MIDL_user_allocate,\r\n    MIDL_user_free,\r\n    &KMSServer__MIDL_AutoBindHandle,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    1, /* -error bounds_check flag */\r\n    0x50002, /* Ndr library version */\r\n    0,\r\n    0x8000253, /* MIDL Version 8.0.595 */\r\n    0,\r\n    0,\r\n    0,  /* notify & notify_flag routine table */\r\n    0x1, /* MIDL flag */\r\n    0, /* cs routines */\r\n    0,   /* proxy/server info */\r\n    0\r\n    };\r\n\r\n#endif // !MULTI_CALL_BINARY\r\n\r\n#pragma optimize(\"\", on )\r\n#if _MSC_VER >= 1200\r\n#pragma warning(pop)\r\n#endif\r\n\r\n\r\n#endif /* !defined(_M_IA64) && !defined(_M_AMD64) && !defined(_ARM_) */\r\n\r\n"
  },
  {
    "path": "src/KMSServer_c_x64_mingw_gcc.c",
    "content": "\r\n\r\n/* this ALWAYS GENERATED file contains the RPC client stubs */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0603 */\r\n/* at Fri Feb 20 04:17:07 2015\r\n * modified by Hotbird64 to work with MingW-w64 and gcc\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.00.0603 \r\n    protocol : all , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if defined(_M_AMD64)\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n#if _MSC_VER >= 1200\r\n#pragma warning(push)\r\n#endif\r\n\r\n#pragma warning( disable: 4211 )  /* redefine extern to static */\r\n#pragma warning( disable: 4232 )  /* dllimport identity*/\r\n#pragma warning( disable: 4024 )  /* array to pointer mapping*/\r\n\r\n#include <string.h>\r\n\r\n#include \"KMSServer_h.h\"\r\n\r\n#if !MULTI_CALL_BINARY\r\n\r\n#define TYPE_FORMAT_STRING_SIZE   43                                \r\n#define PROC_FORMAT_STRING_SIZE   61                                \r\n#define EXPR_FORMAT_STRING_SIZE   1                                 \r\n#define TRANSMIT_AS_TABLE_SIZE    0            \r\n#define WIRE_MARSHAL_TABLE_SIZE   0            \r\n\r\ntypedef struct _KMSServer_MIDL_TYPE_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_TYPE_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_PROC_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_PROC_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_EXPR_FORMAT_STRING\r\n    {\r\n    long          Pad;\r\n    unsigned char  Format[ EXPR_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_EXPR_FORMAT_STRING;\r\n\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax = \r\n{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _NDR64_RpcTransferSyntax = \r\n{{0x71710533,0xbeba,0x4937,{0x83,0x19,0xb5,0xdb,0xef,0x9c,0xcc,0x36}},{1,0}};\r\n\r\n\r\n\r\nextern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;\r\nextern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;\r\nextern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;\r\n\r\n#endif // !MULTI_CALL_BINARY\r\n\r\n#define GENERIC_BINDING_TABLE_SIZE   0            \r\n\r\n\r\n/* Standard interface: KMSServer, ver. 1.0,\r\n   GUID={0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}} */\r\n\r\n extern const MIDL_STUBLESS_PROXY_INFO KMSServer_ProxyInfo;\r\n\r\n\r\nstatic const RPC_CLIENT_INTERFACE KMSServer___RpcClientInterface =\r\n    {\r\n    sizeof(RPC_CLIENT_INTERFACE),\r\n    {{0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}},{1,0}},\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    &KMSServer_ProxyInfo,\r\n    0x02000000\r\n    };\r\nRPC_IF_HANDLE KMSServer_v1_0_c_ifspec = (RPC_IF_HANDLE)& KMSServer___RpcClientInterface;\r\n\r\nextern const MIDL_STUB_DESC KMSServer_StubDesc;\r\n\r\nstatic RPC_BINDING_HANDLE KMSServer__MIDL_AutoBindHandle;\r\n\r\n\r\nint RequestActivation( \r\n    /* [in] */ handle_t IDL_handle,\r\n    /* [in] */ int requestSize,\r\n    /* [size_is][in] */ unsigned char *request,\r\n    /* [out] */ int *responseSize,\r\n    /* [size_is][size_is][out] */ unsigned char **response)\r\n{\r\n\r\n    CLIENT_CALL_RETURN _RetVal;\r\n\r\n    _RetVal = NdrClientCall3(\r\n                  ( PMIDL_STUBLESS_PROXY_INFO  )&KMSServer_ProxyInfo,\r\n                  0,\r\n                  0,\r\n                  IDL_handle,\r\n                  requestSize,\r\n                  request,\r\n                  responseSize,\r\n                  response);\r\n    return ( int  )_RetVal.Simple;\r\n    \r\n}\r\n\r\n\r\n#if !defined(__RPC_WIN64__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n#if !MULTI_CALL_BINARY\r\n/*static*/ const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString =\r\n    {\r\n        0,\r\n        {\r\n\r\n\t/* Procedure RequestActivation */\r\n\r\n\t\t\t0x0,\t\t/* 0 */\r\n\t\t\t0x48,\t\t/* Old Flags:  */\r\n/*  2 */\tNdrFcLong( 0x0 ),\t/* 0 */\r\n/*  6 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x30 ),\t/* X64 Stack size/offset = 48 */\r\n/* 10 */\t0x32,\t\t/* FC_BIND_PRIMITIVE */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 12 */\tNdrFcShort( 0x0 ),\t/* X64 Stack size/offset = 0 */\r\n/* 14 */\tNdrFcShort( 0x8 ),\t/* 8 */\r\n/* 16 */\tNdrFcShort( 0x24 ),\t/* 36 */\r\n/* 18 */\t0x47,\t\t/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */\r\n\t\t\t0x5,\t\t/* 5 */\r\n/* 20 */\t0xa,\t\t/* 10 */\r\n\t\t\t0x7,\t\t/* Ext Flags:  new corr desc, clt corr check, srv corr check, */\r\n/* 22 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 24 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 26 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/* 28 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n\r\n\t/* Parameter IDL_handle */\r\n\r\n/* 30 */\tNdrFcShort( 0x48 ),\t/* Flags:  in, base type, */\r\n/* 32 */\tNdrFcShort( 0x8 ),\t/* X64 Stack size/offset = 8 */\r\n/* 34 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter requestSize */\r\n\r\n/* 36 */\tNdrFcShort( 0x10b ),\t/* Flags:  must size, must free, in, simple ref, */\r\n/* 38 */\tNdrFcShort( 0x10 ),\t/* X64 Stack size/offset = 16 */\r\n/* 40 */\tNdrFcShort( 0x6 ),\t/* Type Offset=6 */\r\n\r\n\t/* Parameter request */\r\n\r\n/* 42 */\tNdrFcShort( 0x2150 ),\t/* Flags:  out, base type, simple ref, srv alloc size=8 */\r\n/* 44 */\tNdrFcShort( 0x18 ),\t/* X64 Stack size/offset = 24 */\r\n/* 46 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter responseSize */\r\n\r\n/* 48 */\tNdrFcShort( 0x2013 ),\t/* Flags:  must size, must free, out, srv alloc size=8 */\r\n/* 50 */\tNdrFcShort( 0x20 ),\t/* X64 Stack size/offset = 32 */\r\n/* 52 */\tNdrFcShort( 0x16 ),\t/* Type Offset=22 */\r\n\r\n\t/* Parameter response */\r\n\r\n/* 54 */\tNdrFcShort( 0x70 ),\t/* Flags:  out, return, base type, */\r\n/* 56 */\tNdrFcShort( 0x28 ),\t/* X64 Stack size/offset = 40 */\r\n/* 58 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\n/*static*/ const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString =\r\n    {\r\n        0,\r\n        {\r\n\t\t\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  2 */\t\r\n\t\t\t0x11, 0x0,\t/* FC_RP */\r\n/*  4 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (6) */\r\n/*  6 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 10 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x0,\t\t/*  */\r\n/* 12 */\tNdrFcShort( 0x8 ),\t/* X64 Stack size/offset = 8 */\r\n/* 14 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 16 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n/* 18 */\t\r\n\t\t\t0x11, 0xc,\t/* FC_RP [alloced_on_stack] [simple_pointer] */\r\n/* 20 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x5c,\t\t/* FC_PAD */\r\n/* 22 */\t\r\n\t\t\t0x11, 0x14,\t/* FC_RP [alloced_on_stack] [pointer_deref] */\r\n/* 24 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (26) */\r\n/* 26 */\t\r\n\t\t\t0x12, 0x0,\t/* FC_UP */\r\n/* 28 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (30) */\r\n/* 30 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 32 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 34 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x54,\t\t/* FC_DEREFERENCE */\r\n/* 36 */\tNdrFcShort( 0x18 ),\t/* X64 Stack size/offset = 24 */\r\n/* 38 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 40 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\nstatic const unsigned short KMSServer_FormatStringOffsetTable[] =\r\n    {\r\n    0\r\n    };\r\n\r\n#endif //!MULTI_CALL_BINARY\r\n\r\n#endif /* defined(_M_AMD64)*/\r\n\r\n\r\n\r\n/* this ALWAYS GENERATED file contains the RPC client stubs */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0603 */\r\n/* at Fri Feb 20 04:17:07 2015\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.00.0603 \r\n    protocol : all , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if defined(_M_AMD64)\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n\r\n\r\n#if !defined(__RPC_WIN64__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n\r\n#include \"ndr64types.h\"\r\n#include \"pshpack8.h\"\r\n\r\n#if !MULTI_CALL_BINARY\r\n\r\ntypedef \r\nstruct \r\n{\r\n    NDR64_FORMAT_UINT32 frag1;\r\n    struct _NDR64_EXPR_OPERATOR frag2;\r\n    struct _NDR64_EXPR_VAR frag3;\r\n}\r\n__midl_frag13_t;\r\n\r\nextern const __midl_frag13_t __midl_frag13;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_CONF_ARRAY_HEADER_FORMAT frag1;\r\n    struct _NDR64_ARRAY_ELEMENT_INFO frag2;\r\n}\r\n__midl_frag12_t;\r\nextern const __midl_frag12_t __midl_frag12;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag11_t;\r\nextern const __midl_frag11_t __midl_frag11;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag10_t;\r\nextern const __midl_frag10_t __midl_frag10;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag8_t;\r\nextern const __midl_frag8_t __midl_frag8;\r\n\r\ntypedef \r\nNDR64_FORMAT_CHAR\r\n__midl_frag7_t;\r\nextern const __midl_frag7_t __midl_frag7;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    NDR64_FORMAT_UINT32 frag1;\r\n    struct _NDR64_EXPR_VAR frag2;\r\n}\r\n__midl_frag6_t;\r\nextern const __midl_frag6_t __midl_frag6;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_CONF_ARRAY_HEADER_FORMAT frag1;\r\n    struct _NDR64_ARRAY_ELEMENT_INFO frag2;\r\n}\r\n__midl_frag5_t;\r\nextern const __midl_frag5_t __midl_frag5;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag4_t;\r\nextern const __midl_frag4_t __midl_frag4;\r\n\r\ntypedef \r\nNDR64_FORMAT_CHAR\r\n__midl_frag3_t;\r\nextern const __midl_frag3_t __midl_frag3;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_PROC_FORMAT frag1;\r\n    struct _NDR64_BIND_AND_NOTIFY_EXTENSION frag2;\r\n    struct _NDR64_PARAM_FORMAT frag3;\r\n    struct _NDR64_PARAM_FORMAT frag4;\r\n    struct _NDR64_PARAM_FORMAT frag5;\r\n    struct _NDR64_PARAM_FORMAT frag6;\r\n    struct _NDR64_PARAM_FORMAT frag7;\r\n}\r\n__midl_frag2_t;\r\nextern const __midl_frag2_t __midl_frag2;\r\n\r\ntypedef \r\nNDR64_FORMAT_UINT32\r\n__midl_frag1_t;\r\nextern const __midl_frag1_t __midl_frag1;\r\n\r\n/*static*/ const __midl_frag13_t __midl_frag13 =\r\n{ \r\n/*  */\r\n    (NDR64_UINT32) 1 /* 0x1 */,\r\n    { \r\n    /* struct _NDR64_EXPR_OPERATOR */\r\n        0x4,    /* FC_EXPR_OPER */\r\n        0x5,    /* OP_UNARY_INDIRECTION */\r\n        0x5,    /* FC64_INT32 */\r\n        (NDR64_UINT8) 0 /* 0x0 */\r\n    },\r\n    { \r\n    /* struct _NDR64_EXPR_VAR */\r\n        0x3,    /* FC_EXPR_VAR */\r\n        0x7,    /* FC64_INT64 */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 24 /* 0x18 */  /* Offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag12_t __midl_frag12 =\r\n{ \r\n/* *char */\r\n    { \r\n    /* *char */\r\n        0x41,    /* FC64_CONF_ARRAY */\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        { \r\n        /* *char */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0\r\n        },\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag13\r\n    },\r\n    { \r\n    /* struct _NDR64_ARRAY_ELEMENT_INFO */\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag7\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag11_t __midl_frag11 =\r\n{ \r\n/* *char */\r\n    0x21,    /* FC64_UP */\r\n    (NDR64_UINT8) 0 /* 0x0 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag12\r\n};\r\n\r\n/*static*/ const __midl_frag10_t __midl_frag10 =\r\n{ \r\n/* **char */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 20 /* 0x14 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag11\r\n};\r\n\r\n/*static*/ const __midl_frag8_t __midl_frag8 =\r\n{ \r\n/* *int */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 12 /* 0xc */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag3\r\n};\r\n\r\n/*static*/ const __midl_frag7_t __midl_frag7 =\r\n0x10    /* FC64_CHAR */;\r\n\r\n/*static*/ const __midl_frag6_t __midl_frag6 =\r\n{ \r\n/*  */\r\n    (NDR64_UINT32) 1 /* 0x1 */,\r\n    { \r\n    /* struct _NDR64_EXPR_VAR */\r\n        0x3,    /* FC_EXPR_VAR */\r\n        0x5,    /* FC64_INT32 */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 8 /* 0x8 */  /* Offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag5_t __midl_frag5 =\r\n{ \r\n/* *char */\r\n    { \r\n    /* *char */\r\n        0x41,    /* FC64_CONF_ARRAY */\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        { \r\n        /* *char */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0\r\n        },\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag6\r\n    },\r\n    { \r\n    /* struct _NDR64_ARRAY_ELEMENT_INFO */\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag7\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag4_t __midl_frag4 =\r\n{ \r\n/* *char */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 0 /* 0x0 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag5\r\n};\r\n\r\n/*static*/ const __midl_frag3_t __midl_frag3 =\r\n0x5    /* FC64_INT32 */;\r\n\r\n/*static*/ const __midl_frag2_t __midl_frag2 =\r\n{ \r\n/* RequestActivation */\r\n    { \r\n    /* RequestActivation */      /* procedure RequestActivation */\r\n        (NDR64_UINT32) 23986240 /* 0x16e0040 */,    /* explicit handle */ /* IsIntrepreted, ServerMustSize, ClientMustSize, HasReturn, ServerCorrelation, ClientCorrelation, HasExtensions */\r\n        (NDR64_UINT32) 48 /* 0x30 */ ,  /* Stack size */\r\n        (NDR64_UINT32) 8 /* 0x8 */,\r\n        (NDR64_UINT32) 40 /* 0x28 */,\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT16) 5 /* 0x5 */,\r\n        (NDR64_UINT16) 8 /* 0x8 */\r\n    },\r\n    { \r\n    /* struct _NDR64_BIND_AND_NOTIFY_EXTENSION */\r\n        { \r\n        /* struct _NDR64_BIND_AND_NOTIFY_EXTENSION */\r\n            0x72,    /* FC64_BIND_PRIMITIVE */\r\n            (NDR64_UINT8) 0 /* 0x0 */,\r\n            0 /* 0x0 */,   /* Stack offset */\r\n            (NDR64_UINT8) 0 /* 0x0 */,\r\n            (NDR64_UINT8) 0 /* 0x0 */\r\n        },\r\n        (NDR64_UINT16) 0 /* 0x0 */      /* Notify index */\r\n    },\r\n    { \r\n    /* requestSize */      /* parameter requestSize */\r\n        &__midl_frag3,\r\n        { \r\n        /* requestSize */\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* [in], Basetype, ByValue */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        8 /* 0x8 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* request */      /* parameter request */\r\n        &__midl_frag5,\r\n        { \r\n        /* request */\r\n            1,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* MustSize, MustFree, [in], SimpleRef */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        16 /* 0x10 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* responseSize */      /* parameter responseSize */\r\n        &__midl_frag3,\r\n        { \r\n        /* responseSize */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            1\r\n        },    /* [out], Basetype, SimpleRef, UseCache */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        24 /* 0x18 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* response */      /* parameter response */\r\n        &__midl_frag10,\r\n        { \r\n        /* response */\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            1\r\n        },    /* MustSize, MustFree, [out], UseCache */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        32 /* 0x20 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* int */      /* parameter int */\r\n        &__midl_frag3,\r\n        { \r\n        /* int */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            1,\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* [out], IsReturn, Basetype, ByValue */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        40 /* 0x28 */,   /* Stack offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag1_t __midl_frag1 =\r\n(NDR64_UINT32) 0 /* 0x0 */;\r\n\r\n#endif // !MULTI_CALL_BINARY\r\n\r\n#include \"poppack.h\"\r\n\r\n#if !MULTI_CALL_BINARY\r\n\r\nstatic const FormatInfoRef KMSServer_Ndr64ProcTable[] =\r\n    {\r\n    &__midl_frag2\r\n    };\r\n\r\n//typedef void *__RPC_USER MIDL_user_allocate_t(SIZE_T)\r\ntypedef void *(__RPC_API *midl_allocate_t)(size_t);\r\n\r\n/*static*/ const MIDL_STUB_DESC KMSServer_StubDesc =\r\n    {\r\n    (void *)& KMSServer___RpcClientInterface,\r\n    (midl_allocate_t)MIDL_user_allocate,\r\n    MIDL_user_free,\r\n    &KMSServer__MIDL_AutoBindHandle,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    1, /* -error bounds_check flag */\r\n    0x60000, /* Ndr library version */\r\n    0,\r\n    0x800025b, /* MIDL Version 8.0.603 */\r\n    0,\r\n    0,\r\n    0,  /* notify & notify_flag routine table */\r\n    0x2000001, /* MIDL flag */\r\n    0, /* cs routines */\r\n    (void *)& KMSServer_ProxyInfo,   /* proxy/server info */\r\n    0\r\n    };\r\n\r\nstatic const MIDL_SYNTAX_INFO KMSServer_SyntaxInfo [  2 ] = \r\n    {\r\n    {\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    0,\r\n    KMSServer__MIDL_ProcFormatString.Format,\r\n    KMSServer_FormatStringOffsetTable,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    0,\r\n    0,\r\n    0\r\n    }\r\n    ,{\r\n    {{0x71710533,0xbeba,0x4937,{0x83,0x19,0xb5,0xdb,0xef,0x9c,0xcc,0x36}},{1,0}},\r\n    0,\r\n    0 ,\r\n    (unsigned short *) KMSServer_Ndr64ProcTable,\r\n    0,\r\n    0,\r\n    0,\r\n    0\r\n    }\r\n    };\r\n\r\n#endif // !MULTI_CALL_BINARY\r\n\r\n/*static*/ const MIDL_STUBLESS_PROXY_INFO KMSServer_ProxyInfo =\r\n    {\r\n    &KMSServer_StubDesc,\r\n    KMSServer__MIDL_ProcFormatString.Format,\r\n    KMSServer_FormatStringOffsetTable,\r\n    (RPC_SYNTAX_IDENTIFIER*)&_RpcTransferSyntax,\r\n    2,\r\n    (MIDL_SYNTAX_INFO*)KMSServer_SyntaxInfo\r\n    \r\n    };\r\n\r\n#if _MSC_VER >= 1200\r\n#pragma warning(pop)\r\n#endif\r\n\r\n\r\n#endif /* defined(_M_AMD64)*/\r\n\r\n"
  },
  {
    "path": "src/KMSServer_h.h",
    "content": "\r\n\r\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\r\n\r\n/* Modified by Hotbird64 for use with MingW and gcc */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0595 */\r\n/* at Thu Oct 18 15:24:14 2012\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595 \r\n    protocol : dce , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if _WIN32\r\n#include \"winsock2.h\"\r\n#endif\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n\r\n\r\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\r\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\r\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\r\n#endif\r\n\r\n//#include \"rpc.h\"\r\n#include \"rpcndr.h\"\r\n\r\n#ifndef __RPCNDR_H_VERSION__\r\n#error this stub requires an updated version of <rpcndr.h>\r\n#endif // __RPCNDR_H_VERSION__\r\n\r\n\r\n#ifndef __KMSServer_h_h__\r\n#define __KMSServer_h_h__\r\n\r\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r\n#pragma once\r\n#endif\r\n\r\n/* Forward Declarations */ \r\n\r\n#ifdef __cplusplus\r\nextern \"C\"{\r\n#endif \r\n\r\n\r\n#ifndef __KMSServer_INTERFACE_DEFINED__\r\n#define __KMSServer_INTERFACE_DEFINED__\r\n\r\n/* interface KMSServer */\r\n/* [version][uuid] */ \r\n\r\nint RequestActivation( \r\n    /* [in] */ handle_t IDL_handle,\r\n    /* [in] */ int requestSize,\r\n    /* [size_is][in] */ unsigned char *request,\r\n    /* [out] */ int *responseSize,\r\n    /* [size_is][size_is][out] */ unsigned char **response);\r\n\r\n\r\n\r\nextern RPC_IF_HANDLE KMSServer_v1_0_c_ifspec;\r\nextern RPC_IF_HANDLE KMSServer_v1_0_s_ifspec;\r\n#endif /* __KMSServer_INTERFACE_DEFINED__ */\r\n\r\n/* Additional Prototypes for ALL interfaces */\r\n\r\n/* end of Additional Prototypes */\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n\r\n"
  },
  {
    "path": "src/KMSServer_s2_mingw_gcc.c",
    "content": "\r\n\r\n/* this ALWAYS GENERATED file contains the RPC server stubs */\r\n\r\n/* WARNING! manually edited by Hotbird64 to work with MingW */\r\n\r\n /* File created by MIDL compiler version 8.00.0595 */\r\n/* at Thu Oct 18 15:24:14 2012\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595 \r\n    protocol : dce , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if !defined(_M_IA64) && !defined(_M_AMD64) && !defined(_ARM_)\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n#if _MSC_VER >= 1200\r\n#pragma warning(push)\r\n#endif\r\n\r\n#pragma warning( disable: 4211 )  /* redefine extern to static */\r\n#pragma warning( disable: 4232 )  /* dllimport identity*/\r\n#pragma warning( disable: 4024 )  /* array to pointer mapping*/\r\n#pragma warning( disable: 4100 ) /* unreferenced arguments in x86 call */\r\n\r\n#pragma optimize(\"\", off ) \r\n\r\n#include <string.h>\r\n#include \"KMSServer_h.h\"\r\n\r\n#define TYPE_FORMAT_STRING_SIZE   43                                \r\n#define PROC_FORMAT_STRING_SIZE   59                                \r\n#define EXPR_FORMAT_STRING_SIZE   1                                 \r\n#define TRANSMIT_AS_TABLE_SIZE    0            \r\n#define WIRE_MARSHAL_TABLE_SIZE   0            \r\n\r\ntypedef struct _KMSServer_MIDL_TYPE_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_TYPE_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_PROC_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_PROC_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_EXPR_FORMAT_STRING\r\n    {\r\n    long          Pad;\r\n    unsigned char  Format[ EXPR_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_EXPR_FORMAT_STRING;\r\n\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax = \r\n{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};\r\n\r\nextern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;\r\nextern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;\r\nextern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;\r\n\r\n/* Standard interface: KMSServer, ver. 1.0,\r\n   GUID={0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}} */\r\n\r\n\r\nextern const MIDL_SERVER_INFO KMSServer_ServerInfo;\r\n\r\nextern const RPC_DISPATCH_TABLE KMSServer_v1_0_DispatchTable;\r\n\r\n\tint ProcessActivationRequest( \r\n    /* [in] */ handle_t IDL_handle,\r\n    /* [in] */ int requestSize,\r\n    /* [size_is][in] */ unsigned char *request,\r\n    /* [out] */ int *responseSize,\r\n    /* [size_is][size_is][out] */ unsigned char **response);\r\n\r\n\tstatic const RPC_SERVER_INTERFACE KMSServer___RpcServerInterface =\r\n    {\r\n    sizeof(RPC_SERVER_INTERFACE),\r\n    {{0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}},{1,0}},\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    (RPC_DISPATCH_TABLE*)&KMSServer_v1_0_DispatchTable,\r\n    0,\r\n    0,\r\n    0,\r\n    &KMSServer_ServerInfo,\r\n    0x04000000\r\n    };\r\nRPC_IF_HANDLE KMSServer_v1_0_s_ifspec = (RPC_IF_HANDLE)& KMSServer___RpcServerInterface;\r\n\r\nextern const MIDL_STUB_DESC KMSServer_StubDesc;\r\n\r\n\r\n#if !defined(__RPC_WIN32__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n#if !(TARGET_IS_NT50_OR_LATER)\r\n#error You need Windows 2000 or later to run this stub because it uses these features:\r\n#error   /robust command line switch.\r\n#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.\r\n#error This app will fail with the RPC_X_WRONG_STUB_VERSION error.\r\n#endif\r\n\r\nconst KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString =\r\n    {\r\n        0,\r\n        {\r\n\r\n\t/* Procedure RequestActivation */\r\n\r\n\t\t\t0x0,\t\t/* 0 */\r\n\t\t\t0x48,\t\t/* Old Flags:  */\r\n/*  2 */\tNdrFcLong( 0x0 ),\t/* 0 */\r\n/*  6 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x18 ),\t/* x86 Stack size/offset = 24 */\r\n/* 10 */\t0x32,\t\t/* FC_BIND_PRIMITIVE */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 12 */\tNdrFcShort( 0x0 ),\t/* x86 Stack size/offset = 0 */\r\n/* 14 */\tNdrFcShort( 0x8 ),\t/* 8 */\r\n/* 16 */\tNdrFcShort( 0x24 ),\t/* 36 */\r\n/* 18 */\t0x47,\t\t/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */\r\n\t\t\t0x5,\t\t/* 5 */\r\n/* 20 */\t0x8,\t\t/* 8 */\r\n\t\t\t0x7,\t\t/* Ext Flags:  new corr desc, clt corr check, srv corr check, */\r\n/* 22 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 24 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 26 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n\r\n\t/* Parameter IDL_handle */\r\n\r\n/* 28 */\tNdrFcShort( 0x48 ),\t/* Flags:  in, base type, */\r\n/* 30 */\tNdrFcShort( 0x4 ),\t/* x86 Stack size/offset = 4 */\r\n/* 32 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter requestSize */\r\n\r\n/* 34 */\tNdrFcShort( 0x10b ),\t/* Flags:  must size, must free, in, simple ref, */\r\n/* 36 */\tNdrFcShort( 0x8 ),\t/* x86 Stack size/offset = 8 */\r\n/* 38 */\tNdrFcShort( 0x6 ),\t/* Type Offset=6 */\r\n\r\n\t/* Parameter request */\r\n\r\n/* 40 */\tNdrFcShort( 0x2150 ),\t/* Flags:  out, base type, simple ref, srv alloc size=8 */\r\n/* 42 */\tNdrFcShort( 0xc ),\t/* x86 Stack size/offset = 12 */\r\n/* 44 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter responseSize */\r\n\r\n/* 46 */\tNdrFcShort( 0x2013 ),\t/* Flags:  must size, must free, out, srv alloc size=8 */\r\n/* 48 */\tNdrFcShort( 0x10 ),\t/* x86 Stack size/offset = 16 */\r\n/* 50 */\tNdrFcShort( 0x16 ),\t/* Type Offset=22 */\r\n\r\n\t/* Parameter response */\r\n\r\n/* 52 */\tNdrFcShort( 0x70 ),\t/* Flags:  out, return, base type, */\r\n/* 54 */\tNdrFcShort( 0x14 ),\t/* x86 Stack size/offset = 20 */\r\n/* 56 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\nconst KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString =\r\n    {\r\n        0,\r\n        {\r\n\t\t\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  2 */\t\r\n\t\t\t0x11, 0x0,\t/* FC_RP */\r\n/*  4 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (6) */\r\n/*  6 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 10 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x0,\t\t/*  */\r\n/* 12 */\tNdrFcShort( 0x4 ),\t/* x86 Stack size/offset = 4 */\r\n/* 14 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 16 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n/* 18 */\t\r\n\t\t\t0x11, 0xc,\t/* FC_RP [alloced_on_stack] [simple_pointer] */\r\n/* 20 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x5c,\t\t/* FC_PAD */\r\n/* 22 */\t\r\n\t\t\t0x11, 0x14,\t/* FC_RP [alloced_on_stack] [pointer_deref] */\r\n/* 24 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (26) */\r\n/* 26 */\t\r\n\t\t\t0x12, 0x0,\t/* FC_UP */\r\n/* 28 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (30) */\r\n/* 30 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 32 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 34 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x54,\t\t/* FC_DEREFERENCE */\r\n/* 36 */\tNdrFcShort( 0xc ),\t/* x86 Stack size/offset = 12 */\r\n/* 38 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 40 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\nstatic const unsigned short KMSServer_FormatStringOffsetTable[] =\r\n    {\r\n    0\r\n    };\r\n\r\ntypedef void *(__RPC_API *midl_allocate_t)(size_t);\r\n\r\nconst MIDL_STUB_DESC KMSServer_StubDesc =\r\n    {\r\n    (void *)& KMSServer___RpcServerInterface,\r\n    (midl_allocate_t)MIDL_user_allocate,\r\n    MIDL_user_free,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    1, /* -error bounds_check flag */\r\n    0x50002, /* Ndr library version */\r\n    0,\r\n    0x8000253, /* MIDL Version 8.0.595 */\r\n    0,\r\n    0,\r\n    0,  /* notify & notify_flag routine table */\r\n    0x1, /* MIDL flag */\r\n    0, /* cs routines */\r\n    0,   /* proxy/server info */\r\n    0\r\n    };\r\n\r\nstatic const RPC_DISPATCH_FUNCTION KMSServer_table[] =\r\n    {\r\n    NdrServerCall2,\r\n    0\r\n    };\r\nconst RPC_DISPATCH_TABLE KMSServer_v1_0_DispatchTable =\r\n    {\r\n    1,\r\n    (RPC_DISPATCH_FUNCTION*)KMSServer_table\r\n    };\r\n\r\nstatic const SERVER_ROUTINE KMSServer_ServerRoutineTable[] = \r\n    {\r\n    (SERVER_ROUTINE)ProcessActivationRequest\r\n    };\r\n\r\nconst MIDL_SERVER_INFO KMSServer_ServerInfo =\r\n    {\r\n    &KMSServer_StubDesc,\r\n    KMSServer_ServerRoutineTable,\r\n    KMSServer__MIDL_ProcFormatString.Format,\r\n    KMSServer_FormatStringOffsetTable,\r\n    0,\r\n    0,\r\n    0,\r\n    0};\r\n#pragma optimize(\"\", on )\r\n#if _MSC_VER >= 1200\r\n#pragma warning(pop)\r\n#endif\r\n\r\n\r\n#endif /* !defined(_M_IA64) && !defined(_M_AMD64) && !defined(_ARM_) */\r\n\r\n"
  },
  {
    "path": "src/KMSServer_s2_x64_mingw_gcc.c",
    "content": "\r\n\r\n/* this ALWAYS GENERATED file contains the RPC server stubs */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0603 */\r\n/* at Fri Feb 20 04:17:07 2015\r\n * Modified by Hotbird64 to work with gcc and MingW-w64\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.00.0603 \r\n    protocol : all , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if defined(_M_AMD64)\r\n\r\nint ProcessActivationRequest(\r\n\t/* [in] */ handle_t IDL_handle,\r\n\t/* [in] */ int requestSize,\r\n\t/* [size_is][in] */ unsigned char *request,\r\n\t/* [out] */ int *responseSize,\r\n\t/* [size_is][size_is][out] */ unsigned char **response);\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n#if _MSC_VER >= 1200\r\n#pragma warning(push)\r\n#endif\r\n\r\n#pragma warning( disable: 4211 )  /* redefine extern to static */\r\n#pragma warning( disable: 4232 )  /* dllimport identity*/\r\n#pragma warning( disable: 4024 )  /* array to pointer mapping*/\r\n\r\n#include <string.h>\r\n#include \"KMSServer_h.h\"\r\n\r\n#define TYPE_FORMAT_STRING_SIZE   43                                \r\n#define PROC_FORMAT_STRING_SIZE   61                                \r\n#define EXPR_FORMAT_STRING_SIZE   1                                 \r\n#define TRANSMIT_AS_TABLE_SIZE    0            \r\n#define WIRE_MARSHAL_TABLE_SIZE   0            \r\n\r\ntypedef struct _KMSServer_MIDL_TYPE_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_TYPE_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_PROC_FORMAT_STRING\r\n    {\r\n    short          Pad;\r\n    unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_PROC_FORMAT_STRING;\r\n\r\ntypedef struct _KMSServer_MIDL_EXPR_FORMAT_STRING\r\n    {\r\n    long          Pad;\r\n    unsigned char  Format[ EXPR_FORMAT_STRING_SIZE ];\r\n    } KMSServer_MIDL_EXPR_FORMAT_STRING;\r\n\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax = \r\n{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};\r\n\r\nstatic const RPC_SYNTAX_IDENTIFIER  _NDR64_RpcTransferSyntax = \r\n{{0x71710533,0xbeba,0x4937,{0x83,0x19,0xb5,0xdb,0xef,0x9c,0xcc,0x36}},{1,0}};\r\n\r\n\r\nextern const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString;\r\nextern const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString;\r\nextern const KMSServer_MIDL_EXPR_FORMAT_STRING KMSServer__MIDL_ExprFormatString;\r\n\r\n/* Standard interface: KMSServer, ver. 1.0,\r\n   GUID={0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}} */\r\n\r\n\r\nextern const MIDL_SERVER_INFO KMSServer_ServerInfo;\r\n\r\nextern const RPC_DISPATCH_TABLE KMSServer_v1_0_DispatchTable;\r\n\r\nstatic const RPC_SERVER_INTERFACE KMSServer___RpcServerInterface =\r\n    {\r\n    sizeof(RPC_SERVER_INTERFACE),\r\n    {{0x51C82175,0x844E,0x4750,{0xB0,0xD8,0xEC,0x25,0x55,0x55,0xBC,0x06}},{1,0}},\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    (RPC_DISPATCH_TABLE*)&KMSServer_v1_0_DispatchTable,\r\n    0,\r\n    0,\r\n    0,\r\n    &KMSServer_ServerInfo,\r\n    0x06000000\r\n    };\r\nRPC_IF_HANDLE KMSServer_v1_0_s_ifspec = (RPC_IF_HANDLE)& KMSServer___RpcServerInterface;\r\n\r\nextern const MIDL_STUB_DESC KMSServer_StubDesc;\r\n\r\n\r\n#if !defined(__RPC_WIN64__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n/*static*/ const KMSServer_MIDL_PROC_FORMAT_STRING KMSServer__MIDL_ProcFormatString =\r\n    {\r\n        0,\r\n        {\r\n\r\n\t/* Procedure RequestActivation */\r\n\r\n\t\t\t0x0,\t\t/* 0 */\r\n\t\t\t0x48,\t\t/* Old Flags:  */\r\n/*  2 */\tNdrFcLong( 0x0 ),\t/* 0 */\r\n/*  6 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x30 ),\t/* X64 Stack size/offset = 48 */\r\n/* 10 */\t0x32,\t\t/* FC_BIND_PRIMITIVE */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 12 */\tNdrFcShort( 0x0 ),\t/* X64 Stack size/offset = 0 */\r\n/* 14 */\tNdrFcShort( 0x8 ),\t/* 8 */\r\n/* 16 */\tNdrFcShort( 0x24 ),\t/* 36 */\r\n/* 18 */\t0x47,\t\t/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */\r\n\t\t\t0x5,\t\t/* 5 */\r\n/* 20 */\t0xa,\t\t/* 10 */\r\n\t\t\t0x7,\t\t/* Ext Flags:  new corr desc, clt corr check, srv corr check, */\r\n/* 22 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 24 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 26 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/* 28 */\tNdrFcShort( 0x0 ),\t/* 0 */\r\n\r\n\t/* Parameter IDL_handle */\r\n\r\n/* 30 */\tNdrFcShort( 0x48 ),\t/* Flags:  in, base type, */\r\n/* 32 */\tNdrFcShort( 0x8 ),\t/* X64 Stack size/offset = 8 */\r\n/* 34 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter requestSize */\r\n\r\n/* 36 */\tNdrFcShort( 0x10b ),\t/* Flags:  must size, must free, in, simple ref, */\r\n/* 38 */\tNdrFcShort( 0x10 ),\t/* X64 Stack size/offset = 16 */\r\n/* 40 */\tNdrFcShort( 0x6 ),\t/* Type Offset=6 */\r\n\r\n\t/* Parameter request */\r\n\r\n/* 42 */\tNdrFcShort( 0x2150 ),\t/* Flags:  out, base type, simple ref, srv alloc size=8 */\r\n/* 44 */\tNdrFcShort( 0x18 ),\t/* X64 Stack size/offset = 24 */\r\n/* 46 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t/* Parameter responseSize */\r\n\r\n/* 48 */\tNdrFcShort( 0x2013 ),\t/* Flags:  must size, must free, out, srv alloc size=8 */\r\n/* 50 */\tNdrFcShort( 0x20 ),\t/* X64 Stack size/offset = 32 */\r\n/* 52 */\tNdrFcShort( 0x16 ),\t/* Type Offset=22 */\r\n\r\n\t/* Parameter response */\r\n\r\n/* 54 */\tNdrFcShort( 0x70 ),\t/* Flags:  out, return, base type, */\r\n/* 56 */\tNdrFcShort( 0x28 ),\t/* X64 Stack size/offset = 40 */\r\n/* 58 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x0,\t\t/* 0 */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\n/*static*/ const KMSServer_MIDL_TYPE_FORMAT_STRING KMSServer__MIDL_TypeFormatString =\r\n    {\r\n        0,\r\n        {\r\n\t\t\tNdrFcShort( 0x0 ),\t/* 0 */\r\n/*  2 */\t\r\n\t\t\t0x11, 0x0,\t/* FC_RP */\r\n/*  4 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (6) */\r\n/*  6 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/*  8 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 10 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x0,\t\t/*  */\r\n/* 12 */\tNdrFcShort( 0x8 ),\t/* X64 Stack size/offset = 8 */\r\n/* 14 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 16 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n/* 18 */\t\r\n\t\t\t0x11, 0xc,\t/* FC_RP [alloced_on_stack] [simple_pointer] */\r\n/* 20 */\t0x8,\t\t/* FC_LONG */\r\n\t\t\t0x5c,\t\t/* FC_PAD */\r\n/* 22 */\t\r\n\t\t\t0x11, 0x14,\t/* FC_RP [alloced_on_stack] [pointer_deref] */\r\n/* 24 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (26) */\r\n/* 26 */\t\r\n\t\t\t0x12, 0x0,\t/* FC_UP */\r\n/* 28 */\tNdrFcShort( 0x2 ),\t/* Offset= 2 (30) */\r\n/* 30 */\t\r\n\t\t\t0x1b,\t\t/* FC_CARRAY */\r\n\t\t\t0x0,\t\t/* 0 */\r\n/* 32 */\tNdrFcShort( 0x1 ),\t/* 1 */\r\n/* 34 */\t0x28,\t\t/* Corr desc:  parameter, FC_LONG */\r\n\t\t\t0x54,\t\t/* FC_DEREFERENCE */\r\n/* 36 */\tNdrFcShort( 0x18 ),\t/* X64 Stack size/offset = 24 */\r\n/* 38 */\tNdrFcShort( 0x1 ),\t/* Corr flags:  early, */\r\n/* 40 */\t0x2,\t\t/* FC_CHAR */\r\n\t\t\t0x5b,\t\t/* FC_END */\r\n\r\n\t\t\t0x0\r\n        }\r\n    };\r\n\r\nstatic const unsigned short KMSServer_FormatStringOffsetTable[] =\r\n    {\r\n    0\r\n    };\r\n\r\n\r\nstatic const RPC_DISPATCH_FUNCTION KMSServer_table[] =\r\n    {\r\n    NdrServerCall2,\r\n    0\r\n    };\r\n/*static*/ const RPC_DISPATCH_TABLE KMSServer_v1_0_DispatchTable =\r\n    {\r\n    1,\r\n    (RPC_DISPATCH_FUNCTION*)KMSServer_table\r\n    };\r\n\r\n\r\n#endif /* defined(_M_AMD64)*/\r\n\r\n\r\n\r\n/* this ALWAYS GENERATED file contains the RPC server stubs */\r\n\r\n\r\n /* File created by MIDL compiler version 8.00.0603 */\r\n/* at Fri Feb 20 04:17:07 2015\r\n */\r\n/* Compiler settings for KMSServer.idl:\r\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.00.0603 \r\n    protocol : all , ms_ext, c_ext, robust\r\n    error checks: allocation ref bounds_check enum stub_data \r\n    VC __declspec() decoration level: \r\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\r\n         DECLSPEC_UUID(), MIDL_INTERFACE()\r\n*/\r\n/* @@MIDL_FILE_HEADING(  ) */\r\n\r\n#if defined(_M_AMD64)\r\n\r\n\r\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\r\n\r\n\r\n#if !defined(__RPC_WIN64__)\r\n#error  Invalid build platform for this stub.\r\n#endif\r\n\r\n\r\n#include \"ndr64types.h\"\r\n#include \"pshpack8.h\"\r\n\r\n\r\ntypedef \r\nstruct \r\n{\r\n    NDR64_FORMAT_UINT32 frag1;\r\n    struct _NDR64_EXPR_OPERATOR frag2;\r\n    struct _NDR64_EXPR_VAR frag3;\r\n}\r\n__midl_frag13_t;\r\nextern const __midl_frag13_t __midl_frag13;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_CONF_ARRAY_HEADER_FORMAT frag1;\r\n    struct _NDR64_ARRAY_ELEMENT_INFO frag2;\r\n}\r\n__midl_frag12_t;\r\nextern const __midl_frag12_t __midl_frag12;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag11_t;\r\nextern const __midl_frag11_t __midl_frag11;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag10_t;\r\nextern const __midl_frag10_t __midl_frag10;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag8_t;\r\nextern const __midl_frag8_t __midl_frag8;\r\n\r\ntypedef \r\nNDR64_FORMAT_CHAR\r\n__midl_frag7_t;\r\nextern const __midl_frag7_t __midl_frag7;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    NDR64_FORMAT_UINT32 frag1;\r\n    struct _NDR64_EXPR_VAR frag2;\r\n}\r\n__midl_frag6_t;\r\nextern const __midl_frag6_t __midl_frag6;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_CONF_ARRAY_HEADER_FORMAT frag1;\r\n    struct _NDR64_ARRAY_ELEMENT_INFO frag2;\r\n}\r\n__midl_frag5_t;\r\nextern const __midl_frag5_t __midl_frag5;\r\n\r\ntypedef \r\nstruct _NDR64_POINTER_FORMAT\r\n__midl_frag4_t;\r\nextern const __midl_frag4_t __midl_frag4;\r\n\r\ntypedef \r\nNDR64_FORMAT_CHAR\r\n__midl_frag3_t;\r\nextern const __midl_frag3_t __midl_frag3;\r\n\r\ntypedef \r\nstruct \r\n{\r\n    struct _NDR64_PROC_FORMAT frag1;\r\n    struct _NDR64_BIND_AND_NOTIFY_EXTENSION frag2;\r\n    struct _NDR64_PARAM_FORMAT frag3;\r\n    struct _NDR64_PARAM_FORMAT frag4;\r\n    struct _NDR64_PARAM_FORMAT frag5;\r\n    struct _NDR64_PARAM_FORMAT frag6;\r\n    struct _NDR64_PARAM_FORMAT frag7;\r\n}\r\n__midl_frag2_t;\r\nextern const __midl_frag2_t __midl_frag2;\r\n\r\ntypedef \r\nNDR64_FORMAT_UINT32\r\n__midl_frag1_t;\r\nextern const __midl_frag1_t __midl_frag1;\r\n\r\n/*static*/ const __midl_frag13_t __midl_frag13 =\r\n{ \r\n/*  */\r\n    (NDR64_UINT32) 1 /* 0x1 */,\r\n    { \r\n    /* struct _NDR64_EXPR_OPERATOR */\r\n        0x4,    /* FC_EXPR_OPER */\r\n        0x5,    /* OP_UNARY_INDIRECTION */\r\n        0x5,    /* FC64_INT32 */\r\n        (NDR64_UINT8) 0 /* 0x0 */\r\n    },\r\n    { \r\n    /* struct _NDR64_EXPR_VAR */\r\n        0x3,    /* FC_EXPR_VAR */\r\n        0x7,    /* FC64_INT64 */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 24 /* 0x18 */  /* Offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag12_t __midl_frag12 =\r\n{ \r\n/* *char */\r\n    { \r\n    /* *char */\r\n        0x41,    /* FC64_CONF_ARRAY */\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        { \r\n        /* *char */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0\r\n        },\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag13\r\n    },\r\n    { \r\n    /* struct _NDR64_ARRAY_ELEMENT_INFO */\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag7\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag11_t __midl_frag11 =\r\n{ \r\n/* *char */\r\n    0x21,    /* FC64_UP */\r\n    (NDR64_UINT8) 0 /* 0x0 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag12\r\n};\r\n\r\n/*static*/ const __midl_frag10_t __midl_frag10 =\r\n{ \r\n/* **char */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 20 /* 0x14 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag11\r\n};\r\n\r\n/*static*/ const __midl_frag8_t __midl_frag8 =\r\n{ \r\n/* *int */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 12 /* 0xc */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag3\r\n};\r\n\r\n/*static*/ const __midl_frag7_t __midl_frag7 =\r\n0x10    /* FC64_CHAR */;\r\n\r\n/*static*/ const __midl_frag6_t __midl_frag6 =\r\n{ \r\n/*  */\r\n    (NDR64_UINT32) 1 /* 0x1 */,\r\n    { \r\n    /* struct _NDR64_EXPR_VAR */\r\n        0x3,    /* FC_EXPR_VAR */\r\n        0x5,    /* FC64_INT32 */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 8 /* 0x8 */  /* Offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag5_t __midl_frag5 =\r\n{ \r\n/* *char */\r\n    { \r\n    /* *char */\r\n        0x41,    /* FC64_CONF_ARRAY */\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        { \r\n        /* *char */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0\r\n        },\r\n        (NDR64_UINT8) 0 /* 0x0 */,\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag6\r\n    },\r\n    { \r\n    /* struct _NDR64_ARRAY_ELEMENT_INFO */\r\n        (NDR64_UINT32) 1 /* 0x1 */,\r\n        &__midl_frag7\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag4_t __midl_frag4 =\r\n{ \r\n/* *char */\r\n    0x20,    /* FC64_RP */\r\n    (NDR64_UINT8) 0 /* 0x0 */,\r\n    (NDR64_UINT16) 0 /* 0x0 */,\r\n    &__midl_frag5\r\n};\r\n\r\n/*static*/ const __midl_frag3_t __midl_frag3 =\r\n0x5    /* FC64_INT32 */;\r\n\r\n/*static*/ const __midl_frag2_t __midl_frag2 =\r\n{ \r\n/* RequestActivation */\r\n    { \r\n    /* RequestActivation */      /* procedure RequestActivation */\r\n        (NDR64_UINT32) 23986240 /* 0x16e0040 */,    /* explicit handle */ /* IsIntrepreted, ServerMustSize, ClientMustSize, HasReturn, ServerCorrelation, ClientCorrelation, HasExtensions */\r\n        (NDR64_UINT32) 48 /* 0x30 */ ,  /* Stack size */\r\n        (NDR64_UINT32) 8 /* 0x8 */,\r\n        (NDR64_UINT32) 40 /* 0x28 */,\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        (NDR64_UINT16) 5 /* 0x5 */,\r\n        (NDR64_UINT16) 8 /* 0x8 */\r\n    },\r\n    { \r\n    /* struct _NDR64_BIND_AND_NOTIFY_EXTENSION */\r\n        { \r\n        /* struct _NDR64_BIND_AND_NOTIFY_EXTENSION */\r\n            0x72,    /* FC64_BIND_PRIMITIVE */\r\n            (NDR64_UINT8) 0 /* 0x0 */,\r\n            0 /* 0x0 */,   /* Stack offset */\r\n            (NDR64_UINT8) 0 /* 0x0 */,\r\n            (NDR64_UINT8) 0 /* 0x0 */\r\n        },\r\n        (NDR64_UINT16) 0 /* 0x0 */      /* Notify index */\r\n    },\r\n    { \r\n    /* requestSize */      /* parameter requestSize */\r\n        &__midl_frag3,\r\n        { \r\n        /* requestSize */\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* [in], Basetype, ByValue */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        8 /* 0x8 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* request */      /* parameter request */\r\n        &__midl_frag5,\r\n        { \r\n        /* request */\r\n            1,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* MustSize, MustFree, [in], SimpleRef */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        16 /* 0x10 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* responseSize */      /* parameter responseSize */\r\n        &__midl_frag3,\r\n        { \r\n        /* responseSize */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            1\r\n        },    /* [out], Basetype, SimpleRef, UseCache */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        24 /* 0x18 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* response */      /* parameter response */\r\n        &__midl_frag10,\r\n        { \r\n        /* response */\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            1\r\n        },    /* MustSize, MustFree, [out], UseCache */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        32 /* 0x20 */,   /* Stack offset */\r\n    },\r\n    { \r\n    /* int */      /* parameter int */\r\n        &__midl_frag3,\r\n        { \r\n        /* int */\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            1,\r\n            1,\r\n            1,\r\n            1,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            0,\r\n            (NDR64_UINT16) 0 /* 0x0 */,\r\n            0\r\n        },    /* [out], IsReturn, Basetype, ByValue */\r\n        (NDR64_UINT16) 0 /* 0x0 */,\r\n        40 /* 0x28 */,   /* Stack offset */\r\n    }\r\n};\r\n\r\n/*static*/ const __midl_frag1_t __midl_frag1 =\r\n(NDR64_UINT32) 0 /* 0x0 */;\r\n\r\n\r\n#include \"poppack.h\"\r\n\r\n\r\nstatic const FormatInfoRef KMSServer_Ndr64ProcTable[] =\r\n    {\r\n    &__midl_frag2\r\n    };\r\n\r\n//typedef void *__RPC_USER MIDL_user_allocate_t(SIZE_T);\r\ntypedef void *(__RPC_API *midl_allocate_t)(size_t);\r\n\r\n/*static*/ const MIDL_STUB_DESC KMSServer_StubDesc =\r\n    {\r\n    (void *)& KMSServer___RpcServerInterface,\r\n    (midl_allocate_t)MIDL_user_allocate,\r\n    MIDL_user_free,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    0,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    1, /* -error bounds_check flag */\r\n    0x60000, /* Ndr library version */\r\n    0,\r\n    0x800025b, /* MIDL Version 8.0.603 */\r\n    0,\r\n    0,\r\n    0,  /* notify & notify_flag routine table */\r\n    0x2000001, /* MIDL flag */\r\n    0, /* cs routines */\r\n    (void *)& KMSServer_ServerInfo,   /* proxy/server info */\r\n    0\r\n    };\r\n\r\nstatic const RPC_DISPATCH_FUNCTION KMSServer_NDR64__table[] =\r\n    {\r\n    NdrServerCallAll,\r\n    0\r\n    };\r\nstatic const RPC_DISPATCH_TABLE KMSServer_NDR64__v1_0_DispatchTable = \r\n    {\r\n    1,\r\n    (RPC_DISPATCH_FUNCTION*)KMSServer_NDR64__table\r\n    };\r\n\r\nstatic const MIDL_SYNTAX_INFO KMSServer_SyntaxInfo [  2 ] = \r\n    {\r\n    {\r\n    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},\r\n    (RPC_DISPATCH_TABLE*)&KMSServer_v1_0_DispatchTable,\r\n    KMSServer__MIDL_ProcFormatString.Format,\r\n    KMSServer_FormatStringOffsetTable,\r\n    KMSServer__MIDL_TypeFormatString.Format,\r\n    0,\r\n    0,\r\n    0\r\n    }\r\n    ,{\r\n    {{0x71710533,0xbeba,0x4937,{0x83,0x19,0xb5,0xdb,0xef,0x9c,0xcc,0x36}},{1,0}},\r\n    (RPC_DISPATCH_TABLE*)&KMSServer_NDR64__v1_0_DispatchTable,\r\n    0 ,\r\n    (unsigned short *) KMSServer_Ndr64ProcTable,\r\n    0,\r\n    0,\r\n    0,\r\n    0\r\n    }\r\n    };\r\n\r\n\r\nstatic const SERVER_ROUTINE KMSServer_ServerRoutineTable[] = \r\n    {\r\n\t(SERVER_ROUTINE)ProcessActivationRequest\r\n    };\r\n\r\n/*static*/ const MIDL_SERVER_INFO KMSServer_ServerInfo =\r\n    {\r\n    &KMSServer_StubDesc,\r\n    KMSServer_ServerRoutineTable,\r\n    KMSServer__MIDL_ProcFormatString.Format,\r\n    (unsigned short *) KMSServer_FormatStringOffsetTable,\r\n    0,\r\n    (RPC_SYNTAX_IDENTIFIER*)&_NDR64_RpcTransferSyntax,\r\n    2,\r\n    (MIDL_SYNTAX_INFO*)KMSServer_SyntaxInfo\r\n    };\r\n#if _MSC_VER >= 1200\r\n#pragma warning(pop)\r\n#endif\r\n\r\n\r\n#endif /* defined(_M_AMD64)*/\r\n\r\n"
  },
  {
    "path": "src/config.h",
    "content": "#ifndef CONFIG_H_\n#define CONFIG_H_\n\n/* Don't change anything ABOVE this line */\n\n/*\n * As a best practice do not change the original config.h as distributed with vlmcsd.\n * Instead make a copy, e.g. myconfig.h, customize it and type 'make CONFIG=myconfig.h'\n * to build vlmcsd. This prevents your copy being overwritten when you upgrade to a\n * new version.\n */\n\n\n\n /*\n  * ----------------------------------------------------------------------------------------\n  * Useful customizations. These options are mandatory. You cannot comment them out.\n  * Feel free to change them to fit your needs.\n  * ----------------------------------------------------------------------------------------\n  */\n\n#ifndef VERSION\n  /*\n   * Define your own version identifier here, e.g. '#define VERSION \"my vlmcsd based on 1103\"'\n   */\n\n#define VERSION \"private build\"\n\n#endif // VERSION\n\n\n\n\n\n#ifndef HWID // HwId from the Ratiborus VM\n#define HWID 0x3A, 0x1C, 0x04, 0x96, 0x00, 0xB6, 0x00, 0x76\n#endif\n\n\n\n\n\n/*\n * Anything below this line is optional. If you want to use any of these options\n * uncomment one or more lines starting with \"//#define\"\n */\n\n\n\n /*\n  * -------------------------------\n  * Defaults\n  * -------------------------------\n  */\n\n\n\n#ifndef INI_FILE\n  /*\n   * Uncomment and customize the following line if you want vlmcsd to look for an ini file\n   * at a default location.\n   */\n\n   //#define INI_FILE \"/etc/vlmcsd.ini\"\n\n#endif // INI_FILE\n\n\n\n\n\n#ifndef DATA_FILE\n/*\n * Uncomment and customize the following line if you want vlmcsd to look for a KMS data file\n * at a custom default location.\n */\n\n //#define DATA_FILE \"/etc/vlmcsd.kmd\"\n\n#endif // DATA_FILE\n\n\n/*\n * ----------------------------------------------------------------------------------------\n * Troubleshooting options. Please note that disabling features may also help troubleshooting.\n * If you have an old OS that does not support features like pthreads, shared memory or\n * semaphores, uncomment \"#define NO_LIMIT\" and \"#define NO_SIGHUP\" and leave \"#define USE_THREADS\"\n * commented out.\n * ----------------------------------------------------------------------------------------\n */\n\n\n#ifndef CHILD_HANDLER\n /*\n  * Uncomment the following #define if you are compiling for a platform that does\n  * not correctly handle the SA_NOCLDWAIT flag when ignoring SIGCHLD, i.e. forked\n  * processes remain as \"zombies\" after dying. This option will add a SIGCHLD handler that\n  * \"waits\" for a child that has terminated. This is only required for a few\n  * unixoid OSses.\n  */\n\n  //#define CHILD_HANDLER\n\n#endif // CHILD_HANDLER\n\n\n#ifndef NO_TIMEOUT\n/*\n * Uncomment the following #define if you are compiling for a platform that does\n * not support custom socket send or receive timeouts.\n */\n\n //#define NO_TIMEOUT\n\n#endif // NO_TIMEOUT\n\n\n#ifndef NO_DNS\n/*\n * Uncomment the following #define if you have trouble with accessing routines\n * from libresolv. If enabled, vlmcs will be compiled without support for\n * detecting KMS servers via DNS.\n */\n\n //#define NO_DNS\n\n#endif // NO_DNS\n\n\n#ifndef TERMINAL_FIXED_WIDTH\n/*\n * Uncomment the following #define and optionally change its value if you are compiling for\n * a platform that cannot properly determine the width of a terminal/command prompt.\n * This affects the output of \"vlmcsd -x\" only. It should be rarely necessary to use this.\n */\n\n //#define TERMINAL_FIXED_WIDTH 80\n\n#endif // TERMINAL_FIXED_WIDTH\n\n\n\n\n#ifndef _PEDANTIC\n/*\n * Uncomment the following #define if you want to do vlmcs and vlmcsd more checks on the data\n * it receives over the network. They are normally not necessary but may provide useful if\n * you are testing any KMS server or client emulator that may send malformed KMS packets.\n */\n\n //#define _PEDANTIC\n\n#endif // _PEDANTIC\n\n\n\n\n#ifndef NO_PROCFS\n/*\n * Cygwin, Linux, Android, NetBSD, DragonflyBSD:\n *    Do not rely on a properly mounted proc filesystem and use the less reliable\n *    argv[0] to determine the program's executable name.\n *    Use only if absolutely necessary (very old versions of these OSses).\n *\n * Minix, OpenBSD:\n *    This option has no effect since the OS always must use the less reliable argv[0].\n *\n * FreeBSD, Mac OS X, iOS, Solaris, Windows:\n *    This option is not neccessary (and has no effect) since these OSses provide\n *    a reliable way to determine the executable name.\n *\n */\n\n //#define NO_PROCFS\n\n#endif // NO_PROCFS\n\n\n\n\n#ifndef USE_AUXV\n/*\n * Linux only:\n *    Use the process' ELF aux vector to determine the executable name.\n *    This is actually the best method but is supported only with\n *\n *        * the musl library\n *        * the glbic library 2.16 or newer\n *\n *    It does NOT work with uclibc (most routers and other small devices) and glibc < 2.16.\n *    Use it only if your system supports it and you do not plan to use the binary on older systems.\n *    It won't work on debian 7 or Red Hat 6.x.\n *\n *    It is safe to try this by yourself. vlmcsd won't compile if your system doesn't support it.\n */\n\n //#define USE_AUXV\n\n#endif // USE_AUXV\n\n\n\n\n#ifndef _OPENSSL_NO_HMAC\n/*\n * If you configured vlmcsd to use OpenSSL (which you shouldn't) you may use this option\n * to calculate the KMSv6 HMAC with internal code instead of using OpenSSL.\n *\n * This may be necessary for some embedded devices that have OpenSSL without HMAC support.\n */\n\n //#define _OPENSSL_NO_HMAC\n\n#endif // _OPENSSL_NO_HMAC\n\n\n\n\n/*\n * ----------------------------------------------------------------------------------------\n * Modes of operation\n * ----------------------------------------------------------------------------------------\n */\n\n\n#ifndef USE_THREADS\n /*\n  * Do not use fork() but threads to serve your clients.\n  *\n  * Unix-like operarting systems:\n  *    You may use this or not. Entirely your choice. Threads do not require explicitly allocating\n  *    a shared memory segment which might be a problem on some systems. Using fork() is more robust\n  *    although the threaded version of vlmcsd is rock solid too.\n  *\n  *    Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP\n  *    and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.\n  *\n  * Cygwin:\n  *    It is recommended to use threads since fork() is extremely slow (no copy on write) and somewhat\n  *    unstable.\n  *\n  * Windows:\n  *    This option has no effect since fork() is not supported.\n  */\n\n  //#define USE_THREADS\n\n#endif // USE_THREADS\n\n\n\n\n#ifndef _CRYPTO_POLARSSL\n/*\n * Not available on native Windows. Can be used with Cygwin.\n *\n * Use PolarSSL for crypto routines if possible and if it is safe. There is not much benefit by using this\n * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because\n * KMSv6 uses a modified algorithm that PolarSSL does not support. KMSv4 CMAC is also unsupported since it uses\n * a Rijndael keysize (160 bits) that is not part of the AES standard.\n *\n * It is strongly recommended not to use an external crypto library.\n *\n * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL\n */\n\n //#define _CRYPTO_POLARSSL\n\n#endif // _CRYPTO_POLARSSL\n\n\n\n\n#ifndef _CRYPTO_OPENSSL\n/*\n * Not available on native Windows. Can be used with Cygwin.\n *\n * Use OpenSSL for crypto routines if possible and if it is safe. There is not much benefit by using this\n * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because\n * KMSv6 uses a modified algorithm that OpenSSL does not support. KMSv4 CMAC is also unsupported since it uses\n * a Rijndael keysize (160 bits) that is not part of the AES standard.\n *\n * It is strongly recommended not to use an external crypto library.\n *\n * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL\n */\n\n //#define _CRYPTO_OPENSSL\n\n#endif // _CRYPTO_OPENSSL\n\n\n\n\n#ifndef _USE_AES_FROM_OPENSSL\n/*\n * DANGEROUS: Tweak OpenSSL to perform KMSv4 CMAC and KMSv6 modified AES. This option creates the expanded\n * AES key by itself and then applies modifications to it. OpenSSL will then perfom modified AES operations.\n *\n * This options tampers with internal structures of OpenSSL that are subject to change or may have a platform\n * specific implementation. In this case your resulting binary can only perform KMSv5 operations.\n *\n * This option has no effect if _CRYPTO_OPENSSL is not defined.\n *\n * Don't use this except for your own research on the internals of OpenSSL.\n */\n\n //#define _USE_AES_FROM_OPENSSL\n\n#endif // _USE_AES_FROM_OPENSSL\n\n\n\n\n\n#ifndef _OPENSSL_SOFTWARE\n/*\n * Use this only if you have defined _CRYPTO_OPENSSL and _USE_AES_FROM_OPENSSL. It has no effect otherwise.\n *\n * This options assumes a different internal AES expanded key in OpenSSL which is used mostly if OpenSSL is\n * compiled without support for hardware accelerated AES. It's worth a try if _USE_AES_FROM_OPENSSL doesn't work.\n */\n\n //#define _OPENSSL_SOFTWARE\n\n#endif // _OPENSSL_SOFTWARE\n\n\n\n\n#ifndef FULL_INTERNAL_DATA\n/*\n * Includes the full database in vlmcsd.\n */\n\n //#define FULL_INTERNAL_DATA\n#endif // FULL_INTERNAL_DATA\n\n\n\n\n/*\n * ----------------------------------------------------------------------------------------\n * Removal of features. Allows you to remove features of vlmcsd you do not need or want.\n * Use it to get smaller binaries. This is especially useful on very small embedded devices.\n * ----------------------------------------------------------------------------------------\n */\n\n\n#ifndef NO_FREEBIND\n /*\n  * Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command\n  * line option and you can bind only to (listen on) IP addresses that are currently up and running on\n  * your system.\n  */\n\n//#define NO_FREEBIND\n\n#endif // NO_FREEBIND\n\n\n\n\n#ifndef NO_TAP\n /*\n  * Do not compile support for using a VPN adapter under Windows. Disables -O command line option.\n  */\n\n//#define NO_TAP\n\n#endif // NO_TAP\n\n\n\n\n#ifndef NO_VERSION_INFORMATION\n/*\n * Removes the -V option from vlmcsd and vlmcs that displays the version information\n */\n\n //#define NO_VERSION_INFORMATION\n\n#endif // NO_VERSION_INFORMATION\n\n\n\n\n#ifndef NO_VERBOSE_LOG\n/*\n * Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v\n * option in the vlmcs client. Disables ini file directive LogVerbose.\n */\n\n //#define NO_VERBOSE_LOG\n\n#endif // NO_VERBOSE_LOG\n\n\n\n\n#ifndef NO_LOG\n/*\n * Disables logging completely. You can neither log to a file nor to the console. -D and -f will\n * start vlmcsd in foreground. -e will not be available. Disables ini file directive LogFile.\n * Implies NO_VERBOSE_LOG.\n */\n\n //#define NO_LOG\n\n#endif // NO_LOG\n\n\n\n\n#ifndef NO_STRICT_MODES\n/*\n * Disables emulator detection protection. Removes -M0, -M1, -E0, -E1, -K0, -K1, -K2 and -K3 from\n * vlmcsd command line options and WhitelistingLevel from INI file parameters. vlmcsd always behaves\n * as if it was started with -K0, -M0.\n */\n\n //#define NO_STRICT_MODES\n\n#endif // NO_STRICT_MODES\n\n\n\n\n\n#ifndef NO_CLIENT_LIST\n/*\n * Disables the ability to maintain a list of Client Machine IDs (CMIDs). Removes -M0, -M1, -E0 and -E1\n * from vlmcsd command line options.\n */\n\n //#define NO_CLIENT_LIST\n\n#endif // !NO_CLIENT_LIST\n\n\n\n#ifndef NO_RANDOM_EPID\n /*\n  * Disables the ability to generate random ePIDs. Useful if you managed to grab ePID/HWID from a\n  * real KMS server and want to use these. Removes -r from the vlmcsd command line and the ini\n  * file directive RandomizationLevel (The randomization level will be harcoded to 0).\n  */\n\n  //#define NO_RANDOM_EPID\n\n#endif // NO_RANDOM_EPID\n\n\n\n\n#ifndef NO_INI_FILE\n/*\n * Disables the ability to use a configuration file (aka ini file). Removes -i from the command line.\n */\n\n //#define NO_INI_FILE\n\n#endif // NO_INI_FILE\n\n\n\n\n#ifndef NO_PID_FILE\n /*\n * Disables the abilty to write a pid file containing the process id of vlmcsd. If your init system\n * does not need this feature, you can safely disables this but it won't save much space. Disables\n * the use of -p from the command line and PidFile from the ini file.\n */\n\n //#define NO_PID_FILE\n\n#endif // NO_PID_FILE\n\n\n\n\n#ifndef NO_EXTERNAL_DATA\n /*\n * Disables the abilty to load external KMS data from a file. Disables command line options -j\n * and ini file parameter KmsData. Implies UNSAFE_DATA_LOAD.\n */\n\n //#define NO_EXTERNAL_DATA\n\n#endif // NO_EXTERNAL_DATA\n\n\n\n\n#ifndef NO_INTERNAL_DATA\n /*\n * Compiles vlmcsd and vlmcs without an internal database. If no database is found at\n * either the default location or the file specified with command line option -j.,\n * the program exits with an error message.\n */\n\n //#define NO_INTERNAL_DATA\n\n#endif // NO_INTERNAL_DATA\n\n\n\n\n#ifndef UNSAFE_DATA_LOAD\n /*\n * Does not check an external KMS data file for integrity.\n * This save some bytes but it dangerous if you load a KMS data file from an unknown source.\n */\n\n //#define UNSAFE_DATA_LOAD\n\n#endif // UNSAFE_DATA_LOAD\n\n\n\n\n#ifndef NO_USER_SWITCH\n/*\n * Disables switching to another uid and/or gid after starting the program and setting up the sockets.\n * You cannot use -u anf -g on the command line as well as User and Group in the ini file. If your init system\n * supports starting daemons as another uid/gid (user/group) you can disable this feature in vlmcsd as long as you\n * do not need to run vlmcsd on a privileged port ( < 1024 on most systems).\n *\n * This setting has no effect on native Windows since -u and -g is not available anyway. It may be used with\n * Cygwin.\n */\n\n //#define NO_USER_SWITCH\n\n#endif // NO_USER_SWITCH\n\n\n\n\n#ifndef NO_HELP\n/*\n * Disables display of help in both vlmcsd and vlmcs. Saves some bytes but only makes sense if you have\n * access to the man files vlmcsd.8 and vlmcs.1\n */\n\n //#define NO_HELP\n\n#endif // NO_HELP\n\n\n\n\n#ifndef NO_CUSTOM_INTERVALS\n/*\n * Disables the ability to specify custom interval for renewing and retrying activation. Newer versions of the Microsoft's\n * KMS activation client (as in Win 8.1) do not honor these parameters anyway. Disable them to save some bytes. Removes\n * -A and -R from the command line as well as ActivationInterval and RenewalInterval in the ini file.\n */\n\n //#define NO_CUSTOM_INTERVALS\n\n#endif // NO_CUSTOM_INTERVALS\n\n\n\n\n#ifndef NO_PRIVATE_IP_DETECT\n/*\n * Disables the ability to protect vlmcsd against KMS requests from public IP addresses.\n * Removes -o from the command line.\n */\n\n //#define NO_PRIVATE_IP_DETECT\n\n#endif // NO_PRIVATE_IP_DETECT\n\n\n\n\n#ifndef NO_SOCKETS\n/*\n * Disables standalone startup of vlmcsd. If you use this config directive, you must start vlmcsd from an internet\n * superserver like inetd, xinetd, systemd or launchd. Disables -m, -t, -4, -6, -e, -f, -P and -L in the vlmcsd\n * command line. Socket setup is the job of your superserver.\n */\n\n //#define NO_SOCKETS\n\n#endif // NO_SOCKETS\n\n\n\n\n#ifndef NO_CL_PIDS\n/*\n * Disables the ability to specify ePIDs and HWID at the command line. You still may use them in the ini file.\n * Removes -0, -3, -w and -H from the vlmcsd command line.\n */\n\n //#define NO_CL_PIDS\n\n#endif // NO_CL_PIDS\n\n\n\n\n#ifndef NO_LIMIT\n/*\n * Disables the ability to limit the number of worker threads or processes that vlmcsd uses. While you should set a\n * limit whenever possible, you may save some bytes by enabling that setting. If you do not use a limit, use vlmcsd\n * in a \"friendly\" environment only, i.e. do not run it without a reasonable limit on the internet.\n *\n * Removes the ability to use -m in the vlmcsd command line and MaxWorkers in the ini file.\n *\n * Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP\n * and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.\n */\n\n //#define NO_LIMIT\n\n#endif // NO_LIMIT\n\n\n\n\n#ifndef NO_SIGHUP\n/*\n * Disables the ability to signal hangup (SIGHUP) to vlmcsd to restart it (rereading the ini file). The SIGHUP\n * handler makes heavy use of OS specific code. It should not cause any trouble on Solaris, Mac OS X and iOS. On Linux\n * use \"#define USE_AUXV\" (see troubleshooting options) if this is supported by your C runtime library.\n *\n * You may save some bytes by enabling this option. Use it also if the SIGHUP handler causes any trouble on your\n * platform. Please note that with no SIGHUP handler at all. vlmcsd will simply terminate (uncleanly) if it receives\n * the SIGHUP signal. This is the same behavior as with most other signals.\n *\n * This option has no effect on native Windows since Posix signaling is not supported. It can be used with Cygwin.\n */\n\n //#define NO_SIGHUP\n\n#endif // NO_SIGHUP\n\n\n\n\n#ifndef SIMPLE_RPC\n/*\n * Uses a simple version of the RPC protocol which does not support NDR64 and BTFN.\n * Supports RPC with the features present in Windows XP and earlier only. Using this creates\n * smaller binaries but makes emulator detection easier.\n */\n\n //#define SIMPLE_RPC\n#endif // !SIMPLE_RPC\n\n\n\n\n#ifndef SIMPLE_SOCKETS\n/*\n * Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.\n * It still supports IPv4 and IPv6.\n */\n\n //#define SIMPLE_SOCKETS\n\n#endif // SIMPLE_SOCKETS\n\n\n\n/* Don't change anything BELOW this line */\n\n\n#endif /* CONFIG_H_ */\n"
  },
  {
    "path": "src/crypto.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"crypto.h\"\n#include \"endian.h\"\n#include <stdint.h>\n\nconst BYTE AesKeyV4[] = {\n\t0x05, 0x3D, 0x83, 0x07, 0xF9, 0xE5, 0xF0, 0x88, 0xEB, 0x5E, 0xA6, 0x68, 0x6C, 0xF0, 0x37, 0xC7, 0xE4, 0xEF, 0xD2, 0xD6};\n\nconst BYTE AesKeyV5[] = {\n\t0xCD, 0x7E, 0x79, 0x6F, 0x2A, 0xB2, 0x5D, 0xCB, 0x55, 0xFF, 0xC8, 0xEF, 0x83, 0x64, 0xC4, 0x70 };\n\nconst BYTE AesKeyV6[] = {\n\t0xA9, 0x4A, 0x41, 0x95, 0xE2, 0x01, 0x43, 0x2D, 0x9B, 0xCB, 0x46, 0x04, 0x05, 0xD8, 0x4A, 0x21 };\n\nstatic const BYTE SBox[] = {\n\t    0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,\n\t    0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,\n\t    0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,\n\t    0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,\n\t    0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,\n\t    0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,\n\t    0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,\n\t    0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,\n\t    0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,\n\t    0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,\n\t    0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,\n\t    0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,\n\t    0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,\n\t    0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,\n\t    0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,\n\t    0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16\n};\n\n\nvoid XorBlock(const BYTE *const in, const BYTE *out) // Ensure that this is always 32 bit aligned\n{\n\t/*UAA64( out, 0 ) ^= UAA64( in, 0 );\n\tUAA64( out, 1 ) ^= UAA64( in, 1 );*/\n\n\tuint_fast8_t i;\n\n\tfor (i = 0; i < AES_BLOCK_WORDS; i++)\n\t{\n\t\t((DWORD*)out)[i] ^= ((DWORD*)in)[i];\n\t}\n}\n\n#define AddRoundKey(d, rk) XorBlock((const BYTE *)rk, (const BYTE *)d)\n\n#define Mul2(word) (((word & 0x7f7f7f7f) << 1) ^ (((word & 0x80808080) >> 7) * 0x1b))\n#define Mul3(word) (Mul2(word) ^ word)\n#define Mul4(word) (Mul2(Mul2(word)))\n#define Mul8(word) (Mul2(Mul2(Mul2(word))))\n#define Mul9(word) (Mul8(word) ^ word)\n#define MulB(word) (Mul8(word) ^ Mul3(word))\n#define MulD(word) (Mul8(word) ^ Mul4(word) ^ word)\n#define MulE(word) (Mul8(word) ^ Mul4(word) ^ Mul2(word))\n\n//32 bit Galois Multiplication (generates bigger code than Macros)\n/*static DWORD Mul(DWORD x, DWORD y)\n{\n\tDWORD result = x, yTemp = y, log2;\n\n\tif (!y) return 0;\n\n\tfor (log2 = 0; yTemp >>= 1; log2++ )\n\t{\n\t\tresult = Mul2(result);\n\t}\n\n\treturn result ^ Mul(x, y - (1 << log2));\n}*/\n\n\nvoid MixColumnsR(BYTE *restrict state)\n{\n\tuint_fast8_t i = 0;\n\tfor (; i < AES_BLOCK_WORDS; i++)\n\t{\n\t\t#if defined(_CRYPTO_OPENSSL) && defined(_OPENSSL_SOFTWARE) && defined(_USE_AES_FROM_OPENSSL) //Always byte swap regardless of endianess\n\t\t\tDWORD word = BS32(((DWORD *) state)[i]);\n\t\t\t((DWORD *) state)[i] = BS32(MulE(word) ^ ROR32(MulB(word), 8) ^ ROR32(MulD(word), 16) ^ ROR32(Mul9(word), 24));\n\t\t#else\n\t\t\tDWORD word = LE32(((DWORD *) state)[i]);\n\t\t\t((DWORD *) state)[i] = LE32(MulE(word) ^ ROR32(MulB(word), 8) ^ ROR32(MulD(word), 16) ^ ROR32(Mul9(word), 24));\n\t\t#endif\n\t}\n}\n\n\nstatic DWORD SubDword(DWORD v)\n{\n\tBYTE *b = (BYTE *)&v;\n\tuint_fast8_t i = 0;\n\n\tfor (; i < sizeof(DWORD); i++) b[i] = SBox[b[i]];\n\n\treturn v;\n}\n\n\nvoid AesInitKey(AesCtx *Ctx, const BYTE *Key, int_fast8_t IsV6, int RijndaelKeyBytes)\n{\n\tint RijndaelKeyDwords = RijndaelKeyBytes / sizeof(DWORD);\n\tCtx->rounds = (uint_fast8_t)(RijndaelKeyDwords + 6);\n\n\tstatic const DWORD RCon[] = {\n\t\t0x00000000, 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,\n\t\t0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000 };\n\n\tuint_fast8_t  i;\n\tDWORD  temp;\n\n\tmemcpy(Ctx->Key, Key, RijndaelKeyBytes);\n\n\tfor ( i = (uint_fast8_t)RijndaelKeyDwords; i < ( Ctx->rounds + 1 ) << 2; i++ )\n\t{\n\t\ttemp = Ctx->Key[ i - 1 ];\n\n\t\tif ( ( i % RijndaelKeyDwords ) == 0 )\n\t\t\ttemp = BE32( SubDword( ROR32( BE32(temp), 24)  ) ^ RCon[ i / RijndaelKeyDwords ] );\n\n\t\tCtx->Key[ i ] = Ctx->Key[ i - RijndaelKeyDwords ] ^ temp;\n\t}\n\n\tif ( IsV6 )\n\t{\n\t\tBYTE *_p = (BYTE *)Ctx->Key;\n\n\t\t_p[ 4 * 16 ] ^= 0x73;\n\t\t_p[ 6 * 16 ] ^= 0x09;\n\t\t_p[ 8 * 16 ] ^= 0xE4;\n\t}\n}\n\n\n#if !defined(_CRYPTO_OPENSSL) || !defined(_USE_AES_FROM_OPENSSL) || defined(_OPENSSL_SOFTWARE)\nstatic void SubBytes(BYTE *block)\n{\n\tuint_fast8_t i;\n\n\tfor (i = 0; i < AES_BLOCK_BYTES; i++)\n\t\tblock[i] = SBox[ block[i] ];\n}\n\n\nstatic void ShiftRows(BYTE *state)\n{\n\tBYTE bIn[AES_BLOCK_BYTES];\n\tuint_fast8_t i;\n\n\tmemcpy(bIn, state, AES_BLOCK_BYTES);\n\tfor (i = 0; i < AES_BLOCK_BYTES; i++)\n\t{\n\t\tstate[i] = bIn[(i + ((i & 3) << 2)) & 0xf];\n\t}\n};\n\n\nstatic void MixColumns(BYTE *state)\n{\n\tuint_fast8_t i = 0;\n\tfor (; i < AES_BLOCK_WORDS; i++)\n\t{\n\t\tDWORD word = LE32(((DWORD *) state)[i]);\n\t\t((DWORD *) state)[i] = LE32(Mul2(word) ^ ROR32(Mul3(word), 8) ^ ROR32(word, 16) ^ ROR32(word, 24));\n\t}\n}\n\n\nvoid AesEncryptBlock(const AesCtx *const Ctx, BYTE *block)\n{\n\tuint_fast8_t  i;\n\n\tfor ( i = 0 ;; i += 4 )\n\t{\n\t\tAddRoundKey(block, &Ctx->Key[ i ]);\n\t\tSubBytes(block);\n\t\tShiftRows(block);\n\n\t\tif ( i >= ( Ctx->rounds - 1 ) << 2 ) break;\n\n\t\tMixColumns(block);\n\t}\n\n\tAddRoundKey(block, &Ctx->Key[ Ctx->rounds << 2 ]);\n}\n\n\nvoid AesCmacV4(BYTE *Message, size_t MessageSize, BYTE *MacOut)\n{\n    size_t i;\n    BYTE mac[AES_BLOCK_BYTES];\n    AesCtx Ctx;\n\n    AesInitKey(&Ctx, AesKeyV4, FALSE, V4_KEY_BYTES);\n\n    memset(mac, 0, sizeof(mac));\n    memset(Message + MessageSize, 0, AES_BLOCK_BYTES);\n    Message[MessageSize] = 0x80;\n\n    for (i = 0; i <= MessageSize; i += AES_BLOCK_BYTES)\n    {\n        XorBlock(Message + i, mac);\n        AesEncryptBlock(&Ctx, mac);\n    }\n\n    memcpy(MacOut, mac, AES_BLOCK_BYTES);\n}\n#endif\n\n#if !defined(_CRYPTO_OPENSSL) || !defined(_USE_AES_FROM_OPENSSL)\n\n#ifndef SMALL_AES\n\nstatic const BYTE SBoxR[] = {\n\t0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,\n\t0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,\n\t0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,\n\t0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,\n\t0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,\n\t0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,\n\t0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,\n\t0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,\n\t0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,\n\t0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,\n\t0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,\n\t0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,\n\t0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,\n\t0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,\n\t0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,\n\t0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D\n};\n\n#define GetSBoxR(x) SBoxR[x]\n\n#else // SMALL_AES\n\nstatic uint8_t SBoxR(uint8_t byte)\n{\n\tuint8_t i;\n\n\tfor (i = 0; TRUE; i++)\n\t{\n\t\tif (byte == SBox[i]) return i;\n\t}\n}\n\n#define GetSBoxR(x) SBoxR(x)\n\n#endif // SMALL_AES\n\n\nstatic void ShiftRowsR(BYTE *state)\n{\n\tBYTE b[AES_BLOCK_BYTES];\n\tuint_fast8_t i;\n\n\tmemcpy(b, state, AES_BLOCK_BYTES);\n\n\tfor (i = 0; i < AES_BLOCK_BYTES; i++)\n\t\tstate[i] = b[(i - ((i & 0x3) << 2)) & 0xf];\n}\n\n\nstatic void SubBytesR(BYTE *block)\n{\n\tuint_fast8_t i;\n\n\tfor (i = 0; i < AES_BLOCK_BYTES; i++)\n\t{\n\t\tblock[i] = GetSBoxR( block[i] );\n\t}\n}\n\n\nvoid AesEncryptCbc(const AesCtx *const Ctx, BYTE *restrict iv, BYTE *restrict data, size_t *restrict len)\n{\n\t// Pad up to blocksize inclusive\n\tsize_t i;\n\tuint_fast8_t pad = (~*len & (AES_BLOCK_BYTES - 1)) + 1;\n\n\t#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8) // gcc 4.8 memset bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56977\n\t\tfor (i = 0; i < pad; i++) data[*len + i] = pad;\n\t#else\n\t\tmemset(data + *len, pad, pad);\n\t#endif\n\t*len += pad;\n\n\tif ( iv ) XorBlock(iv, data);\n\tAesEncryptBlock(Ctx, data);\n\n\tfor (i = *len - AES_BLOCK_BYTES; i; i -= AES_BLOCK_BYTES)\n\t{\n\t\tXorBlock(data, data + AES_BLOCK_BYTES);\n\t\tdata += AES_BLOCK_BYTES;\n\t\tAesEncryptBlock(Ctx, data);\n\t}\n}\n\n\nvoid AesDecryptBlock(const AesCtx *const Ctx, BYTE *block)\n{\n\tuint_fast8_t  i;\n\n\tAddRoundKey(block, &Ctx->Key[ Ctx->rounds << 2 ]);\n\n\tfor ( i = ( Ctx->rounds - 1 ) << 2 ;; i -= 4 )\n\t{\n\t\tShiftRowsR(block);\n\t\tSubBytesR(block);\n\t\tAddRoundKey(block, &Ctx->Key[ i ]);\n\n\t\tif ( i == 0 ) break;\n\n\t\tMixColumnsR(block);\n\t}\n}\n\n\nvoid AesDecryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t len)\n{\n\tBYTE  *cc;\n\n\tfor (cc = data + len - AES_BLOCK_BYTES; cc > data; cc -= AES_BLOCK_BYTES)\n\t{\n\t\tAesDecryptBlock(Ctx, cc);\n\t\tXorBlock(cc - AES_BLOCK_BYTES, cc);\n\t}\n\n\tAesDecryptBlock(Ctx, cc);\n\tif ( iv ) XorBlock(iv, cc);\n}\n#endif // _CRYPTO_OPENSSL || OPENSSL_VERSION_NUMBER < 0x10000000L\n"
  },
  {
    "path": "src/crypto.h",
    "content": "#ifndef __crypto_h\n#define __crypto_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"types.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n#include \"endian.h\"\n#include <stdint.h>\n\n#define AES_KEY_BYTES   (16) // 128 Bits\n#define AES_BLOCK_BYTES (16)\n#define AES_BLOCK_WORDS (AES_BLOCK_BYTES / sizeof(DWORD))\n#define AES_KEY_DWORDS  (AES_KEY_BYTES / sizeof(DWORD))\n#define V4_KEY_BYTES\t(20) // 160 Bits\n\n#define ROR32(v, n)  ( (v) << (32 - n) | (v) >> n )\n\nvoid XorBlock(const BYTE *const in, const BYTE *out);\n\nvoid AesCmacV4(BYTE *data, size_t len, BYTE *hash);\n\nextern const BYTE AesKeyV5[];\nextern const BYTE AesKeyV6[];\n\ntypedef struct {\n\tDWORD  Key[48]; // Supports a maximum of 160 key bits!\n\tuint_fast8_t rounds;\n} AesCtx;\n\nvoid AesInitKey(AesCtx *Ctx, const BYTE *Key, int_fast8_t IsV6, int AesKeyBytes);\nvoid AesEncryptBlock(const AesCtx *const Ctx, BYTE *block);\nvoid AesDecryptBlock(const AesCtx *const Ctx, BYTE *block);\nvoid AesEncryptCbc(const AesCtx *const Ctx, BYTE *restrict iv, BYTE *restrict data, size_t *restrict len);\nvoid AesDecryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t len);\nvoid MixColumnsR(BYTE *restrict state);\n\n#if defined(_CRYPTO_OPENSSL)\n#include \"crypto_openssl.h\"\n\n#elif defined(_CRYPTO_POLARSSL)\n#include \"crypto_polarssl.h\"\n\n#elif defined(_CRYPTO_WINDOWS)\n#include \"crypto_windows.h\"\n\n#else\n#include \"crypto_internal.h\"\n\n#endif\n#endif // __crypto_h\n"
  },
  {
    "path": "src/crypto_internal.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if !defined(_CRYPTO_OPENSSL) && !defined(_CRYPTO_POLARSSL) && !defined(_CRYPTO_WINDOWS)\n#include \"crypto_internal.h\"\n#include \"endian.h\"\n\n#define F0(x, y, z)  ( ((x) & (y)) | (~(x) & (z)) )\n#define F1(x, y, z)  ( ((x) & (y)) | ((x) & (z)) | ((y) & (z)) )\n\n#define SI1(x)  ( ROR32(x, 2 ) ^ ROR32(x, 13) ^ ROR32(x, 22) )\n#define SI2(x)  ( ROR32(x, 6 ) ^ ROR32(x, 11) ^ ROR32(x, 25) )\n#define SI3(x)  ( ROR32(x, 7 ) ^ ROR32(x, 18) ^ ((x) >> 3 ) )\n#define SI4(x)  ( ROR32(x, 17) ^ ROR32(x, 19) ^ ((x) >> 10) )\n\nstatic const DWORD k[] = {\n\t0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1,\n\t0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n\t0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786,\n\t0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n\t0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147,\n\t0x06CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n\t0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B,\n\t0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n\t0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A,\n\t0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n\t0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n};\n\n\nstatic void Sha256Init(Sha256Ctx *Ctx)\n{\n\tCtx->State[0] = 0x6A09E667;\n\tCtx->State[1] = 0xBB67AE85;\n\tCtx->State[2] = 0x3C6EF372;\n\tCtx->State[3] = 0xA54FF53A;\n\tCtx->State[4] = 0x510E527F;\n\tCtx->State[5] = 0x9B05688C;\n\tCtx->State[6] = 0x1F83D9AB;\n\tCtx->State[7] = 0x5BE0CD19;\n\tCtx->Len = 0;\n}\n\n\nstatic void Sha256ProcessBlock(Sha256Ctx *Ctx, BYTE *block)\n{\n\tunsigned int  i;\n\tDWORD  w[64], temp1, temp2;\n\tDWORD  a = Ctx->State[0];\n\tDWORD  b = Ctx->State[1];\n\tDWORD  c = Ctx->State[2];\n\tDWORD  d = Ctx->State[3];\n\tDWORD  e = Ctx->State[4];\n\tDWORD  f = Ctx->State[5];\n\tDWORD  g = Ctx->State[6];\n\tDWORD  h = Ctx->State[7];\n\n\tfor (i = 0; i < 16; i++)\n\t\t//w[ i ] = GET_UAA32BE(block, i);\n\t\tw[i] = BE32(((DWORD*)block)[i]);\n\n\tfor (i = 16; i < 64; i++)\n\t\tw[ i ] = SI4(w[ i - 2 ]) + w[ i - 7 ] + SI3(w[ i - 15 ]) + w[ i - 16 ];\n\n\tfor (i = 0; i < 64; i++)\n\t{\n\t\ttemp1 = h + SI2(e) + F0(e, f, g) + k[ i ] + w[ i ];\n\t\ttemp2 = SI1(a) + F1(a, b, c);\n\n\t\th = g;\n\t\tg = f;\n\t\tf = e;\n\t\te = d + temp1;\n\t\td = c;\n\t\tc = b;\n\t\tb = a;\n\t\ta = temp1 + temp2;\n\t}\n\n\tCtx->State[0] += a;\n\tCtx->State[1] += b;\n\tCtx->State[2] += c;\n\tCtx->State[3] += d;\n\tCtx->State[4] += e;\n\tCtx->State[5] += f;\n\tCtx->State[6] += g;\n\tCtx->State[7] += h;\n}\n\n\nstatic void Sha256Update(Sha256Ctx *Ctx, BYTE *data, size_t len)\n{\n\tunsigned int  b_len = Ctx->Len & 63,\n\t\t\t\t\t\t\t\tr_len = (b_len ^ 63) + 1;\n\n\tCtx->Len += (unsigned int)len;\n\n\tif ( len < r_len )\n\t{\n\t\tmemcpy(Ctx->Buffer + b_len, data, len);\n\t\treturn;\n\t}\n\n\tif ( r_len < 64 )\n\t{\n\t\tmemcpy(Ctx->Buffer + b_len, data, r_len);\n\t\tlen  -= r_len;\n\t\tdata += r_len;\n\t\tSha256ProcessBlock(Ctx, Ctx->Buffer);\n\t}\n\n\tfor (; len >= 64; len -= 64, data += 64)\n\t\tSha256ProcessBlock(Ctx, data);\n\n\tif ( len ) memcpy(Ctx->Buffer, data, len);\n}\n\n\nstatic void Sha256Finish(Sha256Ctx *Ctx, BYTE *hash)\n{\n\tunsigned int  i, b_len = Ctx->Len & 63;\n\n\tCtx->Buffer[ b_len ] = 0x80;\n\tif ( b_len ^ 63 ) memset(Ctx->Buffer + b_len + 1, 0, b_len ^ 63);\n\n\tif ( b_len >= 56 )\n\t{\n\t\tSha256ProcessBlock(Ctx, Ctx->Buffer);\n\t\tmemset(Ctx->Buffer, 0, 56);\n\t}\n\n\t//PUT_UAA64BE(Ctx->Buffer, (unsigned long long)(Ctx->Len * 8), 7);\n\t((uint64_t*)Ctx->Buffer)[7] = BE64((uint64_t)Ctx->Len << 3);\n\tSha256ProcessBlock(Ctx, Ctx->Buffer);\n\n\tfor (i = 0; i < 8; i++)\n\t\t//PUT_UAA32BE(hash, Ctx->State[i], i);\n\t\t((DWORD*)hash)[i] = BE32(Ctx->State[i]);\n\n}\n\n\nvoid Sha256(BYTE *data, size_t len, BYTE *hash)\n{\n\tSha256Ctx Ctx;\n\n\tSha256Init(&Ctx);\n\tSha256Update(&Ctx, data, len);\n\tSha256Finish(&Ctx, hash);\n}\n\n\nstatic void _Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, size_t klen)\n{\n\tBYTE  IPad[64];\n\tunsigned int  i;\n\n\tmemset(IPad, 0x36, sizeof(IPad));\n\tmemset(Ctx->OPad, 0x5C, sizeof(Ctx->OPad));\n\n\tif ( klen > 64 )\n\t{\n\t\tBYTE *temp = (BYTE*)alloca(32);\n\t\tSha256(key, klen, temp);\n\t\tklen = 32;\n\t\tkey  = temp;\n\t}\n\n\tfor (i = 0; i < klen; i++)\n\t{\n\t\tIPad[ i ]      ^= key[ i ];\n\t\tCtx->OPad[ i ] ^= key[ i ];\n\t}\n\n\tSha256Init(&Ctx->ShaCtx);\n\tSha256Update(&Ctx->ShaCtx, IPad, sizeof(IPad));\n}\n\n\nstatic void _Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, size_t len)\n{\n\tSha256Update(&Ctx->ShaCtx, data, len);\n}\n\n\nstatic void _Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac)\n{\n\tBYTE  temp[32];\n\n\tSha256Finish(&Ctx->ShaCtx, temp);\n\tSha256Init(&Ctx->ShaCtx);\n\tSha256Update(&Ctx->ShaCtx, Ctx->OPad, sizeof(Ctx->OPad));\n\tSha256Update(&Ctx->ShaCtx, temp, sizeof(temp));\n\tSha256Finish(&Ctx->ShaCtx, hmac);\n}\n\n\n\nint_fast8_t Sha256Hmac(BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac)\n{\n\tSha256HmacCtx Ctx;\n\t_Sha256HmacInit(&Ctx, key, 16);\n\t_Sha256HmacUpdate(&Ctx, data, len);\n\t_Sha256HmacFinish(&Ctx, hmac);\n\treturn TRUE;\n}\n\n\n#endif // No external Crypto\n\n"
  },
  {
    "path": "src/crypto_internal.h",
    "content": "#ifndef __crypto_internal_h\n#define __crypto_internal_h\n\n#if !defined(_CRYPTO_OPENSSL) && !defined(_CRYPTO_POLARSSL) && !defined(_CRYPTO_WINDOWS)\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"crypto.h\"\n\ntypedef struct {\n\tDWORD  State[8];\n\tBYTE   Buffer[64];\n\tunsigned int  Len;\n} Sha256Ctx;\n\ntypedef struct {\n\tSha256Ctx  ShaCtx;\n\tBYTE  OPad[64];\n} Sha256HmacCtx;\n\nvoid Sha256(BYTE *data, size_t len, BYTE *hash);\nint_fast8_t Sha256Hmac(BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);\n\n//void _Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, size_t klen);\n//void _Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, size_t len);\n//void _Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac);\n\n//#define Sha256HmacInit(c, k, l)    ( _Sha256HmacInit(c, k, l),   !0 )\n//#define Sha256HmacUpdate(c, d, l)  ( _Sha256HmacUpdate(c, d, l), !0 )\n//#define Sha256HmacFinish(c, h)     ( _Sha256HmacFinish(c, h),    !0 )\n\n\n#endif // !defined(_CRYPTO_OPENSSL) && !defined(_CRYPTO_POLARSSL) && !defined(_CRYPTO_WINDOWS)\n\n#endif // __crypto_internal_h\n"
  },
  {
    "path": "src/crypto_openssl.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if defined(_CRYPTO_OPENSSL)\n\n#include \"crypto.h\"\n#include \"crypto_openssl.h\" // Required for Eclipse only\n#include <stdint.h>\n#include \"endian.h\"\n\n\n#ifndef _OPENSSL_NO_HMAC\n\nint Sha256HmacInit_OpenSSL(HMAC_CTX *c, const void *k, int l)\n{\n\tHMAC_CTX_init(c);\n\t#if OPENSSL_VERSION_NUMBER >= 0x10000000L\n\t\tint result =\n\t#else\n\t\tint result = TRUE;\n\t#endif\n\tHMAC_Init_ex(c, k, l, EVP_sha256(), NULL);\n\treturn result;\n}\n\nint Sha256HmacFinish_OpenSSL(HMAC_CTX *c, unsigned char *h, unsigned int *l)\n{\n\t#if OPENSSL_VERSION_NUMBER >= 0x10000000L\n\t\tint result =\n\t#else\n\t\tint result = !0;\n\t#endif\n\tHMAC_Final(c, h, l);\n\tHMAC_CTX_cleanup(c);\n\treturn result;\n}\n\nint_fast8_t Sha256Hmac(BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac)\n{\n\tHMAC_CTX Ctx;\n\n#\tif OPENSSL_VERSION_NUMBER >= 0x10000000L\n\n\treturn\n\t\tSha256HmacInit_OpenSSL(&Ctx, key, 16) &&\n\t\tHMAC_Update(&Ctx, data, len) &&\n\t\tSha256HmacFinish_OpenSSL(&Ctx, hmac, NULL);\n\n#\telse // OpenSSL 0.9.x\n\n\tSha256HmacInit_OpenSSL(&Ctx, key, 16);\n\tHMAC_Update(&Ctx, data, len);\n\tSha256HmacFinish_OpenSSL(&Ctx, hmac, NULL);\n\treturn TRUE;\n\n#\tendif\n}\n\n#else // _OPENSSL_NO_HMAC (some routers have OpenSSL without support for HMAC)\n\nint _Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, size_t klen)\n{\n\tBYTE  IPad[64];\n\tunsigned int  i;\n\n\tmemset(IPad, 0x36, sizeof(IPad));\n\tmemset(Ctx->OPad, 0x5C, sizeof(Ctx->OPad));\n\n\tif ( klen > 64 )\n\t{\n\t\tBYTE *temp = (BYTE*)alloca(32);\n\t\tSHA256(key, klen, temp);\n\t\tklen = 32;\n\t\tkey  = temp;\n\t}\n\n\tfor (i = 0; i < klen; i++)\n\t{\n\t\tIPad[ i ]      ^= key[ i ];\n\t\tCtx->OPad[ i ] ^= key[ i ];\n\t}\n\n\tSHA256_Init(&Ctx->ShaCtx);\n\treturn SHA256_Update(&Ctx->ShaCtx, IPad, sizeof(IPad));\n}\n\nint _Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, size_t len)\n{\n\tint rc = SHA256_Update(&Ctx->ShaCtx, data, len);\n\treturn rc;\n}\n\nint _Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac, void* dummy)\n{\n\tBYTE temp[32];\n\n\tSHA256_Final(temp, &Ctx->ShaCtx);\n\tSHA256_Init(&Ctx->ShaCtx);\n\tSHA256_Update(&Ctx->ShaCtx, Ctx->OPad, sizeof(Ctx->OPad));\n\tSHA256_Update(&Ctx->ShaCtx, temp, sizeof(temp));\n\treturn SHA256_Final(hmac, &Ctx->ShaCtx);\n}\n\nint_fast8_t Sha256Hmac(BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac)\n{\n\tSha256HmacCtx Ctx;\n\t_Sha256HmacInit(&Ctx, key, 16);\n\t_Sha256HmacUpdate(&Ctx, data, len);\n\t_Sha256HmacFinish(&Ctx, hmac, NULL);\n\treturn TRUE;\n}\n#endif\n\n#if defined(_USE_AES_FROM_OPENSSL)\nvoid TransformOpenSslEncryptKey(AES_KEY *k, const AesCtx *const Ctx)\n{\n\tuint32_t *rk_OpenSSL = k->rd_key, *rk_vlmcsd = (uint32_t*)Ctx->Key;\n\tk->rounds = Ctx->rounds;\n\n\tfor (; rk_OpenSSL < k->rd_key + ((k->rounds + 1) << 2); rk_OpenSSL++, rk_vlmcsd++)\n\t{\n\t\t#ifdef _OPENSSL_SOFTWARE\n\t\t\t*rk_OpenSSL = BE32(*rk_vlmcsd);\n\t\t#else\n\t\t\t*rk_OpenSSL = LE32(*rk_vlmcsd);\n\t\t#endif\n\t}\n}\n\nvoid TransformOpenSslDecryptKey(AES_KEY *k, const AesCtx *const Ctx)\n{\n\tuint_fast8_t i;\n\n\t#ifdef _DEBUG_OPENSSL\n\tAES_set_decrypt_key((BYTE*)Ctx->Key, 128, k);\n\terrorout(\"Correct V5 round key:\");\n\n\tfor (i = 0; i < (Ctx->rounds + 1) << 4; i++)\n\t{\n\t\tif (!(i % 16)) errorout(\"\\n\");\n\t\tif (!(i % 4)) errorout(\" \");\n\t\terrorout(\"%02X\", ((BYTE*)(k->rd_key))[i]);\n\t}\n\n\terrorout(\"\\n\");\n\t#endif\n\n\tk->rounds = Ctx->rounds;\n\n\t/* invert the order of the round keys blockwise (1 Block = AES_BLOCK_SIZE = 16): */\n\n\tfor (i = 0; i < (Ctx->rounds + 1) << 2; i++)\n\t{\n\t\t#ifdef _OPENSSL_SOFTWARE\n\t\t\tk->rd_key[((Ctx->rounds-(i >> 2)) << 2) + (i & 3)] = BE32(Ctx->Key[i]);\n\t\t#else\n\t\t\tk->rd_key[((Ctx->rounds-(i >> 2)) << 2) + (i & 3)] = LE32(Ctx->Key[i]);\n\t\t#endif\n\t}\n\n    /* apply the inverse MixColumn transform to all round keys but the first and the last: */\n\n\tuint32_t *rk = k->rd_key + 4;\n\n\tfor (i = 0; i < (Ctx->rounds - 1); i++)\n\t{\n    \tMixColumnsR((BYTE*)(rk + (i << 2)));\n    }\n\n\t#ifdef _DEBUG_OPENSSL\n\terrorout(\"Real round key:\");\n\n\tfor (i = 0; i < (Ctx->rounds + 1) << 4; i++)\n\t{\n\t\tif (!(i % 16)) errorout(\"\\n\");\n\t\tif (!(i % 4)) errorout(\" \");\n\t\terrorout(\"%02X\", ((BYTE*)(k->rd_key))[i]);\n\t}\n\n\terrorout(\"\\n\");\n\t#endif\n}\n\nstatic BYTE NullIV[AES_BLOCK_SIZE + 8]; // OpenSSL may overwrite bytes behind IV\n\nvoid AesEncryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t *len)\n{\n\tAES_KEY k;\n\n\t// OpenSSL overwrites IV plus 4 bytes\n\tBYTE localIV[24]; // 4 spare bytes for safety\n\tif (iv) memcpy(localIV, iv, AES_BLOCK_SIZE);\n\n\t// OpenSSL Low-Level APIs do not pad. Could use EVP API instead but needs more code to access the expanded key\n\tuint_fast8_t pad = (~*len & (AES_BLOCK_SIZE - 1)) + 1;\n\n\t#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8) // gcc 4.8 memset bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56977\n\t    size_t i;\n\t\tfor (i = 0; i < pad; i++) data[*len + i] = pad;\n\t#else\n\t\tmemset(data + *len, pad, pad);\n\t#endif\n\t*len += pad;\n\n\tmemset(NullIV, 0, sizeof(NullIV));\n\n\tTransformOpenSslEncryptKey(&k, Ctx);\n\n\tAES_cbc_encrypt(data, data, *len, &k, iv ? localIV : NullIV, AES_ENCRYPT);\n}\n\nvoid AesDecryptBlock(const AesCtx *const Ctx, BYTE *block)\n{\n\tAES_KEY k;\n\n\tTransformOpenSslDecryptKey(&k, Ctx);\n\tAES_decrypt(block, block, &k);\n}\n\n#if defined(_CRYPTO_OPENSSL) && defined(_USE_AES_FROM_OPENSSL) && !defined(_OPENSSL_SOFTWARE)\nvoid AesEncryptBlock(const AesCtx *const Ctx, BYTE *block)\n{\n\tAES_KEY k;\n\n\tTransformOpenSslEncryptKey(&k, Ctx);\n\tAES_encrypt(block, block, &k);\n}\n#endif\n\nvoid AesDecryptCbc(const AesCtx *const Ctx, BYTE *iv, BYTE *data, size_t len)\n{\n\tAES_KEY k;\n\n\tmemset(NullIV, 0, sizeof(NullIV));\n\n\tTransformOpenSslDecryptKey(&k, Ctx);\n\tAES_cbc_encrypt(data, data, len, &k, iv ? iv : NullIV, AES_DECRYPT);\n}\n\n#ifndef _OPENSSL_SOFTWARE\nvoid AesCmacV4(BYTE *Message, size_t MessageSize, BYTE *HashOut)\n{\n    size_t i;\n    BYTE hash[AES_BLOCK_BYTES];\n    AesCtx Ctx;\n    AES_KEY k;\n\n    AesInitKey(&Ctx, AesKeyV4, FALSE, V4_KEY_BYTES);\n    TransformOpenSslEncryptKey(&k, &Ctx);\n\n    memset(hash, 0, sizeof(hash));\n    memset(Message + MessageSize, 0, AES_BLOCK_BYTES);\n    Message[MessageSize] = 0x80;\n\n    for (i = 0; i <= MessageSize; i += AES_BLOCK_BYTES)\n    {\n        XorBlock(Message + i, hash);\n        AES_encrypt(hash, hash, &k);\n    }\n\n    memcpy(HashOut, hash, AES_BLOCK_BYTES);\n}\n#endif // !_OPENSSL_SOFTWARE\n\n#endif // defined(_USE_AES_FROM_OPENSSL)\n\n#endif // _CRYPTO_OPENSSL\n"
  },
  {
    "path": "src/crypto_openssl.h",
    "content": "#ifndef __crypto_openssl_h\n#define __crypto_openssl_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include <openssl/opensslv.h>\n#include <openssl/sha.h>\n#include <openssl/hmac.h>\n#include <openssl/aes.h>\n#include \"crypto.h\"\n\n#define Sha256(d, l, h)  SHA256(d, l, h)\nint_fast8_t Sha256Hmac(BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);\n\n#ifndef _OPENSSL_NO_HMAC\n#define Sha256HmacCtx    HMAC_CTX\n#else\ntypedef struct {\n\tSHA256_CTX  ShaCtx;\n\tBYTE  OPad[64];\n} Sha256HmacCtx;\n#endif\n\n#ifndef _OPENSSL_NO_HMAC\n\n#define Sha256HmacInit(c, k, l)    Sha256HmacInit_OpenSSL(c, k, l)\n#define Sha256HmacFinish(c, h)     Sha256HmacFinish_OpenSSL(c, h, NULL)\n\n#if OPENSSL_VERSION_NUMBER >= 0x10000000L\n#define Sha256HmacUpdate(c, d, l)  HMAC_Update(c, d, l)\n#else // OPENSSL_VERSION_NUMBER < 0x10000000L\n#define Sha256HmacUpdate(c, d, l)  (HMAC_Update(c, d, l), !0)\n#endif // OPENSSL_VERSION_NUMBER >= 0x10000000L\n\nint Sha256HmacInit_OpenSSL(HMAC_CTX *c, const void *k, int l);\nint Sha256HmacFinish_OpenSSL(HMAC_CTX *c, unsigned char *h, unsigned int *l);\n\n#else // _OPENSSL_NO_HMAC\n\nint _Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, size_t klen);\nint _Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, size_t len);\nint _Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac, void* dummy);\n#define Sha256HmacInit(c, k, l)    _Sha256HmacInit(c, k, l)\n#define Sha256HmacFinish(c, h)     _Sha256HmacFinish(c, h, NULL)\n#define Sha256HmacUpdate(c, d, l)  _Sha256HmacUpdate(c, d, l)\n\n#endif // _OPENSSL_NO_HMAC\n\nextern const BYTE AesKeyV4[];\n#endif // __crypto_openssl_h\n"
  },
  {
    "path": "src/crypto_polarssl.h",
    "content": "#ifndef __crypto_polarssl_h\n#define __crypto_polarssl_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include <polarssl/version.h>\n#include \"crypto.h\"\n\n#if POLARSSL_VERSION_NUMBER >= 0x01030000\n\n#include <polarssl/sha256.h>\n\n#define Sha256(d, l, h)  sha256(d, l, h, 0)\n\n#define Sha256HmacCtx              sha256_context\n#define Sha256HmacInit(c, k, l)    ( sha256_hmac_starts(c, k, l, 0),     !0 )\n#define Sha256HmacUpdate(c, d, l)  ( sha256_hmac_update(c, d, l),        !0 )\n#define Sha256HmacFinish(c, h)     ( sha256_hmac_finish(c, h),           !0 )\n#define Sha256Hmac(k, d, l, h)     ( sha256_hmac(k, 16, d, l, h, FALSE), !0 )\n\n#else // POLARSSL_VERSION_NUMBER\n\n#include <polarssl/sha2.h>\n\n#define Sha256(d, l, h)  sha2(d, l, h, 0)\n\n#define Sha256HmacCtx\t\t\t\tsha2_context\n#define Sha256HmacInit(c, k, l)\t\t( sha2_hmac_starts(c, k, l, 0),     !0 )\n#define Sha256HmacUpdate(c, d, l)\t( sha2_hmac_update(c, d, l),        !0 )\n#define Sha256HmacFinish(c, h)\t\t( sha2_hmac_finish(c, h),           !0 )\n#define Sha256Hmac(k, d, l, h)\t\t( sha2_hmac(k, 16, d, l, h, FALSE), !0 )\n\n#endif // POLARSSL_VERSION_NUMBER\n#endif // __crypto_polarssl_h\n\n\n"
  },
  {
    "path": "src/crypto_windows.c",
    "content": "/*\n * crypto_windows.c\n */\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef _CRYPTO_WINDOWS\n\n#if !_WIN32 && !__CYGWIN__\n#error You cannot use Windows CryptoAPI on non-Windows platforms\n#else // _WIN32 || __CYGWIN__\n\n#include \"crypto_windows.h\"\n\n\ntypedef struct _HMAC_KEYBLOB\n{\n\tBLOBHEADER hdr;\n\tDWORD dwKeySize;\n\tBYTE KeyData[16];\n} HMAC_KEYBLOB;\n\n\n/*\n * MingW and Cygwin define NULL as ((void*)0) (Posix standard) which you can't assign to\n * non-pointer types without compiler warning. Thus we use the following\n */\n#define NULLHANDLE 0\n#define NULLFLAGS 0\n\n\nstatic HCRYPTPROV hRsaAesProvider = 0; // Needs to be initialized just once per process\n\n\n\nstatic int_fast8_t AcquireCryptContext()\n{\n\tif (!hRsaAesProvider)\n\t{\n\t\treturn (int_fast8_t)CryptAcquireContextW\n\t\t(\n\t\t\t&hRsaAesProvider,\t\t// Provider handle\n\t\t\tNULL,\t\t\t\t\t// No key container name\n\t\t\tNULL,\t\t\t\t\t// Default provider\n\t\t\tPROV_RSA_AES,\t\t\t// Provides SHA and AES\n\t\t\tCRYPT_VERIFYCONTEXT\t\t// We don't need access to persistent keys\n\t\t);\n\t}\n\n\treturn TRUE;\n}\n\n\nint_fast8_t Sha256(BYTE* restrict data, DWORD DataSize, BYTE* restrict hash)\n{\n\tHCRYPTHASH hHash = 0;\n\tDWORD HashSize = 32;\n\n\tint_fast8_t success =\n\t\tAcquireCryptContext() &&\n\n\t\tCryptCreateHash\n\t\t(\n\t\t\thRsaAesProvider,// Provider handle\n\t\t\tCALG_SHA_256,\t// Algorithm\n\t\t\tNULLHANDLE,\t\t// SHA256 requires no key\n\t\t\tNULLFLAGS,\t\t// Use default flags\n\t\t\t&hHash\t\t\t// Handle for hashing\n\t\t) &&\n\n\t\tCryptHashData\n\t\t(\n\t\t\thHash,\t\t\t// Handle\n\t\t\tdata,\t\t\t// data to hash\n\t\t\tDataSize,\t\t// size of data\n\t\t\tNULLFLAGS\t\t// Use default flags\n\t\t) &&\n\n\t\tCryptGetHashParam\n\t\t(\n\t\t\thHash,\t\t\t// Handle\n\t\t\tHP_HASHVAL,\t\t// what you actually want to get (the resulting hash)\n\t\t\thash,\t\t\t// data to retrieve\n\t\t\t&HashSize,\t\t// size of data\n\t\t\tNULLFLAGS\t\t// currently reserved (as of this writing)\n\t\t);\n\n\tif (hHash) CryptDestroyHash(hHash);\n\n\treturn success;\n}\n\n\nint_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac)\n{\n#\tifndef USE_THREADS // In fork() mode thread-safety is not required\n\tstatic\n#\tendif\n\tHMAC_KEYBLOB hmackeyblob = {\n\t\t// Type, Version, Algorithm\n\t\t{ PLAINTEXTKEYBLOB, CUR_BLOB_VERSION, 0, CALG_RC2 },\n\t\t// Key length\n\t\t16\n\t};\n\n\tHCRYPTKEY hKey = NULLHANDLE;\n\tHCRYPTHASH hHmacHash = NULLHANDLE;\n\tHMAC_INFO HmacInfo = { 0 };\n\tDWORD dwHmacSize = 32;\n\n\tHmacInfo.HashAlgid = CALG_SHA_256;\n\tmemcpy(hmackeyblob.KeyData, key, sizeof(hmackeyblob.KeyData));\n\n\tBOOL success =\n\t\tAcquireCryptContext() &&\n\n\t\tCryptImportKey\n\t\t(\n\t\t\thRsaAesProvider,        // provider handle\n\t\t\t(PBYTE)&hmackeyblob,    // the actual key MS blob format\n\t\t\tsizeof(HMAC_KEYBLOB),   // size of the entire blob\n\t\t\tNULLHANDLE,             // password/key for the key store (none required here)\n\t\t\tNULLFLAGS,              // default flags\n\t\t\t&hKey                   // key handle to retrieve (must be kept until you finish hashing)\n\t\t) &&\n\n\t\tCryptCreateHash\n\t\t(\n\t\t\thRsaAesProvider,        // provider handle\n\t\t\tCALG_HMAC,              // the actual key MS blob format\n\t\t\thKey,                   // size of the entire blob\n\t\t\tNULLFLAGS,              // password/key for the key store (none required here)\n\t\t\t&hHmacHash              // default flags\n\t\t) &&                        // key handle to retrieve (must be kept until you finish hashing)\n\n\t\tCryptSetHashParam\n\t\t(\n\t\t\thHmacHash,              // hash handle\n\t\t\tHP_HMAC_INFO,           // parameter you want to set\n\t\t\t(PBYTE)&HmacInfo,       // the HMAC parameters (SHA256 with default ipad and opad)\n\t\t\tNULLFLAGS               // flags are reserved up to Windows 8.1\n\t\t) &&\n\n\t\tCryptHashData\n\t\t(\n\t\t\thHmacHash,              // hash handle\n\t\t\tdata,                   // Pointer to data you want to hash\n\t\t\tlen,                    // data length\n\t\t\tNULLFLAGS               // default flags\n\t\t) &&\n\n\t\tCryptGetHashParam\n\t\t(\n\t\t\thHmacHash,              // hash handle\n\t\t\tHP_HASHVAL,             // what you actually want to get (the resulting HMAC)\n\t\t\thmac,                   // data to retrieve\n\t\t\t&dwHmacSize,            // size of data\n\t\t\tNULLFLAGS               // currently reserved (as of this writing)\n\t\t);\n\n\tif (hKey) CryptDestroyKey(hKey);\n\tif (hHmacHash) CryptDestroyHash(hHmacHash);\n\n\treturn (int_fast8_t)success;\n}\n\n#endif // _WIN32 || __CYGWIN__\n#endif // _CRYPTO_WINDOWS\n"
  },
  {
    "path": "src/crypto_windows.h",
    "content": "/*\n * crypto_windows.h\n */\n\n#ifdef _CRYPTO_WINDOWS\n#ifndef CRYPTO_WINDOWS_H_\n#define CRYPTO_WINDOWS_H_\n\n#if !_WIN32 && !__CYGWIN__\n#error You cannot use Windows CryptoAPI on non-Windows platforms\n#else // _WIN32 || __CYGWIN__\n\n#include \"types.h\"\n#if _MSC_VER\n#include \"Wincrypt.h\"\n#endif\n\ntypedef struct _Sha2356HmacCtx\n{\n\tHCRYPTHASH hHmac;\n\tHCRYPTKEY hKey;\n} Sha256HmacCtx;\n\nint_fast8_t Sha256(BYTE* restrict data, DWORD DataSize, BYTE* restrict hash);\nint_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);\n\n/*int_fast8_t Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, uint8_t keySize);\nint_fast8_t Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, DWORD len);\nint_fast8_t Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac);*/\n\n\n#endif // _WIN32 || __CYGWIN__\n#endif /* CRYPTO_WINDOWS_H_ */\n#endif // _CRYPTO_WINDOWS\n"
  },
  {
    "path": "src/dns_srv.c",
    "content": "/*\n * dns_srv.c\n *\n * This file contains the code for KMS SRV record lookup in DNS (_vlmcs._tcp.example.com IN SRV 0 0 1688 mykms.example.com)\n *\n */\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef NO_DNS\n\n#include \"dns_srv.h\"\n\n#include <string.h>\n#include <stdio.h>\n#ifndef _WIN32\n#include <signal.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <netdb.h>\n //#ifndef DNS_PARSER_INTERNAL\n#if __ANDROID__\n#include <netinet/in.h>\n#include \"nameser.h\"\n#include \"resolv.h\"\n#else // other Unix non-Android\n#include <netinet/in.h>\n#include <arpa/nameser.h>\n#include <resolv.h>\n#endif // other Unix non-Android\n//#endif // DNS_PARSER_INTERNAL\n#else // WIN32\n#include <windns.h>\n#endif // WIN32\n\n#include \"helpers.h\"\n#include \"output.h\"\n#include \"endian.h\"\n\n#if defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)\n\n#include \"ns_name.h\"\n#include \"ns_parse.h\"\n\n // Define macros to redirect DNS parser functions to internal versions\n\n#undef ns_msg\n#undef ns_initparse\n#undef ns_parserr\n#undef ns_rr\n#undef ns_name_uncompress\n#undef ns_msg_base\n#undef ns_msg_end\n#undef ns_rr_rdata\n#undef ns_rr_type\n#undef ns_msg_count\n#undef ns_rr_class\n#undef ns_s_an\n#define ns_msg ns_msg_vlmcsd\n#define ns_initparse ns_initparse_vlmcsd\n#define ns_parserr ns_parserr_vlmcsd\n#define ns_rr ns_rr_vlmcsd\n#define ns_name_uncompress ns_name_uncompress_vlmcsd\n#define ns_msg_base ns_msg_base_vlmcsd\n#define ns_msg_end ns_msg_end_vlmcsd\n#define ns_rr_rdata ns_rr_rdata_vlmcsd\n#define ns_rr_type ns_rr_type_vlmcsd\n#define ns_msg_count ns_msg_count_vlmcsd\n#define ns_rr_class ns_rr_class_vlmcsd\n#define ns_s_an ns_s_an_vlmcsd\n\n#ifndef NS_MAXLABEL\n#define NS_MAXLABEL 63\n#endif\n\n#endif // defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)\n\n\n//TODO: maybe move to helpers.c\nstatic unsigned int isqrt(unsigned int n)\n{\n\tunsigned int c = 0x8000;\n\tunsigned int g = 0x8000;\n\n\tfor (;;)\n\t{\n\t\tif (g*g > n)\n\t\t\tg ^= c;\n\n\t\tc >>= 1;\n\n\t\tif (c == 0) return g;\n\n\t\tg |= c;\n\t}\n}\n\n\n/*\n * Compare function for qsort to sort SRV records by priority and weight\n * random_weight must be product of weight from SRV record and square root of a random number\n */\nstatic int kmsServerListCompareFunc1(const void* a, const void* b)\n{\n\tif (!a && !b) return 0;\n\tif (a && !b) return -1;\n\tif (!a && b) return 1;\n\n\tint priority_order = (int)((*(kms_server_dns_ptr*)a)->priority) - ((int)(*(kms_server_dns_ptr*)b)->priority);\n\n\tif (priority_order) return priority_order;\n\n\treturn (int)((*(kms_server_dns_ptr*)b)->random_weight) - ((int)(*(kms_server_dns_ptr*)a)->random_weight);\n}\n\n/* Sort resulting SRV records */\nvoid sortSrvRecords(kms_server_dns_ptr* serverlist, const int answers)\n{\n\tint i;\n\n\tfor (i = 0; i < answers; i++)\n\t{\n\t\tserverlist[i]->random_weight = (rand32() % 256) * isqrt(serverlist[i]->weight * 1000);\n\t}\n\n\tqsort(serverlist, answers, sizeof(kms_server_dns_ptr), kmsServerListCompareFunc1);\n}\n\n\n#define RECEIVE_BUFFER_SIZE 2048\n#ifndef _WIN32 // UNIX resolver\n\n/*\n * Retrieves a raw DNS answer (a buffer of what came over the net)\n * Result must be parsed\n */\nstatic int getDnsRawAnswer(const char *restrict query, unsigned char** receive_buffer)\n{\n\tif (res_init() < 0)\n\t{\n\t\terrorout(\"Cannot initialize resolver: %s\", strerror(errno));\n\t\treturn 0;\n\t}\n\n\t//if(!(*receive_buffer = (unsigned char*)malloc(RECEIVE_BUFFER_SIZE))) OutOfMemory();\n\t*receive_buffer = (unsigned char*)vlmcsd_malloc(RECEIVE_BUFFER_SIZE);\n\n\tint bytes_received;\n\n\tif (*query == '.')\n\t{\n#\t\tif __ANDROID__ || __GLIBC__ /* including __UCLIBC__*/ || __APPLE__ || __CYGWIN__ || __FreeBSD__ || __NetBSD__ || __DragonFly__ || __OpenBSD__ || __sun__\n\t\tbytes_received = res_querydomain(\"_vlmcs._tcp\", query + 1, ns_c_in, ns_t_srv, *receive_buffer, RECEIVE_BUFFER_SIZE);\n#\t\telse\n\t\tchar* querystring = (char*)alloca(strlen(query) + 12);\n\t\tstrcpy(querystring, \"_vlmcs._tcp\");\n\t\tstrcat(querystring, query);\n\t\tbytes_received = res_query(querystring, ns_c_in, ns_t_srv, *receive_buffer, RECEIVE_BUFFER_SIZE);\n#\t\tendif\n\t}\n\telse\n\t{\n\t\tbytes_received = res_search(\"_vlmcs._tcp\", ns_c_in, ns_t_srv, *receive_buffer, RECEIVE_BUFFER_SIZE);\n\t}\n\n\tif (bytes_received < 0)\n\t{\n\t\terrorout(\"Fatal: DNS query to %s%s failed: %s\\n\", \"_vlmcs._tcp\", *query == '.' ? query : \"\", hstrerror(h_errno));\n\t\treturn 0;\n\t}\n\n\treturn bytes_received;\n}\n\n/*\n * Retrieves an unsorted array of SRV records (Unix / Posix)\n */\nint getKmsServerList(kms_server_dns_ptr** serverlist, const char *restrict query)\n{\n\tunsigned char* receive_buffer;\n\t*serverlist = NULL;\n\n\tint bytes_received = getDnsRawAnswer(query, &receive_buffer);\n\n\tif (bytes_received == 0) return 0;\n\n\tns_msg msg;\n\n\tif (ns_initparse(receive_buffer, bytes_received, &msg) < 0)\n\t{\n\t\terrorout(\"Fatal: Incorrect DNS response: %s\\n\", strerror(errno));\n\t\tfree(receive_buffer);\n\t\treturn 0;\n\t}\n\n\tuint16_t i, answers = ns_msg_count(msg, ns_s_an);\n\t//if(!(*serverlist = (kms_server_dns_ptr*)malloc(answers * sizeof(kms_server_dns_ptr)))) OutOfMemory();\n\t*serverlist = (kms_server_dns_ptr*)malloc(answers * sizeof(kms_server_dns_ptr));\n\n\tmemset(*serverlist, 0, answers * sizeof(kms_server_dns_ptr));\n\n\tfor (i = 0; i < answers; i++)\n\t{\n\t\tns_rr rr;\n\n\t\tif (ns_parserr(&msg, ns_s_an, i, &rr) < 0)\n\t\t{\n\t\t\terrorout(\"Warning: Error in DNS resource record: %s\\n\", strerror(errno));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (ns_rr_type(rr) != ns_t_srv)\n\t\t{\n\t\t\terrorout(\"Warning: DNS server returned non-SRV record\\n\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (ns_rr_class(rr) != ns_c_in)\n\t\t{\n\t\t\terrorout(\"Warning: DNS server returned non-IN class record\\n\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tdns_srv_record_ptr srvrecord = (dns_srv_record_ptr)ns_rr_rdata(rr);\n\t\tkms_server_dns_ptr kms_server = (kms_server_dns_ptr)vlmcsd_malloc(sizeof(kms_server_dns_t));\n\n\t\t(*serverlist)[i] = kms_server;\n\n\t\tif (ns_name_uncompress(ns_msg_base(msg), ns_msg_end(msg), srvrecord->name, kms_server->serverName, sizeof(kms_server->serverName)) < 0)\n\t\t{\n\t\t\terrorout(\"Warning: No valid DNS name returned in SRV record: %s\\n\", strerror(errno));\n\t\t\tcontinue;\n\t\t}\n\n\t\tsprintf(kms_server->serverName + strlen(kms_server->serverName), \":%hu\", GET_UA16BE(&srvrecord->port));\n\t\tkms_server->priority = GET_UA16BE(&srvrecord->priority);\n\t\tkms_server->weight = GET_UA16BE(&srvrecord->weight);\n\n\t}\n\n\tfree(receive_buffer);\n\treturn answers;\n}\n\n#else // WIN32 (Windows Resolver)\n\n/*\n * Retrieves an unsorted array of SRV records (Windows)\n */\nint getKmsServerList(kms_server_dns_ptr** serverlist, const char *const restrict query)\n{\n#\tdefine MAX_DNS_NAME_SIZE 254\n\t* serverlist = NULL;\n\tPDNS_RECORD receive_buffer;\n\tchar dnsDomain[MAX_DNS_NAME_SIZE];\n\tchar FqdnQuery[MAX_DNS_NAME_SIZE];\n\tDWORD size = MAX_DNS_NAME_SIZE;\n\tDNS_STATUS result;\n\tint answers = 0;\n\tPDNS_RECORD dns_iterator;\n\n\tif (*query == '-')\n\t{\n\t\tif (!GetComputerNameExA(ComputerNamePhysicalDnsDomain, dnsDomain, &size))\n\t\t{\n\t\t\terrorout(\"Fatal: Could not determine computer's DNS name: %s\\n\", vlmcsd_strerror(GetLastError()));\n\t\t\treturn 0;\n\t\t}\n\n\t\tstrcpy(FqdnQuery, \"_vlmcs._tcp.\");\n\t\tstrncat(FqdnQuery, dnsDomain, MAX_DNS_NAME_SIZE - 12);\n\t}\n\telse\n\t{\n\t\tstrcpy(FqdnQuery, \"_vlmcs._tcp\");\n\t\tstrncat(FqdnQuery, query, MAX_DNS_NAME_SIZE - 11);\n\t}\n\n\tif ((result = DnsQuery_UTF8(FqdnQuery, DNS_TYPE_SRV, 0, NULL, &receive_buffer, NULL)) != 0)\n\t{\n\t\terrorout(\"Fatal: DNS query to %s failed: %s\\n\", FqdnQuery, vlmcsd_strerror(result));\n\t\treturn 0;\n\t}\n\n\tfor (dns_iterator = receive_buffer; dns_iterator; dns_iterator = dns_iterator->pNext)\n\t{\n\t\tif (dns_iterator->Flags.S.Section != 1) continue;\n\n\t\tif (dns_iterator->wType != DNS_TYPE_SRV)\n\t\t{\n\t\t\terrorout(\"Warning: DNS server returned non-SRV record\\n\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tanswers++;\n\t}\n\n\t*serverlist = (kms_server_dns_ptr*)vlmcsd_malloc(answers * sizeof(kms_server_dns_ptr));\n\n\tfor (answers = 0, dns_iterator = receive_buffer; dns_iterator; dns_iterator = dns_iterator->pNext)\n\t{\n\t\tif (dns_iterator->wType != DNS_TYPE_SRV) continue;\n\n\t\tkms_server_dns_ptr kms_server = (kms_server_dns_ptr)vlmcsd_malloc(sizeof(kms_server_dns_t));\n\n\t\tmemset(kms_server, 0, sizeof(kms_server_dns_t));\n\n\t\tvlmcsd_snprintf(kms_server->serverName, sizeof(kms_server->serverName), \"%s:%hu\", dns_iterator->Data.SRV.pNameTarget, dns_iterator->Data.SRV.wPort);\n\t\tkms_server->priority = dns_iterator->Data.SRV.wPriority;\n\t\tkms_server->weight = dns_iterator->Data.SRV.wWeight;\n\n\t\t(*serverlist)[answers++] = kms_server;\n\t}\n\n\t//sortSrvRecords(*serverlist, answers, NoSrvRecordPriority);\n\n\tDnsRecordListFree(receive_buffer, DnsFreeRecordList);\n\n\treturn answers;\n#\tundef MAX_DNS_NAME_SIZE\n}\n#endif // _WIN32\n#undef RECEIVE_BUFFER_SIZE\n#endif // NO_DNS\n\n\n"
  },
  {
    "path": "src/dns_srv.h",
    "content": "/*\n * dns_srv.h\n *\n */\n\n#ifndef DNS_SRV_H_\n#define DNS_SRV_H_\n#ifndef NO_DNS\n\n\n#include \"types.h\"\n\ntypedef struct\n{\n\tuint32_t random_weight;\n\tuint16_t priority;\n\tuint16_t weight;\n\tchar serverName[260];\n}  kms_server_dns_t, *kms_server_dns_ptr;\n\ntypedef struct\n{\n\tuint16_t priority;\n\tuint16_t weight;\n\tuint16_t port;\n\tunsigned char name[1];\n} dns_srv_record_t, *dns_srv_record_ptr;\n\n#if __OpenBSD__\ntypedef enum __ns_type {\n\tns_t_invalid = 0,\t/*%< Cookie. */\n\tns_t_a = 1,\t\t/*%< Host address. */\n\tns_t_ns = 2,\t\t/*%< Authoritative server. */\n\tns_t_md = 3,\t\t/*%< Mail destination. */\n\tns_t_mf = 4,\t\t/*%< Mail forwarder. */\n\tns_t_cname = 5,\t\t/*%< Canonical name. */\n\tns_t_soa = 6,\t\t/*%< Start of authority zone. */\n\tns_t_mb = 7,\t\t/*%< Mailbox domain name. */\n\tns_t_mg = 8,\t\t/*%< Mail group member. */\n\tns_t_mr = 9,\t\t/*%< Mail rename name. */\n\tns_t_null = 10,\t\t/*%< Null resource record. */\n\tns_t_wks = 11,\t\t/*%< Well known service. */\n\tns_t_ptr = 12,\t\t/*%< Domain name pointer. */\n\tns_t_hinfo = 13,\t/*%< Host information. */\n\tns_t_minfo = 14,\t/*%< Mailbox information. */\n\tns_t_mx = 15,\t\t/*%< Mail routing information. */\n\tns_t_txt = 16,\t\t/*%< Text strings. */\n\tns_t_rp = 17,\t\t/*%< Responsible person. */\n\tns_t_afsdb = 18,\t/*%< AFS cell database. */\n\tns_t_x25 = 19,\t\t/*%< X_25 calling address. */\n\tns_t_isdn = 20,\t\t/*%< ISDN calling address. */\n\tns_t_rt = 21,\t\t/*%< Router. */\n\tns_t_nsap = 22,\t\t/*%< NSAP address. */\n\tns_t_nsap_ptr = 23,\t/*%< Reverse NSAP lookup (deprecated). */\n\tns_t_sig = 24,\t\t/*%< Security signature. */\n\tns_t_key = 25,\t\t/*%< Security key. */\n\tns_t_px = 26,\t\t/*%< X.400 mail mapping. */\n\tns_t_gpos = 27,\t\t/*%< Geographical position (withdrawn). */\n\tns_t_aaaa = 28,\t\t/*%< Ip6 Address. */\n\tns_t_loc = 29,\t\t/*%< Location Information. */\n\tns_t_nxt = 30,\t\t/*%< Next domain (security). */\n\tns_t_eid = 31,\t\t/*%< Endpoint identifier. */\n\tns_t_nimloc = 32,\t/*%< Nimrod Locator. */\n\tns_t_srv = 33,\t\t/*%< Server Selection. */\n\tns_t_atma = 34,\t\t/*%< ATM Address */\n\tns_t_naptr = 35,\t/*%< Naming Authority PoinTeR */\n\tns_t_kx = 36,\t\t/*%< Key Exchange */\n\tns_t_cert = 37,\t\t/*%< Certification record */\n\tns_t_a6 = 38,\t\t/*%< IPv6 address (deprecated, use ns_t_aaaa) */\n\tns_t_dname = 39,\t/*%< Non-terminal DNAME (for IPv6) */\n\tns_t_sink = 40,\t\t/*%< Kitchen sink (experimentatl) */\n\tns_t_opt = 41,\t\t/*%< EDNS0 option (meta-RR) */\n\tns_t_apl = 42,\t\t/*%< Address prefix list (RFC3123) */\n\tns_t_tkey = 249,\t/*%< Transaction key */\n\tns_t_tsig = 250,\t/*%< Transaction signature. */\n\tns_t_ixfr = 251,\t/*%< Incremental zone transfer. */\n\tns_t_axfr = 252,\t/*%< Transfer zone of authority. */\n\tns_t_mailb = 253,\t/*%< Transfer mailbox records. */\n\tns_t_maila = 254,\t/*%< Transfer mail agent records. */\n\tns_t_any = 255,\t\t/*%< Wildcard match. */\n\tns_t_zxfr = 256,\t/*%< BIND-specific, nonstandard. */\n\tns_t_max = 65536\n} ns_type;\n\ntypedef enum __ns_class {\n\tns_c_invalid = 0,\t/*%< Cookie. */\n\tns_c_in = 1,\t\t/*%< Internet. */\n\tns_c_2 = 2,\t\t/*%< unallocated/unsupported. */\n\tns_c_chaos = 3,\t\t/*%< MIT Chaos-net. */\n\tns_c_hs = 4,\t\t/*%< MIT Hesiod. */\n\t/* Query class values which do not appear in resource records */\n\tns_c_none = 254,\t/*%< for prereq. sections in update requests */\n\tns_c_any = 255,\t\t/*%< Wildcard match. */\n\tns_c_max = 65536\n} ns_class;\n\n#endif\n\nint getKmsServerList(kms_server_dns_ptr** serverlist, const char *const restrict query);\nvoid sortSrvRecords(kms_server_dns_ptr* serverlist, const int answers);\n\n#endif // NO_DNS\n#endif /* DNS_SRV_H_ */\n"
  },
  {
    "path": "src/endian.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"endian.h\"\n\n#if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)  \\\n\t&& defined(BS16) && defined(BS32) && defined(BS64) && !defined(NO_COMPILER_UAA)\n\n#else // ! defined(__BYTE_ORDER)\n\nvoid PUT_UAA64BE(void *p, unsigned long long v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned long long *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v >> 56);\n\t_p[ 1 ] = (unsigned char)(v >> 48);\n\t_p[ 2 ] = (unsigned char)(v >> 40);\n\t_p[ 3 ] = (unsigned char)(v >> 32);\n\t_p[ 4 ] = (unsigned char)(v >> 24);\n\t_p[ 5 ] = (unsigned char)(v >> 16);\n\t_p[ 6 ] = (unsigned char)(v >> 8);\n\t_p[ 7 ] = (unsigned char)(v);\n}\n\nvoid PUT_UAA32BE(void *p, unsigned int v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned int *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v >> 24);\n\t_p[ 1 ] = (unsigned char)(v >> 16);\n\t_p[ 2 ] = (unsigned char)(v >> 8);\n\t_p[ 3 ] = (unsigned char)(v);\n}\n\nvoid PUT_UAA16BE(void *p, unsigned short v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v >> 8);\n\t_p[ 1 ] = (unsigned char)(v);\n}\n\n\nvoid PUT_UAA64LE(void *p, unsigned long long v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned long long *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v);\n\t_p[ 1 ] = (unsigned char)(v >> 8);\n\t_p[ 2 ] = (unsigned char)(v >> 16);\n\t_p[ 3 ] = (unsigned char)(v >> 24);\n\t_p[ 4 ] = (unsigned char)(v >> 32);\n\t_p[ 5 ] = (unsigned char)(v >> 40);\n\t_p[ 6 ] = (unsigned char)(v >> 48);\n\t_p[ 7 ] = (unsigned char)(v >> 56);\n}\n\nvoid PUT_UAA32LE(void *p, unsigned int v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned int *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v);\n\t_p[ 1 ] = (unsigned char)(v >> 8);\n\t_p[ 2 ] = (unsigned char)(v >> 16);\n\t_p[ 3 ] = (unsigned char)(v >> 24);\n}\n\nvoid PUT_UAA16LE(void *p, unsigned short v, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];\n\t_p[ 0 ] = (unsigned char)(v);\n\t_p[ 1 ] = (unsigned char)(v >> 8);\n}\n\n\nunsigned long long GET_UAA64BE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned long long *)p)[i];\n\treturn\n\t\t(unsigned long long)_p[ 0 ] << 56 |\n\t\t(unsigned long long)_p[ 1 ] << 48 |\n\t\t(unsigned long long)_p[ 2 ] << 40 |\n\t\t(unsigned long long)_p[ 3 ] << 32 |\n\t\t(unsigned long long)_p[ 4 ] << 24 |\n\t\t(unsigned long long)_p[ 5 ] << 16 |\n\t\t(unsigned long long)_p[ 6 ] << 8  |\n\t\t(unsigned long long)_p[ 7 ];\n\n}\n\nunsigned int GET_UAA32BE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned int *)p)[i];\n\treturn\n\t\t(unsigned int)_p[ 0 ] << 24 |\n\t\t(unsigned int)_p[ 1 ] << 16 |\n\t\t(unsigned int)_p[ 2 ] << 8  |\n\t\t(unsigned int)_p[ 3 ];\n}\n\nunsigned short GET_UAA16BE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];\n\treturn\n\t\t(unsigned short)_p[ 0 ] << 8 |\n\t\t(unsigned short)_p[ 1 ];\n}\n\n\nunsigned long long GET_UAA64LE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned long long *)p)[i];\n\treturn\n\t\t(unsigned long long)_p[ 0 ] |\n\t\t(unsigned long long)_p[ 1 ] << 8  |\n\t\t(unsigned long long)_p[ 2 ] << 16 |\n\t\t(unsigned long long)_p[ 3 ] << 24 |\n\t\t(unsigned long long)_p[ 4 ] << 32 |\n\t\t(unsigned long long)_p[ 5 ] << 40 |\n\t\t(unsigned long long)_p[ 6 ] << 48 |\n\t\t(unsigned long long)_p[ 7 ] << 56;\n\n}\n\nunsigned int GET_UAA32LE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned int *)p)[i];\n\treturn\n\t\t(unsigned int)_p[ 0 ] |\n\t\t(unsigned int)_p[ 1 ] << 8  |\n\t\t(unsigned int)_p[ 2 ] << 16 |\n\t\t(unsigned int)_p[ 3 ] << 24;\n}\n\nunsigned short GET_UAA16LE(void *p, unsigned int i)\n{\n\tunsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];\n\treturn\n\t\t(unsigned short)_p[ 0 ] |\n\t\t(unsigned short)_p[ 1 ] << 8;\n}\n#endif\n\n\n#if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)  \\\n\t&& defined(BS16) && defined(BS32) && defined(BS64)\n#else\nunsigned short BE16(unsigned short x)\n{\n\treturn GET_UAA16BE(&x, 0);\n}\n\nunsigned short LE16(unsigned short x)\n{\n\treturn GET_UAA16LE(&x, 0);\n}\n\nunsigned int BE32(unsigned int x)\n{\n\treturn GET_UAA32BE(&x, 0);\n}\n\nunsigned int LE32(unsigned int x)\n{\n\treturn GET_UAA32LE(&x, 0);\n}\n\nunsigned long long BE64(unsigned long long x)\n{\n\treturn GET_UAA64BE(&x, 0);\n}\n\nunsigned long long LE64(unsigned long long x)\n{\n\treturn GET_UAA64LE(&x, 0);\n}\n\n#endif // defined(__BYTE_ORDER)\n"
  },
  {
    "path": "src/endian.h",
    "content": "#ifndef __endian_h\n#define __endian_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n//\n// Unaligned access\n//\n\n#if !defined(NO_COMPILER_UAA)\n#define UAA16(p, i) (((PACKED16*)p)->val[i])\n#define UAA32(p, i) (((PACKED32*)p)->val[i])\n#define UAA64(p, i) (((PACKED64*)p)->val[i])\n#endif \n\n//\n//Byteswap: Use compiler support if available\n//\n#ifndef NO_COMPILER_UAA\n#ifdef __has_builtin // Clang supports this\n\n#if __has_builtin(__builtin_bswap16)\n#define BS16(x) __builtin_bswap16(x)\n#endif\n\n#if __has_builtin(__builtin_bswap32)\n#define BS32(x) __builtin_bswap32(x)\n#endif\n\n#if __has_builtin(__builtin_bswap64)\n#define BS64(x) __builtin_bswap64(x)\n#endif\n\n#endif // has_builtin\n\n#ifdef __GNUC__ // GNU C >= 4.3 has bswap32 and bswap64. GNU C >= 4.8 also has bswap16\n#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)\n\n#ifndef BS32\n#define BS32(x) __builtin_bswap32(x)\n#endif\n\n#ifndef BS64\n#define BS64(x) __builtin_bswap64(x)\n#endif\n\n#if (__GNUC__ > 4) || (__GNUC_MINOR__ > 7)\n\n#ifndef BS16\n#define BS16(x) __builtin_bswap16(x)\n#endif\n\n#endif // GNU C > 4.7\n#endif // __GNUC__ > 4\n#endif // __GNUC__\n#endif // NO_COMPILER_UAA\n\n//\n// Byteorder\n//\n#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)\n\n#include <endian.h>\n#include <byteswap.h>\n\n#ifndef BS16\n#define BS16(x) bswap_16(x)\n#endif\n\n#ifndef BS32\n#define BS32(x) bswap_32(x)\n#endif\n\n#ifndef BS64\n#define BS64(x) bswap_64(x)\n#endif\n\n#elif defined(__sun__)\n\n#include <sys/byteorder.h>\n\n#ifndef BS16\n#define BS16(x) BSWAP_16(x)\n#endif\n\n#ifndef BS32\n#define BS32(x) BSWAP_32(x)\n#endif\n\n#ifndef BS64\n#define BS64(x) BSWAP_64(x)\n#endif\n\n#define __LITTLE_ENDIAN 1234\n#define __BIG_ENDIAN 4321\n\n#ifdef _LITTLE_ENDIAN\n#define __BYTE_ORDER __LITTLE_ENDIAN\n#else\n#define __BYTE_ORDER __BIG_ENDIAN\n#endif\n\n#elif __minix__ || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)\n\n#include <sys/types.h>\n#include <sys/endian.h>\n\n#define __BYTE_ORDER     _BYTE_ORDER\n#define __LITTLE_ENDIAN  _LITTLE_ENDIAN\n#define __BIG_ENDIAN     _BIG_ENDIAN\n\n#ifdef __OpenBSD__\n\n#ifndef BS16\n#define BS16  swap16\n#endif\n\n#ifndef BS32\n#define BS32  swap32\n#endif\n\n#ifndef BS64\n#define BS64  swap64\n#endif\n\n#else // !__OpenBSD__\n\n#ifndef BS16\n#define BS16  bswap16\n#endif\n\n#ifndef BS32\n#define BS32  bswap32\n#endif\n\n#ifndef BS64\n#define BS64  bswap64\n#endif\n\n#endif // !__OpenBSD__\n\n#elif defined(__APPLE__)\n\n#include <sys/types.h>\n#include <machine/endian.h>\n#include <libkern/OSByteOrder.h>\n\n#define __BYTE_ORDER     _BYTE_ORDER\n#define __LITTLE_ENDIAN  _LITTLE_ENDIAN\n#define __BIG_ENDIAN     _BIG_ENDIAN\n\n#ifndef BS16\n#define BS16 OSSwapInt16\n#endif\n\n#ifndef BS32\n#define BS32 OSSwapInt32\n#endif\n\n#ifndef BS64\n#define BS64 OSSwapInt64\n#endif\n\n#elif defined(_WIN32)\n\n#define __LITTLE_ENDIAN 1234\n#define __BIG_ENDIAN 4321\n#define __BYTE_ORDER __LITTLE_ENDIAN\n\n#include <stdlib.h>\n\n#ifndef BS16\n#define BS16 _byteswap_ushort\n#endif\n\n#ifndef BS32\n#define BS32 _byteswap_ulong\n#endif\n\n#ifndef BS64\n#define BS64 _byteswap_uint64\n#endif\n\n#endif // Byteorder in different OS\n\n\n#if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)  \\\n\t&& defined(BS16) && defined(BS32) && defined(BS64)\n\n#if __BYTE_ORDER == __LITTLE_ENDIAN\n\n#define __BE16(x)  BS16(x)\n#define __LE16(x)  (x)\n#define __BE32(x)  BS32(x)\n#define __LE32(x)  (x)\n#define __BE64(x)  BS64(x)\n#define __LE64(x)  (x)\n\n#define PUT_UA16(p, v) PUT_UA16LE(p, v)\n#define PUT_UA32(p, v) PUT_UA32LE(p, v)\n#define PUT_UA64(p, v) PUT_UA64LE(p, v)\n\n#else // __BYTE_ORDER == __BIG_ENDIAN\n\n#define __BE16(x)  (x)\n#define __LE16(x)  BS16(x)\n#define __BE32(x)  (x)\n#define __LE32(x)  BS32(x)\n#define __BE64(x)  (x)\n#define __LE64(x)  BS64(x)\n\n#define PUT_UA16(p, v) PUT_UA16BE(p, v)\n#define PUT_UA32(p, v) PUT_UA32BE(p, v)\n#define PUT_UA64(p, v) PUT_UA64BE(p, v)\n\n#endif // __BYTE_ORDER\n\n#define BE16(x)  __BE16(x)\n#define LE16(x)  __LE16(x)\n#define BE32(x)  __BE32(x)\n#define LE32(x)  __LE32(x)\n#define BE64(x)  __BE64(x)\n#define LE64(x)  __LE64(x)\n\n#else\n\nextern unsigned short BE16(unsigned short x);\n\nextern unsigned short LE16(unsigned short x);\n\nextern unsigned int BE32(unsigned int x);\n\nextern unsigned int LE32(unsigned int x);\n\nextern unsigned long long BE64(unsigned long long x);\n\nextern unsigned long long LE64(unsigned long long x);\n\n#endif // defined(__BYTE_ORDER)\n\n#if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)  \\\n\t&& defined(BS16) && defined(BS32) && defined(BS64) &&!defined(NO_COMPILER_UAA)\n\n#define PUT_UAA64BE(p, v, i)  ( UAA64(p, i) = __BE64(v) )\n#define PUT_UAA32BE(p, v, i)  ( UAA32(p, i) = __BE32(v) )\n#define PUT_UAA16BE(p, v, i)  ( UAA16(p, i) = __BE16(v) )\n\n#define PUT_UAA64LE(p, v, i)  ( UAA64(p, i) = __LE64(v) )\n#define PUT_UAA32LE(p, v, i)  ( UAA32(p, i) = __LE32(v) )\n#define PUT_UAA16LE(p, v, i)  ( UAA16(p, i) = __LE16(v) )\n\n#define GET_UAA64BE(p, i)  __BE64(UAA64(p, i))\n#define GET_UAA32BE(p, i)  __BE32(UAA32(p, i))\n#define GET_UAA16BE(p, i)  __BE16(UAA16(p, i))\n\n#define GET_UAA64LE(p, i)  __LE64(UAA64(p, i))\n#define GET_UAA32LE(p, i)  __LE32(UAA32(p, i))\n#define GET_UAA16LE(p, i)  __LE16(UAA16(p, i))\n\n\n#else // ! defined(__BYTE_ORDER)\n\nextern void PUT_UAA64BE(void* p, unsigned long long v, unsigned int i);\n\nextern void PUT_UAA32BE(void* p, unsigned int v, unsigned int i);\n\nextern void PUT_UAA16BE(void* p, unsigned short v, unsigned int i);\n\n\nextern void PUT_UAA64LE(void* p, unsigned long long v, unsigned int i);\n\nextern void PUT_UAA32LE(void* p, unsigned int v, unsigned int i);\n\nextern void PUT_UAA16LE(void* p, unsigned short v, unsigned int i);\n\n\nextern unsigned long long GET_UAA64BE(void* p, unsigned int i);\n\nextern unsigned int GET_UAA32BE(void* p, unsigned int i);\n\nextern unsigned short GET_UAA16BE(void* p, unsigned int i);\n\n\nextern unsigned long long GET_UAA64LE(void* p, unsigned int i);\n\nextern unsigned int GET_UAA32LE(void* p, unsigned int i);\n\nextern unsigned short GET_UAA16LE(void* p, unsigned int i);\n#endif\n\n\n\n#define PUT_UA64BE(p, v)  PUT_UAA64BE(p, v, 0)\n#define PUT_UA32BE(p, v)  PUT_UAA32BE(p, v, 0)\n#define PUT_UA16BE(p, v)  PUT_UAA16BE(p, v, 0)\n\n#define PUT_UA64LE(p, v)  PUT_UAA64LE(p, v, 0)\n#define PUT_UA32LE(p, v)  PUT_UAA32LE(p, v, 0)\n#define PUT_UA16LE(p, v)  PUT_UAA16LE(p, v, 0)\n\n#define GET_UA64BE(p)  GET_UAA64BE(p, 0)\n#define GET_UA32BE(p)  GET_UAA32BE(p, 0)\n#define GET_UA16BE(p)  GET_UAA16BE(p, 0)\n\n#define GET_UA64LE(p)  GET_UAA64LE(p, 0)\n#define GET_UA32LE(p)  GET_UAA32LE(p, 0)\n#define GET_UA16LE(p)  GET_UAA16LE(p, 0)\n\n#endif // __endian_h\n"
  },
  {
    "path": "src/getifaddrs-musl.c",
    "content": "#define _GNU_SOURCE\n#include <errno.h>\n#include <string.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include \"ifaddrs-musl.h\"\n//#include <syscall.h>\n#include <net/if.h>\n#include <netinet/in.h>\n#include \"netlink-musl.h\"\n\n#define IFADDRS_HASH_SIZE 64\n\n/* getifaddrs() reports hardware addresses with PF_PACKET that implies\n * struct sockaddr_ll.  But e.g. Infiniband socket address length is\n * longer than sockaddr_ll.ssl_addr[8] can hold. Use this hack struct\n * to extend ssl_addr - callers should be able to still use it. */\nstruct sockaddr_ll_hack {\n\tunsigned short sll_family, sll_protocol;\n\tint sll_ifindex;\n\tunsigned short sll_hatype;\n\tunsigned char sll_pkttype, sll_halen;\n\tunsigned char sll_addr[24];\n};\n\nunion sockany {\n\tstruct sockaddr sa;\n\tstruct sockaddr_ll_hack ll;\n\tstruct sockaddr_in v4;\n\tstruct sockaddr_in6 v6;\n};\n\nstruct ifaddrs_storage {\n\tstruct ifaddrs ifa;\n\tstruct ifaddrs_storage *hash_next;\n\tunion sockany addr, netmask, ifu;\n\tunsigned int index;\n\tchar name[IFNAMSIZ+1];\n};\n\nstruct ifaddrs_ctx {\n\tstruct ifaddrs_storage *first;\n\tstruct ifaddrs_storage *last;\n\tstruct ifaddrs_storage *hash[IFADDRS_HASH_SIZE];\n};\n\nvoid freeifaddrs(struct ifaddrs *ifp)\n{\n\tstruct ifaddrs *n;\n\twhile (ifp) {\n\t\tn = ifp->ifa_next;\n\t\tfree(ifp);\n\t\tifp = n;\n\t}\n}\n\nstatic int __netlink_enumerate(int fd, unsigned int seq, int type, int af,\n\tint (*cb)(void *ctx, struct nlmsghdr *h), void *ctx)\n{\n\tstruct nlmsghdr *h;\n\tunion {\n\t\tuint8_t buf[8192];\n\t\tstruct {\n\t\t\tstruct nlmsghdr nlh;\n\t\t\tstruct rtgenmsg g;\n\t\t} req;\n\t\tstruct nlmsghdr reply;\n\t} u;\n\tint r, ret;\n\n\tmemset(&u.req, 0, sizeof(u.req));\n\tu.req.nlh.nlmsg_len = sizeof(u.req);\n\tu.req.nlh.nlmsg_type = type;\n\tu.req.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;\n\tu.req.nlh.nlmsg_seq = seq;\n\tu.req.g.rtgen_family = af;\n\tr = send(fd, &u.req, sizeof(u.req), 0);\n\tif (r < 0) return r;\n\n\twhile (1) {\n\t\tr = recv(fd, u.buf, sizeof(u.buf), MSG_DONTWAIT);\n\t\tif (r <= 0) return -1;\n\t\tfor (h = &u.reply; NLMSG_OK(h, (void*)&u.buf[r]); h = NLMSG_NEXT(h)) {\n\t\t\tif (h->nlmsg_type == NLMSG_DONE) return 0;\n\t\t\tif (h->nlmsg_type == NLMSG_ERROR) return -1;\n\t\t\tret = cb(ctx, h);\n\t\t\tif (ret) return ret;\n\t\t}\n\t}\n}\n\nint __rtnetlink_enumerate(int link_af, int addr_af, int (*cb)(void *ctx, struct nlmsghdr *h), void *ctx)\n{\n\tint fd, r;\n\n\tfd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);\n\tif (fd < 0) return -1;\n\tr = __netlink_enumerate(fd, 1, RTM_GETLINK, link_af, cb, ctx);\n\tif (!r) r = __netlink_enumerate(fd, 2, RTM_GETADDR, addr_af, cb, ctx);\n\tclose(fd);\n\treturn r;\n}\n\nstatic void copy_addr(struct sockaddr **r, int af, union sockany *sa, void *addr, size_t addrlen, int ifindex)\n{\n\tuint8_t *dst;\n\tint len;\n\n\tswitch (af) {\n\tcase AF_INET:\n\t\tdst = (uint8_t*) &sa->v4.sin_addr;\n\t\tlen = 4;\n\t\tbreak;\n\tcase AF_INET6:\n\t\tdst = (uint8_t*) &sa->v6.sin6_addr;\n\t\tlen = 16;\n\t\tif (IN6_IS_ADDR_LINKLOCAL(addr) || IN6_IS_ADDR_MC_LINKLOCAL(addr))\n\t\t\tsa->v6.sin6_scope_id = ifindex;\n\t\tbreak;\n\tdefault:\n\t\treturn;\n\t}\n\tif (addrlen < len) return;\n\tsa->sa.sa_family = af;\n\tmemcpy(dst, addr, len);\n\t*r = &sa->sa;\n}\n\nstatic void gen_netmask(struct sockaddr **r, int af, union sockany *sa, int prefixlen)\n{\n\tuint8_t addr[16] = {0};\n\tint i;\n\n\tif (prefixlen > 8*sizeof(addr)) prefixlen = 8*sizeof(addr);\n\ti = prefixlen / 8;\n\tmemset(addr, 0xff, i);\n\tif (i < sizeof(addr)) addr[i++] = 0xff << (8 - (prefixlen % 8));\n\tcopy_addr(r, af, sa, addr, sizeof(addr), 0);\n}\n\nstatic void copy_lladdr(struct sockaddr **r, union sockany *sa, void *addr, size_t addrlen, int ifindex, unsigned short hatype)\n{\n\tif (addrlen > sizeof(sa->ll.sll_addr)) return;\n\tsa->ll.sll_family = AF_PACKET;\n\tsa->ll.sll_ifindex = ifindex;\n\tsa->ll.sll_hatype = hatype;\n\tsa->ll.sll_halen = addrlen;\n\tmemcpy(sa->ll.sll_addr, addr, addrlen);\n\t*r = &sa->sa;\n}\n\nstatic int netlink_msg_to_ifaddr(void *pctx, struct nlmsghdr *h)\n{\n\tstruct ifaddrs_ctx *ctx = pctx;\n\tstruct ifaddrs_storage *ifs, *ifs0 = NULL;\n\tstruct ifinfomsg *ifi = NLMSG_DATA(h);\n\tstruct ifaddrmsg *ifa = NLMSG_DATA(h);\n\tstruct rtattr *rta;\n\tint stats_len = 0;\n\n\tif (h->nlmsg_type == RTM_NEWLINK) {\n\t\tfor (rta = NLMSG_RTA(h, sizeof(*ifi)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {\n\t\t\tif (rta->rta_type != IFLA_STATS) continue;\n\t\t\tstats_len = RTA_DATALEN(rta);\n\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tfor (ifs0 = ctx->hash[ifa->ifa_index % IFADDRS_HASH_SIZE]; ifs0; ifs0 = ifs0->hash_next)\n\t\t\tif (ifs0->index == ifa->ifa_index)\n\t\t\t\tbreak;\n\t\tif (!ifs0) return 0;\n\t}\n\n\tifs = calloc(1, sizeof(struct ifaddrs_storage) + stats_len);\n\tif (ifs == 0) return -1;\n\n\tif (h->nlmsg_type == RTM_NEWLINK) {\n\t\tifs->index = ifi->ifi_index;\n\t\tifs->ifa.ifa_flags = ifi->ifi_flags;\n\n\t\tfor (rta = NLMSG_RTA(h, sizeof(*ifi)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {\n\t\t\tswitch (rta->rta_type) {\n\t\t\tcase IFLA_IFNAME:\n\t\t\t\tif (RTA_DATALEN(rta) < sizeof(ifs->name)) {\n\t\t\t\t\tmemcpy(ifs->name, RTA_DATA(rta), RTA_DATALEN(rta));\n\t\t\t\t\tifs->ifa.ifa_name = ifs->name;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase IFLA_ADDRESS:\n\t\t\t\tcopy_lladdr(&ifs->ifa.ifa_addr, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type);\n\t\t\t\tbreak;\n\t\t\tcase IFLA_BROADCAST:\n\t\t\t\tcopy_lladdr(&ifs->ifa.ifa_broadaddr, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type);\n\t\t\t\tbreak;\n\t\t\tcase IFLA_STATS:\n\t\t\t\tifs->ifa.ifa_data = (void*)(ifs+1);\n\t\t\t\tmemcpy(ifs->ifa.ifa_data, RTA_DATA(rta), RTA_DATALEN(rta));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ifs->ifa.ifa_name) {\n\t\t\tunsigned int bucket = ifs->index % IFADDRS_HASH_SIZE;\n\t\t\tifs->hash_next = ctx->hash[bucket];\n\t\t\tctx->hash[bucket] = ifs;\n\t\t}\n\t} else {\n\t\tifs->ifa.ifa_name = ifs0->ifa.ifa_name;\n\t\tifs->ifa.ifa_flags = ifs0->ifa.ifa_flags;\n\t\tfor (rta = NLMSG_RTA(h, sizeof(*ifa)); NLMSG_RTAOK(rta, h); rta = RTA_NEXT(rta)) {\n\t\t\tswitch (rta->rta_type) {\n\t\t\tcase IFA_ADDRESS:\n\t\t\t\t/* If ifa_addr is already set we, received an IFA_LOCAL before\n\t\t\t\t * so treat this as destination address */\n\t\t\t\tif (ifs->ifa.ifa_addr)\n\t\t\t\t\tcopy_addr(&ifs->ifa.ifa_dstaddr, ifa->ifa_family, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);\n\t\t\t\telse\n\t\t\t\t\tcopy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);\n\t\t\t\tbreak;\n\t\t\tcase IFA_BROADCAST:\n\t\t\t\tcopy_addr(&ifs->ifa.ifa_broadaddr, ifa->ifa_family, &ifs->ifu, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);\n\t\t\t\tbreak;\n\t\t\tcase IFA_LOCAL:\n\t\t\t\t/* If ifa_addr is set and we get IFA_LOCAL, assume we have\n\t\t\t\t * a point-to-point network. Move address to correct field. */\n\t\t\t\tif (ifs->ifa.ifa_addr) {\n\t\t\t\t\tifs->ifu = ifs->addr;\n\t\t\t\t\tifs->ifa.ifa_dstaddr = &ifs->ifu.sa;\n\t\t\t\t\tmemset(&ifs->addr, 0, sizeof(ifs->addr));\n\t\t\t\t}\n\t\t\t\tcopy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, RTA_DATA(rta), RTA_DATALEN(rta), ifa->ifa_index);\n\t\t\t\tbreak;\n\t\t\tcase IFA_LABEL:\n\t\t\t\tif (RTA_DATALEN(rta) < sizeof(ifs->name)) {\n\t\t\t\t\tmemcpy(ifs->name, RTA_DATA(rta), RTA_DATALEN(rta));\n\t\t\t\t\tifs->ifa.ifa_name = ifs->name;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ifs->ifa.ifa_addr)\n\t\t\tgen_netmask(&ifs->ifa.ifa_netmask, ifa->ifa_family, &ifs->netmask, ifa->ifa_prefixlen);\n\t}\n\n\tif (ifs->ifa.ifa_name) {\n\t\tif (!ctx->first) ctx->first = ifs;\n\t\tif (ctx->last) ctx->last->ifa.ifa_next = &ifs->ifa;\n\t\tctx->last = ifs;\n\t} else {\n\t\tfree(ifs);\n\t}\n\treturn 0;\n}\n\nint getifaddrs(struct ifaddrs **ifap)\n{\n\tstruct ifaddrs_ctx _ctx, *ctx = &_ctx;\n\tint r;\n\tmemset(ctx, 0, sizeof *ctx);\n\tr = __rtnetlink_enumerate(AF_UNSPEC, AF_UNSPEC, netlink_msg_to_ifaddr, ctx);\n\tif (r == 0) *ifap = &ctx->first->ifa;\n\telse freeifaddrs(&ctx->first->ifa);\n\treturn r;\n}\n"
  },
  {
    "path": "src/helpers.c",
    "content": "/*\n * Helper functions used by other modules\n */\n\n //#ifndef _GNU_SOURCE\n //#define _GNU_SOURCE\n //#endif\n\n#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef _WIN32\n#include <errno.h>\n#include <libgen.h>\n#endif // _WIN32\n#ifndef _MSC_VER\n#include <getopt.h>\n#else\n#include \"wingetopt.h\"\n#endif\n#include <string.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include \"helpers.h\"\n#include \"output.h\"\n#include \"endian.h\"\n#include \"shared_globals.h\"\n\n#ifndef NO_INTERNAL_DATA\n#include \"kmsdata.h\"\n#endif // NO_INTERNAL_DATA\n\n#ifdef _WIN32\n#include <shlwapi.h>\n#endif // _WIN32\n\n#if __APPLE__\n#include <mach-o/dyld.h>\n#endif // __APPLE__\n\n#if (__GLIBC__ || __linux__) && defined(USE_AUXV)\n#include <sys/auxv.h>\n#endif\n\n#if __FreeBSD__ || __FreeBSD_kernel__\n#include <sys/sysctl.h>\n#endif\n\n /*\n  *  UCS2 <-> UTF-8 functions\n  *  All functions use little endian UCS2 since we only need it to communicate with Windows via RPC\n  */\n\n  // Convert one character from UTF-8 to UCS2\n  // Returns 0xffff, if utf-8 evaluates to > 0xfffe (outside basic multilingual pane)\nWCHAR utf8_to_ucs2_char(const unsigned char *input, const unsigned char **end_ptr)\n{\n\t*end_ptr = input;\n\tif (input[0] == 0)\n\t\treturn (WCHAR)~0;\n\n\tif (input[0] < 0x80) {\n\t\t*end_ptr = input + 1;\n\t\treturn LE16(input[0]);\n\t}\n\n\tif ((input[0] & 0xE0) == 0xE0) {\n\n\t\tif (input[1] == 0 || input[2] == 0)\n\t\t\treturn (WCHAR)~0;\n\n\t\t*end_ptr = input + 3;\n\n\t\treturn\n\t\t\tLE16((input[0] & 0x0F) << 12 |\n\t\t\t(input[1] & 0x3F) << 6 |\n\t\t\t\t(input[2] & 0x3F));\n\t}\n\n\tif ((input[0] & 0xC0) == 0xC0) {\n\t\tif (input[1] == 0)\n\t\t\treturn (WCHAR)~0;\n\n\t\t*end_ptr = input + 2;\n\n\t\treturn\n\t\t\tLE16((input[0] & 0x1F) << 6 |\n\t\t\t(input[1] & 0x3F));\n\t}\n\treturn (WCHAR)~0;\n}\n\n// Convert one character from UCS2 to UTF-8\n// Returns length of UTF-8 char (1, 2 or 3) or -1 on error (UTF-16 outside UCS2)\n// char *utf8 must be large enough to hold 3 bytes\nint ucs2_to_utf8_char(const WCHAR ucs2_le, char *utf8)\n{\n\tconst WCHAR ucs2 = LE16(ucs2_le);\n\n\tif (ucs2 < 0x80) {\n\t\tutf8[0] = (char)ucs2;\n\t\tutf8[1] = '\\0';\n\t\treturn 1;\n\t}\n\n\tif (ucs2 >= 0x80 && ucs2 < 0x800) {\n\t\tutf8[0] = (char)((ucs2 >> 6) | 0xC0);\n\t\tutf8[1] = (char)((ucs2 & 0x3F) | 0x80);\n\t\tutf8[2] = '\\0';\n\t\treturn 2;\n\t}\n\n\tif (ucs2 >= 0x800 && ucs2 < 0xFFFF) {\n\n\t\tif (ucs2 >= 0xD800 && ucs2 <= 0xDFFF) {\n\t\t\t/* Ill-formed (UTF-16 ouside of BMP) */\n\t\t\treturn -1;\n\t\t}\n\n\t\tutf8[0] = ((ucs2 >> 12)) | 0xE0;\n\t\tutf8[1] = ((ucs2 >> 6) & 0x3F) | 0x80;\n\t\tutf8[2] = ((ucs2) & 0x3F) | 0x80;\n\t\tutf8[3] = '\\0';\n\t\treturn 3;\n\t}\n\n\treturn -1;\n}\n\n\n// Converts UTF8 to UCS2. Returns size in bytes of the converted string or -1 on error\nsize_t utf8_to_ucs2(WCHAR* const ucs2_le, const char* const utf8, const size_t maxucs2, const size_t maxutf8)\n{\n\tconst unsigned char* current_utf8 = (unsigned char*)utf8;\n\tWCHAR* current_ucs2_le = ucs2_le;\n\n\tfor (; *current_utf8; current_ucs2_le++)\n\t{\n\t\tsize_t size = (char*)current_utf8 - utf8;\n\n\t\tif (size >= maxutf8) return (size_t)-1;\n\t\tif (((*current_utf8 & 0xc0) == 0xc0) && (size >= maxutf8 - 1)) return (size_t)-1;\n\t\tif (((*current_utf8 & 0xe0) == 0xe0) && (size >= maxutf8 - 2)) return (size_t)-1;\n\t\tif (current_ucs2_le - ucs2_le >= (intptr_t)maxucs2 - 1) return (size_t)-1;\n\n\t\t*current_ucs2_le = utf8_to_ucs2_char(current_utf8, &current_utf8);\n\t\tcurrent_ucs2_le[1] = 0;\n\n\t\tif (*current_ucs2_le == (WCHAR)-1) return (size_t)-1;\n\t}\n\treturn current_ucs2_le - ucs2_le;\n}\n\n// Converts UCS2 to UTF-8. Returns TRUE or FALSE\nBOOL ucs2_to_utf8(const WCHAR* const ucs2_le, char* utf8, size_t maxucs2, size_t maxutf8)\n{\n\tchar utf8_char[4];\n\tconst WCHAR* current_ucs2 = ucs2_le;\n\tunsigned int index_utf8 = 0;\n\n\tfor (*utf8 = 0; *current_ucs2; current_ucs2++)\n\t{\n\t\tif (current_ucs2 - ucs2_le > (intptr_t)maxucs2) return FALSE;\n\t\tint len = ucs2_to_utf8_char(*current_ucs2, utf8_char);\n\t\tif (index_utf8 + len > maxutf8) return FALSE;\n\t\tstrncat(utf8, utf8_char, len);\n\t\tindex_utf8 += len;\n\t}\n\n\treturn TRUE;\n}\n\n/* End of UTF-8 <-> UCS2 conversion */\n\n\n// Checks, whether a string is a valid integer number between min and max. Returns TRUE or FALSE. Puts int value in *value\nBOOL stringToInt(const char *const szValue, const unsigned int min, const unsigned int max, unsigned int *const value)\n{\n\tchar *nextchar;\n\n\terrno = 0;\n\tlong long result = vlmcsd_strtoll(szValue, &nextchar, 10);\n\n\tif (errno || result < (long long)min || result >(long long)max || *nextchar)\n\t{\n\t\treturn FALSE;\n\t}\n\n\t*value = (unsigned int)result;\n\treturn TRUE;\n}\n\n\n//Converts a String Guid to a host binary guid in host endianess\nint_fast8_t string2UuidLE(const char *const restrict input, GUID *const restrict guid)\n{\n\tint i;\n\n\tif (strlen(input) < GUID_STRING_LENGTH) return FALSE;\n\tif (input[8] != '-' || input[13] != '-' || input[18] != '-' || input[23] != '-') return FALSE;\n\n\tfor (i = 0; i < GUID_STRING_LENGTH; i++)\n\t{\n\t\tif (i == 8 || i == 13 || i == 18 || i == 23) continue;\n\n\t\tconst char c = (char)toupper((int)input[i]);\n\n\t\tif (c < '0' || c > 'F' || (c > '9' && c < 'A')) return FALSE;\n\t}\n\n\tchar inputCopy[GUID_STRING_LENGTH + 1];\n\tstrncpy(inputCopy, input, GUID_STRING_LENGTH + 1);\n\tinputCopy[8] = inputCopy[13] = inputCopy[18] = 0;\n\n\thex2bin((BYTE*)&guid->Data1, inputCopy, 8);\n\thex2bin((BYTE*)&guid->Data2, inputCopy + 9, 4);\n\thex2bin((BYTE*)&guid->Data3, inputCopy + 14, 4);\n\thex2bin(guid->Data4, input + 19, 16);\n\n\tguid->Data1 = BS32(guid->Data1);\n\tguid->Data2 = BS16(guid->Data2);\n\tguid->Data3 = BS16(guid->Data3);\n\treturn TRUE;\n}\n\n\n__pure DWORD timeSpanString2Seconds(const char *const restrict argument)\n{\n\tchar *unitId;\n\n\tlong long val = vlmcsd_strtoll(argument, &unitId, 10);\n\n\tswitch (toupper((int)*unitId))\n\t{\n\tcase 'W':\n\t\tval *= 7;\n\tcase 'D':\n\t\tval *= 24;\n\tcase 'H':\n\t\tval *= 60;\n\tcase 0:\n\tcase 'M':\n\t\tval *= 60;\n\tcase 'S':\n\t\tbreak;\n\tdefault:\n\t\treturn 0;\n\t}\n\n\tif (*unitId && unitId[1]) return 0;\n\tif (val < 1) val = 1;\n\treturn (DWORD)(val & UINT_MAX);\n}\n\n\n#if !IS_LIBRARY\n//Checks a command line argument if it is numeric and between min and max. Returns the numeric value or exits on error\n__pure unsigned int getOptionArgumentInt(const char o, const unsigned int min, const unsigned int max)\n{\n\tunsigned int result;\n\n\tif (!stringToInt(optarg, min, max, &result))\n\t{\n\t\tprinterrorf(\"Fatal: Option \\\"-%c\\\" must be numeric between %u and %u.\\n\", o, min, max);\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\treturn result;\n}\n\n// Resets getopt() to start parsing from the beginning\nvoid optReset(void)\n{\n#if __minix__ || defined(__BSD__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)\n\toptind = 1;\n\toptreset = 1; // Makes newer BSD getopt happy\n#elif defined(__UCLIBC__) // uClibc headers also define __GLIBC__ so be careful here\n\toptind = 0; // uClibc seeks compatibility with GLIBC\n#elif defined(__GLIBC__)\n\toptind = 0; // Makes GLIBC getopt happy\n#else // Standard for most systems\n\toptind = 1;\n#endif\n}\n#endif // !IS_LIBRARY\n\n#if _WIN32 || __CYGWIN__\n\n// Returns a static message buffer containing text for a given Win32 error. Not thread safe (same as strerror)\nchar* win_strerror(const int message)\n{\n#define STRERROR_BUFFER_SIZE 256\n\tstatic char buffer[STRERROR_BUFFER_SIZE];\n\n\tFormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, message, 0, buffer, STRERROR_BUFFER_SIZE, NULL);\n\treturn buffer;\n}\n\n#endif // _WIN32 || __CYGWIN__\n\n\n/*\n * parses an address in the form host:[port] in addr\n * returns host and port in seperate strings\n */\nvoid parseAddress(char *const addr, char** szHost, char** szPort)\n{\n\t*szHost = addr;\n\n#\tifndef NO_SOCKETS\n\t*szPort = (char*)defaultport;\n#\telse // NO_SOCKETS\n\t*szPort = \"1688\";\n#\tendif // NO_SOCKETS\n\n\tchar *lastcolon = strrchr(addr, ':');\n\tchar *firstcolon = strchr(addr, ':');\n\tchar *closingbracket = strrchr(addr, ']');\n\n\tif (*addr == '[' && closingbracket) //Address in brackets\n\t{\n\t\t*closingbracket = 0;\n\t\t(*szHost)++;\n\n\t\tif (closingbracket[1] == ':')\n\t\t\t*szPort = closingbracket + 2;\n\t}\n\telse if (firstcolon && firstcolon == lastcolon) //IPv4 address or hostname with port\n\t{\n\t\t*firstcolon = 0;\n\t\t*szPort = firstcolon + 1;\n\t}\n}\n\n\n// Initialize random generator (needs to be done in each thread)\nvoid randomNumberInit()\n{\n#\tif _MSC_VER\n\tsrand(GetTickCount());\n#\telse\n\tstruct timeval tv;\n\tgettimeofday(&tv, NULL);\n\tsrand((unsigned int)(tv.tv_sec ^ tv.tv_usec));\n#\tendif\n}\n\n\n// We always exit immediately if any OOM condition occurs\n__noreturn void OutOfMemory(void)\n{\n\terrorout(\"Fatal: Out of memory\");\n\texit(VLMCSD_ENOMEM);\n}\n\n\nvoid* vlmcsd_malloc(size_t len)\n{\n\tvoid* buf = malloc(len);\n\tif (!buf) OutOfMemory();\n\treturn buf;\n}\n\nchar* vlmcsd_strdup(const char* src)\n{\n#\tif _MSC_VER\n\tchar* dst = _strdup(src);\n#\telse // !_MSC_VER\n\tchar* dst = strdup(src);\n#\tendif\n\n\tif (!dst) OutOfMemory();\n\treturn dst;\n}\n\n\n/*\n * Converts hex digits to bytes in big-endian order.\n * Ignores any non-hex characters\n */\nvoid hex2bin(BYTE *const bin, const char *hex, const size_t maxbin)\n{\n\tstatic const char *const hexdigits = \"0123456789ABCDEF\";\n\tchar* nextchar;\n\tsize_t i;\n\n\tfor (i = 0; (i < 16) && utf8_to_ucs2_char((const unsigned char*)hex, (const unsigned char**)&nextchar) != (WCHAR)-1; hex = nextchar)\n\t{\n\t\tconst char* pos = strchr(hexdigits, toupper((int)*hex));\n\t\tif (!pos) continue;\n\n\t\tif (!(i & 1)) bin[i >> 1] = 0;\n\t\tbin[i >> 1] |= (char)(pos - hexdigits);\n\t\tif (!(i & 1)) bin[i >> 1] <<= 4;\n\t\ti++;\n\t\tif (i >> 1 > maxbin) break;\n\t}\n}\n\n\n__pure BOOL getArgumentBool(int_fast8_t *result, const char *const argument)\n{\n\tif (\n\t\t!strncasecmp(argument, \"true\", 4) ||\n\t\t!strncasecmp(argument, \"on\", 2) ||\n\t\t!strncasecmp(argument, \"yes\", 3) ||\n\t\t!strncasecmp(argument, \"1\", 1)\n\t\t)\n\t{\n\t\t*result = TRUE;\n\t\treturn TRUE;\n\t}\n\telse if (\n\t\t!strncasecmp(argument, \"false\", 5) ||\n\t\t!strncasecmp(argument, \"off\", 3) ||\n\t\t!strncasecmp(argument, \"no\", 2) ||\n\t\t!strncasecmp(argument, \"0\", 1)\n\t\t)\n\t{\n\t\t*result = FALSE;\n\t\treturn TRUE;\n\t}\n\n\treturn FALSE;\n}\n\n#ifndef IS_LIBRARY\n#ifndef NO_EXTERNAL_DATA\n__noreturn static void dataFileReadError()\n{\n\tconst int error = errno;\n\terrorout(\"Fatal: Could not read %s: %s\\n\", fn_data, strerror(error));\n\texit(error);\n}\n\n__noreturn static void dataFileFormatError()\n{\n\terrorout(\"Fatal: %s is not a KMS data file version 2.x\\n\", fn_data);\n\texit(VLMCSD_EINVAL);\n}\n#endif // NO_EXTERNAL_DATA\n\n#if !defined(DATA_FILE) || !defined(NO_SIGHUP)\nvoid getExeName()\n{\n\tif (fn_exe != NULL) return;\n\n#\tif (__GLIBC__ || __linux__) && defined(USE_AUXV)\n\n\tfn_exe = (char*)getauxval(AT_EXECFN);\n\n#\telif (__ANDROID__ && __ANDROID_API__ < 16) || (__UCLIBC__ && __UCLIBC_MAJOR__ < 1 && !defined(NO_PROCFS)) // Workaround for older uclibc\n\n\tchar temp[PATH_MAX + 1];\n\n\tif (realpath(\"/proc/self/exe\", temp) == temp)\n\t{\n\t\tfn_exe = vlmcsd_strdup(temp);\n\t}\n\n#\telif (__linux__ || __CYGWIN__) && !defined(NO_PROCFS)\n\n\tfn_exe = realpath(\"/proc/self/exe\", NULL);\n\n#\telif (__FreeBSD__ || __FreeBSD_kernel__)\n\n\tint mib[4];\n\tmib[0] = CTL_KERN;\n\tmib[1] = KERN_PROC;\n\tmib[2] = KERN_PROC_PATHNAME;\n\tmib[3] = -1;\n\tchar path[PATH_MAX + 1];\n\tsize_t cb = sizeof(path);\n\n\tif (!sysctl(mib, 4, path, &cb, NULL, 0))\n\t{\n\t\tfn_exe = vlmcsd_strdup(path);\n\t}\n\n#\telif (__DragonFly__) && !defined(NO_PROCFS)\n\n\tfn_exe = realpath(\"/proc/curproc/file\", NULL);\n\n#\telif __NetBSD__ && !defined(NO_PROCFS)\n\n\tfn_exe = realpath(\"/proc/curproc/exe\", NULL);\n\n#\telif __sun__\n\n\tfn_exe = getexecname();\n\n#\telif __APPLE__\n\n\tchar path[PATH_MAX + 1];\n\tuint32_t size = sizeof(path);\n\n\tif (_NSGetExecutablePath(path, &size) == 0)\n\t{\n\t\tfn_exe = vlmcsd_strdup(path);\n\t}\n\n#\telif _WIN32\n\n\tchar path[512];\n\tGetModuleFileName(GetModuleHandle(NULL), path, 512);\n\tpath[511] = 0;\n\tfn_exe = vlmcsd_strdup(path);\n\n#\telse\n\t// Sorry no exe detection\n#\tendif\n}\n#endif // defined(DATA_FILE) && defined(NO_SIGHUP)\n\n#if !defined(DATA_FILE) && !defined(NO_EXTERNAL_DATA)\n#ifdef _WIN32\nstatic void getDefaultDataFile()\n{\n\tchar fileName[MAX_PATH];\n\tgetExeName();\n\tstrncpy(fileName, fn_exe, MAX_PATH);\n\tPathRemoveFileSpec(fileName);\n\tstrncat(fileName, \"\\\\vlmcsd.kmd\", MAX_PATH - 11);\n\tfn_data = vlmcsd_strdup(fileName);\n}\n#else // !_WIN32\nstatic void getDefaultDataFile()\n{\n\tchar fileName[512];\n\tgetExeName();\n\n\tif (!fn_exe)\n\t{\n\t\tfn_data = (char*)\"/etc/vlmcsd.kmd\";\n\t\treturn;\n\t}\n\n\tchar* fn_exe_copy = vlmcsd_strdup(fn_exe);\n\tstrncpy(fileName, dirname(fn_exe_copy), 512);\n\tfree(fn_exe_copy);\n\tstrncat(fileName, \"/vlmcsd.kmd\", 500);\n\tfn_data = vlmcsd_strdup(fileName);\n}\n#endif // !_WIN32\n#endif // !defined(DATA_FILE) && !defined(NO_EXTERNAL_DATA)\n\nvoid loadKmsData()\n{\n#\tifndef NO_INTERNAL_DATA\n\tKmsData = (PVlmcsdHeader_t)DefaultKmsData;\n#\tendif // NO_INTERNAL_DATA\n\n#\tifndef NO_EXTERNAL_DATA\n\tlong size;\n#\tifndef NO_INTERNAL_DATA\n\tsize = (long)getDefaultKmsDataSize();\n#\tendif // NO_INTERNAL_DATA\n\n#\tifndef DATA_FILE\n\tif (!fn_data) getDefaultDataFile();\n#\tendif // DATA_FILE\n\n\tif (strcmp(fn_data, \"-\"))\n\t{\n\t\tFILE *file = fopen(fn_data, \"rb\");\n\n\t\tif (!file)\n\t\t{\n#\t\t\tifndef NO_INTERNAL_DATA\n\t\t\tif (ExplicitDataLoad)\n#\t\t\tendif // NO_INTERNAL_DATA\n\t\t\t{\n\t\t\t\tdataFileReadError();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (fseek(file, 0, SEEK_END)) dataFileReadError();\n\t\t\tsize = ftell(file);\n\t\t\tif (size == -1L) dataFileReadError();\n\n\t\t\tKmsData = (PVlmcsdHeader_t)vlmcsd_malloc(size);\n\t\t\tif (fseek(file, 0, SEEK_SET)) dataFileReadError();\n\n\t\t\tconst size_t bytesRead = fread(KmsData, 1, size, file);\n\t\t\tif ((long)bytesRead != size) dataFileReadError();\n\t\t\tfclose(file);\n\n#\t\t\tif !defined(NO_LOG) && !defined(NO_SOCKETS)\n\t\t\tif (!InetdMode) logger(\"Read KMS data file version %u.%u %s\\n\", (unsigned int)LE16(KmsData->MajorVer), (unsigned int)LE16(KmsData->MinorVer), fn_data);\n#\t\t\tendif // NO_LOG\n\t\t}\n\t}\n\n\n#\tendif // NO_EXTERNAL_DATA\n\n#\tifndef UNSAFE_DATA_LOAD\n\tif (((BYTE*)KmsData)[size - 1] != 0) dataFileFormatError();\n#\tendif // UNSAFE_DATA_LOAD\n\n\tKmsData->MajorVer = LE16(KmsData->MajorVer);\n\tKmsData->MinorVer = LE16(KmsData->MinorVer);\n\tKmsData->AppItemCount = LE32(KmsData->AppItemCount);\n\tKmsData->KmsItemCount = LE32(KmsData->KmsItemCount);\n\tKmsData->SkuItemCount = LE32(KmsData->SkuItemCount);\n\tKmsData->HostBuildCount = LE32(KmsData->HostBuildCount);\n\n\tuint32_t i;\n\n\tfor (i = 0; i < vlmcsd_countof(KmsData->Datapointers); i++)\n\t{\n\t\tKmsData->Datapointers[i].Pointer = (BYTE*)KmsData + LE64(KmsData->Datapointers[i].Offset);\n#\t\tifndef UNSAFE_DATA_LOAD\n\t\tif ((BYTE*)KmsData->Datapointers[i].Pointer > (BYTE*)KmsData + size) dataFileFormatError();\n#\t\tendif // UNSAFE_DATA_LOAD\n\t}\n\n\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t{\n\t\tPCsvlkData_t csvlkData = &KmsData->CsvlkData[i];\n\t\tcsvlkData->EPid = (char*)KmsData + LE64(csvlkData->EPidOffset);\n\t\tcsvlkData->ReleaseDate = LE64(csvlkData->ReleaseDate);\n#\t\tifndef UNSAFE_DATA_LOAD\n\t\tif (csvlkData->EPid > (char*)KmsData + size) dataFileFormatError();\n#\t\tendif // UNSAFE_DATA_LOAD\n\n#\t\tifndef NO_RANDOM_EPID\n\t\tcsvlkData->GroupId = LE32(csvlkData->GroupId);\n\t\tcsvlkData->MinKeyId = LE32(csvlkData->MinKeyId);\n\t\tcsvlkData->MaxKeyId = LE32(csvlkData->MaxKeyId);\n#\t\tendif // NO_RANDOM_EPID\n\t}\n\n\tfor (i = 0; i < (uint32_t)KmsData->HostBuildCount; i++)\n\t{\n\t\tPHostBuild_t hostBuild = &KmsData->HostBuildList[i];\n\t\thostBuild->BuildNumber = LE32(hostBuild->BuildNumber);\n\t\thostBuild->Flags = LE32(hostBuild->Flags);\n\t\thostBuild->PlatformId = LE32(hostBuild->PlatformId);\n\t\thostBuild->ReleaseDate = LE64(hostBuild->ReleaseDate);\n\t\thostBuild->DisplayName = (char*)KmsData + LE64(hostBuild->DisplayNameOffset);\n#\t\tifndef UNSAFE_DATA_LOAD\n\t\tif (hostBuild->DisplayName > (char*)KmsData + size) dataFileFormatError();\n#\t\tendif // UNSAFE_DATA_LOAD\n\t}\n\n\tconst uint32_t totalItemCount = KmsData->AppItemCount + KmsData->KmsItemCount + KmsData->SkuItemCount;\n\n#\tifndef NO_EXTERNAL_DATA\n\tif (\n\t\tmemcmp(KmsData->Magic, \"KMD\", sizeof(KmsData->Magic)) ||\n\t\tKmsData->MajorVer != 2\n#\t\tifndef UNSAFE_DATA_LOAD\n\t\t||\n\t\tsizeof(VlmcsdHeader_t) + totalItemCount * sizeof(VlmcsdData_t) >= ((uint64_t)size)\n#\t\tendif //UNSAFE_DATA_LOAD\n\t\t)\n\t{\n\t\tdataFileFormatError();\n\t}\n#\tendif // NO_EXTERNAL_DATA\n\n\tfor (i = 0; i < totalItemCount; i++)\n\t{\n\t\tPVlmcsdData_t item = &KmsData->AppItemList[i];\n\t\titem->Name = (char*)KmsData + LE64(item->NameOffset);\n\n#\t\tifndef UNSAFE_DATA_LOAD\n\t\tif (\n\t\t\titem->Name >= (char*)KmsData + (uint64_t)size ||\n\t\t\t(KmsData->AppItemCount && item->AppIndex >= KmsData->AppItemCount) ||\n\t\t\titem->KmsIndex >= KmsData->KmsItemCount\n\t\t\t)\n\t\t{\n\t\t\tdataFileFormatError();\n\t\t}\n#\t\tendif // UNSAFE_DATA_LOAD\n\t}\n}\n\n#ifndef NO_SOCKETS\nvoid exitOnWarningLevel(const int_fast8_t level)\n{\n\tif (ExitLevel >= level)\n\t{\n\t\tprinterrorf(\"Fatal: Exiting on warning level %i or greater\\n\", (int)ExitLevel);\n\t\texit(-1);\n\t}\n}\n#endif // !NO_SOCKETS\n\n#endif // IS_LIBRARY\n\n\n#if __ANDROID__ && !defined(USE_THREADS) // Bionic does not wrap these syscalls (intentionally because Google fears, developers don't know how to use it)\n\n#ifdef __NR_shmget\nint shmget(key_t key, size_t size, int shmflg)\n{\n\treturn syscall(__NR_shmget, key, size, shmflg);\n}\n#endif // __NR_shmget\n\n#ifdef __NR_shmat\nvoid *shmat(int shmid, const void *shmaddr, int shmflg)\n{\n\treturn (void *)syscall(__NR_shmat, shmid, shmaddr, shmflg);\n}\n#endif // __NR_shmat\n\n#ifdef __NR_shmdt\nint shmdt(const void *shmaddr)\n{\n\treturn syscall(__NR_shmdt, shmaddr);\n}\n#endif // __NR_shmdt\n\n#ifdef __NR_shmctl\nint shmctl(int shmid, int cmd, /*struct shmid_ds*/void *buf)\n{\n\treturn syscall(__NR_shmctl, shmid, cmd, buf);\n}\n#endif // __NR_shmctl\n\n#endif // __ANDROID__ && !defined(USE_THREADS)\n\n\n"
  },
  {
    "path": "src/helpers.h",
    "content": "#ifndef HELPERS_H\n#define HELPERS_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include <stdint.h>\n#include \"types.h\"\n\n#if __ANDROID__\n#include <sys/syscall.h>\n#endif // __ANDROID__\n\n#define GUID_LE 0\n#define GUID_BE 1\n#define GUID_SWAP 2\n\nBOOL stringToInt(const char *const szValue, const unsigned int min, const unsigned int max, unsigned int *const value);\nunsigned int getOptionArgumentInt(const char o, const unsigned int min, const unsigned int max);\nvoid optReset(void);\n__pure DWORD timeSpanString2Seconds(const char *const restrict argument);\n#define timeSpanString2Minutes(x) (timeSpanString2Seconds(x) / 60)\nchar* win_strerror(const int message);\nint ucs2_to_utf8_char (const WCHAR ucs2_le, char *utf8);\nsize_t utf8_to_ucs2(WCHAR* const ucs2_le, const char* const utf8, const size_t maxucs2, const size_t maxutf8);\nWCHAR utf8_to_ucs2_char (const unsigned char * input, const unsigned char ** end_ptr);\nBOOL ucs2_to_utf8(const WCHAR* const ucs2_le, char* utf8, size_t maxucs2, size_t maxutf8);\nint_fast8_t string2UuidLE(const char *const restrict input, GUID *const restrict guid);\nvoid randomNumberInit();\nvoid parseAddress(char *const addr, char** szHost, char** szPort);\n__noreturn void OutOfMemory(void);\nvoid* vlmcsd_malloc(size_t len);\nvoid hex2bin(BYTE *const bin, const char *hex, const size_t maxbin);\nvoid loadKmsData();\n#if !defined(DATA_FILE) || !defined(NO_SIGHUP)\nvoid getExeName();\n#endif // !defined(DATA_FILE) || !defined(NO_SIGHUP)\n__pure BOOL getArgumentBool(int_fast8_t *result, const char *const argument);\nchar* vlmcsd_strdup(const char* src);\n\n#if defined(NO_SOCKETS) || IS_LIBRARY\n#define exitOnWarningLevel(x)\n#else // !NO_SOCKETS\nvoid exitOnWarningLevel(const int_fast8_t level);\n#endif // !NO_SOCKETS\n\n\n#if __ANDROID__ && !defined(USE_THREADS) // Bionic does not wrap these syscalls (intentionally because Google fears, developers don't know how to use it)\nint shmget(key_t key, size_t size, int shmflg);\nvoid *shmat(int shmid, const void *shmaddr, int shmflg);\nint shmdt(const void *shmaddr);\nint shmctl(int shmid, int cmd, /*struct shmid_ds*/void *buf);\n#endif // __ANDROID__ && !defined(USE_THREADS)\n\n#endif // HELPERS_H\n"
  },
  {
    "path": "src/ifaddrs-android.c",
    "content": "/*\nCopyright (c) 2013, Kenneth MacKay\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include \"ifaddrs-android.h\"\n\n#include <string.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <unistd.h>\n#include <sys/socket.h>\n#include <net/if_arp.h>\n#include <netinet/in.h>\n#include <linux/netlink.h>\n#include <linux/rtnetlink.h>\n\ntypedef struct NetlinkList\n{\n    struct NetlinkList *m_next;\n    struct nlmsghdr *m_data;\n    unsigned int m_size;\n} NetlinkList;\n\nstatic int netlink_socket(void)\n{\n    int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);\n    if(l_socket < 0)\n    {\n        return -1;\n    }\n    \n    struct sockaddr_nl l_addr;\n    memset(&l_addr, 0, sizeof(l_addr));\n    l_addr.nl_family = AF_NETLINK;\n    if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0)\n    {\n        close(l_socket);\n        return -1;\n    }\n    \n    return l_socket;\n}\n\nstatic int netlink_send(int p_socket, int p_request)\n{\n    char l_buffer[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))];\n    memset(l_buffer, 0, sizeof(l_buffer));\n    struct nlmsghdr *l_hdr = (struct nlmsghdr *)l_buffer;\n    struct rtgenmsg *l_msg = (struct rtgenmsg *)NLMSG_DATA(l_hdr);\n    \n    l_hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*l_msg));\n    l_hdr->nlmsg_type = p_request;\n    l_hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;\n    l_hdr->nlmsg_pid = 0;\n    l_hdr->nlmsg_seq = p_socket;\n    l_msg->rtgen_family = AF_UNSPEC;\n    \n    struct sockaddr_nl l_addr;\n    memset(&l_addr, 0, sizeof(l_addr));\n    l_addr.nl_family = AF_NETLINK;\n    return (sendto(p_socket, l_hdr, l_hdr->nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr)));\n}\n\nstatic int netlink_recv(int p_socket, void *p_buffer, size_t p_len)\n{\n    struct msghdr l_msg;\n    struct iovec l_iov = { p_buffer, p_len };\n    struct sockaddr_nl l_addr;\n    //int l_result;\n\n    for(;;)\n    {\n        l_msg.msg_name = (void *)&l_addr;\n        l_msg.msg_namelen = sizeof(l_addr);\n        l_msg.msg_iov = &l_iov;\n        l_msg.msg_iovlen = 1;\n        l_msg.msg_control = NULL;\n        l_msg.msg_controllen = 0;\n        l_msg.msg_flags = 0;\n        int l_result = recvmsg(p_socket, &l_msg, 0);\n        \n        if(l_result < 0)\n        {\n            if(errno == EINTR)\n            {\n                continue;\n            }\n            return -2;\n        }\n        \n        if(l_msg.msg_flags & MSG_TRUNC)\n        { // buffer was too small\n            return -1;\n        }\n        return l_result;\n    }\n}\n\nstatic struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done)\n{\n    size_t l_size = 4096;\n    void *l_buffer = NULL;\n    \n    for(;;)\n    {\n        free(l_buffer);\n        l_buffer = malloc(l_size);\n        \n        int l_read = netlink_recv(p_socket, l_buffer, l_size);\n        *p_size = l_read;\n        if(l_read == -2)\n        {\n            free(l_buffer);\n            return NULL;\n        }\n        if(l_read >= 0)\n        {\n            pid_t l_pid = getpid();\n            struct nlmsghdr *l_hdr;\n            for(l_hdr = (struct nlmsghdr *)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); l_hdr = (struct nlmsghdr *)NLMSG_NEXT(l_hdr, l_read))\n            {\n                if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)\n                {\n                    continue;\n                }\n                \n                if(l_hdr->nlmsg_type == NLMSG_DONE)\n                {\n                    *p_done = 1;\n                    break;\n                }\n                \n                if(l_hdr->nlmsg_type == NLMSG_ERROR)\n                {\n                    free(l_buffer);\n                    return NULL;\n                }\n            }\n            return l_buffer;\n        }\n        \n        l_size *= 2;\n    }\n}\n\nstatic NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size)\n{\n    NetlinkList *l_item = malloc(sizeof(NetlinkList));\n    l_item->m_next = NULL;\n    l_item->m_data = p_data;\n    l_item->m_size = p_size;\n    return l_item;\n}\n\nstatic void freeResultList(NetlinkList *p_list)\n{\n    NetlinkList *l_cur;\n    while(p_list)\n    {\n        l_cur = p_list;\n        p_list = p_list->m_next;\n        free(l_cur->m_data);\n        free(l_cur);\n    }\n}\n\nstatic NetlinkList *getResultList(int p_socket, int p_request)\n{\n    if(netlink_send(p_socket, p_request) < 0)\n    {\n        return NULL;\n    }\n\n    NetlinkList *l_list = NULL;\n    NetlinkList *l_end = NULL;\n    int l_size;\n    int l_done = 0;\n    while(!l_done)\n    {\n        struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done);\n        if(!l_hdr)\n        { // error\n            freeResultList(l_list);\n            return NULL;\n        }\n        \n        NetlinkList *l_item = newListItem(l_hdr, l_size);\n        if(!l_list)\n        {\n            l_list = l_item;\n        }\n        else\n        {\n            l_end->m_next = l_item;\n        }\n        l_end = l_item;\n    }\n    return l_list;\n}\n\nstatic size_t maxSize(size_t a, size_t b)\n{\n    return (a > b ? a : b);\n}\n\nstatic size_t calcAddrLen(sa_family_t p_family, int p_dataSize)\n{\n    switch(p_family)\n    {\n        case AF_INET:\n            return sizeof(struct sockaddr_in);\n        case AF_INET6:\n            return sizeof(struct sockaddr_in6);\n        case AF_PACKET:\n            return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize);\n        default:\n            return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize);\n    }\n}\n\nstatic void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size)\n{\n    switch(p_family)\n    {\n        case AF_INET:\n            memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size);\n            break;\n        case AF_INET6:\n            memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size);\n            break;\n        case AF_PACKET:\n            memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size);\n            ((struct sockaddr_ll*)p_dest)->sll_halen = p_size;\n            break;\n        default:\n            memcpy(p_dest->sa_data, p_data, p_size);\n            break;\n    }\n    p_dest->sa_family = p_family;\n}\n\nstatic void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry)\n{\n    if(!*p_resultList)\n    {\n        *p_resultList = p_entry;\n    }\n    else\n    {\n        struct ifaddrs *l_cur = *p_resultList;\n        while(l_cur->ifa_next)\n        {\n            l_cur = l_cur->ifa_next;\n        }\n        l_cur->ifa_next = p_entry;\n    }\n}\n\nstatic void interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_links, struct ifaddrs **p_resultList)\n{\n    struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr);\n\n    size_t l_nameSize = 0;\n    size_t l_addrSize = 0;\n    size_t l_dataSize = 0;\n    \n    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));\n    struct rtattr *l_rta;\n    for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifinfomsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))\n    {\n        //void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch(l_rta->rta_type)\n        {\n            case IFLA_ADDRESS:\n            case IFLA_BROADCAST:\n                l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize));\n                break;\n            case IFLA_IFNAME:\n                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);\n                break;\n            case IFLA_STATS:\n                l_dataSize += NLMSG_ALIGN(l_rtaSize);\n                break;\n            default:\n                break;\n        }\n    }\n    \n    struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize + l_dataSize);\n    memset(l_entry, 0, sizeof(struct ifaddrs));\n    l_entry->ifa_name = \"\";\n    \n    char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs);\n    char *l_addr = l_name + l_nameSize;\n    char *l_data = l_addr + l_addrSize;\n    \n    l_entry->ifa_flags = l_info->ifi_flags;\n    \n    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));\n    for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifinfomsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))\n    {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch(l_rta->rta_type)\n        {\n            case IFLA_ADDRESS:\n            case IFLA_BROADCAST:\n            {\n                size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize);\n                makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);\n                ((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index;\n                ((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type;\n                if(l_rta->rta_type == IFLA_ADDRESS)\n                {\n                    l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                }\n                else\n                {\n                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;\n                }\n                l_addr += NLMSG_ALIGN(l_addrLen);\n                break;\n            }\n            case IFLA_IFNAME:\n                strncpy(l_name, l_rtaData, l_rtaDataSize);\n                l_name[l_rtaDataSize] = '\\0';\n                l_entry->ifa_name = l_name;\n                break;\n            case IFLA_STATS:\n                memcpy(l_data, l_rtaData, l_rtaDataSize);\n                l_entry->ifa_data = l_data;\n                break;\n            default:\n                break;\n        }\n    }\n    \n    addToEnd(p_resultList, l_entry);\n    p_links[l_info->ifi_index - 1] = l_entry;\n}\n\nstatic void interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_links, struct ifaddrs **p_resultList)\n{\n    struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr);\n\n    size_t l_nameSize = 0;\n    size_t l_addrSize = 0;\n    \n    int l_addedNetmask = 0;\n    \n    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));\n    struct rtattr *l_rta;\n    for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))\n    {\n        //void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        if(l_info->ifa_family == AF_PACKET)\n        {\n            continue;\n        }\n        \n        switch(l_rta->rta_type)\n        {\n            case IFA_ADDRESS:\n            case IFA_LOCAL:\n                if((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask)\n                { // make room for netmask\n                    l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));\n                    l_addedNetmask = 1;\n                }\n            case IFA_BROADCAST:\n                l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));\n                break;\n            case IFA_LABEL:\n                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);\n                break;\n            default:\n                break;\n        }\n    }\n    \n    struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize);\n    memset(l_entry, 0, sizeof(struct ifaddrs));\n    l_entry->ifa_name = p_links[l_info->ifa_index - 1]->ifa_name;\n    \n    char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs);\n    char *l_addr = l_name + l_nameSize;\n    \n    l_entry->ifa_flags = l_info->ifa_flags | p_links[l_info->ifa_index - 1]->ifa_flags;\n    \n    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));\n    for(l_rta = (struct rtattr *)(((char *)l_info) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))\n    {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch(l_rta->rta_type)\n        {\n            case IFA_ADDRESS:\n            case IFA_BROADCAST:\n            case IFA_LOCAL:\n            {\n                size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize);\n                makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);\n                if(l_info->ifa_family == AF_INET6)\n                {\n                    if(IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData))\n                    {\n                        ((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index;\n                    }\n                }\n                \n                if(l_rta->rta_type == IFA_ADDRESS)\n                { // apparently in a point-to-point network IFA_ADDRESS contains the dest address and IFA_LOCAL contains the local address\n                    if(l_entry->ifa_addr)\n                    {\n                        l_entry->ifa_dstaddr = (struct sockaddr *)l_addr;\n                    }\n                    else\n                    {\n                        l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                    }\n                }\n                else if(l_rta->rta_type == IFA_LOCAL)\n                {\n                    if(l_entry->ifa_addr)\n                    {\n                        l_entry->ifa_dstaddr = l_entry->ifa_addr;\n                    }\n                    l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                }\n                else\n                {\n                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;\n                }\n                l_addr += NLMSG_ALIGN(l_addrLen);\n                break;\n            }\n            case IFA_LABEL:\n                strncpy(l_name, l_rtaData, l_rtaDataSize);\n                l_name[l_rtaDataSize] = '\\0';\n                l_entry->ifa_name = l_name;\n                break;\n            default:\n                break;\n        }\n    }\n    \n    if(l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6))\n    {\n        unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128);\n        unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen);\n        char l_mask[16] = {0};\n        unsigned i;\n        for(i=0; i<(l_prefix/8); ++i)\n        {\n            l_mask[i] = 0xff;\n        }\n        l_mask[i] = 0xff << (8 - (l_prefix % 8));\n        \n        makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8);\n        l_entry->ifa_netmask = (struct sockaddr *)l_addr;\n    }\n    \n    addToEnd(p_resultList, l_entry);\n}\n\nstatic void interpret(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_links, struct ifaddrs **p_resultList)\n{\n    pid_t l_pid = getpid();\n    for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)\n    {\n        unsigned int l_nlsize = p_netlinkList->m_size;\n        struct nlmsghdr *l_hdr;\n        for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))\n        {\n            if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)\n            {\n                continue;\n            }\n            \n            if(l_hdr->nlmsg_type == NLMSG_DONE)\n            {\n                break;\n            }\n            \n            if(l_hdr->nlmsg_type == RTM_NEWLINK)\n            {\n                interpretLink(l_hdr, p_links, p_resultList);\n            }\n            else if(l_hdr->nlmsg_type == RTM_NEWADDR)\n            {\n                interpretAddr(l_hdr, p_links, p_resultList);\n            }\n        }\n    }\n}\n\nstatic unsigned countLinks(int p_socket, NetlinkList *p_netlinkList)\n{\n    unsigned l_links = 0;\n    pid_t l_pid = getpid();\n    for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)\n    {\n        unsigned int l_nlsize = p_netlinkList->m_size;\n        struct nlmsghdr *l_hdr;\n        for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))\n        {\n            if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)\n            {\n                continue;\n            }\n            \n            if(l_hdr->nlmsg_type == NLMSG_DONE)\n            {\n                break;\n            }\n            \n            if(l_hdr->nlmsg_type == RTM_NEWLINK)\n            {\n                ++l_links;\n            }\n        }\n    }\n    \n    return l_links;\n}\n\nint getifaddrs(struct ifaddrs **ifap)\n{\n    if(!ifap)\n    {\n        return -1;\n    }\n    *ifap = NULL;\n    \n    int l_socket = netlink_socket();\n    if(l_socket < 0)\n    {\n        return -1;\n    }\n    \n    NetlinkList *l_linkResults = getResultList(l_socket, RTM_GETLINK);\n    if(!l_linkResults)\n    {\n        close(l_socket);\n        return -1;\n    }\n    \n    NetlinkList *l_addrResults = getResultList(l_socket, RTM_GETADDR);\n    if(!l_addrResults)\n    {\n        close(l_socket);\n        freeResultList(l_linkResults);\n        return -1;\n    }\n    \n    unsigned l_numLinks = countLinks(l_socket, l_linkResults) + countLinks(l_socket, l_addrResults);\n    struct ifaddrs *l_links[l_numLinks];\n    memset(l_links, 0, l_numLinks * sizeof(struct ifaddrs *));\n    \n    interpret(l_socket, l_linkResults, l_links, ifap);\n    interpret(l_socket, l_addrResults, l_links, ifap);\n\n    freeResultList(l_linkResults);\n    freeResultList(l_addrResults);\n    close(l_socket);\n    return 0;\n}\n\nvoid freeifaddrs(struct ifaddrs *ifa)\n{\n    struct ifaddrs *l_cur;\n    while(ifa)\n    {\n        l_cur = ifa;\n        ifa = ifa->ifa_next;\n        free(l_cur);\n    }\n}\n"
  },
  {
    "path": "src/ifaddrs-android.h",
    "content": "/*\n * Copyright (c) 1995, 1999\n *\tBerkeley Software Design, Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n *\tBSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp\n */\n\n#if !__ANDROID__\n#error ifaddrs-android only works with Android\n#endif\n\n#ifndef\t_IFADDRS_H_\n#define\t_IFADDRS_H_\n\nstruct ifaddrs {\n\tstruct ifaddrs  *ifa_next;\n\tchar\t\t*ifa_name;\n\tunsigned int\t ifa_flags;\n\tstruct sockaddr\t*ifa_addr;\n\tstruct sockaddr\t*ifa_netmask;\n\tstruct sockaddr\t*ifa_dstaddr;\n\tvoid\t\t*ifa_data;\n};\n\n/*\n * This may have been defined in <net/if.h>.  Note that if <net/if.h> is\n * to be included it must be included before this header file.\n */\n#ifndef\tifa_broadaddr\n#define\tifa_broadaddr\tifa_dstaddr\t/* broadcast address interface */\n#endif\n\n#include <sys/cdefs.h>\n\n__BEGIN_DECLS\nextern int getifaddrs(struct ifaddrs **ifap);\nextern void freeifaddrs(struct ifaddrs *ifa);\n__END_DECLS\n\n#endif\n"
  },
  {
    "path": "src/ifaddrs-musl.h",
    "content": "#ifndef _IFADDRS_H\n#define _IFADDRS_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#if !__linux__\n#error ifaddrs-musl.h only works with a Linux kernel\n#endif\n\n#if __ANDROID__\n#error ifaddrs-musl.h does not work with Android\n#endif\n\n#include <features.h>\n#include <netinet/in.h>\n#include <sys/socket.h>\n\nstruct ifaddrs {\n\tstruct ifaddrs *ifa_next;\n\tchar *ifa_name;\n\tunsigned ifa_flags;\n\tstruct sockaddr *ifa_addr;\n\tstruct sockaddr *ifa_netmask;\n\tunion {\n\t\tstruct sockaddr *ifu_broadaddr;\n\t\tstruct sockaddr *ifu_dstaddr;\n\t} ifa_ifu;\n\tvoid *ifa_data;\n};\n#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n\nvoid freeifaddrs(struct ifaddrs *ifp);\nint getifaddrs(struct ifaddrs **ifap);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n"
  },
  {
    "path": "src/kms.c",
    "content": "#ifndef CONFIG\r\n#define CONFIG \"config.h\"\r\n#endif // CONFIG\r\n#include CONFIG\r\n\r\n#ifndef _GNU_SOURCE\r\n#define _GNU_SOURCE\r\n#endif\r\n\r\n#ifndef _CRT_SECURE_NO_WARNINGS\r\n#define _CRT_SECURE_NO_WARNINGS\r\n#endif\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdint.h>\r\n#include <ctype.h>\r\n#include <time.h>\r\n#if !defined(_WIN32)\r\n#if !__ANDROID__\r\n#include <sys/shm.h>\r\n#endif // !__ANDROID__\r\n#include <sys/socket.h>\r\n#include <sys/ipc.h>\r\n#endif // !defined(_WIN32)\r\n\r\n#include \"output.h\"\r\n#include \"crypto.h\"\r\n#include \"endian.h\"\r\n#include \"kms.h\"\r\n#include \"shared_globals.h\"\r\n#include \"helpers.h\"\r\n\r\n#define FRIENDLY_NAME_WINDOWS \"Windows\"\r\n#define FRIENDLY_NAME_OFFICE2010 \"Office 2010\"\r\n#define FRIENDLY_NAME_OFFICE2013 \"Office 2013+\"\r\n\r\n#ifndef IS_LIBRARY\r\n\r\n#ifdef NO_LOG\r\n#define LOGTEXT(x) \"\"\r\n#else //!NO_LOG\r\n#define LOGTEXT(x) x\r\n#endif // !NO_LOG\r\n\r\nint32_t getProductIndex(const GUID* guid, const PVlmcsdData_t list, const int32_t count, char** name, char** ePid)\r\n{\r\n\tint i;\r\n\r\n\tfor (i = count - 1; i >= 0; i--)\r\n\t{\r\n\t\tif (IsEqualGUID(guid, &list[i].Guid))\r\n\t\t{\r\n\t\t\tif (name) *name = list[i].Name;\r\n\t\t\tif (ePid) *ePid = KmsData->CsvlkData[list[i].EPidIndex].EPid;\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\tif (name) *name = (char*)\"Unknown\";\r\n\tif (ePid) *ePid = KmsData->CsvlkData->EPid;\r\n\treturn i;\r\n}\r\n\r\n#if !defined(NO_INI_FILE)||!defined(NO_VERBOSE_LOG)\r\nconst char* getNextString(const char* s)\r\n{\r\n\treturn s + strlen(s) + 1;\r\n}\r\n#endif //!defined(NO_INI_FILE)||!defined(NO_VERBOSE_LOG)\r\n\r\n#endif // IS_LIBRARY\r\n\r\n\r\n#ifndef NO_RANDOM_EPID\r\n//static const uint16_t HostBuilds[] = { 6002, 7601, 9200, 9600, 14393, 17763 };\r\n\r\n// Valid language identifiers to be used in the ePID\r\nstatic const uint16_t LcidList[] = {\r\n\t1078, 1052, 1025, 2049, 3073, 4097, 5121, 6145, 7169, 8193, 9217, 10241, 11265, 12289, 13313, 14337, 15361, 16385,\r\n\t1067, 1068, 2092, 1069, 1059, 1093, 5146, 1026, 1027, 1028, 2052, 3076, 4100, 5124, 1050, 4122, 1029, 1030, 1125, 1043, 2067,\r\n\t1033, 2057, 3081, 4105, 5129, 6153, 7177, 8201, 9225, 10249, 11273, 12297, 13321, 1061, 1080, 1065, 1035, 1036, 2060,\r\n\t3084, 4108, 5132, 6156, 1079, 1110, 1031, 2055, 3079, 4103, 5127, 1032, 1095, 1037, 1081, 1038, 1039, 1057, 1040, 2064, 1041, 1099,\r\n\t1087, 1111, 1042, 1088, 1062, 1063, 1071, 1086, 2110, 1100, 1082, 1153, 1102, 1104, 1044, 2068, 1045, 1046, 2070,\r\n\t1094, 1131, 2155, 3179, 1048, 1049, 9275, 4155, 5179, 3131, 1083, 2107, 8251, 6203, 7227, 1103, 2074, 6170, 3098,\r\n\t7194, 1051, 1060, 1034, 2058, 3082, 4106, 5130, 6154, 7178, 8202, 9226, 10250, 11274, 12298, 13322, 14346, 15370, 16394,\r\n\t17418, 18442, 19466, 20490, 1089, 1053, 2077, 1114, 1097, 1092, 1098, 1054, 1074, 1058, 1056, 1091, 2115, 1066, 1106, 1076, 1077\r\n};\r\n\r\nint32_t getPlatformId(int32_t hostBuild)\r\n{\r\n\tint32_t i;\r\n\r\n\tfor (i = 0; i < KmsData->HostBuildCount; i++)\r\n\t{\r\n\t\tif (KmsData->HostBuildList[i].BuildNumber <= hostBuild)\r\n\t\t{\r\n\t\t\treturn KmsData->HostBuildList[i].PlatformId;\r\n\t\t}\r\n\t}\r\n\r\n\treturn KmsData->HostBuildList[KmsData->HostBuildCount - 1].PlatformId;\r\n}\r\n\r\n\r\ntime_t getReleaseDate(int32_t hostBuild)\r\n{\r\n\tint32_t i;\r\n\r\n\tfor (i = KmsData->HostBuildCount - 1; i >= 0; i--)\r\n\t{\r\n\t\tif (KmsData->HostBuildList[i].BuildNumber >= hostBuild)\r\n\t\t{\r\n\t\t\treturn (time_t)KmsData->HostBuildList[i].ReleaseDate;\r\n\t\t}\r\n\t}\r\n\r\n\treturn (time_t)KmsData->HostBuildList->ReleaseDate;\r\n}\r\n\r\n\r\n#ifdef _PEDANTIC\r\nuint16_t IsValidLcid(const uint16_t lcid)\r\n{\r\n\tuint16_t i;\r\n\r\n\tfor (i = 0; i < vlmcsd_countof(LcidList); i++)\r\n\t{\r\n\t\tif (lcid == LcidList[i]) return lcid;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\n\r\nuint32_t IsValidHostBuild(const int32_t hostBuild)\r\n{\r\n\tPHostBuild_t hostOS;\r\n\r\n\tfor (hostOS = KmsData->HostBuildList; hostOS < KmsData->HostBuildList + KmsData->HostBuildCount; hostOS++)\r\n\t{\r\n\t\tif (hostBuild == hostOS->BuildNumber) return hostBuild;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n#endif // _PEDANTIC\r\n#endif // NO_RANDOM_EPID\r\n\r\n\r\n// Unix time is seconds from 1970-01-01. Should be 64 bits to avoid year 2038 overflow bug.\r\n// FILETIME is 100 nanoseconds from 1601-01-01. Must be 64 bits.\r\nvoid getUnixTimeAsFileTime(FILETIME* ts)\r\n{\r\n\tconst int64_t unixtime = (int64_t)time(NULL);\r\n\tint64_t *filetime = (int64_t*)ts;\r\n\r\n\tPUT_UA64LE(filetime, (unixtime + 11644473600LL) * 10000000LL);\r\n}\r\n\r\n__pure int64_t fileTimeToUnixTime(FILETIME* ts)\r\n{\r\n\treturn GET_UA64LE(ts) / 10000000LL - 11644473600LL;\r\n}\r\n\r\n\r\n#ifndef NO_STRICT_MODES\r\n#ifndef NO_CLIENT_LIST\r\n\r\nstatic PClientList_t ClientLists;\r\nstatic BYTE ZeroGuid[16] = { 0 };\r\n\r\n#if !defined(_WIN32) && !defined(__CYGWIN__)\r\npthread_mutex_t* mutex;\r\n#define mutex_size (((sizeof(pthread_mutex_t)+7)>>3)<<3)\r\n#else\r\nCRITICAL_SECTION* mutex;\r\n#define mutex_size (((sizeof(CRITICAL_SECTION)+7)>>3)<<3)\r\n#endif // _WIN32\r\n\r\n#ifndef USE_THREADS\r\nstatic int shmid_clients = -1;\r\n#endif // USE_THREADS\r\n\r\n#if !defined(_WIN32) && !defined(__CYGWIN__)\r\n#define lock_client_lists() pthread_mutex_lock(mutex)\r\n#define unlock_client_lists() pthread_mutex_unlock(mutex)\r\n#define mutex_t pthread_mutex_t\r\n#else\r\n#define lock_client_lists() EnterCriticalSection(mutex)\r\n#define unlock_client_lists() LeaveCriticalSection(mutex)\r\n#define mutex_t CRITICAL_SECTION\r\n#endif\r\n\r\nvoid CleanUpClientLists()\r\n{\r\n#\tifndef USE_THREADS\r\n\tshmctl(shmid_clients, IPC_RMID, NULL);\r\n#\tendif // !USE_THREADS\r\n}\r\n\r\nvoid InitializeClientLists()\r\n{\r\n\tint_fast8_t i;\r\n\tint_fast16_t j;\r\n\r\n#\tifndef USE_THREADS\r\n\tif (\r\n\t\t(shmid_clients = shmget(IPC_PRIVATE, sizeof(ClientList_t) * KmsData->AppItemCount + mutex_size, IPC_CREAT | 0600)) < 0 ||\r\n\t\t(mutex = (mutex_t*)shmat(shmid_clients, NULL, 0)) == (mutex_t*)-1\r\n\t\t)\r\n\t{\r\n\t\tint errno_save = errno;\r\n\t\tprinterrorf(\"Warning: CMID lists disabled. Could not create shared memory: %s\\n\", vlmcsd_strerror(errno_save));\r\n\t\tif (shmid_clients >= 0) shmctl(shmid_clients, IPC_RMID, NULL);\r\n\t\tMaintainClients = FALSE;\r\n\t\treturn;\r\n\t}\r\n\r\n\tClientLists = (PClientList_t)((BYTE*)mutex + mutex_size);\r\n\r\n#\tif __CYGWIN__\r\n\tInitializeCriticalSection(mutex);\r\n#\telse // !__CYGWIN__\r\n\tpthread_mutexattr_t mutex_attr;\r\n\tpthread_mutexattr_init(&mutex_attr);\r\n\tpthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED);\r\n\tpthread_mutex_init(mutex, &mutex_attr);\r\n\r\n#\tendif // !__CYGWIN__\r\n\r\n#\telse // USE_THREADS\r\n\r\n\tClientLists = (PClientList_t)vlmcsd_malloc(sizeof(ClientList_t) * KmsData->AppItemCount);\r\n\tmutex = (mutex_t*)vlmcsd_malloc(sizeof(mutex_t));\r\n\r\n#\tif !_WIN32 && !__CYGWIN__\r\n\tpthread_mutex_init(mutex, NULL);\r\n#\telse //_WIN32 || __CYGWIN__\r\n\tInitializeCriticalSection(mutex);\r\n#   endif //_WIN32 || __CYGWIN__\r\n\r\n#\tendif // USE_THREADS\r\n\r\n\tmemset(ClientLists, 0, sizeof(ClientList_t) * KmsData->AppItemCount);\r\n\r\n\tif (!StartEmpty)\r\n\t{\r\n\t\tfor (i = 0; i < KmsData->AppItemCount; i++)\r\n\t\t{\r\n\t\t\tconst uint8_t maxCount = KmsData->AppItemList[i].NCountPolicy;\r\n\t\t\tClientLists[i].CurrentCount = (maxCount >> 1) - 1;\r\n\t\t\tClientLists[i].MaxCount = maxCount;\r\n\r\n\t\t\tfor (j = 0; j < (maxCount >> 1) - 1; j++)\r\n\t\t\t{\r\n\t\t\t\tget16RandomBytes(&ClientLists[i].Guid[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n#endif // NO_CLIENT_LIST\r\n#endif // !NO_STRICT_MODES\r\n\r\n#ifndef NO_RANDOM_EPID\r\n// formats an int with a fixed number of digits with leading zeros (helper for ePID generation)\r\nstatic char* itoc(char *const c, const int i, uint_fast8_t digits)\r\n{\r\n\tchar formatString[8];\r\n\tif (digits > 9) digits = 0;\r\n\tstrcpy(formatString, \"%\");\r\n\r\n\tif (digits)\r\n\t{\r\n\t\tformatString[1] = '0';\r\n\t\tformatString[2] = digits | 0x30;\r\n\t\tformatString[3] = 0;\r\n\t}\r\n\r\n\tstrcat(formatString, \"u\");\r\n\tsprintf(c, formatString, i);\r\n\treturn c;\r\n}\r\n\r\nstatic uint8_t getRandomServerType()\r\n{\r\n#\tif defined(USE_MSRPC) || defined(SIMPLE_RPC)\r\n\r\n\treturn rand() % KmsData->HostBuildCount;\r\n\r\n#\telse // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\r\n\twhile (TRUE)\r\n\t{\r\n\t\tconst uint32_t buildIndex = rand() % KmsData->HostBuildCount;\r\n\r\n\t\tif (!(KmsData->HostBuildList[buildIndex].Flags & UseNdr64) == !UseServerRpcNDR64)\r\n\t\t{\r\n\t\t\treturn (uint8_t)buildIndex;\r\n\t\t}\r\n\t}\r\n#\tendif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\r\n}\r\n\r\n\r\n/*\r\n * Generates a random ePID\r\n */\r\nstatic void generateRandomPid(const int index, char *const szPid, int16_t lang, int32_t hostBuild)\r\n{\r\n\tchar numberBuffer[12];\r\n\r\n\tif (!hostBuild)\r\n\t{\r\n\t\thostBuild = KmsData->HostBuildList[getRandomServerType()].BuildNumber;\r\n\t}\r\n\r\n\r\n\tstrcpy(szPid, itoc(numberBuffer, getPlatformId(hostBuild), 5));\r\n\tstrcat(szPid, \"-\");\r\n\r\n\t//if (index > 3) index = 0;\r\n\r\n\tPCsvlkData_t csvlkData = &KmsData->CsvlkData[index];\r\n\tstrcat(szPid, itoc(numberBuffer, csvlkData->GroupId, 5));\r\n\tstrcat(szPid, \"-\");\r\n\r\n\tconst int keyId = (rand32() % (csvlkData->MaxKeyId - csvlkData->MinKeyId)) + csvlkData->MinKeyId;\r\n\tstrcat(szPid, itoc(numberBuffer, keyId / 1000000, 3));\r\n\tstrcat(szPid, \"-\");\r\n\tstrcat(szPid, itoc(numberBuffer, keyId % 1000000, 6));\r\n\tstrcat(szPid, \"-03-\");\r\n\r\n\tif (lang < 1) lang = LcidList[rand() % vlmcsd_countof(LcidList)];\r\n\tstrcat(szPid, itoc(numberBuffer, lang, 0));\r\n\tstrcat(szPid, \"-\");\r\n\r\n\tstrcat(szPid, itoc(numberBuffer, hostBuild, 0));\r\n\tstrcat(szPid, \".0000-\");\r\n\r\n\tconst time_t hostBuildReleaseDate = getReleaseDate(hostBuild);\r\n\tconst time_t minTime = csvlkData->ReleaseDate < hostBuildReleaseDate ? hostBuildReleaseDate : csvlkData->ReleaseDate;\r\n\r\n\ttime_t maxTime;\r\n\ttime(&maxTime);\r\n\r\n#\tifndef BUILD_TIME\r\n#\tdefine BUILD_TIME 1538922811\r\n#   endif\r\n\r\n\tif (maxTime < (time_t)BUILD_TIME) // Just in case the system time is < 10/17/2013 1:00 pm\r\n\t\tmaxTime = (time_t)BUILD_TIME;\r\n\r\n\ttime_t kmsTime = (rand32() % (maxTime - minTime)) + minTime;\r\n\tstruct tm *pidTime = gmtime(&kmsTime);\r\n\r\n\tstrcat(szPid, itoc(numberBuffer, pidTime->tm_yday + 1, 3));\r\n\tstrcat(szPid, itoc(numberBuffer, pidTime->tm_year + 1900, 4));\r\n}\r\n\r\n\r\n/*\r\n * Generates random ePIDs and stores them if not already read from ini file.\r\n * For use with randomization level 1\r\n */\r\nvoid randomPidInit()\r\n{\r\n\tuint32_t i;\r\n\r\n\tconst int16_t lang = Lcid ? Lcid : LcidList[rand() % vlmcsd_countof(LcidList)];\r\n\r\n\tfor (i = 0; i < KmsData->CsvlkCount; i++)\r\n\t{\r\n\t\tif (KmsResponseParameters[i].Epid) continue;\r\n\r\n\t\tchar Epid[PID_BUFFER_SIZE];\r\n\r\n\t\tif (!HostBuild)\r\n\t\t{\r\n\t\t\tuint8_t index;\r\n\r\n#if defined(USE_MSRPC) || defined(SIMPLE_RPC)\r\n\t\t\tindex = getRandomServerType();\r\n#else // !(defined(USE_MSRPC) || defined(SIMPLE_RPC))\r\n\t\t\tif (IsNDR64Defined)\r\n\t\t\t{\r\n\t\t\t\tindex = getRandomServerType();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tindex = (uint8_t)(rand() % KmsData->HostBuildCount);\r\n\t\t\t\tUseServerRpcNDR64 = !!(KmsData->HostBuildList[index].Flags & UseNdr64);\r\n\t\t\t}\r\n#endif // !(defined(USE_MSRPC) || defined(SIMPLE_RPC))\r\n\r\n\t\t\tHostBuild = (uint16_t)KmsData->HostBuildList[index].BuildNumber;\r\n\t\t}\r\n\r\n\t\tgenerateRandomPid(i, Epid, lang, HostBuild);\r\n\t\tKmsResponseParameters[i].Epid = (const char*)vlmcsd_strdup(Epid);\r\n\r\n#ifndef NO_LOG\r\n\t\tKmsResponseParameters[i].EpidSource = \"randomized at program start\";\r\n\t\tKmsResponseParameters[i].IsRandom = TRUE;\r\n#endif // NO_LOG\r\n\t}\r\n}\r\n\r\n#endif // NO_RANDOM_EPID\r\n\r\n\r\n#ifndef NO_LOG\r\nstatic int32_t getProductIndexFromAllLists(const GUID* guid, char** productName)\r\n{\r\n\treturn getProductIndex(guid, KmsData->AppItemList, KmsData->AppItemCount + KmsData->KmsItemCount + KmsData->SkuItemCount, productName, NULL);\r\n}\r\n\r\n/*\r\n * Logs a Request\r\n */\r\nstatic void logRequest(REQUEST* baseRequest)\r\n{\r\n#ifndef NO_VERBOSE_LOG\r\n\tif (logverbose)\r\n\t{\r\n\t\tlogger(\"<<< Incoming KMS request\\n\");\r\n\t\tlogRequestVerbose(baseRequest, &logger);\r\n\t\treturn;\r\n\t}\r\n#endif // NO_VERBOSE_LOG\r\n\r\n\tchar *productName;\r\n\tchar clientName[64];\r\n\r\n\tint32_t index = getProductIndexFromAllLists(&baseRequest->ActID, &productName);\r\n\tif (index < 0) index = getProductIndexFromAllLists(&baseRequest->KMSID, &productName);\r\n\tif (index < 0) index = getProductIndexFromAllLists(&baseRequest->AppID, &productName);\r\n\r\n\tif (index < 0 || !strcasecmp(productName, \"Unknown\"))\r\n\t{\r\n\t\tproductName = (char*)alloca(GUID_STRING_LENGTH + 1);\r\n\t\tuuid2StringLE(&baseRequest->ActID, productName);\r\n\t}\r\n\r\n\tucs2_to_utf8(baseRequest->WorkstationName, clientName, 64, 64);\r\n\tlogger(\"KMS v%i.%i request from %s for %s\\n\", LE16(baseRequest->MajorVer), LE16(baseRequest->MinorVer), clientName, productName);\r\n}\r\n#endif // NO_LOG\r\n\r\n\r\n/*\r\n * Converts a utf-8 ePID string to UCS-2 and writes it to a RESPONSE struct\r\n */\r\n#ifndef IS_LIBRARY\r\nstatic void getEpidFromString(RESPONSE *const Response, const char *const pid)\r\n{\r\n\tconst size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);\r\n\tResponse->PIDSize = LE32(((unsigned int)length + 1) << 1);\r\n}\r\n\r\n\r\n/*\r\n * get ePID from appropriate source\r\n */\r\nstatic void getEpid(RESPONSE *const baseResponse, const char** EpidSource, const int32_t index, BYTE *const HwId, const char* defaultEPid)\r\n{\r\n#if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\r\n\tconst char* pid;\r\n\tif (KmsResponseParameters[index].Epid == NULL)\r\n\t{\r\n#ifndef NO_RANDOM_EPID\r\n\t\tif (RandomizationLevel == 2)\r\n\t\t{\r\n\t\t\tchar ePid[PID_BUFFER_SIZE];\r\n\t\t\tgenerateRandomPid(index, ePid, Lcid, HostBuild);\r\n\t\t\tpid = ePid;\r\n\r\n#ifndef NO_LOG\r\n\t\t\t*EpidSource = \"randomized on every request\";\r\n#endif // NO_LOG\r\n\t\t}\r\n\t\telse\r\n#endif // NO_RANDOM_EPID\r\n\t\t{\r\n\t\t\tpid = defaultEPid;\r\n#ifndef NO_LOG\r\n\t\t\t*EpidSource = \"vlmcsd default\";\r\n#endif // NO_LOG\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tpid = KmsResponseParameters[index].Epid;\r\n\r\n\t\tif (HwId && KmsResponseParameters[index].HwId != NULL)\r\n\t\t\tmemcpy(HwId, KmsResponseParameters[index].HwId, sizeof(((RESPONSE_V6 *)0)->HwId));\r\n\r\n#ifndef NO_LOG\r\n\t\t*EpidSource = KmsResponseParameters[index].EpidSource;\r\n#endif // NO_LOG\r\n\t}\r\n\r\n\tgetEpidFromString(baseResponse, pid);\r\n\r\n#else // defined(NO_RANDOM_EPID) && defined(NO_CL_PIDS) && !defined(NO_INI_FILE)\r\n\r\n\tgetEpidFromString(baseResponse, defaultEPid);\r\n\r\n#\tifndef NO_LOG\r\n\t*EpidSource = \"vlmcsd default\";\r\n#\tendif // NO_LOG\r\n\r\n#endif // defined(NO_RANDOM_EPID) && defined(NO_CL_PIDS) && !defined(NO_INI_FILE)\r\n}\r\n#endif // IS_LIBRARY\r\n\r\n\r\n#if !defined(NO_LOG) && defined(_PEDANTIC)\r\nstatic BOOL CheckVersion4Uuid(const GUID *const guid, const char *const szGuidName)\r\n{\r\n\tif (LE16(guid->Data3) >> 12 != 4 || guid->Data4[0] >> 6 != 2)\r\n\t{\r\n\t\tlogger(\"Warning: %s does not conform to version 4 UUID according to RFC 4122\\n\", szGuidName);\r\n\t\treturn FALSE;\r\n\t}\r\n\treturn TRUE;\r\n}\r\n\r\n\r\nstatic void CheckRequest(const REQUEST *const Request)\r\n{\r\n\tCheckVersion4Uuid(&Request->CMID, \"Client machine ID\");\r\n\tCheckVersion4Uuid(&Request->AppID, \"Application ID\");\r\n\tCheckVersion4Uuid(&Request->KMSID, \"Server SKU ID\");\r\n\tCheckVersion4Uuid(&Request->ActID, \"Client SKU ID\");\r\n\r\n\tif (LE32(Request->IsClientVM) > 1)\r\n\t\tlogger(\"Warning: Virtual Machine field in request must be 0 or 1 but is %u\\n\", LE32(Request->IsClientVM));\r\n\r\n\tif (LE32(Request->LicenseStatus) > 6)\r\n\t\tlogger(\"Warning: License status must be between 0 and 6 but is %u\\n\", LE32(Request->LicenseStatus));\r\n}\r\n#endif // !defined(NO_LOG) && defined(_PEDANTIC)\r\n\r\n\r\n#ifndef NO_LOG\r\n/*\r\n * Logs the Response\r\n */\r\nstatic void logResponse(RESPONSE* baseResponse, const BYTE *const hwId, const char *const EpidSource)\r\n{\r\n\tchar utf8pid[PID_BUFFER_SIZE * 3];\r\n\tucs2_to_utf8(baseResponse->KmsPID, utf8pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);\r\n\r\n#ifndef NO_VERBOSE_LOG\r\n\tif (!logverbose)\r\n\t{\r\n#endif // NO_VERBOSE_LOG\r\n\t\tlogger(\"Sending ePID (%s): %s\\n\", EpidSource, utf8pid);\r\n#ifndef NO_VERBOSE_LOG\r\n\t}\r\n\telse\r\n\t{\r\n\t\tlogger(\">>> Sending response, ePID source = %s\\n\", EpidSource);\r\n\t\tlogResponseVerbose(utf8pid, hwId, baseResponse, &logger);\r\n\t}\r\n#endif // NO_VERBOSE_LOG\r\n\r\n}\r\n#endif\r\n\r\n\r\n#if __UCLIBC__ && !defined(NO_STRICT_MODES)\r\nlong long int llabs(long long int j);\r\n#endif\r\n\r\n\r\n/*\r\n * Creates the unencrypted base response\r\n */\r\n#ifndef IS_LIBRARY\r\nstatic HRESULT __stdcall CreateResponseBaseCallback(REQUEST* baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr_unused)\r\n{\r\n\tconst char* EpidSource;\r\n#ifndef NO_LOG\r\n\tlogRequest(baseRequest);\r\n#ifdef _PEDANTIC\r\n\tCheckRequest(baseRequest);\r\n#endif // _PEDANTIC\r\n#endif // NO_LOG\r\n\r\n\tchar* ePid;\r\n\tconst DWORD minClients = LE32(baseRequest->N_Policy);\r\n\tconst DWORD required_clients = minClients < 1 ? 1 : minClients << 1;\r\n\r\n\tconst int32_t index = getProductIndex(&baseRequest->KMSID, KmsData->KmsItemList, KmsData->KmsItemCount, NULL, &ePid);\r\n\r\n#\tifndef NO_STRICT_MODES\r\n\r\n\tif (required_clients > 2000)\r\n\t{\r\n#\t\tifndef NO_LOG\r\n\t\tlogger(\"Rejecting request with more than 1000 minimum clients (0x8007000D)\\n\");\r\n#\t\tendif\r\n\r\n\t\treturn 0x8007000D;\r\n\t}\r\n\r\n\tif (CheckClientTime)\r\n\t{\r\n\t\ttime_t requestTime = (time_t)fileTimeToUnixTime(&baseRequest->ClientTime);\r\n\r\n\t\tif (llabs(requestTime - time(NULL)) > 60 * 60 * 4)\r\n\t\t{\r\n#\t\t\tifndef NO_LOG\r\n\t\t\tlogger(\"Client time differs more than 4 hours from system time (0xC004F06C)\\n\");\r\n#\t\t\tendif // !NO_LOG\r\n\r\n\t\t\treturn 0xC004F06C;\r\n\t\t}\r\n\t}\r\n\r\n\tif (WhitelistingLevel & 2)\r\n\t{\r\n\t\tif (index >= 0 && (KmsData->KmsItemList[index].IsPreview || KmsData->KmsItemList[index].IsRetail))\r\n\t\t{\r\n#\t\t\tifndef NO_LOG\r\n\t\t\tlogger(\"Refusing retail or beta product (0xC004F042)\\n\");\r\n#\t\t\tendif // !NO_LOG\r\n\r\n\t\t\treturn 0xC004F042;\r\n\t\t}\r\n\t}\r\n\r\n\tif ((WhitelistingLevel & 1) && index < 0)\r\n\t{\r\n#\t\tifndef NO_LOG\r\n\t\tlogger(\"Refusing unknown product (0xC004F042)\\n\");\r\n#\t\tendif // !NO_LOG\r\n\r\n\t\treturn 0xC004F042;\r\n\t}\r\n\r\n#\tifndef NO_CLIENT_LIST\r\n\tconst int32_t appIndex = index < 0 ? 0 : KmsData->KmsItemList[index].AppIndex;\r\n#\tendif // NO_CLIENT_LIST\r\n\r\n#\tendif // !NO_STRICT_MODES\r\n\r\n\tconst int32_t ePidIndex = index < 0 ? 0 : KmsData->KmsItemList[index].EPidIndex;\r\n\r\n#\tif !defined(NO_STRICT_MODES)\r\n\r\n\tif ((WhitelistingLevel & 1) && index >= 0 && !IsEqualGUID(&KmsData->AppItemList[KmsData->KmsItemList[index].AppIndex].Guid, &baseRequest->AppID))\r\n\t{\r\n#\t\tifndef NO_LOG\r\n\t\tlogger(\"Refusing product with incorrect Application ID (0xC004F042)\\n\");\r\n#\t\tendif // NO_LOG\r\n\t\treturn 0xC004F042;\r\n\t}\r\n\r\n#\tifndef NO_CLIENT_LIST\r\n\tif (MaintainClients)\r\n\t{\r\n\t\tlock_client_lists();\r\n\r\n\t\tint_fast16_t i;\r\n\t\tint_fast8_t isKnownClient = FALSE;\r\n\r\n\t\tif (required_clients > (DWORD)ClientLists[appIndex].MaxCount) ClientLists[appIndex].MaxCount = required_clients;\r\n\r\n\t\tfor (i = 0; i < ClientLists[appIndex].MaxCount; i++)\r\n\t\t{\r\n\t\t\tif (IsEqualGUID(&ClientLists[appIndex].Guid[i], &baseRequest->CMID))\r\n\t\t\t{\r\n\t\t\t\tisKnownClient = TRUE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isKnownClient)\r\n\t\t{\r\n\t\t\tbaseResponse->Count = LE32(ClientLists[appIndex].CurrentCount);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor (i = 0; i < ClientLists[appIndex].MaxCount; i++)\r\n\t\t\t{\r\n\t\t\t\tif (IsEqualGUID(ZeroGuid, &ClientLists[appIndex].Guid[i]))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (ClientLists[appIndex].CurrentCount >= MAX_CLIENTS)\r\n\t\t\t\t\t{\r\n#\t\t\t\t\t\tifndef NO_LOG\r\n\t\t\t\t\t\tlogger(\"Rejecting more than 671 clients (0xC004D104)\\n\");\r\n#\t\t\t\t\t\tendif // !NO_LOG\r\n\r\n\t\t\t\t\t\tunlock_client_lists();\r\n\t\t\t\t\t\treturn 0xC004D104;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbaseResponse->Count = LE32(++ClientLists[appIndex].CurrentCount);\r\n\t\t\t\t\tmemcpy(&ClientLists[appIndex].Guid[i], &baseRequest->CMID, sizeof(GUID));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (i >= ClientLists[appIndex].MaxCount)\r\n\t\t\t{\r\n\t\t\t\tmemcpy(&ClientLists[appIndex].Guid[ClientLists[appIndex].CurrentPosition], &baseRequest->CMID, sizeof(GUID));\r\n\t\t\t\tClientLists[appIndex].CurrentPosition = (ClientLists[appIndex].CurrentPosition + 1) % (ClientLists[appIndex].MaxCount > MAX_CLIENTS ? MAX_CLIENTS : ClientLists[appIndex].MaxCount);\r\n\t\t\t\tbaseResponse->Count = LE32(ClientLists[appIndex].CurrentCount);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tunlock_client_lists();\r\n\t}\r\n\telse\r\n#\tendif // !NO_CLIENT_LIST\r\n#\tendif // !defined(NO_STRICT_MODES)\r\n\t{\r\n\t\tconst uint8_t minimum_answer_clients = (uint8_t)KmsData->CsvlkData[ePidIndex].MinActiveClients;\r\n\t\tbaseResponse->Count = LE32(required_clients > minimum_answer_clients ? required_clients : minimum_answer_clients);\r\n\t\t//if (LE32(baseRequest->N_Policy) > LE32(baseResponse->Count)) baseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);\r\n\t}\r\n\r\n\tgetEpid(baseResponse, &EpidSource, ePidIndex, hwId, ePid);\r\n\r\n\tbaseResponse->Version = baseRequest->Version;\r\n\r\n\tmemcpy(&baseResponse->CMID, &baseRequest->CMID, sizeof(GUID));\r\n\tmemcpy(&baseResponse->ClientTime, &baseRequest->ClientTime, sizeof(FILETIME));\r\n\r\n\tbaseResponse->VLActivationInterval = LE32(VLActivationInterval);\r\n\tbaseResponse->VLRenewalInterval = LE32(VLRenewalInterval);\r\n\r\n#ifndef NO_LOG\r\n\tlogResponse(baseResponse, hwId, EpidSource);\r\n#endif // NO_LOG\r\n\r\n\treturn S_OK;\r\n}\r\n\r\nRequestCallback_t CreateResponseBase = &CreateResponseBaseCallback;\r\n\r\n#else // IS_LIBRARY\r\n\r\nRequestCallback_t CreateResponseBase = NULL;\r\n\r\n#endif // IS_LIBRARY\r\n\r\n\r\n////TODO: Move to helpers.c\r\nvoid get16RandomBytes(void* ptr)\r\n{\r\n\tint i;\r\n\tfor (i = 0; i < 4; i++)\t((DWORD*)ptr)[i] = rand32();\r\n}\r\n\r\n/*\r\n * Creates v4 response\r\n */\r\nsize_t CreateResponseV4(REQUEST_V4 *const request_v4, BYTE *const responseBuffer, const char* const ipString)\r\n{\r\n\tRESPONSE_V4* response = (RESPONSE_V4*)responseBuffer;\r\n\r\n\tHRESULT hResult;\r\n\tif (FAILED(hResult = CreateResponseBase(&request_v4->RequestBase, &response->ResponseBase, NULL, ipString))) return hResult;\r\n\r\n\tconst DWORD pidSize = LE32(response->ResponseBase.PIDSize);\r\n\tBYTE* postEpidPtr = responseBuffer + V4_PRE_EPID_SIZE + pidSize;\r\n\tmemmove(postEpidPtr, &response->ResponseBase.CMID, V4_POST_EPID_SIZE);\r\n\r\n\tconst size_t encryptSize = V4_PRE_EPID_SIZE + V4_POST_EPID_SIZE + pidSize;\r\n\tAesCmacV4(responseBuffer, encryptSize, responseBuffer + encryptSize);\r\n\r\n\treturn encryptSize + sizeof(response->MAC);\r\n}\r\n\r\n/*\r\n// Workaround for buggy GCC 4.2/4.3\r\n#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 4)\r\n__attribute__((noinline))\r\n#endif\r\n__pure static uint64_t TimestampInterval(void *ts)\r\n{\r\n\treturn ( GET_UA64LE(ts) / TIME_C1 ) * TIME_C2 + TIME_C3;\r\n}*/\r\n\r\n\r\n/*\r\n * Creates the HMAC for v6\r\n */\r\nstatic int_fast8_t CreateV6Hmac(BYTE *const encrypt_start, const size_t encryptSize, const int_fast8_t tolerance)\r\n{\r\n\tBYTE hash[32];\r\n\tconst uint8_t halfHashSize = sizeof(hash) >> 1;\r\n\tBYTE *responseEnd = encrypt_start + encryptSize;\r\n\r\n\t// This is the time from the response\r\n\tFILETIME* ft = (FILETIME*)(responseEnd - V6_POST_EPID_SIZE + sizeof(((RESPONSE*)0)->CMID));\r\n\r\n\t// Generate a time slot that changes every 4.11 hours.\r\n\t// Request and response time must match +/- 1 slot.\r\n\t// When generating a response tolerance must be 0.\r\n\t// If verifying the hash, try tolerance -1, 0 and +1. One of them must match.\r\n\r\n\tuint64_t timeSlot = LE64((GET_UA64LE(ft) / TIME_C1 * TIME_C2 + TIME_C3) + (tolerance * TIME_C1));\r\n\r\n\t// The time slot is hashed with SHA256 so it is not so obvious that it is time\r\n\tSha256((BYTE*)&timeSlot, sizeof(timeSlot), hash);\r\n\r\n\t// The last 16 bytes of the hashed time slot are the actual HMAC key\r\n\tif (!Sha256Hmac\r\n\t(\r\n\t\thash + halfHashSize,\t\t\t\t\t\t\t\t\t// Use last 16 bytes of SHA256 as HMAC key\r\n\t\tencrypt_start,\t\t\t\t\t\t\t\t\t\t\t// hash only the encrypted part of the v6 response\r\n\t\t(DWORD)(encryptSize - sizeof(((RESPONSE_V6*)0)->HMAC)),\t// encryptSize minus the HMAC itself\r\n\t\thash\t\t\t\t\t\t\t\t\t\t\t\t\t// use same buffer for resulting hash where the key came from\r\n\t))\r\n\t{\r\n\t\treturn FALSE;\r\n\t}\r\n\r\n\tmemcpy(responseEnd - sizeof(((RESPONSE_V6*)0)->HMAC), hash + halfHashSize, halfHashSize);\r\n\treturn TRUE;\r\n}\r\n\r\n\r\n/*\r\n * Creates v5 or v6 response\r\n */\r\nsize_t CreateResponseV6(REQUEST_V6 *restrict request_v6, BYTE *const responseBuffer, const char* const ipString)\r\n{\r\n\t// The response will be created in a fixed sized struct to\r\n\t// avoid unaligned access macros and packed structs on RISC systems\r\n\t// which largely increase code size.\r\n\t//\r\n\t// The fixed sized struct with 64 WCHARs for the ePID will be converted\r\n\t// to a variable sized struct later and requires unaligned access macros.\r\n\r\n\tRESPONSE_V6* response = (RESPONSE_V6*)responseBuffer;\r\n\tRESPONSE* baseResponse = &response->ResponseBase;\r\n\r\n#ifdef _DEBUG\r\n\t// ReSharper disable once CppDeclaratorNeverUsed\r\n\tRESPONSE_V6_DEBUG* xxx_unused = (RESPONSE_V6_DEBUG*)responseBuffer;\r\n#endif\r\n\r\n\tstatic const BYTE DefaultHwId[8] = { HWID };\r\n\tconst int_fast8_t v6 = LE16(request_v6->MajorVer) > 5;\r\n\tAesCtx aesCtx;\r\n\r\n\tAesInitKey(&aesCtx, v6 ? AesKeyV6 : AesKeyV5, v6, AES_KEY_BYTES);\r\n\tAesDecryptCbc(&aesCtx, NULL, request_v6->IV, V6_DECRYPT_SIZE);\r\n\r\n\t// get random salt and SHA256 it\r\n\tget16RandomBytes(response->RandomXoredIVs);\r\n\tSha256(response->RandomXoredIVs, sizeof(response->RandomXoredIVs), response->Hash);\r\n\r\n\tif (v6) // V6 specific stuff\r\n\t{\r\n\t\t// In v6 a random IV is generated\r\n\t\tresponse->Version = request_v6->Version;\r\n\t\tget16RandomBytes(response->IV);\r\n\r\n\t\t// pre-fill with default HwId (not required for v5)\r\n\t\tmemcpy(response->HwId, DefaultHwId, sizeof(response->HwId));\r\n\r\n\t\t// Just copy decrypted request IV (using Null IV) here. Note this is identical\r\n\t\t// to XORing non-decrypted request and response IVs\r\n\t\tmemcpy(response->XoredIVs, request_v6->IV, sizeof(response->XoredIVs));\r\n\t}\r\n\telse // V5 specific stuff\r\n\t{\r\n\t\t// In v5 IVs of request and response must be identical (MS client checks this)\r\n\t\t// The following memcpy copies Version and IVs at once\r\n\t\tmemcpy(response, request_v6, V6_UNENCRYPTED_SIZE);\r\n\t}\r\n\r\n\t// Xor Random bytes with decrypted request IV\r\n\tXorBlock(request_v6->IV, response->RandomXoredIVs);\r\n\r\n\t// Get the base response\r\n\tHRESULT hResult;\r\n\tif (FAILED(hResult = CreateResponseBase(&request_v6->RequestBase, baseResponse, response->HwId, ipString))) return hResult;\r\n\r\n\t// Convert the fixed sized struct into variable sized\r\n\tconst DWORD pidSize = LE32(baseResponse->PIDSize);\r\n\tBYTE* postEpidPtr = responseBuffer + V6_PRE_EPID_SIZE + pidSize;\r\n\tconst size_t post_epid_size = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;\r\n\r\n\tmemmove(postEpidPtr, &baseResponse->CMID, post_epid_size);\r\n\r\n\t// number of bytes to encrypt\r\n\tsize_t encryptSize =\r\n\t\tV6_PRE_EPID_SIZE\r\n\t\t- sizeof(response->Version)\r\n\t\t+ pidSize\r\n\t\t+ post_epid_size;\r\n\r\n\t//AesDecryptBlock(&aesCtx, Response->IV);\r\n\tif (v6 && !CreateV6Hmac(response->IV, encryptSize, 0)) return 0;\r\n\r\n\t// Padding auto handled by encryption func\r\n\tAesEncryptCbc(&aesCtx, NULL, response->IV, &encryptSize);\r\n\r\n\treturn encryptSize + sizeof(response->Version);\r\n}\r\n\r\n\r\n// Create Hashed KMS Client Request Data for KMS Protocol Version 4\r\nBYTE *CreateRequestV4(size_t *size, const REQUEST* requestBase)\r\n{\r\n\t*size = sizeof(REQUEST_V4);\r\n\r\n\t// Build a proper KMS client request data\r\n\tBYTE *request = (BYTE *)vlmcsd_malloc(sizeof(REQUEST_V4));\r\n\r\n\t// Temporary Pointer for access to REQUEST_V4 structure\r\n\tREQUEST_V4 *request_v4 = (REQUEST_V4 *)request;\r\n\r\n\t// Set KMS Client Request Base\r\n\tmemcpy(&request_v4->RequestBase, requestBase, sizeof(REQUEST));\r\n\r\n\t// Generate Hash Signature\r\n\tAesCmacV4(request, sizeof(REQUEST), request_v4->MAC);\r\n\r\n\t// Return Request Data\r\n\treturn request;\r\n}\r\n\r\n\r\n// Create Encrypted KMS Client Request Data for KMS Protocol Version 6\r\nBYTE* CreateRequestV6(size_t *size, const REQUEST* requestBase)\r\n{\r\n\t*size = sizeof(REQUEST_V6);\r\n\r\n\t// Temporary Pointer for access to REQUEST_V5 structure\r\n\tREQUEST_V6 *request = (REQUEST_V6 *)vlmcsd_malloc(sizeof(REQUEST_V6));\r\n\r\n\t// KMS Protocol Version\r\n\trequest->Version = requestBase->Version;\r\n\r\n\t// Initialize the IV\r\n\tget16RandomBytes(request->IV);\r\n\r\n\t// Set KMS Client Request Base\r\n\tmemcpy(&request->RequestBase, requestBase, sizeof(REQUEST));\r\n\r\n\t// Encrypt KMS Client Request\r\n\tsize_t encryptSize = sizeof(request->RequestBase);\r\n\tAesCtx ctx;\r\n\tconst int_fast8_t v6 = LE16(request->MajorVer) > 5;\r\n\tAesInitKey(&ctx, v6 ? AesKeyV6 : AesKeyV5, v6, 16);\r\n\tAesEncryptCbc(&ctx, request->IV, (BYTE*)(&request->RequestBase), &encryptSize);\r\n\r\n\t// Return Proper Request Data\r\n\treturn (BYTE*)request;\r\n}\r\n\r\n\r\n/*\r\n * Checks whether Length of ePID is valid\r\n */\r\nstatic uint8_t checkPidLength(const RESPONSE *const responseBase)\r\n{\r\n\tunsigned int i;\r\n\r\n\tif (LE32(responseBase->PIDSize) > (PID_BUFFER_SIZE << 1)) return FALSE;\r\n\tif (responseBase->KmsPID[(LE32(responseBase->PIDSize) >> 1) - 1]) return FALSE;\r\n\r\n\tfor (i = 0; i < (LE32(responseBase->PIDSize) >> 1) - 2; i++)\r\n\t{\r\n\t\tif (!responseBase->KmsPID[i]) return FALSE;\r\n\t}\r\n\r\n\treturn TRUE;\r\n}\r\n\r\n\r\n/*\r\n * \"Decrypts\" a KMS v4 response. Actually just copies to a fixed size buffer\r\n */\r\nRESPONSE_RESULT DecryptResponseV4(RESPONSE_V4* response_v4, const int responseSize, BYTE* const rawResponse, const BYTE* const rawRequest)\r\n{\r\n\tconst int copySize =\r\n\t\tV4_PRE_EPID_SIZE +\r\n\t\t(LE32(((RESPONSE_V4*)rawResponse)->ResponseBase.PIDSize) <= PID_BUFFER_SIZE << 1 ?\r\n\t\t\tLE32(((RESPONSE_V4*)rawResponse)->ResponseBase.PIDSize) :\r\n\t\t\tPID_BUFFER_SIZE << 1);\r\n\r\n\tconst int messageSize = copySize + V4_POST_EPID_SIZE;\r\n\r\n\tmemcpy(response_v4, rawResponse, copySize);\r\n\tmemcpy(&response_v4->ResponseBase.CMID, rawResponse + copySize, responseSize - copySize);\r\n\r\n\t// ensure PID is null terminated\r\n\tresponse_v4->ResponseBase.KmsPID[PID_BUFFER_SIZE - 1] = 0;\r\n\r\n\tuint8_t* mac = rawResponse + messageSize;\r\n\tAesCmacV4(rawResponse, messageSize, mac);\r\n\r\n\tREQUEST_V4* request_v4 = (REQUEST_V4*)rawRequest;\r\n\tRESPONSE_RESULT result;\r\n\r\n\tresult.mask = (DWORD)~0;\r\n\tresult.PidLengthOK = checkPidLength((RESPONSE*)rawResponse);\r\n\tresult.VersionOK = response_v4->ResponseBase.Version == request_v4->RequestBase.Version;\r\n\tresult.HashOK = !memcmp(&response_v4->MAC, mac, sizeof(response_v4->MAC));\r\n\tresult.TimeStampOK = !memcmp(&response_v4->ResponseBase.ClientTime, &request_v4->RequestBase.ClientTime, sizeof(FILETIME));\r\n\tresult.ClientMachineIDOK = !memcmp(&response_v4->ResponseBase.CMID, &request_v4->RequestBase.CMID, sizeof(GUID));\r\n\tresult.effectiveResponseSize = responseSize;\r\n\tresult.correctResponseSize = sizeof(RESPONSE_V4) - sizeof(response_v4->ResponseBase.KmsPID) + LE32(response_v4->ResponseBase.PIDSize);\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\nstatic RESPONSE_RESULT VerifyResponseV6(RESPONSE_RESULT result, RESPONSE_V6* response_v6, REQUEST_V6* request_v6, BYTE* const rawResponse)\r\n{\r\n\t// Check IVs\r\n\tresult.IVsOK = !memcmp // In V6 the XoredIV is actually the request IV\r\n\t(\r\n\t\tresponse_v6->XoredIVs,\r\n\t\trequest_v6->IV,\r\n\t\tsizeof(response_v6->XoredIVs)\r\n\t);\r\n\r\n\tresult.IVnotSuspicious = !!memcmp // If IVs are identical, it is obviously an emulator\r\n\t(\r\n\t\trequest_v6->IV,\r\n\t\tresponse_v6->IV,\r\n\t\tsizeof(request_v6->IV)\r\n\t);\r\n\r\n\t// Check Hmac\r\n\tint_fast8_t tolerance;\r\n\tBYTE OldHmac[sizeof(response_v6->HMAC)];\r\n\r\n\tresult.HmacSha256OK = FALSE;\r\n\r\n\tmemcpy\t// Save received HMAC to compare with calculated HMAC later\r\n\t(\r\n\t\tOldHmac,\r\n\t\tresponse_v6->HMAC,\r\n\t\tsizeof(response_v6->HMAC)\r\n\t);\r\n\r\n\t//AesEncryptBlock(Ctx, Response_v6->IV); // CreateV6Hmac needs original IV as received over the network\r\n\r\n\tfor (tolerance = -1; tolerance < 2; tolerance++)\r\n\t{\r\n\t\tCreateV6Hmac\r\n\t\t(\r\n\t\t\trawResponse + sizeof(response_v6->Version),                          // Pointer to start of the encrypted part of the response\r\n\t\t\t(size_t)result.correctResponseSize - sizeof(response_v6->Version),   // size of the encrypted part\r\n\t\t\ttolerance                                                            // tolerance -1, 0, or +1\r\n\t\t);\r\n\r\n\t\tresult.HmacSha256OK = !memcmp // Compare both HMACs\r\n\t\t(\r\n\t\t\tOldHmac,\r\n\t\t\trawResponse + (size_t)result.correctResponseSize - sizeof(response_v6->HMAC),\r\n\t\t\tsizeof(OldHmac)\r\n\t\t);\r\n\r\n\t\tif (result.HmacSha256OK) break;\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\nstatic RESPONSE_RESULT VerifyResponseV5(RESPONSE_RESULT result, REQUEST_V5* request_v5, RESPONSE_V5* response_v5)\r\n{\r\n\t// Check IVs: in V5 (and only v5) request and response IVs must match\r\n\tresult.IVsOK = !memcmp(request_v5->IV, response_v5->IV, sizeof(request_v5->IV));\r\n\r\n\t// V5 has no Hmac, always set to TRUE\r\n\tresult.HmacSha256OK = TRUE;\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\n/*\r\n * Decrypts a KMS v5 or v6 response received from a server.\r\n * hwid must supply a valid 16 byte buffer for v6. hwid is ignored in v5\r\n */\r\nRESPONSE_RESULT DecryptResponseV6(RESPONSE_V6* response_v6, int responseSize, BYTE* const response, const BYTE* const rawRequest, BYTE* hwid)\r\n{\r\n\tRESPONSE_RESULT result;\r\n\tresult.mask = (DWORD)~0; // Set all bits in the results mask to 1. Assume success first.\r\n\tresult.effectiveResponseSize = responseSize;\r\n\r\n\tint copySize1 =\r\n\t\tsizeof(response_v6->Version);\r\n\r\n\t// Decrypt KMS Server Response (encrypted part starts after RequestIV)\r\n\tresponseSize -= copySize1;\r\n\r\n\tAesCtx ctx;\r\n\tconst int_fast8_t v6 = LE16(((RESPONSE_V6*)response)->MajorVer) > 5;\r\n\r\n\tAesInitKey(&ctx, v6 ? AesKeyV6 : AesKeyV5, v6, AES_KEY_BYTES);\r\n\tAesDecryptCbc(&ctx, NULL, response + copySize1, responseSize);\r\n\r\n\t// Check padding\r\n\tBYTE* lastPadByte = response + (size_t)result.effectiveResponseSize - 1;\r\n\r\n\t// Must be from 1 to 16\r\n\tif (!*lastPadByte || *lastPadByte > AES_BLOCK_BYTES)\r\n\t{\r\n\t\tresult.DecryptSuccess = FALSE;\r\n\t\treturn result;\r\n\t}\r\n\r\n\t// Check if pad bytes are all the same\r\n\tBYTE* padByte;\r\n\tfor (padByte = lastPadByte - *lastPadByte + 1; padByte < lastPadByte; padByte++)\r\n\t{\r\n\t\tif (*padByte != *lastPadByte)\r\n\t\t{\r\n\t\t\tresult.DecryptSuccess = FALSE;\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n\r\n\t// Add size of Version, KmsPIDLen and variable size PID\r\n\tconst DWORD pidSize = LE32(((RESPONSE_V6*)response)->ResponseBase.PIDSize);\r\n\r\n\tcopySize1 +=\r\n\t\tV6_UNENCRYPTED_SIZE +\r\n\t\tsizeof(response_v6->ResponseBase.PIDSize) +\r\n\t\t(pidSize <= PID_BUFFER_SIZE << 1 ? pidSize : PID_BUFFER_SIZE << 1);\r\n\r\n\t// Copy part 1 of response up to variable sized PID\r\n\tmemcpy(response_v6, response, copySize1);\r\n\r\n\t// ensure PID is null terminated\r\n\tresponse_v6->ResponseBase.KmsPID[PID_BUFFER_SIZE - 1] = 0;\r\n\r\n\t// Copy part 2\r\n\tconst size_t copySize2 = v6 ? V6_POST_EPID_SIZE : V5_POST_EPID_SIZE;\r\n\tmemcpy(&response_v6->ResponseBase.CMID, response + copySize1, copySize2);\r\n\r\n\t// Decrypting the response is finished here. Now we check the results for validity\r\n\t// A basic client doesn't need the stuff below this comment but we want to use vlmcs\r\n\t// as a debug tool for KMS emulators.\r\n\r\n\tREQUEST_V6* request_v6 = (REQUEST_V6*)rawRequest;\r\n\tconst DWORD decryptSize = sizeof(request_v6->IV) + sizeof(request_v6->RequestBase) + sizeof(request_v6->Pad);\r\n\r\n\tAesDecryptCbc(&ctx, NULL, request_v6->IV, decryptSize);\r\n\r\n\t// Check that all version information is the same\r\n\tresult.VersionOK =\r\n\t\trequest_v6->Version == response_v6->ResponseBase.Version &&\r\n\t\trequest_v6->Version == response_v6->Version &&\r\n\t\trequest_v6->Version == request_v6->RequestBase.Version;\r\n\r\n\t// Check Base Request\r\n\tresult.PidLengthOK = checkPidLength(&((RESPONSE_V6*)response)->ResponseBase);\r\n\tresult.TimeStampOK = !memcmp(&response_v6->ResponseBase.ClientTime, &request_v6->RequestBase.ClientTime, sizeof(FILETIME));\r\n\tresult.ClientMachineIDOK = IsEqualGUID(&response_v6->ResponseBase.CMID, &request_v6->RequestBase.CMID);\r\n\r\n\t// Rebuild Random Key and Sha256 Hash\r\n\tBYTE hashVerify[sizeof(response_v6->Hash)];\r\n\tBYTE randomKey[sizeof(response_v6->RandomXoredIVs)];\r\n\r\n\tmemcpy(randomKey, request_v6->IV, sizeof(randomKey));\r\n\tXorBlock(response_v6->RandomXoredIVs, randomKey);\r\n\tSha256(randomKey, sizeof(randomKey), hashVerify);\r\n\r\n\tresult.HashOK = !memcmp(response_v6->Hash, hashVerify, sizeof(hashVerify));\r\n\r\n\t// size before encryption (padding not included)\r\n\tresult.correctResponseSize =\r\n\t\t(v6 ? sizeof(RESPONSE_V6) : sizeof(RESPONSE_V5))\r\n\t\t- sizeof(response_v6->ResponseBase.KmsPID)\r\n\t\t+ LE32(response_v6->ResponseBase.PIDSize);\r\n\r\n\t// Version specific stuff\r\n\tif (v6)\r\n\t{\r\n\t\t// Copy the HwId\r\n\t\tmemcpy(hwid, response_v6->HwId, sizeof(response_v6->HwId));\r\n\r\n\t\t// Verify the V6 specific part of the response\r\n\t\tresult = VerifyResponseV6(result, response_v6, request_v6, response);\r\n\t}\r\n\telse // V5\r\n\t{\r\n\t\t// Verify the V5 specific part of the response\r\n\t\tresult = VerifyResponseV5(result, request_v6, (RESPONSE_V5*)response_v6);\r\n\t}\r\n\r\n\t// padded size after encryption\r\n\tresult.correctResponseSize += (~(result.correctResponseSize - sizeof(response_v6->ResponseBase.Version)) & 0xf) + 1;\r\n\r\n\treturn result;\r\n}\r\n\r\n"
  },
  {
    "path": "src/kms.h",
    "content": "#ifndef __kms_h\n#define __kms_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if _MSC_VER\n//#include <time.h>\n#else\n#include <sys/time.h>\n#endif // _MSC_VER\n//#include <stdlib.h>\n#include \"types.h\"\n//\n// REQUEST... types are actually fixed size\n// RESPONSE... size may vary, defined here is max possible size\n//\n\n#define MAX_RESPONSE_SIZE 384\n#define PID_BUFFER_SIZE 64\n#define MAX_REQUEST_SIZE sizeof(REQUEST_V6)\n#define WORKSTATION_NAME_BUFFER 64\n\n// Constants for V6 time stamp interval\n#define TIME_C1 0x00000022816889BDULL\n#define TIME_C2 0x000000208CBAB5EDULL\n#define TIME_C3 0x3156CD5AC628477AULL\n\n#define VERSION_INFO union \\\n{ \\\n\tDWORD Version;\\\n\tstruct { \\\n\t\tWORD MinorVer; \\\n\t\tWORD MajorVer; \\\n\t} /*__packed*/; \\\n} /*__packed*/\n\n// Aliases for various KMS struct members\n#define IsClientVM VMInfo\n#define GraceTime BindingExpiration\n#define MinutesRemaingInCurrentStatus BindingExpiration\n#define ID ActID\n#define ApplicationID AppID\n#define SkuId ActID\n#define KmsId KMSID\n#define ClientMachineId CMID\n#define MinimumClients N_Policy\n#define TimeStamp ClientTime\n#define PreviousCLientMachineId CMID_prev\n#define Salt IV\n#define XorSalt XoredIVs\n#define ActivationInterval VLActivationInterval\n#define RenewalInterval VLRenewalInterval\n\n#define MAX_CLIENTS 671\n\ntypedef struct\n{\n\tGUID Guid[MAX_CLIENTS];\n\tint_fast16_t CurrentCount;\n\tint_fast16_t MaxCount;\n\tint_fast16_t CurrentPosition;\n} ClientList_t, *PClientList_t;\n\ntypedef struct {\n\tVERSION_INFO;\n\tDWORD VMInfo;\t\t\t\t\t// 0 = client is bare metal / 1 = client is VM\n\tDWORD LicenseStatus;\t\t\t// 0 = Unlicensed, 1 = Licensed (Activated), 2 = OOB grace, 3 = OOT grace, 4 = NonGenuineGrace, 5 = Notification, 6 = extended grace\n\tDWORD BindingExpiration;\t\t// Expiration of the current status in minutes (e.g. when KMS activation or OOB grace expires).\n\tGUID AppID;\t\t\t\t\t\t// Can currently be Windows, Office2010 or Office2013 (see kms.c, table AppList).\n\tGUID ActID;\t\t\t\t\t\t// Most detailed product list. One product key per ActID (see kms.c, table ExtendedProductList). Is ignored by KMS server.\n\tGUID KMSID;\t\t\t\t\t\t// This is actually what the KMS server uses to grant or refuse activation (see kms.c, table BasicProductList).\n\tGUID CMID;\t\t\t\t\t\t// Client machine id. Used by the KMS server for counting minimum clients.\n\tDWORD N_Policy;\t\t\t\t\t// Minimum clients required for activation.\n\tFILETIME ClientTime;\t\t\t// Current client time.\n\tGUID CMID_prev;\t\t\t\t\t// previous client machine id. All zeros, if it never changed.\n\tWCHAR WorkstationName[64];\t\t// Workstation name. FQDN if available, NetBIOS otherwise.\n} /*__packed*/ REQUEST;\n\ntypedef struct {\n\tVERSION_INFO;\n\tDWORD PIDSize;\t\t\t\t\t// Size of PIDData in bytes.\n\tWCHAR KmsPID[PID_BUFFER_SIZE];\t// ePID (must include terminating zero)\n\tGUID CMID;\t\t\t\t\t\t// Client machine id. Must be the same as in request.\n\tFILETIME ClientTime;\t\t\t// Current client time. Must be the same as in request.\n\tDWORD Count;\t\t\t\t\t// Current activated machines. KMS server counts up to N_Policy << 1 then stops\n\tDWORD VLActivationInterval;\t\t// Time in minutes when clients should retry activation if it was unsuccessful (default 2 hours)\n\tDWORD VLRenewalInterval;        // Time in minutes when clients should renew KMS activation (default 7 days)\n} /*__packed*/ RESPONSE;\n\n#ifdef _DEBUG\ntypedef struct {\n\tVERSION_INFO;\n\tDWORD PIDSize;\n\tWCHAR KmsPID[49]; \t\t\t\t// Set this to the ePID length you want to debug\n\tGUID CMID;\n\tFILETIME ClientTime;\n\tDWORD Count;\n\tDWORD VLActivationInterval;\n\tDWORD VLRenewalInterval;\n} __packed RESPONSE_DEBUG;\n#endif\n\n\ntypedef struct {\n\tREQUEST RequestBase;\t\t\t// Base request\n\tBYTE MAC[16];\t\t\t\t\t// Aes 160 bit CMAC\n} /*__packed*/ REQUEST_V4;\n\ntypedef struct {\n\tRESPONSE ResponseBase;\t\t\t// Base response\n\tBYTE MAC[16];\t\t\t\t\t// Aes 160 bit CMAC\n} /*__packed*/ RESPONSE_V4;\n\n\ntypedef struct {\n\tVERSION_INFO;\t\t\t\t\t// unencrypted version info\n\tBYTE IV[16];\t\t\t\t\t// IV\n\tREQUEST RequestBase;\t\t\t// Base Request\n\tBYTE Pad[4];\t\t\t\t\t// since this struct is fixed, we use fixed PKCS pad bytes\n} /*__packed*/ REQUEST_V5;\n\ntypedef REQUEST_V5 REQUEST_V6;\t\t// v5 and v6 requests are identical\n\ntypedef struct {\n\tVERSION_INFO;\n\tBYTE IV[16];\n\tRESPONSE ResponseBase;\n\tBYTE RandomXoredIVs[16];\t\t// If RequestIV was used for decryption: Random ^ decrypted Request IV ^ ResponseIV. If NULL IV was used for decryption: Random ^ decrypted Request IV\n\tBYTE Hash[32];\t\t\t\t\t// SHA256 of Random used in RandomXoredIVs\n\tBYTE HwId[8];\t\t\t\t\t// HwId from the KMS server\n\tBYTE XoredIVs[16];\t\t\t\t// If RequestIV was used for decryption: decrypted Request IV ^ ResponseIV. If NULL IV was used for decryption: decrypted Request IV.\n\tBYTE HMAC[16];\t\t\t\t\t// V6 Hmac (low 16 bytes only), see kms.c CreateV6Hmac\n\t//BYTE Pad[10];\t\t\t\t\t// Pad is variable sized. So do not include in struct\n} /*__packed*/ RESPONSE_V6;\n\ntypedef struct {\t\t\t\t\t// not used except for sizeof(). Fields are the same as RESPONSE_V6\n\tVERSION_INFO;\n\tBYTE IV[16];\n\tRESPONSE ResponseBase;\n\tBYTE RandomXoredIVs[16];\n\tBYTE Hash[32];\n} /*__packed*/ RESPONSE_V5;\n\n#ifdef _DEBUG\ntypedef struct {\t\t\t\t\t// Debug structure for direct casting of RPC data in debugger\n\tVERSION_INFO;\n\tBYTE IV[16];\n\tRESPONSE_DEBUG ResponseBase;\n\tBYTE RandomXoredIVs[16];\n\tBYTE MAC[32];\n\tBYTE Unknown[8];\n\tBYTE XorSalts[16];\n\tBYTE HMAC[16];\n\tBYTE Pad[16];\n} __packed RESPONSE_V6_DEBUG;\n#endif\n\n#define V4_PRE_EPID_SIZE \t( \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->Version) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->PIDSize) \\\n\t\t\t\t\t\t\t)\n\n#define V4_POST_EPID_SIZE \t( \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->CMID) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->ClientTime) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->Count) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->VLActivationInterval) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->VLRenewalInterval) \\\n\t\t\t\t\t\t\t)\n\n#define V6_DECRYPT_SIZE\t\t( \\\n\t\t\t\t\t\t\t\tsizeof(((REQUEST_V6*)0)->IV) + \\\n\t\t\t\t\t\t\t\tsizeof(((REQUEST_V6*)0)->RequestBase) + \\\n\t\t\t\t\t\t\t\tsizeof(((REQUEST_V6*)0)->Pad) \\\n\t\t\t\t\t\t\t)\n\n#define V6_UNENCRYPTED_SIZE\t( \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->Version) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->IV) \\\n\t\t\t\t\t\t\t)\n\n#define V6_PRE_EPID_SIZE \t( \\\n\t\t\t\t\t\t\t\tV6_UNENCRYPTED_SIZE + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->Version) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE*)0)->PIDSize) \\\n\t\t\t\t\t\t\t)\n\n#define V5_POST_EPID_SIZE \t( \\\n\t\t\t\t\t\t\t\tV4_POST_EPID_SIZE + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->RandomXoredIVs) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->Hash) \\\n\t\t\t\t\t\t\t)\n\n#define V6_POST_EPID_SIZE \t( \\\n\t\t\t\t\t\t\t\tV5_POST_EPID_SIZE + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->HwId) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->XoredIVs) + \\\n\t\t\t\t\t\t\t\tsizeof(((RESPONSE_V6*)0)->HMAC) \\\n\t\t\t\t\t\t\t)\n\n#define RESPONSE_RESULT_OK ((1 << 10) - 1) //(9 bits)\ntypedef union\n{\n\tDWORD mask;\n\tstruct\n\t{\n\t\tBOOL HashOK : 1;\n\t\tBOOL TimeStampOK : 1;\n\t\tBOOL ClientMachineIDOK : 1;\n\t\tBOOL VersionOK : 1;\n\t\tBOOL IVsOK : 1;\n\t\tBOOL DecryptSuccess : 1;\n\t\tBOOL HmacSha256OK : 1;\n\t\tBOOL PidLengthOK : 1;\n\t\tBOOL RpcOK : 1;\n\t\tBOOL IVnotSuspicious : 1;\n\t\tBOOL reserved3 : 1;\n\t\tBOOL reserved4 : 1;\n\t\tBOOL reserved5 : 1;\n\t\tBOOL reserved6 : 1;\n\t\tuint32_t effectiveResponseSize : 9;\n\t\tuint32_t correctResponseSize : 9;\n\t};\n} RESPONSE_RESULT;\n\ntypedef BYTE hwid_t[8];\n\ntypedef enum \n{\n\tNone = 0,\n\tUseNdr64 = 1 << 0,\n\tUseForEpid = 1 << 1,\n\tMayBeServer = 1 << 2,\n} HostBuildFlag;\n\ntypedef struct CsvlkData\n{\n\tunion\n\t{\n\t\tuint64_t EPidOffset;\n\t\tchar* EPid;\n\t};\n\n\tint64_t ReleaseDate;\n\tuint32_t GroupId;\n\tuint32_t MinKeyId;\n\tuint32_t MaxKeyId;\n\tuint8_t MinActiveClients;\n\tuint8_t Reserved[3];\n\n} CsvlkData_t, *PCsvlkData_t;\n\ntypedef struct VlmcsdData\n{\n\tunion\n\t{\n\t\tGUID Guid;\n\t\tuint8_t GuidBytes[16];\n\t};\n\n\tunion\n\t{\n\t\tuint64_t NameOffset;\n\t\tchar* Name;\n\t};\n\n\tuint8_t AppIndex;\n\tuint8_t KmsIndex;\n\tuint8_t ProtocolVersion;\n\tuint8_t NCountPolicy;\n\tuint8_t IsRetail;\n\tuint8_t IsPreview;\n\tuint8_t EPidIndex;\n\tuint8_t reserved;\n\n} VlmcsdData_t, *PVlmcsdData_t;\n\ntypedef struct\n{\n\tunion\n\t{\n\t\tuint64_t Offset;\n\t\tvoid* Pointer;\n\t};\n} DataPointer_t;\n\n#define KMS_OPTIONS_USENDR64 1 << 0\n\ntypedef struct HostBuild\n{\n\tunion\n\t{\n\t\tuint64_t DisplayNameOffset;\n\t\tchar* DisplayName;\n\t};\n\n\tint64_t ReleaseDate;\n\tint32_t BuildNumber;\n\tint32_t PlatformId;\n\tHostBuildFlag Flags;\n\tuint8_t reserved[4];\n\n} HostBuild_t, *PHostBuild_t;\n\ntypedef struct VlmcsdHeader\n{\n\tBYTE Magic[4];\n\tVERSION_INFO;\n\tuint8_t CsvlkCount;\n\tuint8_t Flags;\n\tuint8_t Reserved[2];\n\n\tunion\n\t{\n\t\tint32_t Counts[5];\n\n\t\tstruct\n\t\t{\n\t\t\tint32_t AppItemCount;\n\t\t\tint32_t KmsItemCount;\n\t\t\tint32_t SkuItemCount;\n\t\t\tint32_t HostBuildCount;\n\t\t\tint32_t reserved2Counts;\n\t\t};\n\t};\n\n\tunion\n\t{\n\t\tDataPointer_t Datapointers[5];\n\n\t\tstruct\n\t\t{\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t AppItemOffset;\n\t\t\t\tPVlmcsdData_t AppItemList;\n\t\t\t};\n\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t KmsItemOffset;\n\t\t\t\tPVlmcsdData_t KmsItemList;\n\t\t\t};\n\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t SkuItemOffset;\n\t\t\t\tPVlmcsdData_t SkuItemList;\n\t\t\t};\n\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t HostBuildOffset;\n\t\t\t\tPHostBuild_t HostBuildList;\n\t\t\t};\n\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t Reserved2Offset;\n\t\t\t\tvoid* Reserved2List;\n\t\t\t};\n\n\t\t\tCsvlkData_t CsvlkData[1];\n\t\t};\n\t};\n\n} VlmcsdHeader_t, *PVlmcsdHeader_t;\n\n//#define EPID_INDEX_WINDOWS 0\n//#define EPID_INDEX_OFFICE2010 1\n//#define EPID_INDEX_OFFICE2013 2\n//#define EPID_INDEX_OFFICE2016 3\n//#define EPID_INDEX_WINCHINAGOV 4\n\ntypedef HRESULT(__stdcall *RequestCallback_t)(REQUEST* baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr);\n\nsize_t CreateResponseV4(REQUEST_V4 *const Request, BYTE *const response_data, const char* const ipstr);\nsize_t CreateResponseV6(REQUEST_V6 *restrict Request, BYTE *const response_data, const char* const ipstr);\nBYTE *CreateRequestV4(size_t *size, const REQUEST* requestBase);\nBYTE *CreateRequestV6(size_t *size, const REQUEST* requestBase);\nvoid randomPidInit();\nvoid get16RandomBytes(void* ptr);\nRESPONSE_RESULT DecryptResponseV6(RESPONSE_V6* response_v6, int responseSize, BYTE* const response, const BYTE* const rawRequest, BYTE* hwid);\nRESPONSE_RESULT DecryptResponseV4(RESPONSE_V4* response_v4, const int responseSize, BYTE* const rawResponse, const BYTE* const rawRequest);\nvoid getUnixTimeAsFileTime(FILETIME* ts);\n__pure int64_t fileTimeToUnixTime(FILETIME* ts);\n\n#ifndef IS_LIBRARY\nint32_t getProductIndex(const GUID* guid, const PVlmcsdData_t list, const int32_t count, char** name, char** ePid);\n#if !defined(NO_INI_FILE)||!defined(NO_VERBOSE_LOG)\nconst char* getNextString(const char* s);\n#endif  // !defined(NO_INI_FILE)||!defined(NO_VERBOSE_LOG)\n#endif // IS_LIBRARY\n\n#ifndef NO_STRICT_MODES\nvoid InitializeClientLists();\nvoid CleanUpClientLists();\n#endif // !NO_STRICT_MODES\n\nextern RequestCallback_t CreateResponseBase;\n\n#ifdef _PEDANTIC\nuint16_t IsValidLcid(const uint16_t lcid);\nuint32_t IsValidHostBuild(const int32_t hostBuild);\n#endif // _PEDANTIC\n\n#endif // __kms_h\n"
  },
  {
    "path": "src/kmsdata-full.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef NO_INTERNAL_DATA\n\n#include \"kmsdata.h\"\n\nuint8_t DefaultKmsData[] =\n{\n\t/* 0000 */ 0x4B, 0x4D, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,   // KMD.............\n\t/* 0010 */ 0x1D, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...............\n\t/* 0020 */ 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........h.......\n\t/* 0030 */ 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........H.......\n\t/* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ................\n\t/* 0050 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xC0, 0x97, 0xD7, 0x20,   // .[........ \n\t/* 0060 */ 0xBF, 0xC4, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\"....V.......\n\t/* 0070 */ 0x80, 0x4F, 0x3E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0xDC, 0x0B,   // .O>L....`.....\n\t/* 0080 */ 0x7F, 0x6A, 0xFE, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j.............\n\t/* 0090 */ 0x00, 0x11, 0x07, 0x51, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x8E, 0xF2, 0x0D,   // ...Q..........\n\t/* 00A0 */ 0xFF, 0x3F, 0x42, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?B............\n\t/* 00B0 */ 0x00, 0x9A, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x40, 0x17, 0x0C, 0x1A,   // ...V.......@...\n\t/* 00C0 */ 0xBF, 0xC8, 0x5B, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x31, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // [.....1 ......\n\t/* 00D0 */ 0x80, 0x33, 0xE4, 0x58, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0F, 0x00, 0x00, 0xC0, 0xE1, 0xE4, 0x00,   // .3X.........\n\t/* 00E0 */ 0xFF, 0xC9, 0x9A, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;..... ......\n\t/* 00F0 */ 0x00, 0x29, 0xA8, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x5A, 0xB2, 0x27,   // .)[........Z'\n\t/* 0100 */ 0x7F, 0x87, 0xE3, 0x28, 0x00, 0x00, 0x00, 0x00, 0x34, 0x27, 0xC9, 0x55, 0x82, 0xD6, 0x71, 0x4D,   // ..(....4'U.qM\n\t/* 0110 */ 0x98, 0x3E, 0xD6, 0xEC, 0x3F, 0x16, 0x05, 0x9F, 0x84, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .>?....!......\n\t/* 0120 */ 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x81, 0x28, 0xA5, 0x59, 0x89, 0xA9, 0x9D, 0x47,   // ...2.....(Y..G\n\t/* 0130 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x8C, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c.!......\n\t/* 0140 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x15, 0xCE, 0xF1, 0x0F, 0x89, 0xA9, 0x9D, 0x47,   // ............G\n\t/* 0150 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x97, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c.!......\n\t/* 0160 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x05, 0x00, 0xFB, 0xB1, 0x49, 0x84, 0xEA, 0xF0, 0x7A, 0x49,   // ........I.zI\n\t/* 0170 */ 0x99, 0xAB, 0x66, 0xCA, 0x96, 0xE9, 0xA0, 0xF5, 0xA3, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .f..!......\n\t/* 0180 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x59, 0x56, 0xB1, 0x11, 0x03, 0xE6, 0xF1, 0x4C,   // ........YV..L\n\t/* 0190 */ 0x9C, 0x1F, 0xF0, 0xEC, 0x01, 0xB8, 0x18, 0x88, 0xB7, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....!......\n\t/* 01A0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x36, 0xD6, 0x7C, 0xD2, 0x62, 0x19, 0xE9, 0x44,   // ........6|b.D\n\t/* 01B0 */ 0x8B, 0x4F, 0x27, 0xB6, 0xC2, 0x3E, 0xFB, 0x85, 0xD0, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .O'>.!......\n\t/* 01C0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x23, 0xBF, 0xA0, 0x7B, 0xF5, 0xD0, 0x72, 0x40,   // ........#.{r@\n\t/* 01D0 */ 0x91, 0xD9, 0xD5, 0x5A, 0xF5, 0xA4, 0x81, 0xB6, 0xEC, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.!......\n\t/* 01E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0xC0, 0xE3, 0x9F, 0x96, 0xEC, 0xA3, 0x1A, 0x49,   // ...........I\n\t/* 01F0 */ 0x9F, 0x25, 0x42, 0x36, 0x05, 0xDE, 0xB3, 0x65, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .%B6.޳e.\"......\n\t/* 0200 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x58, 0x13, 0xC5, 0xE1, 0x3E, 0xFE, 0x03, 0x42,   // ........X.>.B\n\t/* 0210 */ 0xA4, 0xA2, 0x3B, 0x6B, 0x20, 0xC9, 0x73, 0x4E, 0x21, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ;k sN!\"......\n\t/* 0220 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x4F, 0x13, 0xE2, 0x58, 0x11, 0x8E, 0x17, 0x4D,   // ........O.X...M\n\t/* 0230 */ 0x9C, 0xB2, 0x91, 0x06, 0x9C, 0x15, 0x11, 0x48, 0x35, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ......H5\"......\n\t/* 0240 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x19, 0x52, 0xDE, 0x7F, 0xFA, 0xFB, 0x4A, 0x48,   // .........R.JH\n\t/* 0250 */ 0x82, 0xC9, 0x34, 0xD1, 0xAD, 0x53, 0xE8, 0x56, 0x4E, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4ѭSVN\"......\n\t/* 0260 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x7B, 0xB9, 0xBB, 0xA4, 0x8C, 0x28, 0x4A,   // ........;{.(J\n\t/* 0270 */ 0x97, 0x17, 0x89, 0xFA, 0xBD, 0x42, 0xC4, 0xAC, 0x58, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...BĬX\"......\n\t/* 0280 */ 0x00, 0x00, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0x58, 0xB3, 0x40, 0x3C, 0x48, 0x59, 0xAF, 0x45,   // ........X@<HYE\n\t/* 0290 */ 0x92, 0x3B, 0x53, 0xD2, 0x1F, 0xCC, 0x7E, 0x79, 0x6B, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;S.~yk\"......\n\t/* 02A0 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x90, 0x68, 0x64, 0x6D, 0x06, 0x36, 0x1A, 0x46,   // .........hdm.6.F\n\t/* 02B0 */ 0x86, 0xAB, 0x59, 0x8B, 0xB8, 0x4A, 0xCE, 0x82, 0x7E, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Y.J.~\"......\n\t/* 02C0 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x80, 0xC7, 0x8F, 0xCB, 0x05, 0x2C, 0x5A, 0x49,   // ...........,ZI\n\t/* 02D0 */ 0x97, 0x10, 0x85, 0xAF, 0xFF, 0xC9, 0x04, 0xD7, 0x93, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....\"......\n\t/* 02E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBB, 0xA0, 0x94, 0x5F, 0xA0, 0xD5, 0x81, 0x40,   // .........._..@\n\t/* 02F0 */ 0xA6, 0x85, 0x58, 0x19, 0x41, 0x8B, 0x2F, 0xE0, 0xA8, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .X.A./\"......\n\t/* 0300 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0xE4, 0x56, 0xE1, 0x33, 0x6F, 0xB7, 0x52, 0x4A,   // ........V3oRJ\n\t/* 0310 */ 0x9F, 0x91, 0xF6, 0x41, 0xDD, 0x95, 0xAC, 0x48, 0xB8, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..A.H\"......\n\t/* 0320 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x87, 0x33, 0xE5, 0x8F, 0x87, 0x30, 0x47, 0x44,   // .........3..0GD\n\t/* 0330 */ 0x89, 0x85, 0xF7, 0x51, 0x32, 0x21, 0x5A, 0xC9, 0xDC, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Q2!Z\"......\n\t/* 0340 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xFD, 0x21, 0x8A, 0xC5, 0xCB, 0xEB, 0x44,   // ........!.D\n\t/* 0350 */ 0x83, 0xF3, 0xFE, 0x28, 0x4E, 0x66, 0x80, 0xA7, 0x0C, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .(Nf..#......\n\t/* 0360 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xCC, 0xC6, 0x0F, 0x0E, 0xFF, 0xAE, 0x4F,   // ..........O\n\t/* 0370 */ 0x9D, 0x08, 0x43, 0x70, 0x78, 0x5B, 0xF7, 0xED, 0x2F, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Cpx[/#......\n\t/* 0380 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xF5, 0x87, 0xCA, 0x46, 0xCD, 0xC0, 0x40,   // .........F@\n\t/* 0390 */ 0xB0, 0x6D, 0x8E, 0xCD, 0x57, 0xA4, 0x37, 0x3F, 0x56, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // m.W7?V#......\n\t/* 03A0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x89, 0x26, 0xCA, 0xB2, 0xA8, 0xA9, 0xD7, 0x42,   // .........&ʲB\n\t/* 03B0 */ 0x93, 0x8D, 0xCF, 0x8E, 0x9F, 0x20, 0x19, 0x58, 0x89, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .... .X.#......\n\t/* 03C0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCB, 0x65, 0x86, 0x8C, 0x46, 0xA3, 0x4A,   // ........qe..FJ\n\t/* 03D0 */ 0xA3, 0x37, 0xCB, 0x9B, 0xC9, 0xD5, 0xEA, 0xAC, 0xAF, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 7.꬯#......\n\t/* 03E0 */ 0x00, 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD3, 0xEF, 0x56, 0x84, 0x04, 0x0C, 0x89, 0x40,   // ........V....@\n\t/* 03F0 */ 0x87, 0x40, 0x5B, 0x72, 0x38, 0x53, 0x5A, 0x65, 0xC3, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .@[r8SZe#......\n\t/* 0400 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x69, 0xC0, 0x9F, 0x6E, 0x7D, 0x25, 0xC4, 0x4B,   // ........i.n}%K\n\t/* 0410 */ 0xB4, 0xA7, 0x75, 0x05, 0x14, 0xD3, 0x27, 0x43, 0xDA, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // u..'C#......\n\t/* 0420 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x70, 0x52, 0x5F, 0x6D, 0xAC, 0x31, 0x3E, 0x43,   // ........pR_m1>C\n\t/* 0430 */ 0xB9, 0x0A, 0x39, 0x89, 0x29, 0x23, 0xC6, 0x57, 0xEE, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .9.)#W#......\n\t/* 0440 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x01, 0x00, 0x00, 0xDC, 0x64, 0x2A, 0x21, 0xB1, 0x43, 0x3D, 0x4D,   // ........d*!C=M\n\t/* 0450 */ 0xA3, 0x0C, 0x2F, 0xC6, 0x9D, 0x20, 0x95, 0xC6, 0x05, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ./. ..$......\n\t/* 0460 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x46, 0xF9, 0x5A, 0xE8, 0x25, 0x2E, 0xB7, 0x47,   // ........FZ%.G\n\t/* 0470 */ 0x83, 0xE1, 0xBE, 0xBC, 0xEB, 0xEA, 0xC6, 0x11, 0x13, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ᾼ..$......\n\t/* 0480 */ 0x01, 0x00, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xBF, 0xF1, 0xA6, 0xE6, 0x40, 0x9D, 0xC3, 0x40,   // ........@.@\n\t/* 0490 */ 0xAA, 0x9F, 0xC7, 0x7B, 0xA2, 0x15, 0x78, 0xC0, 0x1F, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{.x.$......\n\t/* 04A0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x68, 0x79, 0x4C, 0xAA, 0xDA, 0xB9, 0x80, 0x46,   // ........hyLڹ.F\n\t/* 04B0 */ 0x92, 0xB6, 0xAC, 0xB2, 0x5E, 0x2F, 0x86, 0x6C, 0x2B, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^/.l+$......\n\t/* 04C0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1B, 0xF6, 0xB5, 0x85, 0x0B, 0x32, 0xE3, 0x4B,   // ...........2K\n\t/* 04D0 */ 0x81, 0x4A, 0xB7, 0x6B, 0x2B, 0xFA, 0xFC, 0x82, 0x45, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Jk+.E$......\n\t/* 04E0 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xB1, 0x9E, 0x7D, 0x61, 0x36, 0xEF, 0x82, 0x4F,   // .........}a6.O\n\t/* 04F0 */ 0x86, 0xE0, 0xA6, 0x5A, 0xE0, 0x7B, 0x96, 0xC6, 0x51, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z{.Q$......\n\t/* 0500 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x62, 0xEB, 0xE8, 0x8D, 0xE0, 0xBB, 0xAC, 0x40,   // ........b.໬@\n\t/* 0510 */ 0xAC, 0x17, 0xF7, 0x55, 0x95, 0x07, 0x1E, 0xA3, 0x5D, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .U...]$......\n\t/* 0520 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xC1, 0x9C, 0xA9, 0x19, 0x77, 0x06, 0x43,   // ..........w.C\n\t/* 0530 */ 0x96, 0x45, 0x29, 0x41, 0x02, 0xFB, 0xFF, 0x95, 0x77, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .E)A..w$......\n\t/* 0540 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAE, 0xE1, 0x34, 0xF8, 0x27, 0x50, 0x49,   // ........U4'PI\n\t/* 0550 */ 0x88, 0x77, 0x7A, 0x03, 0xBE, 0x5F, 0xB1, 0x81, 0x96, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .wz._..$......\n\t/* 0560 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x3C, 0x4D, 0x03, 0x4B, 0x5D, 0x45, 0x42,   // ........<M.K]EB\n\t/* 0570 */ 0xB3, 0xF8, 0xF8, 0x45, 0x71, 0x31, 0x40, 0x78, 0xB5, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Eq1@x$......\n\t/* 0580 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xEA, 0x32, 0xDE, 0xEE, 0xAA, 0x62, 0x46,   // ........2bF\n\t/* 0590 */ 0x94, 0x44, 0xC1, 0xBE, 0xFB, 0x41, 0xBD, 0xE2, 0xD4, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .DA$......\n\t/* 05A0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xE5, 0x62, 0xC3, 0x90, 0xA1, 0x0D, 0xFD, 0x4B,   // ........b..K\n\t/* 05B0 */ 0xB5, 0x3B, 0xB8, 0x7D, 0x30, 0x9A, 0xDE, 0x43, 0xF1, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ;}0.C$......\n\t/* 05C0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x95, 0xE3, 0x73, 0x0C, 0xFC, 0x0D, 0x40,   // ........|.s..@\n\t/* 05D0 */ 0x91, 0x84, 0x5F, 0x7B, 0x6F, 0x2E, 0xB4, 0x09, 0x26, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .._{o..&%......\n\t/* 05E0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xFA, 0xD2, 0x32, 0xA8, 0xE4, 0xC2, 0x42,   // ........2B\n\t/* 05F0 */ 0x92, 0x3B, 0x4B, 0xF4, 0xFD, 0x13, 0xE6, 0xEE, 0x59, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;K.Y%......\n\t/* 0600 */ 0x00, 0x01, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x33, 0xA3, 0x03, 0x71, 0xC8, 0xB8, 0xCC, 0x49,   // ........3.qȸI\n\t/* 0610 */ 0x93, 0xCE, 0xD3, 0x7C, 0x09, 0x68, 0x7F, 0x92, 0x79, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|.h..y%......\n\t/* 0620 */ 0x00, 0x01, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x83, 0xD3, 0xB2, 0xE0, 0x12, 0xD1, 0x3F, 0x41,   // .........Ӳ.?A\n\t/* 0630 */ 0x8A, 0x80, 0x97, 0xF3, 0x73, 0xA5, 0x82, 0x0C, 0x9B, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...s...%......\n\t/* 0640 */ 0x00, 0x03, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0xFB, 0x54, 0x84, 0xE3, 0xA4, 0x41, 0x59, 0x4F,   // ........T.AYO\n\t/* 0650 */ 0xA5, 0xDC, 0x25, 0x08, 0x0E, 0x35, 0x47, 0x30, 0xB3, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // %..5G0%......\n\t/* 0660 */ 0x00, 0x03, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0x60, 0x5A, 0x5A, 0x2D, 0x40, 0x30, 0xBF, 0x48,   // ........`ZZ-@0H\n\t/* 0670 */ 0xBE, 0xB0, 0xFC, 0xD7, 0x70, 0xC2, 0x0C, 0xE0, 0xCC, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // p.%......\n\t/* 0680 */ 0x00, 0x04, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x83, 0x6D, 0x77, 0x9F, 0x56, 0x71, 0xB2, 0x45,   // .........mw.VqE\n\t/* 0690 */ 0x8A, 0x5C, 0x35, 0x9B, 0x9C, 0x9F, 0x22, 0xA3, 0xEC, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\\5...\"%......\n\t/* 06A0 */ 0x00, 0x04, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x99, 0x7C, 0xE9, 0x58, 0x77, 0xF3, 0xF1, 0x4E,   // .........|XwN\n\t/* 06B0 */ 0x81, 0xD5, 0x4A, 0xD5, 0x52, 0x2B, 0x5F, 0xD8, 0x0E, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .JR+_.&......\n\t/* 06C0 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x44, 0x75, 0x10, 0xA9, 0xA0, 0xF4, 0x53, 0x40,   // ........Du..S@\n\t/* 06D0 */ 0xA9, 0x6A, 0x14, 0x79, 0xAB, 0xDE, 0xF9, 0x12, 0x1E, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // j.y..&......\n\t/* 06E0 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x51, 0x17, 0x9E, 0x7B, 0xDA, 0xA8, 0x75, 0x4F,   // ........Q..{ڨuO\n\t/* 06F0 */ 0x95, 0x60, 0x5F, 0xAD, 0xFE, 0x3D, 0x8E, 0x38, 0x3F, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`_=.8?&......\n\t/* 0700 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x57, 0x8A, 0x91, 0xCD, 0x1B, 0xA4, 0x82, 0x4C,   // ........W....L\n\t/* 0710 */ 0x8D, 0xCE, 0x1A, 0x53, 0x8E, 0x22, 0x1A, 0x83, 0x51, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..S.\"..Q&......\n\t/* 0720 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x88, 0x22, 0xC4, 0xE0, 0x0C, 0x98, 0x88, 0x47,   // .........\"...G\n\t/* 0730 */ 0xA0, 0x14, 0xC0, 0x80, 0xD2, 0xE1, 0x92, 0x6E, 0x71, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....nq&......\n\t/* 0740 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x55, 0x23, 0x10, 0x3C, 0x27, 0xD0, 0xC6, 0x42,   // ........U#.<'B\n\t/* 0750 */ 0xAD, 0x23, 0x2E, 0x7E, 0xF8, 0xA0, 0x25, 0x85, 0x86, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // #.~.%..&......\n\t/* 0760 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x21, 0x11, 0x11, 0x73, 0x38, 0x56, 0xF6, 0x40,   // ........!..s8V@\n\t/* 0770 */ 0xBC, 0x11, 0xF1, 0xD7, 0xB0, 0xD6, 0x43, 0x00, 0x9D, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .װC..&......\n\t/* 0780 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xA4, 0x51, 0x7B, 0x04, 0x0C, 0x8F, 0x4E,   // ........lQ{...N\n\t/* 0790 */ 0x9A, 0xF4, 0x84, 0x96, 0xCC, 0xA9, 0x0D, 0x5E, 0xB3, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...̩.^&......\n\t/* 07A0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x38, 0xB8, 0x87, 0xB6, 0x41, 0x90, 0x45,   // ........8.A.E\n\t/* 07B0 */ 0x83, 0x18, 0x57, 0x97, 0x95, 0x1D, 0x85, 0x29, 0xD3, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..W....)&......\n\t/* 07C0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xE2, 0xE3, 0x72, 0xE2, 0x2F, 0x73, 0x65, 0x4C,   // ........r/seL\n\t/* 07D0 */ 0xA8, 0xF0, 0x48, 0x47, 0x47, 0xD0, 0xD9, 0x47, 0xF5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // HGGG&......\n\t/* 07E0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x92, 0xC0, 0xBB, 0x82, 0x50, 0xBC, 0x16, 0x4E,   // ..........P.N\n\t/* 07F0 */ 0x8E, 0x18, 0xB7, 0x4F, 0xC4, 0x86, 0xAE, 0xC3, 0x0D, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..O..'......\n\t/* 0800 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xD3, 0x71, 0x15, 0x4B, 0xFB, 0xBA, 0x40, 0x4B,   // ........q.K@K\n\t/* 0810 */ 0x80, 0x87, 0xA9, 0x61, 0xBE, 0x2C, 0xAF, 0x65, 0x31, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..a,e1'......\n\t/* 0820 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x92, 0x73, 0xE6, 0x2D, 0xA7, 0xB7, 0x2A, 0x46,   // .........s-*F\n\t/* 0830 */ 0xB1, 0xCA, 0x10, 0x8D, 0xD1, 0x89, 0xF5, 0x88, 0x57, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....W'......\n\t/* 0840 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x82, 0xFC, 0x1A, 0x3F, 0xAC, 0xF8, 0x6C, 0x4F,   // ..........?lO\n\t/* 0850 */ 0x80, 0x05, 0x1D, 0x23, 0x3E, 0x60, 0x6E, 0xEE, 0x6F, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...#>`no'......\n\t/* 0860 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xB1, 0x00, 0x53, 0x33, 0x2E, 0xC2, 0x4D,   // ..........S3.M\n\t/* 0870 */ 0x82, 0x91, 0x47, 0xFF, 0xCE, 0xC7, 0x46, 0xDD, 0x91, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..GF.'......\n\t/* 0880 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x5A, 0x0B, 0xA8, 0xAD, 0x76, 0x8B, 0x42,   // ........Z.v.B\n\t/* 0890 */ 0xB0, 0x5D, 0xA4, 0x7D, 0x2D, 0xFF, 0xEE, 0xBF, 0xB5, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ]}-'......\n\t/* 08A0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x01, 0x82, 0x80, 0xFF, 0xC6, 0xFE, 0xD4, 0x4F,   // ...........O\n\t/* 08B0 */ 0xAE, 0x16, 0xAB, 0xBD, 0xDA, 0xDE, 0x57, 0x06, 0xCF, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .W.'......\n\t/* 08C0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAB, 0xF2, 0x43, 0x87, 0x7C, 0x56, 0x4D,   // .........C.|VM\n\t/* 08D0 */ 0xB2, 0x7C, 0x44, 0xD0, 0xF9, 0xA3, 0xDA, 0xBD, 0xEF, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // |Dڽ'......\n\t/* 08E0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x65, 0x8E, 0x86, 0xEC, 0xDF, 0xFA, 0x59, 0x47,   // ........e..YG\n\t/* 08F0 */ 0xB2, 0x3E, 0x93, 0xFE, 0x37, 0xF2, 0xCC, 0x29, 0x0D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // >.7).(......\n\t/* 0900 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x50, 0xDB, 0xE4, 0xA1, 0xBD, 0x66, 0x45,   // ........P䡽fE\n\t/* 0910 */ 0xB0, 0x47, 0x0C, 0xA5, 0x0A, 0xBC, 0x6F, 0x07, 0x38, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // G..o.8(......\n\t/* 0920 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x14, 0xF8, 0xF4, 0x0D, 0x57, 0x3F, 0x8B, 0x4B,   // ..........W?.K\n\t/* 0930 */ 0x9A, 0x9D, 0xFD, 0xDA, 0xDC, 0xD6, 0x9F, 0xAC, 0x51, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...Q(......\n\t/* 0940 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x09, 0xE5, 0x2E, 0xAE, 0x34, 0x1B, 0xC0, 0x41,   // ..........4.A\n\t/* 0950 */ 0xAC, 0xB7, 0x6D, 0x46, 0x50, 0x16, 0x89, 0x15, 0x65, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // mFP...e(......\n\t/* 0960 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x08, 0xED, 0xBB, 0x46, 0x7B, 0x9C, 0xFC, 0x48,   // .........F{.H\n\t/* 0970 */ 0xA6, 0x14, 0x95, 0x25, 0x05, 0x73, 0xF4, 0xEA, 0x7A, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..%.sz(......\n\t/* 0980 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x05, 0xD6, 0xB6, 0x1C, 0xB3, 0x11, 0x14, 0x4E,   // .........ֶ...N\n\t/* 0990 */ 0xBB, 0x30, 0xDA, 0x91, 0xC8, 0xE3, 0x98, 0x3A, 0x91, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 0..:.(......\n\t/* 09A0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x80, 0x99, 0x2E, 0xB9, 0xD5, 0xB9, 0x21, 0x48,   // ...........չ!H\n\t/* 09B0 */ 0x9C, 0x94, 0x14, 0x0F, 0x63, 0x2F, 0x63, 0x12, 0xA8, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....c/c.(......\n\t/* 09C0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0x15, 0x04, 0x5A, 0xF8, 0xFE, 0x07, 0x4D,   // ........)..Z.M\n\t/* 09D0 */ 0xB0, 0x6F, 0xB5, 0x9B, 0x57, 0x3B, 0x32, 0xD2, 0xBF, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // o.W;2ҿ(......\n\t/* 09E0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0xA0, 0x54, 0x7B, 0xD5, 0x10, 0x4C,   // ...........T{.L\n\t/* 09F0 */ 0x8B, 0x69, 0xA8, 0x42, 0xD6, 0x59, 0x0A, 0xD5, 0xD8, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .iBY.(......\n\t/* 0A00 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x96, 0x78, 0x53, 0xDB, 0x6F, 0x37, 0xAE, 0x48,   // .........xSo7H\n\t/* 0A10 */ 0xA4, 0x92, 0x53, 0xD0, 0x54, 0x77, 0x73, 0xD0, 0xF1, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .STws(......\n\t/* 0A20 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6A, 0x29, 0xA8, 0xE1, 0x37, 0xDB, 0xD1, 0x44,   // ........j)7D\n\t/* 0A30 */ 0x8C, 0xCE, 0x7B, 0xC9, 0x61, 0xD5, 0x9C, 0x54, 0x0D, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{a.T.)......\n\t/* 0A40 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xD3, 0x6D, 0xAA, 0xB4, 0xC2, 0xE2, 0x40,   // ........m@\n\t/* 0A50 */ 0xA5, 0x44, 0xA6, 0xBB, 0xB3, 0xF5, 0xC3, 0x95, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // D.))......\n\t/* 0A60 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBF, 0xD6, 0x4E, 0xC0, 0xC8, 0x55, 0x47, 0x4B,   // ........NUGK\n\t/* 0A70 */ 0x9F, 0x8E, 0x5A, 0x1F, 0x31, 0xCE, 0xEE, 0x60, 0x3A, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z.1`:)......\n\t/* 0A80 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA2, 0x84, 0x55, 0x9D, 0x85, 0x2D, 0x9A, 0x41,   // .........U..-.A\n\t/* 0A90 */ 0x98, 0x2C, 0xA0, 0x08, 0x88, 0xBB, 0x9D, 0xDF, 0x49, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .,....I)......\n\t/* 0AA0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA0, 0x90, 0x73, 0x19, 0xF6, 0x65, 0x95, 0x4A,   // ..........s.e.J\n\t/* 0AB0 */ 0xBD, 0xC4, 0x55, 0xD5, 0x8A, 0x3B, 0x02, 0x53, 0x69, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // U.;.Si)......\n\t/* 0AC0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xD4, 0xFC, 0x60, 0x88, 0x7B, 0xA7, 0x20, 0x4A,   // ........`.{ J\n\t/* 0AD0 */ 0x90, 0x45, 0xA1, 0x50, 0xFF, 0x11, 0xD6, 0x09, 0x7A, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .EP..z)......\n\t/* 0AE0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA3, 0x18, 0x00, 0xA0, 0x0F, 0xF2, 0x32, 0x46,   // ............2F\n\t/* 0AF0 */ 0xBF, 0x7C, 0x8D, 0xAA, 0x53, 0x51, 0xC9, 0x14, 0x99, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // |.SQ..)......\n\t/* 0B00 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xAF, 0x8B, 0x01, 0x10, 0x21, 0xCE, 0x60, 0x40,   // ...........!`@\n\t/* 0B10 */ 0x80, 0xBD, 0x47, 0xFE, 0x74, 0xED, 0x4D, 0xAB, 0xB4, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .GtM)......\n\t/* 0B20 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x48, 0x18, 0xDB, 0x18, 0xE0, 0x12, 0x67, 0x41,   // ........H...gA\n\t/* 0B30 */ 0xB9, 0xD7, 0xDA, 0x7F, 0xCD, 0xA5, 0x07, 0xDB, 0xDD, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ͥ.)......\n\t/* 0B40 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xEC, 0x1B, 0x8E, 0x45, 0x7A, 0x83, 0xF6, 0x45,   // ..........Ez.E\n\t/* 0B50 */ 0xB9, 0xD5, 0x92, 0x5E, 0xD5, 0xD2, 0x99, 0xDE, 0x04, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^..*......\n\t/* 0B60 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x97, 0x49, 0xE1, 0x0A, 0x80, 0xF7, 0x4C,   // .........I..L\n\t/* 0B70 */ 0xAD, 0x10, 0xDE, 0x4B, 0x45, 0xB5, 0x78, 0xDB, 0x19, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .KEx.*......\n\t/* 0B80 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6D, 0xCD, 0x8B, 0xA9, 0x43, 0x53, 0x03, 0x46,   // ........m.CS.F\n\t/* 0B90 */ 0x8A, 0xFE, 0x59, 0x08, 0xE4, 0x61, 0x11, 0x12, 0x30, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Y.a..0*......\n\t/* 0BA0 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x45, 0xF2, 0xEB, 0xA8, 0x29, 0xAF, 0x4D,   // ........E)M\n\t/* 0BB0 */ 0x9C, 0xB1, 0x38, 0xDF, 0xC6, 0x08, 0xA8, 0xC8, 0x47, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .8.G*......\n\t/* 0BC0 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x38, 0x32, 0x1C, 0xFE, 0x2A, 0x43, 0xA1, 0x43,   // ........82.*CC\n\t/* 0BD0 */ 0x8E, 0x25, 0x97, 0xE7, 0xD1, 0xEF, 0x10, 0xF3, 0x60, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .%..`*......\n\t/* 0BE0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x6A, 0x45, 0xEE, 0xFF, 0x87, 0xCD, 0x90, 0x43,   // ........jE..C\n\t/* 0BF0 */ 0x8E, 0x07, 0x16, 0x14, 0x6C, 0x67, 0x2F, 0xD0, 0x71, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....lg/q*......\n\t/* 0C00 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x4F, 0xB7, 0x78, 0xDB, 0x1C, 0xEF, 0x92, 0x48,   // ........Ox..H\n\t/* 0C10 */ 0xAB, 0xFE, 0x1E, 0x66, 0xB8, 0x23, 0x1D, 0xF6, 0x86, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .f#..*......\n\t/* 0C20 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x64, 0x8A, 0x55, 0x78, 0x19, 0xDC, 0xFE, 0x43,   // ........d.Ux.C\n\t/* 0C30 */ 0xA0, 0xD0, 0x80, 0x75, 0xB2, 0xA3, 0x70, 0xA3, 0xA8, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..up*......\n\t/* 0C40 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x1D, 0x6A, 0x2C, 0xC7, 0x52, 0xF2, 0x7E, 0x4E,   // .........j,R~N\n\t/* 0C50 */ 0xBD, 0xD1, 0x3F, 0xCA, 0x34, 0x2A, 0xCB, 0x35, 0xBB, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?4*5*......\n\t/* 0C60 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0xB5, 0x87, 0x8D, 0xE5, 0x26, 0x81, 0x80, 0x45,   // ..........&..E\n\t/* 0C70 */ 0x80, 0xFB, 0x86, 0x1B, 0x22, 0xF7, 0x92, 0x96, 0xDC, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...\"..*......\n\t/* 0C80 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0xC7, 0x91, 0xB4, 0xCA, 0x18, 0xA9, 0x60, 0x4F,   // ..........`O\n\t/* 0C90 */ 0xB5, 0x02, 0xDA, 0xB7, 0x5E, 0x33, 0x4F, 0x40, 0xFD, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ڷ^3O@*......\n\t/* 0CA0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x3D, 0xE6, 0x6C, 0x09, 0xAC, 0x4F, 0xA9, 0x48,   // ........=l.OH\n\t/* 0CB0 */ 0x82, 0xA9, 0x61, 0xAE, 0x9E, 0x80, 0x0E, 0x5F, 0x20, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .a..._ +......\n\t/* 0CC0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x32, 0x2B, 0x94, 0xE9, 0x55, 0x2E, 0x97, 0x41,   // ........2+.U..A\n\t/* 0CD0 */ 0xB0, 0xBD, 0x5F, 0xF5, 0x8C, 0xBA, 0x88, 0x60, 0x3D, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // _..`=+......\n\t/* 0CE0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x12, 0x82, 0x99, 0xBA, 0x0A, 0x46, 0xDB, 0x44,   // ............FD\n\t/* 0CF0 */ 0xBF, 0xB5, 0x71, 0xBF, 0x09, 0xD1, 0xC6, 0x8B, 0x58, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // q..X+......\n\t/* 0D00 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xEC, 0xDD, 0xC6, 0x54, 0x23, 0x19, 0x4C,   // ........T#.L\n\t/* 0D10 */ 0x90, 0x9B, 0x30, 0x6A, 0x30, 0x58, 0x48, 0x4E, 0x84, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..0j0XHN.+......\n\t/* 0D20 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xA3, 0xE3, 0xF5, 0xB8, 0x33, 0xED, 0x08, 0x46,   // ........3.F\n\t/* 0D30 */ 0x81, 0xE1, 0x37, 0xD6, 0xC9, 0xDC, 0xFD, 0x9C, 0xA1, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .7.+......\n\t/* 0D40 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x1A, 0x67, 0x81, 0xD1, 0x79, 0xB1, 0x4E,   // .........g.yN\n\t/* 0D50 */ 0xB0, 0x04, 0x8C, 0xBB, 0xE1, 0x73, 0xAF, 0xEA, 0xCC, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..s+......\n\t/* 0D60 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x70, 0x3E, 0x11, 0x49, 0xFA, 0xA4, 0x48,   // ........\\p>.IH\n\t/* 0D70 */ 0xBE, 0xEA, 0x7D, 0xD8, 0x79, 0xB4, 0x6B, 0x14, 0xE3, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // }yk.+......\n\t/* 0D80 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x81, 0x69, 0x6B, 0xC0, 0xFD, 0xD7, 0x35, 0x4A,   // .........ik5J\n\t/* 0D90 */ 0xB7, 0xB4, 0x05, 0x47, 0x42, 0xB7, 0xAF, 0x67, 0xFC, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .GBg+......\n\t/* 0DA0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xD7, 0x76, 0x74, 0x48, 0x8E, 0xB4, 0x49,   // .........vtH.I\n\t/* 0DB0 */ 0xAB, 0x63, 0x4D, 0x0B, 0x81, 0x3A, 0x16, 0xE4, 0x15, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // cM..:..,......\n\t/* 0DC0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x54, 0x2D, 0xB8, 0x0A, 0xF4, 0x47, 0xCB, 0x4A,   // ........T-.GJ\n\t/* 0DD0 */ 0x81, 0x8C, 0xCC, 0x5B, 0xF0, 0xEC, 0xB6, 0x49, 0x30, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..[I0,......\n\t/* 0DE0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x90, 0x85, 0xE8, 0xF7, 0xC7, 0xDF, 0x78, 0x4C,   // ..........xL\n\t/* 0DF0 */ 0xBC, 0xCB, 0x6F, 0x38, 0x65, 0xB9, 0x9D, 0x1A, 0x5B, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // o8e..[,......\n\t/* 0E00 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x2D, 0x4E, 0xCD, 0x59, 0x50, 0x50, 0x4A,   // .........-NYPPJ\n\t/* 0E10 */ 0xA9, 0x2D, 0x05, 0xD5, 0xBB, 0x12, 0x67, 0xC7, 0x84, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // -.ջ.g.,......\n\t/* 0E20 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x52, 0xE9, 0xCD, 0x96, 0x2F, 0x9D, 0x4D,   // ........R./.M\n\t/* 0E30 */ 0x8F, 0x2B, 0x2D, 0x34, 0x9F, 0x64, 0xFC, 0x51, 0xAD, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .+-4.dQ,......\n\t/* 0E40 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x6B, 0x3E, 0x38, 0xA4, 0xDA, 0xDA, 0x3D, 0x42,   // ........k>8=B\n\t/* 0E50 */ 0xA4, 0x3D, 0xF2, 0x56, 0x78, 0x42, 0x96, 0x76, 0xCB, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // =VxB.v,......\n\t/* 0E60 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7B, 0xA0, 0x59, 0xCF, 0x2A, 0x1A, 0xE0, 0x4B,   // ........{.Y*.K\n\t/* 0E70 */ 0xBF, 0xE0, 0x42, 0x3B, 0x58, 0x23, 0xE6, 0x63, 0xEB, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // B;X#c,......\n\t/* 0E80 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7F, 0x33, 0x9C, 0x2B, 0x1D, 0x7A, 0x71, 0x42,   // .........3.+.zqB\n\t/* 0E90 */ 0x90, 0xA3, 0xC6, 0x85, 0x5A, 0x2B, 0x8A, 0x1C, 0x0F, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z+...-......\n\t/* 0EA0 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x72, 0xAD, 0x1E, 0x63, 0xAB, 0xA8, 0xF8, 0x4D,   // ........r.cM\n\t/* 0EB0 */ 0xBB, 0xDF, 0x37, 0x20, 0x29, 0x98, 0x9B, 0xDD, 0x23, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 7 )..#-......\n\t/* 0EC0 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7C, 0x9F, 0xFA, 0xDD, 0x9E, 0xF0, 0xB9, 0x40,   // ........|..@\n\t/* 0ED0 */ 0x8C, 0x1A, 0xBE, 0x87, 0x7A, 0x9A, 0x7F, 0x4B, 0x3B, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...z..K;-......\n\t/* 0EE0 */ 0x00, 0x0D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x56, 0x11, 0xFB, 0x7A, 0x1D, 0x2C, 0xFC, 0x40,   // ........V.z.,@\n\t/* 0EF0 */ 0xB2, 0x60, 0xAA, 0xB7, 0x44, 0x2B, 0x62, 0xFE, 0x53, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // `D+bS-......\n\t/* 0F00 */ 0x00, 0x0D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x42, 0x25, 0xAD, 0x54, 0x91, 0x6D, 0x4C,   // ........B%T.mL\n\t/* 0F10 */ 0x8A, 0x44, 0x30, 0xF1, 0x1E, 0xE9, 0x69, 0x89, 0x77, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D0.i.w-......\n\t/* 0F20 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xE3, 0x01, 0x24, 0x0A, 0xC5, 0x58, 0x4B,   // .........$.XK\n\t/* 0F30 */ 0x87, 0xB2, 0x7E, 0x79, 0x4B, 0x7D, 0x26, 0x07, 0x94, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .~yK}&..-......\n\t/* 0F40 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x90, 0x4D, 0xAF, 0xC1, 0xBC, 0xD1, 0xCA, 0x44,   // .........MD\n\t/* 0F50 */ 0x85, 0xD4, 0x00, 0x3B, 0xA3, 0x3D, 0xB3, 0xB9, 0xC1, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..;=-......\n\t/* 0F60 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x49, 0x98, 0x81, 0xD0, 0xAD, 0xB2, 0x47,   // .........I..ЭG\n\t/* 0F70 */ 0xB3, 0xBA, 0x31, 0x6B, 0x12, 0xD6, 0x47, 0xB4, 0xE0, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 1k.G-......\n\t/* 0F80 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE2, 0xB6, 0x68, 0x09, 0xCF, 0x6B, 0x46,   // ........ h.kF\n\t/* 0F90 */ 0x92, 0xD3, 0x45, 0xCD, 0x96, 0x4B, 0x95, 0x09, 0x0F, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .E.K..........\n\t/* 0FA0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x77, 0xEF, 0x09, 0xFD, 0x47, 0x56, 0xFF, 0x4E,   // ........w.GVN\n\t/* 0FB0 */ 0x80, 0x9C, 0xAF, 0x2B, 0x64, 0x65, 0x9A, 0x45, 0x2E, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..+de.E........\n\t/* 0FC0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x17, 0xEF, 0x01, 0x0D, 0x3E, 0x2A, 0x42,   // ........k...>*B\n\t/* 0FD0 */ 0xB4, 0xF8, 0x4E, 0xA8, 0x80, 0x03, 0x5E, 0x8F, 0x5D, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // N..^.].......\n\t/* 0FE0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x51, 0x72, 0xF7, 0x87, 0x0E, 0xD5, 0x48,   // ........\\Qr..H\n\t/* 0FF0 */ 0xA6, 0x76, 0xE6, 0x96, 0x2C, 0x3E, 0x11, 0x95, 0x7D, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // v.,>..}.......\n\t/* 1000 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD9, 0x8B, 0x8B, 0xA7, 0x17, 0x80, 0xF5, 0x4D,   // ............M\n\t/* 1010 */ 0xB8, 0x6A, 0x09, 0xF7, 0x56, 0xAF, 0xFA, 0x7C, 0x9C, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // j.V|........\n\t/* 1020 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF3, 0x8C, 0xA1, 0xCD, 0x96, 0xC1, 0xAD, 0x46,   // ..........F\n\t/* 1030 */ 0xB2, 0x89, 0x60, 0xC0, 0x72, 0x86, 0x99, 0x94, 0xB7, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`r..........\n\t/* 1040 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB9, 0x1F, 0x53, 0x68, 0x11, 0x55, 0x89, 0x49,   // .........Sh.U.I\n\t/* 1050 */ 0x97, 0xBE, 0xD1, 0x1A, 0x0F, 0x55, 0x63, 0x3F, 0xDA, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...Uc?.......\n\t/* 1060 */ 0x00, 0x11, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x2B, 0x0E, 0x62, 0xE7, 0x09, 0xFD, 0x42,   // ........=+.b.B\n\t/* 1070 */ 0x80, 0x2A, 0x17, 0xA1, 0x36, 0x52, 0xFE, 0x7A, 0xFA, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .*.6Rz.......\n\t/* 1080 */ 0x00, 0x11, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1B, 0xE6, 0x82, 0x74, 0x89, 0xC5, 0x7F, 0x4B,   // ..........t..K\n\t/* 1090 */ 0x8E, 0xCC, 0x46, 0xD4, 0x55, 0xAC, 0x3B, 0x87, 0x1C, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .FU;../......\n\t/* 10A0 */ 0x00, 0x12, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x85, 0x26, 0x8A, 0x7E, 0x1C, 0xD3, 0x48,   // ..........&.~.H\n\t/* 10B0 */ 0xA6, 0x87, 0xFB, 0xCA, 0x9B, 0x9A, 0xC1, 0x6B, 0x3E, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...k>/......\n\t/* 10C0 */ 0x00, 0x12, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3D, 0x64, 0xD3, 0x42, 0x0C, 0x2D, 0x41,   // ........`=dB.-A\n\t/* 10D0 */ 0xA7, 0xD6, 0x52, 0xE6, 0x63, 0x53, 0x27, 0xF6, 0x6C, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // RcS'l/......\n\t/* 10E0 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x83, 0x1C, 0xFD, 0x95, 0xF5, 0x7D, 0x4A, 0x49,   // ...........}JI\n\t/* 10F0 */ 0xBE, 0x8B, 0x13, 0x00, 0xE1, 0xC9, 0xD1, 0xCD, 0x8B, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..../......\n\t/* 1100 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x86, 0x54, 0x7D, 0x20, 0xE1, 0x71, 0x47,   // .........T} qG\n\t/* 1110 */ 0xB7, 0xF1, 0x7B, 0x56, 0xC6, 0xD3, 0x17, 0x0C, 0xB2, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {V../......\n\t/* 1120 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x41, 0xEC, 0xF5, 0xF0, 0x55, 0x0D, 0x32, 0x47,   // ........AU.2G\n\t/* 1130 */ 0xAF, 0x02, 0x44, 0x0A, 0x44, 0xA3, 0xCF, 0x0F, 0xDA, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D.D./......\n\t/* 1140 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xA2, 0x43, 0xB7, 0xD4, 0x68, 0xD3, 0x4D,   // ........ChM\n\t/* 1150 */ 0xAF, 0x32, 0x92, 0x42, 0x5B, 0x7B, 0xB6, 0x23, 0xF7, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 2.B[{#/......\n\t/* 1160 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x44, 0x13, 0x09, 0x00, 0xA4, 0x1E, 0x37, 0x4F,   // ........D....7O\n\t/* 1170 */ 0xB7, 0x89, 0x01, 0x75, 0x0B, 0xA6, 0x98, 0x8C, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..u....0......\n\t/* 1180 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xA4, 0x6B, 0xDB, 0x21, 0x7B, 0x9A, 0x14, 0x4A,   // ........k!{..J\n\t/* 1190 */ 0x9E, 0x29, 0x64, 0xA6, 0x0C, 0x59, 0x30, 0x1D, 0x3E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .)d.Y0.>0......\n\t/* 11A0 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x04, 0xCA, 0xB3, 0x58, 0xA3, 0x68, 0x4D,   // ........N.ʳXhM\n\t/* 11B0 */ 0x98, 0x83, 0xAA, 0xA2, 0x94, 0x1A, 0xCA, 0x99, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....`0......\n\t/* 11C0 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x34, 0xBF, 0x3D, 0x6C, 0x5F, 0xA7, 0x4F,   // .........4=l_O\n\t/* 11D0 */ 0xB9, 0x36, 0x69, 0x9D, 0xCE, 0x9E, 0x26, 0x3F, 0x80, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 6i..&?.0......\n\t/* 11E0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x33, 0x44, 0x7B, 0xE7, 0xB1, 0x88, 0x47,   // ........3D{.G\n\t/* 11F0 */ 0x89, 0x5A, 0xC4, 0x53, 0x78, 0xD3, 0x82, 0x53, 0x9F, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ZSx.S.0......\n\t/* 1200 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x79, 0x67, 0xC5, 0x21, 0x49, 0xB4, 0x20, 0x4D,   // ........yg!I M\n\t/* 1210 */ 0xAD, 0xFC, 0xEE, 0xCE, 0x0E, 0x1A, 0xD7, 0x4B, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..K0......\n\t/* 1220 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1B, 0x5A, 0x2B, 0xAB, 0xA5, 0x54, 0x4C,   // ..........Z+TL\n\t/* 1230 */ 0xAC, 0x2F, 0xA6, 0xD9, 0x48, 0x24, 0xA2, 0x83, 0xE0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // /H$.0......\n\t/* 1240 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10, 0x54, 0x1C, 0x8C, 0x39, 0x9F, 0x05, 0x48,   // .........T..9..H\n\t/* 1250 */ 0x8C, 0x9D, 0x63, 0xA0, 0x77, 0x06, 0x35, 0x8F, 0xFF, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..c.w.5.0......\n\t/* 1260 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x6E, 0xAF, 0xD9, 0x43, 0x86, 0x5E, 0xE8, 0x4B,   // ........nC.^K\n\t/* 1270 */ 0xA7, 0x97, 0xD0, 0x72, 0xA0, 0x46, 0x89, 0x6C, 0x1C, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .r.F.l.1......\n\t/* 1280 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x08, 0x9C, 0xE4, 0x82, 0xDA, 0xF8, 0x42,   // ...........B\n\t/* 1290 */ 0xBD, 0xE2, 0xB5, 0x70, 0xFB, 0xCA, 0xE7, 0x6C, 0x36, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // pl61......\n\t/* 12A0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x22, 0xEF, 0xC5, 0x61, 0x4F, 0xF1, 0x53, 0x45,   // ........\"aOSE\n\t/* 12B0 */ 0xA8, 0x24, 0xC4, 0xB3, 0x1E, 0x84, 0xB1, 0x00, 0x6B, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // $ĳ...k1......\n\t/* 12C0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x44, 0x7C, 0x94, 0xBA, 0x9D, 0xD1, 0x86, 0x47,   // ........D|...G\n\t/* 12D0 */ 0xB6, 0xAE, 0x22, 0x77, 0x0B, 0xC9, 0x4C, 0x54, 0x9E, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // \"w.LT.1......\n\t/* 12E0 */ 0x00, 0x16, 0x06, 0x05, 0x00, 0x01, 0x00, 0x00, 0x06, 0x16, 0x3D, 0x4F, 0xEA, 0x3F, 0x01, 0x4C,   // ..........=O?.L\n\t/* 12F0 */ 0xBE, 0x3C, 0x8D, 0x67, 0x1C, 0x40, 0x1E, 0x3B, 0xC5, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // <.g.@.;1......\n\t/* 1300 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x2D, 0x68, 0x2C, 0x68, 0x8B, 0x63, 0x4F,   // ........-h,h.cO\n\t/* 1310 */ 0xA1, 0x65, 0xAE, 0x29, 0x1D, 0x4C, 0xF1, 0x38, 0xDC, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // e).L81......\n\t/* 1320 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xD8, 0xCF, 0xD7, 0xC0, 0x2B, 0x45,   // .........+E\n\t/* 1330 */ 0x9F, 0x60, 0xEF, 0x5C, 0x70, 0xC3, 0x20, 0x94, 0xF5, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`\\p .1......\n\t/* 1340 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x50, 0x49, 0xF5, 0xD4, 0xF2, 0x26, 0xB4, 0x4F,   // ........PI&O\n\t/* 1350 */ 0xBA, 0x21, 0xFF, 0xAB, 0x16, 0xAF, 0xCA, 0xDE, 0x0E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // !..2......\n\t/* 1360 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x72, 0xE8, 0xE7, 0x8C, 0x8C, 0x18, 0x98, 0x4B,   // ........r....K\n\t/* 1370 */ 0x9D, 0x90, 0xF8, 0xF9, 0x0B, 0x7A, 0xAD, 0x02, 0x29, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...z.)2......\n\t/* 1380 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x70, 0xD4, 0xE5, 0xCE, 0x3B, 0x6E, 0xCC, 0x4F,   // ........p;nO\n\t/* 1390 */ 0x8C, 0x2B, 0xD1, 0x74, 0x28, 0x56, 0x8A, 0x9F, 0x3C, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .+t(V..<2......\n\t/* 13A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xB8, 0xD0, 0x47, 0x89, 0x3B, 0xC3, 0xE1, 0x43,   // ........G.;C\n\t/* 13B0 */ 0x8C, 0x56, 0x9B, 0x67, 0x4C, 0x05, 0x28, 0x32, 0x4E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .V.gL.(2N2......\n\t/* 13C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x39, 0x66, 0x6B, 0xCA, 0xD6, 0x4A, 0xAE, 0x40,   // ........9fkJ@\n\t/* 13D0 */ 0xA5, 0x75, 0x14, 0xDE, 0xE0, 0x7F, 0x64, 0x30, 0x61, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // u..d0a2......\n\t/* 13E0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x40, 0x96, 0xED, 0x09, 0x20, 0xF0, 0x0A, 0x40,   // ........@.. .@\n\t/* 13F0 */ 0xAC, 0xD8, 0xD7, 0xD8, 0x67, 0xDF, 0xD9, 0xC2, 0x76, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // gv2......\n\t/* 1400 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x49, 0x4E, 0x3D, 0xEF, 0x3D, 0xA5, 0x81, 0x4D,   // ........IN==.M\n\t/* 1410 */ 0xA2, 0xB1, 0x2C, 0xA6, 0xC2, 0x55, 0x6B, 0x2C, 0x8A, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ,Uk,.2......\n\t/* 1420 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x5C, 0x6F, 0x58, 0xAB, 0x56, 0x52, 0x32, 0x46,   // ........\\oXVR2F\n\t/* 1430 */ 0x96, 0x2F, 0xFE, 0xFD, 0x8B, 0x49, 0xE6, 0xF4, 0x9E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ./.I.2......\n\t/* 1440 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x92, 0xC1, 0xB7, 0xEC, 0xAB, 0x73, 0xED, 0x4D,   // .........sM\n\t/* 1450 */ 0xAC, 0xF4, 0x23, 0x99, 0xB0, 0x95, 0xD0, 0xCC, 0xB2, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // #..̲2......\n\t/* 1460 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x1D, 0x3B, 0x59, 0x45, 0xB1, 0xDF, 0x91, 0x4E,   // .........;YE.N\n\t/* 1470 */ 0xBB, 0xFB, 0x2D, 0x5D, 0x0C, 0xE2, 0x22, 0x7A, 0xC6, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // -].\"z2......\n\t/* 1480 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x60, 0x77, 0x32, 0x6F, 0x5C, 0x8C, 0x7C, 0x41,   // ........`w2o\\.|A\n\t/* 1490 */ 0x9B, 0x61, 0x83, 0x6A, 0x98, 0x28, 0x7E, 0x0C, 0xDD, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .a.j.(~.2......\n\t/* 14A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xF7, 0x3F, 0x13, 0xDF, 0x14, 0xBF, 0x95, 0x4F,   // ........?...O\n\t/* 14B0 */ 0xAF, 0xE3, 0x7B, 0x48, 0xE7, 0xE3, 0x31, 0xEF, 0xFB, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {H12......\n\t/* 14C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x61, 0xBF, 0xC7, 0x5D, 0xC9, 0x5E, 0x96, 0x49,   // ........a]^.I\n\t/* 14D0 */ 0x9C, 0xCB, 0xDF, 0x80, 0x6A, 0x2D, 0x0E, 0xFE, 0x13, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..j-..3......\n\t/* 14E0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x75, 0x4F, 0x0C, 0xB5, 0x9B, 0x59, 0xE8, 0x43,   // ........uO..YC\n\t/* 14F0 */ 0x8D, 0xCD, 0x10, 0x81, 0xA7, 0x96, 0x72, 0x41, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....rA03......\n\t/* 1500 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x87, 0x9E, 0x50, 0xEA, 0xA1, 0x07, 0x45, 0x4A,   // ..........P.EJ\n\t/* 1510 */ 0x9E, 0xDC, 0xEB, 0xA5, 0xA3, 0x9F, 0x36, 0xAF, 0x46, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .륣.6F3......\n\t/* 1520 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x78, 0xA6, 0xA2, 0x9D, 0x6B, 0xFB, 0x67, 0x4E,   // ........x.kgN\n\t/* 1530 */ 0xAB, 0x84, 0x60, 0xDD, 0x6A, 0x9C, 0x81, 0x9A, 0x68, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`j...h3......\n\t/* 1540 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x05, 0x61, 0x23, 0x92, 0x67, 0xBB, 0x4F, 0x49,   // .........a#.gOI\n\t/* 1550 */ 0x94, 0xC7, 0x7F, 0x7A, 0x60, 0x79, 0x29, 0xBD, 0x7D, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..z`y)}3......\n\t/* 1560 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x9C, 0x38, 0x58, 0xE5, 0xC3, 0x83, 0x29, 0x4B,   // .........8X.)K\n\t/* 1570 */ 0xAD, 0xFE, 0x5E, 0x4D, 0x7F, 0x46, 0xC3, 0x58, 0x97, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ^M.FX.3......\n\t/* 1580 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xFF, 0x33, 0xD8, 0x9E, 0x92, 0x4F, 0x36, 0x4F,   // ........3..O6O\n\t/* 1590 */ 0xB3, 0x70, 0x86, 0x83, 0xA4, 0xF1, 0x32, 0x75, 0xAD, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // p..2u3......\n\t/* 15A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xE7, 0x82, 0x08, 0x2D, 0xE7, 0xA4, 0x3B, 0x42,   // ..........-;B\n\t/* 15B0 */ 0x8C, 0xCC, 0x70, 0xD9, 0x1E, 0x01, 0x58, 0xB1, 0xC8, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .p..X3......\n\t/* 15C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x2C, 0x62, 0xE7, 0x6E, 0xD8, 0x18, 0x05, 0x40,   // ........,bn..@\n\t/* 15D0 */ 0x9F, 0xB7, 0x92, 0xDB, 0x64, 0x4A, 0x27, 0x9B, 0xD9, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..dJ'.3......\n\t/* 15E0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x52, 0x1D, 0x46, 0xF7, 0x2B, 0x7C, 0xB2, 0x43,   // ........R.F+|C\n\t/* 15F0 */ 0x87, 0x44, 0xEA, 0x95, 0x8E, 0x0B, 0xD0, 0x9A, 0xEC, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D....3......\n\t/* 1600 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x40, 0x80, 0x0B, 0xA3, 0x8A, 0xD6, 0x3F, 0x42,   // ........@...?B\n\t/* 1610 */ 0xB0, 0xB5, 0x9C, 0xE2, 0x92, 0xEA, 0x5A, 0x8F, 0xFE, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z.3......\n\t/* 1620 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE3, 0x11, 0x9F, 0x1B, 0x5C, 0xC8, 0x1B, 0x4E,   // ...........\\.N\n\t/* 1630 */ 0xBB, 0x29, 0x87, 0x9A, 0xD2, 0xC9, 0x09, 0xE3, 0x13, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // )....4......\n\t/* 1640 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x6B, 0x1C, 0x98, 0xDC, 0x8E, 0xFC, 0x0F, 0x42,   // ........k....B\n\t/* 1650 */ 0xAA, 0x43, 0xF8, 0xF3, 0x3E, 0x5C, 0x09, 0x23, 0x24, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // C>\\.#$4......\n\t/* 1660 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE6, 0xF3, 0xE1, 0xEF, 0xA2, 0xAE, 0x44, 0x41,   // ........DA\n\t/* 1670 */ 0xA2, 0x08, 0x32, 0xAA, 0x87, 0x2B, 0x65, 0x45, 0x36, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2.+eE64......\n\t/* 1680 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xFA, 0x3A, 0x1C, 0x77, 0xC5, 0x50, 0x3F, 0x44,   // ........:.wP?D\n\t/* 1690 */ 0xB1, 0x51, 0xFF, 0x25, 0x46, 0xD8, 0x63, 0xA0, 0x4A, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Q%Fc.J4......\n\t/* 16A0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x49, 0x26, 0x76, 0x8C, 0xD1, 0x97, 0x53, 0x49,   // ........I&v..SI\n\t/* 16B0 */ 0xAD, 0x27, 0xB7, 0xE2, 0xC2, 0x5B, 0x97, 0x2E, 0x5E, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // '[..^4......\n\t/* 16C0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x9C, 0xDA, 0x22, 0xB3, 0xE2, 0xA2, 0x58, 0x40,   // .........\"X@\n\t/* 16D0 */ 0x9E, 0x4E, 0xF5, 0x9A, 0x69, 0x70, 0xBD, 0x69, 0x75, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .N.ipiu4......\n\t/* 16E0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x4A, 0x12, 0x5D, 0x4A, 0x20, 0xE6, 0xBA, 0x44,   // ........J.]J D\n\t/* 16F0 */ 0xB6, 0xFF, 0x65, 0x89, 0x61, 0xB3, 0x3B, 0x9A, 0x93, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // e.a;..4......\n\t/* 1700 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xD1, 0x28, 0x7A, 0x42, 0x7C, 0xD1, 0xBF, 0x4A,   // ........(zB|ѿJ\n\t/* 1710 */ 0xB7, 0x17, 0x32, 0xC7, 0x80, 0xBA, 0x6F, 0x07, 0xAB, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2.o.4......\n\t/* 1720 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xF1, 0x9F, 0xC7, 0x00, 0x50, 0x68, 0x3D, 0x44,   // ..........Ph=D\n\t/* 1730 */ 0xBF, 0x61, 0x71, 0xCD, 0xE0, 0xDE, 0x30, 0x5F, 0xC8, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // aq0_4......\n\t/* 1740 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x38, 0xFB, 0x3A, 0xB1, 0x79, 0xCD, 0xE5, 0x4A,   // ........8:yJ\n\t/* 1750 */ 0x9F, 0x7F, 0xEE, 0xD0, 0x58, 0xD7, 0x50, 0xCA, 0xDE, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..XP4......\n\t/* 1760 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x0E, 0xC1, 0x3A, 0xE1, 0xD0, 0x75, 0xFF, 0x4A,   // .........:uJ\n\t/* 1770 */ 0xA0, 0xCD, 0x76, 0x49, 0x82, 0xCF, 0x54, 0x1C, 0xF3, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .vI.T.4......\n\t/* 1780 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xF0, 0xFA, 0x4E, 0xAC, 0x1F, 0xF8, 0x61, 0x4F,   // ........N.aO\n\t/* 1790 */ 0xBD, 0xF7, 0xEA, 0x32, 0xB0, 0x2A, 0xB1, 0x17, 0x09, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 2*..5......\n\t/* 17A0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xC6, 0xB1, 0xF5, 0xD9, 0x86, 0x53, 0x5A, 0x49,   // ........Ʊ.SZI\n\t/* 17B0 */ 0x88, 0xF9, 0x9A, 0xD6, 0xB4, 0x1A, 0xC9, 0xB3, 0x24, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..ִ.ɳ$5......\n\t/* 17C0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE2, 0x38, 0xB5, 0x44, 0x34, 0xFB, 0x32, 0x47,   // ........8D42G\n\t/* 17D0 */ 0x81, 0xE4, 0x64, 0x4C, 0x17, 0xD2, 0xE7, 0x46, 0x35, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .dL.F55......\n\t/* 17E0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xA0, 0xBF, 0x73, 0x93, 0xB3, 0x97, 0x87, 0x45,   // .........s...E\n\t/* 17F0 */ 0xAB, 0x73, 0x30, 0x93, 0x44, 0x61, 0xD5, 0x5C, 0x56, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // s0.Da\\V5......\n\t/* 1800 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xB4, 0x6E, 0x28, 0xAA, 0x6F, 0x55, 0xEB, 0x4E,   // ........n(oUN\n\t/* 1810 */ 0x96, 0x7C, 0xC1, 0xB7, 0x71, 0xB7, 0x67, 0x3E, 0x76, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|qg>v5......\n\t/* 1820 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x56, 0x82, 0xCC, 0x7C, 0xAA, 0xFB, 0xC6, 0x49,   // ........V.|I\n\t/* 1830 */ 0xB2, 0xA9, 0xF5, 0xAF, 0xB4, 0x25, 0x7C, 0xD2, 0x97, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // %|.5......\n\t/* 1840 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x17, 0xFE, 0x3D, 0xC5, 0x00, 0xCC, 0x67, 0x49,   // .........=.gI\n\t/* 1850 */ 0xB1, 0x88, 0xA0, 0x88, 0xA9, 0x65, 0x49, 0x4D, 0xBA, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...eIM5......\n\t/* 1860 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x7D, 0xA8, 0x16, 0x28, 0xED, 0xE1, 0x97, 0x40,   // ........}.(.@\n\t/* 1870 */ 0xB3, 0x11, 0xE2, 0x34, 0x1C, 0x57, 0xB1, 0x79, 0xD9, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4.Wy5......\n\t/* 1880 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x08, 0xF9, 0xC0, 0x67, 0x4F, 0x18, 0x64, 0x4F,   // .........gO.dO\n\t/* 1890 */ 0x82, 0x50, 0x12, 0xDB, 0x79, 0x7A, 0xB3, 0xC3, 0xF9, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .P.yz5......\n\t/* 18A0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x7A, 0x4E, 0xCE, 0x7B, 0x80, 0xDD, 0x82, 0x46,   // ........zN{..F\n\t/* 18B0 */ 0x98, 0xFA, 0xF9, 0x93, 0x72, 0x58, 0x03, 0xD2, 0x1B, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..rX..6......\n\t/* 18C0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0A, 0x0C, 0xC1, 0x1E, 0xF6, 0x54, 0x3E, 0x45,   // ...........T>E\n\t/* 18D0 */ 0xB8, 0x5A, 0x6F, 0xA1, 0xBB, 0xFE, 0xA9, 0xB7, 0x3D, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Zo=6......\n\t/* 18E0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xBF, 0xB5, 0xD2, 0x87, 0x7B, 0xD4, 0xFB, 0x41,   // .........{A\n\t/* 18F0 */ 0xAF, 0x62, 0x71, 0xC3, 0x82, 0xF5, 0xCC, 0x85, 0x62, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // bq..b6......\n\t/* 1900 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xA9, 0x50, 0xFE, 0x3C, 0x03, 0x0E, 0x29, 0x4B,   // ........P<..)K\n\t/* 1910 */ 0x97, 0x54, 0x9F, 0x19, 0x3F, 0x07, 0xB7, 0x1F, 0x8E, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .T..?...6......\n\t/* 1920 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x57, 0x9E, 0xE4, 0x39, 0x68, 0xAE, 0xE3, 0x4E,   // ........W.9hN\n\t/* 1930 */ 0xB0, 0x98, 0x26, 0x48, 0x0D, 0xF3, 0xDA, 0x96, 0xB4, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .&H..6......\n\t/* 1940 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x17, 0x21, 0xAA, 0x15, 0x79, 0x8F, 0xA8, 0x49,   // .........!.y.I\n\t/* 1950 */ 0x83, 0x17, 0x75, 0x30, 0x26, 0xD6, 0xA0, 0x54, 0xDF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..u0&.T6......\n\t/* 1960 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0E, 0xD6, 0xBF, 0xCF, 0x5F, 0x0B, 0x7D, 0x42,   // .........ֿ_.}B\n\t/* 1970 */ 0x91, 0x7C, 0xA4, 0xDF, 0x42, 0xA8, 0x0E, 0x44, 0x03, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|B.D.7......\n\t/* 1980 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x81, 0xCC, 0x12, 0x70, 0x87, 0x88, 0xE9, 0x42,   // ..........p..B\n\t/* 1990 */ 0xB1, 0x7D, 0x4E, 0x5E, 0x42, 0x76, 0x0F, 0x0D, 0x27, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // }N^Bv..'7......\n\t/* 19A0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xB6, 0x7E, 0x9C, 0xDE, 0x85, 0x5A, 0x0D, 0x42,   // ........~..Z.B\n\t/* 19B0 */ 0x97, 0x03, 0xFF, 0xF1, 0x1B, 0xDD, 0x4D, 0x43, 0x50, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...MCP7......\n\t/* 19C0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0C, 0xFC, 0xC0, 0x67, 0xBA, 0xDE, 0x1B, 0x40,   // .........g.@\n\t/* 19D0 */ 0xBF, 0x8B, 0x9C, 0x8A, 0xD8, 0x39, 0x58, 0x04, 0x6F, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...9X.o7......\n\t/* 19E0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x36, 0x5D, 0xE6, 0xC3, 0x1F, 0x14, 0x2F, 0x4D,   // ........6]../M\n\t/* 19F0 */ 0xA3, 0x03, 0xA8, 0x42, 0xEE, 0x75, 0x6A, 0x29, 0x82, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Buj).7......\n\t/* 1A00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xCB, 0xBC, 0xAA, 0x9C, 0xB1, 0x61, 0x4B, 0x4B,   // ........˼.aKK\n\t/* 1A10 */ 0x8B, 0xEC, 0xD1, 0x0A, 0x3C, 0x3A, 0xC2, 0xCE, 0x94, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..<:.7......\n\t/* 1A20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x6E, 0xEA, 0x14, 0xE9, 0xFA, 0xA5, 0x39, 0x44,   // ........n.9D\n\t/* 1A30 */ 0xA3, 0x94, 0xA9, 0xBB, 0x32, 0x93, 0xCA, 0x09, 0xA6, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2..7......\n\t/* 1A40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x59, 0xCE, 0xCA, 0xD8, 0xD2, 0x33, 0xC7, 0x4A,   // ........Y3J\n\t/* 1A50 */ 0x9B, 0x1B, 0x9B, 0x72, 0x33, 0x9C, 0x51, 0xC8, 0xBA, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...r3.QȺ7......\n\t/* 1A60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x65, 0x92, 0x9D, 0xEC, 0x1E, 0x9D, 0xD0, 0x4E,   // ........e....N\n\t/* 1A70 */ 0x83, 0x8A, 0xCD, 0xC2, 0x0F, 0x25, 0x51, 0xA1, 0xCE, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...%Q7......\n\t/* 1A80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xBA, 0x1B, 0x0B, 0xD7, 0x93, 0xB8, 0x44, 0x45,   // ...........DE\n\t/* 1A90 */ 0x96, 0xE2, 0xB7, 0xA3, 0x18, 0x09, 0x1C, 0x33, 0xE2, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ⷣ...37......\n\t/* 1AA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x6F, 0x59, 0x50, 0xD4, 0x4D, 0x89, 0xE0, 0x49,   // ........oYPM.I\n\t/* 1AB0 */ 0x96, 0x6A, 0xFD, 0x39, 0xED, 0x4C, 0x4C, 0x64, 0xF9, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j9LLd7......\n\t/* 1AC0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x97, 0x41, 0x41, 0x4F, 0xC2, 0x0F, 0x01, 0x4C,   // .........AAO..L\n\t/* 1AD0 */ 0xB6, 0x8A, 0x86, 0xCB, 0xB9, 0xAC, 0x25, 0x4C, 0x17, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..˹%L.8......\n\t/* 1AE0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x10, 0x81, 0x9B, 0x82, 0x6F, 0x0E, 0x49, 0x43,   // ............o.IC\n\t/* 1AF0 */ 0xBC, 0xA4, 0x42, 0x80, 0x35, 0x77, 0x78, 0x8D, 0x2F, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // B.5wx./8......\n\t/* 1B00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xBC, 0xDA, 0x7D, 0xDA, 0xBE, 0x3F, 0x47, 0x44,   // ........}ھ?GD\n\t/* 1B10 */ 0x9E, 0x01, 0x6A, 0xB7, 0x44, 0x0B, 0x4C, 0xD4, 0x4B, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..jD.LK8......\n\t/* 1B20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x45, 0xCA, 0xBA, 0xCB, 0x6A, 0x55, 0x16, 0x44,   // ........EʺjU.D\n\t/* 1B30 */ 0xAD, 0x03, 0xBD, 0xA5, 0x98, 0xEA, 0xA7, 0xC8, 0x68, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..h8......\n\t/* 1B40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xCB, 0x06, 0x1A, 0x04, 0xB8, 0xC5, 0x72, 0x47,   // ...........rG\n\t/* 1B50 */ 0x80, 0x9F, 0x41, 0x6D, 0x03, 0xD1, 0x66, 0x54, 0x89, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Am.fT.8......\n\t/* 1B60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xE1, 0x4E, 0xE0, 0x83, 0x8D, 0xFA, 0x6D, 0x43,   // ........N..mC\n\t/* 1B70 */ 0x89, 0x94, 0xD3, 0x1A, 0x86, 0x2C, 0xAB, 0x77, 0x9F, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....,w.8......\n\t/* 1B80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x3D, 0xA2, 0xDF, 0xDE, 0xD1, 0x6E, 0xA6, 0x45,   // ........=nE\n\t/* 1B90 */ 0x85, 0xDC, 0x63, 0xCA, 0xE0, 0x54, 0x6D, 0xE6, 0xBE, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .cTm8......\n\t/* 1BA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xC1, 0x01, 0xF3, 0x6B, 0x4A, 0xB9, 0xE9, 0x43,   // .........kJC\n\t/* 1BB0 */ 0xBA, 0x31, 0xD4, 0x94, 0x59, 0x8C, 0x47, 0xFB, 0xD3, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 1.Y.G8......\n\t/* 1BC0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xE3, 0xAB, 0x34, 0xB2, 0x57, 0x08, 0x9C, 0x4F,   // ........4W..O\n\t/* 1BD0 */ 0xB0, 0x5A, 0x4D, 0xC3, 0x14, 0xF8, 0x55, 0x57, 0xE9, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ZM.UW8......\n\t/* 1BE0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x21, 0x78, 0x2A, 0xAA, 0x27, 0x18, 0x2C, 0x4C,   // ........!x*'.,L\n\t/* 1BF0 */ 0x8F, 0x1D, 0x45, 0x13, 0xA3, 0x4D, 0xDA, 0x97, 0x03, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..E.M..9......\n\t/* 1C00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x20, 0xE6, 0x1F, 0x36, 0xF4, 0x64, 0xB5, 0x41,   // ........ .6dA\n\t/* 1C10 */ 0xBA, 0x77, 0x84, 0xF8, 0xE0, 0x79, 0xB1, 0xF7, 0x1E, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // w.y.9......\n\t/* 1C20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xDF, 0xBA, 0x11, 0xBB, 0xAA, 0xD8, 0x0E, 0x47,   // ........ߺ..G\n\t/* 1C30 */ 0x93, 0x11, 0x20, 0xEA, 0xF8, 0x0F, 0xE5, 0xCC, 0x3D, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .. .=9......\n\t/* 1C40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x85, 0x88, 0xC8, 0x0B, 0x8C, 0x71, 0x1D, 0x49,   // ............q.I\n\t/* 1C50 */ 0x92, 0x1F, 0x6F, 0x21, 0x43, 0x49, 0xE7, 0x9C, 0x4E, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..o!CI.N9......\n\t/* 1C60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x4D, 0x7C, 0xFC, 0x85, 0x2E, 0xB9, 0x4B,   // .........M|..K\n\t/* 1C70 */ 0xAF, 0xD4, 0x01, 0xED, 0x14, 0x76, 0xB5, 0xE9, 0x78, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..vx9......\n\t/* 1C80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x19, 0x66, 0x0F, 0x50, 0x93, 0xEF, 0x75, 0x4B,   // .........f.P.uK\n\t/* 1C90 */ 0xBC, 0xB4, 0x82, 0x81, 0x99, 0x98, 0xA3, 0xCA, 0x9C, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....9......\n\t/* 1CA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xEB, 0xCE, 0x9B, 0x9E, 0x36, 0xE7, 0x26, 0x4F,   // ..........6&O\n\t/* 1CB0 */ 0x88, 0xDE, 0x76, 0x3F, 0x87, 0xDC, 0xC4, 0x85, 0xBE, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .v?..9......\n\t/* 1CC0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xE9, 0x54, 0x78, 0x23, 0xFC, 0x79, 0x97, 0x44,   // ........Tx#y.D\n\t/* 1CD0 */ 0xA0, 0xC1, 0xA7, 0x09, 0x69, 0x69, 0x1C, 0x6B, 0xD1, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..ii.k9......\n\t/* 1CE0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x01, 0xA3, 0xF8, 0xC8, 0xF5, 0x19, 0x32, 0x41,   // ..........2A\n\t/* 1CF0 */ 0x96, 0xCE, 0x2D, 0xE9, 0xD4, 0xAD, 0xBD, 0x33, 0xE3, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .-ԭ39......\n\t/* 1D00 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x61, 0xFD, 0x31, 0x31, 0x4F, 0x5E, 0x08, 0x43,   // ........a11O^.C\n\t/* 1D10 */ 0x8D, 0x6D, 0x62, 0xBE, 0x19, 0x87, 0xC9, 0x2C, 0xF7, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .mb..,9......\n\t/* 1D20 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x5F, 0x8B, 0xDD, 0x85, 0xA4, 0xEA, 0xF3, 0x4A,   // ........_..J\n\t/* 1D30 */ 0xA6, 0x28, 0xCC, 0xE9, 0xE7, 0x7C, 0x9A, 0x03, 0x0E, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // (|...:......\n\t/* 1D40 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x3F, 0xBF, 0xA2, 0x2C, 0x9E, 0x94, 0x6A, 0x44,   // ........?,..jD\n\t/* 1D50 */ 0x82, 0xC7, 0xE2, 0x5A, 0x15, 0xEC, 0x78, 0xC4, 0x2C, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.x,:......\n\t/* 1D60 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xE3, 0xF0, 0x77, 0x17, 0x92, 0x73, 0x98, 0x41,   // ........w..s.A\n\t/* 1D70 */ 0x97, 0xEA, 0x8A, 0xE4, 0xDE, 0x6F, 0x63, 0x81, 0x44, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..oc.D:......\n\t/* 1D80 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xCA, 0x4C, 0x3E, 0x9D, 0x72, 0xE1, 0xF1, 0x46,   // ........L>.rF\n\t/* 1D90 */ 0xA2, 0xF4, 0x1D, 0x21, 0x07, 0x05, 0x14, 0x44, 0x61, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .!...Da:......\n\t/* 1DA0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x6E, 0x6C, 0x4C, 0x73, 0xBA, 0xB0, 0x98, 0x42,   // ........nlLs.B\n\t/* 1DB0 */ 0xA8, 0x91, 0x67, 0x17, 0x72, 0xB2, 0xBD, 0x1B, 0x77, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .g.r.w:......\n\t/* 1DC0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x4B, 0xA7, 0x12, 0x69, 0xFB, 0xA5, 0x1A, 0x40,   // ........K.i.@\n\t/* 1DD0 */ 0xBF, 0xDB, 0x2E, 0x3A, 0xB4, 0x6F, 0x4B, 0x02, 0x96, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .:oK..:......\n\t/* 1DE0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x8F, 0xF0, 0x5C, 0x5B, 0x1A, 0xB8, 0x1D, 0x43,   // .........\\[..C\n\t/* 1DF0 */ 0xB0, 0x80, 0x34, 0x50, 0xD8, 0x62, 0x05, 0x65, 0xAB, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4Pb.e:......\n\t/* 1E00 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xF3, 0x7D, 0x6D, 0xE0, 0xD0, 0xAA, 0x9D, 0x41,   // ........}mЪ.A\n\t/* 1E10 */ 0x8D, 0xFB, 0x0A, 0xC3, 0x7E, 0x2B, 0xDF, 0x39, 0xC1, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..~+9:......\n\t/* 1E20 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xFE, 0x34, 0x98, 0x05, 0xEA, 0xA8, 0xFF, 0x4B,   // ........4..K\n\t/* 1E30 */ 0xB6, 0x7B, 0x4D, 0x00, 0x6B, 0x54, 0x47, 0xD3, 0xDC, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {M.kTG:......\n\t/* 1E40 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xD4, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........ ......\n\t/* 1E50 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x63, 0x45, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // .[....cE......\n\t/* 1E60 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........ ......\n\t/* 1E70 */ 0x80, 0xE2, 0x9F, 0x57, 0x00, 0x00, 0x00, 0x00, 0x39, 0x38, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // ..W....98......\n\t/* 1E80 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .........!......\n\t/* 1E90 */ 0x00, 0x7A, 0x60, 0x52, 0x00, 0x00, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x19, 0x00, 0x00,   // .z`R.....%......\n\t/* 1EA0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........-!......\n\t/* 1EB0 */ 0x80, 0xD2, 0x89, 0x50, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x23, 0x00, 0x00, 0x32, 0x15, 0x00, 0x00,   // ..P....#..2...\n\t/* 1EC0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........E!......\n\t/* 1ED0 */ 0x80, 0xFC, 0x62, 0x4D, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x1D, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .bM..........\n\t/* 1EE0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........d!......\n\t/* 1EF0 */ 0x00, 0x31, 0x1B, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x72, 0x17, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .1.J....r......\n\t/* 1F00 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ........03612-00\n\t/* 1F10 */ 0x32, 0x30, 0x36, 0x2D, 0x35, 0x35, 0x36, 0x2D, 0x31, 0x32, 0x33, 0x37, 0x32, 0x37, 0x2D, 0x30,   // 206-556-123727-0\n\t/* 1F20 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 1F30 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // 0-2972018.Window\n\t/* 1F40 */ 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // s.Windows Server\n\t/* 1F50 */ 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x30, 0x39,   //  2019.03612-0009\n\t/* 1F60 */ 0x36, 0x2D, 0x31, 0x39, 0x39, 0x2D, 0x37, 0x39, 0x39, 0x31, 0x38, 0x38, 0x2D, 0x30, 0x33, 0x2D,   // 6-199-799188-03-\n\t/* 1F70 */ 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D,   // 1033-17763.0000-\n\t/* 1F80 */ 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30,   // 2972018.Office20\n\t/* 1F90 */ 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x30,   // 10.Office 2010.0\n\t/* 1FA0 */ 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x32, 0x34, 0x30, 0x2D, 0x37,   // 3612-00206-240-7\n\t/* 1FB0 */ 0x31, 0x39, 0x36, 0x33, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37,   // 19639-03-1033-17\n\t/* 1FC0 */ 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38,   // 763.0000-2972018\n\t/* 1FD0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69,   // .Office2013.Offi\n\t/* 1FE0 */ 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ce 2013.03612-00\n\t/* 1FF0 */ 0x32, 0x30, 0x36, 0x2D, 0x34, 0x33, 0x38, 0x2D, 0x30, 0x30, 0x34, 0x35, 0x33, 0x32, 0x2D, 0x30,   // 206-438-004532-0\n\t/* 2000 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 2010 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // 0-2972018.Office\n\t/* 2020 */ 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36,   // 2016.Office 2016\n\t/* 2030 */ 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x33, 0x38, 0x35, 0x38, 0x2D, 0x30, 0x35, 0x33,   // .03612-03858-053\n\t/* 2040 */ 0x2D, 0x30, 0x38, 0x39, 0x35, 0x31, 0x36, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D,   // -089516-03-1033-\n\t/* 2050 */ 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30,   // 17763.0000-29720\n\t/* 2060 */ 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x47, 0x6F, 0x76, 0x00, 0x57,   // 18.WinChinaGov.W\n\t/* 2070 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20,   // indows 10 China \n\t/* 2080 */ 0x47, 0x6F, 0x76, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32,   // Government.03612\n\t/* 2090 */ 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x36, 0x38, 0x34, 0x2D, 0x31, 0x33, 0x37, 0x36, 0x36,   // -00206-684-13766\n\t/* 20A0 */ 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E,   // 9-03-1033-17763.\n\t/* 20B0 */ 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66,   // 0000-2972018.Off\n\t/* 20C0 */ 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32,   // ice2019.Office 2\n\t/* 20D0 */ 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x31,   // 019.Windows 10 1\n\t/* 20E0 */ 0x38, 0x30, 0x39, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // 809 / Server 201\n\t/* 20F0 */ 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x31, 0x36, 0x30,   // 9.Windows 10 160\n\t/* 2100 */ 0x37, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00,   // 7 / Server 2016.\n\t/* 2110 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x2F, 0x20, 0x53, 0x65,   // Windows 8.1 / Se\n\t/* 2120 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x00, 0x57, 0x69, 0x6E,   // rver 2012 R2.Win\n\t/* 2130 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // dows 8 / Server \n\t/* 2140 */ 0x32, 0x30, 0x31, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x2F,   // 2012.Windows 7 /\n\t/* 2150 */ 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20,   //  Server 2008 R2 \n\t/* 2160 */ 0x53, 0x50, 0x31, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74,   // SP1.Windows Vist\n\t/* 2170 */ 0x61, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // a / Server 2008 \n\t/* 2180 */ 0x53, 0x50, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x00, 0x4F, 0x66, 0x66, 0x69,   // SP2.Windows.Offi\n\t/* 2190 */ 0x63, 0x65, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31,   // ce2010.Office201\n\t/* 21A0 */ 0x33, 0x2B, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // 3+.Windows Serve\n\t/* 21B0 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31,   // r 2019.Windows 1\n\t/* 21C0 */ 0x30, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00,   // 0 2019 (Volume).\n\t/* 21D0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x55, 0x6E, 0x6B, 0x6E, 0x6F,   // Windows 10 Unkno\n\t/* 21E0 */ 0x77, 0x6E, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // wn (Volume).Wind\n\t/* 21F0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20, 0x47, 0x6F, 0x76,   // ows 10 China Gov\n\t/* 2200 */ 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ernment.Windows \n\t/* 2210 */ 0x31, 0x30, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29,   // 10 2016 (Volume)\n\t/* 2220 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x28, 0x52, 0x65, 0x74,   // .Windows 10 (Ret\n\t/* 2230 */ 0x61, 0x69, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // ail).Windows 10 \n\t/* 2240 */ 0x32, 0x30, 0x31, 0x35, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69,   // 2015 (Volume).Wi\n\t/* 2250 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ndows 7.Windows \n\t/* 2260 */ 0x38, 0x20, 0x28, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // 8 (Retail).Windo\n\t/* 2270 */ 0x77, 0x73, 0x20, 0x38, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69,   // ws 8 (Volume).Wi\n\t/* 2280 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x28, 0x52, 0x65, 0x74, 0x61, 0x69,   // ndows 8.1 (Retai\n\t/* 2290 */ 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x28,   // l).Windows 8.1 (\n\t/* 22A0 */ 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // Volume).Windows \n\t/* 22B0 */ 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // Preview.Windows \n\t/* 22C0 */ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x41, 0x20, 0x28, 0x57,   // Server 2008 A (W\n\t/* 22D0 */ 0x65, 0x62, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x48, 0x50, 0x43, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // eb and HPC).Wind\n\t/* 22E0 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 22F0 */ 0x42, 0x20, 0x28, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x61, 0x6E, 0x64, 0x20,   // B (Standard and \n\t/* 2300 */ 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // Enterprise).Wind\n\t/* 2310 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2320 */ 0x43, 0x20, 0x28, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x29, 0x00, 0x57,   // C (Datacenter).W\n\t/* 2330 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 2340 */ 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x41, 0x20, 0x28, 0x57, 0x65, 0x62, 0x20, 0x61, 0x6E, 0x64,   // 08 R2 A (Web and\n\t/* 2350 */ 0x20, 0x48, 0x50, 0x43, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   //  HPC).Windows Se\n\t/* 2360 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x42, 0x20, 0x28,   // rver 2008 R2 B (\n\t/* 2370 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x45, 0x6E, 0x74,   // Standard and Ent\n\t/* 2380 */ 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // erprise).Windows\n\t/* 2390 */ 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20,   //  Server 2008 R2 \n\t/* 23A0 */ 0x43, 0x20, 0x28, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x29, 0x00, 0x57,   // C (Datacenter).W\n\t/* 23B0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 23C0 */ 0x31, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // 12.Windows Serve\n\t/* 23D0 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // r 2012 R2.Window\n\t/* 23E0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x57, 0x69,   // s Server 2016.Wi\n\t/* 23F0 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x50, 0x72, 0x65,   // ndows Server Pre\n\t/* 2400 */ 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // view.Windows Vis\n\t/* 2410 */ 0x74, 0x61, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F,   // ta.Office 2010.O\n\t/* 2420 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // ffice 2013.Offic\n\t/* 2430 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65,   // e 2013 (Pre-Rele\n\t/* 2440 */ 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36,   // ase).Office 2016\n\t/* 2450 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E,   // .Office 2019.Win\n\t/* 2460 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39,   // dows Server 2019\n\t/* 2470 */ 0x20, 0x41, 0x52, 0x4D, 0x36, 0x34, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   //  ARM64.Windows S\n\t/* 2480 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x41, 0x7A, 0x75, 0x72, 0x65,   // erver 2019 Azure\n\t/* 2490 */ 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   //  Core.Windows Se\n\t/* 24A0 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65,   // rver 2019 Datace\n\t/* 24B0 */ 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72,   // nter.Windows Ser\n\t/* 24C0 */ 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69,   // ver 2019 Essenti\n\t/* 24D0 */ 0x61, 0x6C, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76,   // als.Windows Serv\n\t/* 24E0 */ 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64,   // er 2019 Standard\n\t/* 24F0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 2500 */ 0x32, 0x30, 0x31, 0x39, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20,   // 2019 Datacenter \n\t/* 2510 */ 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x43, 0x68, 0x61,   // (Semi-Annual Cha\n\t/* 2520 */ 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   // nnel).Windows Se\n\t/* 2530 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // rver 2019 Standa\n\t/* 2540 */ 0x72, 0x64, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61, 0x6C, 0x20,   // rd (Semi-Annual \n\t/* 2550 */ 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Channel).Windows\n\t/* 2560 */ 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4C,   //  10 Enterprise L\n\t/* 2570 */ 0x54, 0x53, 0x43, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // TSC 2019.Windows\n\t/* 2580 */ 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4C,   //  10 Enterprise L\n\t/* 2590 */ 0x54, 0x53, 0x43, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // TSC 2019 N.Windo\n\t/* 25A0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65,   // ws 10 Enterprise\n\t/* 25B0 */ 0x20, 0x47, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   //  G.Windows 10 En\n\t/* 25C0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x47, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64,   // terprise GN.Wind\n\t/* 25D0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73,   // ows 10 Enterpris\n\t/* 25E0 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x4C, 0x54, 0x53, 0x42, 0x00, 0x57, 0x69, 0x6E, 0x64,   // e 2016 LTSB.Wind\n\t/* 25F0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73,   // ows 10 Enterpris\n\t/* 2600 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x4C, 0x54, 0x53, 0x42, 0x20, 0x4E, 0x00, 0x57, 0x69,   // e 2016 LTSB N.Wi\n\t/* 2610 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x00, 0x57, 0x69,   // ndows 10 Home.Wi\n\t/* 2620 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x20, 0x43, 0x6F,   // ndows 10 Home Co\n\t/* 2630 */ 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57,   // untry Specific.W\n\t/* 2640 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x20, 0x4E,   // indows 10 Home N\n\t/* 2650 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65,   // .Windows 10 Home\n\t/* 2660 */ 0x20, 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65,   //  Single Language\n\t/* 2670 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x64, 0x75, 0x63,   // .Windows 10 Educ\n\t/* 2680 */ 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30,   // ation.Windows 10\n\t/* 2690 */ 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E,   //  Education N.Win\n\t/* 26A0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 26B0 */ 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   // se.Windows 10 En\n\t/* 26C0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x4C, 0x54,   // terprise 2015 LT\n\t/* 26D0 */ 0x53, 0x42, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   // SB.Windows 10 En\n\t/* 26E0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x4C, 0x54,   // terprise 2015 LT\n\t/* 26F0 */ 0x53, 0x42, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // SB N.Windows 10 \n\t/* 2700 */ 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E,   // Enterprise N.Win\n\t/* 2710 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // dows 10 Professi\n\t/* 2720 */ 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E,   // onal Workstation\n\t/* 2730 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66,   // .Windows 10 Prof\n\t/* 2740 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x74, 0x61,   // essional Worksta\n\t/* 2750 */ 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31,   // tion N.Windows 1\n\t/* 2760 */ 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57,   // 0 Professional.W\n\t/* 2770 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // indows 10 Profes\n\t/* 2780 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E,   // sional Education\n\t/* 2790 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66,   // .Windows 10 Prof\n\t/* 27A0 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69,   // essional Educati\n\t/* 27B0 */ 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // on N.Windows 10 \n\t/* 27C0 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00, 0x57,   // Professional N.W\n\t/* 27D0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // indows 10 Profes\n\t/* 27E0 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57,   // sional Preview.W\n\t/* 27F0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70,   // indows 10 Enterp\n\t/* 2800 */ 0x72, 0x69, 0x73, 0x65, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E,   // rise Preview.Win\n\t/* 2810 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 2820 */ 0x73, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x20, 0x44,   // se for Virtual D\n\t/* 2830 */ 0x65, 0x73, 0x6B, 0x74, 0x6F, 0x70, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // esktops.Windows \n\t/* 2840 */ 0x31, 0x30, 0x20, 0x52, 0x65, 0x6D, 0x6F, 0x74, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // 10 Remote Server\n\t/* 2850 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x53, 0x20, 0x28, 0x4C,   // .Windows 10 S (L\n\t/* 2860 */ 0x65, 0x61, 0x6E, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45,   // ean).Windows 7 E\n\t/* 2870 */ 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // nterprise.Window\n\t/* 2880 */ 0x73, 0x20, 0x37, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x45,   // s 7 Enterprise E\n\t/* 2890 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72,   // .Windows 7 Enter\n\t/* 28A0 */ 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // prise N.Windows \n\t/* 28B0 */ 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57,   // 7 Professional.W\n\t/* 28C0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // indows 7 Profess\n\t/* 28D0 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ional E.Windows \n\t/* 28E0 */ 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E,   // 7 Professional N\n\t/* 28F0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64,   // .Windows 7 Embed\n\t/* 2900 */ 0x64, 0x65, 0x64, 0x20, 0x50, 0x4F, 0x53, 0x52, 0x65, 0x61, 0x64, 0x79, 0x00, 0x57, 0x69, 0x6E,   // ded POSReady.Win\n\t/* 2910 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // dows 7 Embedded \n\t/* 2920 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Standard.Windows\n\t/* 2930 */ 0x20, 0x37, 0x20, 0x54, 0x68, 0x69, 0x6E, 0x50, 0x43, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  7 ThinPC.Window\n\t/* 2940 */ 0x73, 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // s 8 Core.Windows\n\t/* 2950 */ 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20,   //  8 Core Country \n\t/* 2960 */ 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Specific.Windows\n\t/* 2970 */ 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  8 Core N.Window\n\t/* 2980 */ 0x73, 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20,   // s 8 Core Single \n\t/* 2990 */ 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Language.Windows\n\t/* 29A0 */ 0x20, 0x38, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20,   //  8 Professional \n\t/* 29B0 */ 0x57, 0x4D, 0x43, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6D,   // WMC.Windows 8 Em\n\t/* 29C0 */ 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20,   // bedded Industry \n\t/* 29D0 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E,   // Professional.Win\n\t/* 29E0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // dows 8 Embedded \n\t/* 29F0 */ 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72,   // Industry Enterpr\n\t/* 2A00 */ 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6E,   // ise.Windows 8 En\n\t/* 2A10 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // terprise.Windows\n\t/* 2A20 */ 0x20, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00,   //  8 Enterprise N.\n\t/* 2A30 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // Windows 8 Profes\n\t/* 2A40 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38,   // sional.Windows 8\n\t/* 2A50 */ 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00,   //  Professional N.\n\t/* 2A60 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65,   // Windows 8.1 Core\n\t/* 2A70 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72,   // .Windows 8.1 Cor\n\t/* 2A80 */ 0x65, 0x20, 0x41, 0x52, 0x4D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E,   // e ARM.Windows 8.\n\t/* 2A90 */ 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53,   // 1 Core Country S\n\t/* 2AA0 */ 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // pecific.Windows \n\t/* 2AB0 */ 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // 8.1 Core N.Windo\n\t/* 2AC0 */ 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x53, 0x69, 0x6E, 0x67,   // ws 8.1 Core Sing\n\t/* 2AD0 */ 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // le Language.Wind\n\t/* 2AE0 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // ows 8.1 Professi\n\t/* 2AF0 */ 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6E, 0x74, 0x00, 0x57, 0x69, 0x6E,   // onal Student.Win\n\t/* 2B00 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // dows 8.1 Profess\n\t/* 2B10 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6E, 0x74, 0x20, 0x4E, 0x00,   // ional Student N.\n\t/* 2B20 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66,   // Windows 8.1 Prof\n\t/* 2B30 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x4D, 0x43, 0x00, 0x57, 0x69, 0x6E,   // essional WMC.Win\n\t/* 2B40 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F,   // dows 8.1 Core Co\n\t/* 2B50 */ 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // nnected.Windows \n\t/* 2B60 */ 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74,   // 8.1 Core Connect\n\t/* 2B70 */ 0x65, 0x64, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69,   // ed Country Speci\n\t/* 2B80 */ 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20,   // fic.Windows 8.1 \n\t/* 2B90 */ 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x4E,   // Core Connected N\n\t/* 2BA0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72,   // .Windows 8.1 Cor\n\t/* 2BB0 */ 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x53, 0x69, 0x6E, 0x67,   // e Connected Sing\n\t/* 2BC0 */ 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // le Language.Wind\n\t/* 2BD0 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // ows 8.1 Enterpri\n\t/* 2BE0 */ 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45,   // se.Windows 8.1 E\n\t/* 2BF0 */ 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64,   // nterprise N.Wind\n\t/* 2C00 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // ows 8.1 Professi\n\t/* 2C10 */ 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31,   // onal.Windows 8.1\n\t/* 2C20 */ 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00,   //  Professional N.\n\t/* 2C30 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6D, 0x62, 0x65,   // Windows 8.1 Embe\n\t/* 2C40 */ 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x50, 0x72,   // dded Industry Pr\n\t/* 2C50 */ 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // ofessional.Windo\n\t/* 2C60 */ 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // ws 8.1 Embedded \n\t/* 2C70 */ 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x41, 0x75, 0x74, 0x6F, 0x6D, 0x6F, 0x74,   // Industry Automot\n\t/* 2C80 */ 0x69, 0x76, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20,   // ive.Windows 8.1 \n\t/* 2C90 */ 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72,   // Embedded Industr\n\t/* 2CA0 */ 0x79, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E,   // y Enterprise.Win\n\t/* 2CB0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 2CC0 */ 0x73, 0x65, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // se Preview.Windo\n\t/* 2CD0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E,   // ws 10 Profession\n\t/* 2CE0 */ 0x61, 0x6C, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // al Preview.Windo\n\t/* 2CF0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E,   // ws 10 Profession\n\t/* 2D00 */ 0x61, 0x6C, 0x20, 0x57, 0x4D, 0x43, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57,   // al WMC Preview.W\n\t/* 2D10 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x78, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69,   // indows 8.x Previ\n\t/* 2D20 */ 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x78, 0x20, 0x50,   // ew.Windows 8.x P\n\t/* 2D30 */ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x41, 0x52, 0x4D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // review ARM.Windo\n\t/* 2D40 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x57,   // ws Server 2008 W\n\t/* 2D50 */ 0x65, 0x62, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // eb.Windows Serve\n\t/* 2D60 */ 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x20, 0x43,   // r 2008 Compute C\n\t/* 2D70 */ 0x6C, 0x75, 0x73, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // luster.Windows S\n\t/* 2D80 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64,   // erver 2008 Stand\n\t/* 2D90 */ 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76,   // ard.Windows Serv\n\t/* 2DA0 */ 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64,   // er 2008 Standard\n\t/* 2DB0 */ 0x20, 0x77, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56,   //  without Hyper-V\n\t/* 2DC0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 2DD0 */ 0x32, 0x30, 0x30, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00,   // 2008 Enterprise.\n\t/* 2DE0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 2DF0 */ 0x30, 0x30, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x77,   // 008 Enterprise w\n\t/* 2E00 */ 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56, 0x00, 0x57,   // ithout Hyper-V.W\n\t/* 2E10 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 2E20 */ 0x30, 0x38, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // 08 Datacenter.Wi\n\t/* 2E30 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30,   // ndows Server 200\n\t/* 2E40 */ 0x38, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74,   // 8 Datacenter wit\n\t/* 2E50 */ 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56, 0x00, 0x57, 0x69, 0x6E,   // hout Hyper-V.Win\n\t/* 2E60 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38,   // dows Server 2008\n\t/* 2E70 */ 0x20, 0x66, 0x6F, 0x72, 0x20, 0x49, 0x74, 0x61, 0x6E, 0x69, 0x75, 0x6D, 0x00, 0x57, 0x69, 0x6E,   //  for Itanium.Win\n\t/* 2E80 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x4D, 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20,   // dows MultiPoint \n\t/* 2E90 */ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x57, 0x69, 0x6E, 0x64,   // Server 2010.Wind\n\t/* 2EA0 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2EB0 */ 0x52, 0x32, 0x20, 0x57, 0x65, 0x62, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // R2 Web.Windows S\n\t/* 2EC0 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x48, 0x50,   // erver 2008 R2 HP\n\t/* 2ED0 */ 0x43, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // C Edition.Window\n\t/* 2EE0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32,   // s Server 2008 R2\n\t/* 2EF0 */ 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  Standard.Window\n\t/* 2F00 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32,   // s Server 2008 R2\n\t/* 2F10 */ 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   //  Enterprise.Wind\n\t/* 2F20 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2F30 */ 0x52, 0x32, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // R2 Datacenter.Wi\n\t/* 2F40 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30,   // ndows Server 200\n\t/* 2F50 */ 0x38, 0x20, 0x52, 0x32, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x49, 0x74, 0x61, 0x6E, 0x69, 0x75, 0x6D,   // 8 R2 for Itanium\n\t/* 2F60 */ 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   //  Enterprise.Wind\n\t/* 2F70 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20,   // ows Server 2012 \n\t/* 2F80 */ 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // Datacenter.Windo\n\t/* 2F90 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x4D,   // ws Server 2012 M\n\t/* 2FA0 */ 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x50, 0x72, 0x65, 0x6D, 0x69, 0x75,   // ultiPoint Premiu\n\t/* 2FB0 */ 0x6D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // m.Windows Server\n\t/* 2FC0 */ 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x4D, 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74,   //  2012 MultiPoint\n\t/* 2FD0 */ 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  Standard.Window\n\t/* 2FE0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x53, 0x74,   // s Server 2012 St\n\t/* 2FF0 */ 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // andard.Windows S\n\t/* 3000 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x20, 0x43, 0x6C,   // erver 2012 R2 Cl\n\t/* 3010 */ 0x6F, 0x75, 0x64, 0x20, 0x53, 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // oud Storage.Wind\n\t/* 3020 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20,   // ows Server 2012 \n\t/* 3030 */ 0x52, 0x32, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // R2 Datacenter.Wi\n\t/* 3040 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // ndows Server 201\n\t/* 3050 */ 0x32, 0x20, 0x52, 0x32, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69, 0x61, 0x6C, 0x73, 0x00,   // 2 R2 Essentials.\n\t/* 3060 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 3070 */ 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00,   // 012 R2 Standard.\n\t/* 3080 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 3090 */ 0x30, 0x31, 0x36, 0x20, 0x41, 0x7A, 0x75, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57,   // 016 Azure Core.W\n\t/* 30A0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 30B0 */ 0x31, 0x36, 0x20, 0x43, 0x6C, 0x6F, 0x75, 0x64, 0x20, 0x53, 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65,   // 16 Cloud Storage\n\t/* 30C0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 30D0 */ 0x32, 0x30, 0x31, 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00,   // 2016 Datacenter.\n\t/* 30E0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 30F0 */ 0x30, 0x31, 0x36, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69, 0x61, 0x6C, 0x73, 0x00, 0x57,   // 016 Essentials.W\n\t/* 3100 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 3110 */ 0x31, 0x36, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64,   // 16 Standard.Wind\n\t/* 3120 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20,   // ows Server 2016 \n\t/* 3130 */ 0x41, 0x52, 0x4D, 0x36, 0x34, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   // ARM64.Windows Se\n\t/* 3140 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65,   // rver 2016 Datace\n\t/* 3150 */ 0x6E, 0x74, 0x65, 0x72, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61,   // nter (Semi-Annua\n\t/* 3160 */ 0x6C, 0x20, 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // l Channel).Windo\n\t/* 3170 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x53,   // ws Server 2016 S\n\t/* 3180 */ 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E,   // tandard (Semi-An\n\t/* 3190 */ 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69,   // nual Channel).Wi\n\t/* 31A0 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // ndows Server 201\n\t/* 31B0 */ 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x50, 0x72, 0x65,   // 6 Datacenter Pre\n\t/* 31C0 */ 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // view.Windows Vis\n\t/* 31D0 */ 0x74, 0x61, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64,   // ta Business.Wind\n\t/* 31E0 */ 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74, 0x61, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65,   // ows Vista Busine\n\t/* 31F0 */ 0x73, 0x73, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // ss N.Windows Vis\n\t/* 3200 */ 0x74, 0x61, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69,   // ta Enterprise.Wi\n\t/* 3210 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74, 0x61, 0x20, 0x45, 0x6E, 0x74, 0x65,   // ndows Vista Ente\n\t/* 3220 */ 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // rprise N.Office \n\t/* 3230 */ 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69,   // Access 2010.Offi\n\t/* 3240 */ 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66,   // ce Excel 2010.Of\n\t/* 3250 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x47, 0x72, 0x6F, 0x6F, 0x76, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30,   // fice Groove 2010\n\t/* 3260 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E, 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68,   // .Office InfoPath\n\t/* 3270 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E,   //  2010.Office Mon\n\t/* 3280 */ 0x64, 0x6F, 0x20, 0x31, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // do 1 2010.Office\n\t/* 3290 */ 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F, 0x20, 0x32, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66,   //  Mondo 2 2010.Of\n\t/* 32A0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31,   // fice OneNote 201\n\t/* 32B0 */ 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x4C, 0x6F, 0x6F, 0x6B,   // 0.Office OutLook\n\t/* 32C0 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77,   //  2010.Office Pow\n\t/* 32D0 */ 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // erPoint 2010.Off\n\t/* 32E0 */ 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C,   // ice Professional\n\t/* 32F0 */ 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   //  Plus 2010.Offic\n\t/* 3300 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30,   // e Project Pro 20\n\t/* 3310 */ 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63,   // 10.Office Projec\n\t/* 3320 */ 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00,   // t Standard 2010.\n\t/* 3330 */ 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72,   // Office Publisher\n\t/* 3340 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6D, 0x61,   //  2010.Office Sma\n\t/* 3350 */ 0x6C, 0x6C, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x20, 0x42, 0x61, 0x73, 0x69,   // ll Business Basi\n\t/* 3360 */ 0x63, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53,   // cs 2010.Office S\n\t/* 3370 */ 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // tandard 2010.Off\n\t/* 3380 */ 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x65, 0x6D, 0x69, 0x75,   // ice Visio Premiu\n\t/* 3390 */ 0x6D, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69,   // m 2010.Office Vi\n\t/* 33A0 */ 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // sio Pro 2010.Off\n\t/* 33B0 */ 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // ice Visio Standa\n\t/* 33C0 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57,   // rd 2010.Office W\n\t/* 33D0 */ 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // ord 2010.Office \n\t/* 33E0 */ 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69,   // Access 2013.Offi\n\t/* 33F0 */ 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   // ce Excel 2013.Of\n\t/* 3400 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E, 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68, 0x20, 0x32, 0x30,   // fice InfoPath 20\n\t/* 3410 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4C, 0x79, 0x6E, 0x63, 0x20, 0x32,   // 13.Office Lync 2\n\t/* 3420 */ 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F,   // 013.Office Mondo\n\t/* 3430 */ 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x6E, 0x65,   //  2013.Office One\n\t/* 3440 */ 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // Note 2013.Office\n\t/* 3450 */ 0x20, 0x4F, 0x75, 0x74, 0x4C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   //  OutLook 2013.Of\n\t/* 3460 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20,   // fice PowerPoint \n\t/* 3470 */ 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66,   // 2013.Office Prof\n\t/* 3480 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30,   // essional Plus 20\n\t/* 3490 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63,   // 13.Office Projec\n\t/* 34A0 */ 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // t Pro 2013.Offic\n\t/* 34B0 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // e Project Standa\n\t/* 34C0 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // rd 2013.Office P\n\t/* 34D0 */ 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   // ublisher 2013.Of\n\t/* 34E0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30,   // fice Standard 20\n\t/* 34F0 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 13.Office Visio \n\t/* 3500 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Pro 2013.Office \n\t/* 3510 */ 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32,   // Visio Standard 2\n\t/* 3520 */ 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20,   // 013.Office Word \n\t/* 3530 */ 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65,   // 2013.Office Acce\n\t/* 3540 */ 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C,   // ss 2013 (Pre-Rel\n\t/* 3550 */ 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63,   // ease).Office Exc\n\t/* 3560 */ 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C,   // el 2013 (Pre-Rel\n\t/* 3570 */ 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x47, 0x72, 0x6F,   // ease).Office Gro\n\t/* 3580 */ 0x6F, 0x76, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65,   // ove 2013 (Pre-Re\n\t/* 3590 */ 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E,   // lease).Office In\n\t/* 35A0 */ 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65,   // foPath 2013 (Pre\n\t/* 35B0 */ 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // -Release).Office\n\t/* 35C0 */ 0x20, 0x4C, 0x79, 0x6E, 0x63, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D,   //  Lync 2013 (Pre-\n\t/* 35D0 */ 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Release).Office \n\t/* 35E0 */ 0x4D, 0x6F, 0x6E, 0x64, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D,   // Mondo 2013 (Pre-\n\t/* 35F0 */ 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Release).Office \n\t/* 3600 */ 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72,   // OneNote 2013 (Pr\n\t/* 3610 */ 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // e-Release).Offic\n\t/* 3620 */ 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28,   // e Outlook 2013 (\n\t/* 3630 */ 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66,   // Pre-Release).Off\n\t/* 3640 */ 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32,   // ice PowerPoint 2\n\t/* 3650 */ 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65,   // 013 (Pre-Release\n\t/* 3660 */ 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // ).Office Profess\n\t/* 3670 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20,   // ional Plus 2013 \n\t/* 3680 */ 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66,   // (Pre-Release).Of\n\t/* 3690 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F,   // fice Project Pro\n\t/* 36A0 */ 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61,   //  2013 (Pre-Relea\n\t/* 36B0 */ 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65,   // se).Office Proje\n\t/* 36C0 */ 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33,   // ct Standard 2013\n\t/* 36D0 */ 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F,   //  (Pre-Release).O\n\t/* 36E0 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20,   // ffice Publisher \n\t/* 36F0 */ 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73,   // 2013 (Pre-Releas\n\t/* 3700 */ 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // e).Office Visio \n\t/* 3710 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65,   // Pro 2013 (Pre-Re\n\t/* 3720 */ 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69,   // lease).Office Vi\n\t/* 3730 */ 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31,   // sio Standard 201\n\t/* 3740 */ 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00,   // 3 (Pre-Release).\n\t/* 3750 */ 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33,   // Office Word 2013\n\t/* 3760 */ 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F,   //  (Pre-Release).O\n\t/* 3770 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31,   // ffice Access 201\n\t/* 3780 */ 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32,   // 6.Office Excel 2\n\t/* 3790 */ 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F,   // 016.Office Mondo\n\t/* 37A0 */ 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E,   //  2016.Office Mon\n\t/* 37B0 */ 0x64, 0x6F, 0x20, 0x52, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // do R 2016.Office\n\t/* 37C0 */ 0x20, 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   //  OneNote 2016.Of\n\t/* 37D0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31,   // fice Outlook 201\n\t/* 37E0 */ 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x70, 0x6F,   // 6.Office Powerpo\n\t/* 37F0 */ 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // int 2016.Office \n\t/* 3800 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75,   // Professional Plu\n\t/* 3810 */ 0x73, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72,   // s 2016.Office Pr\n\t/* 3820 */ 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F,   // oject Pro 2016.O\n\t/* 3830 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72,   // ffice Project Pr\n\t/* 3840 */ 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // o 2016 C2R.Offic\n\t/* 3850 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // e Project Standa\n\t/* 3860 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // rd 2016.Office P\n\t/* 3870 */ 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20,   // roject Standard \n\t/* 3880 */ 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // 2016 C2R.Office \n\t/* 3890 */ 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F,   // Publisher 2016.O\n\t/* 38A0 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6B, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20,   // ffice Skype for \n\t/* 38B0 */ 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // Business 2016.Of\n\t/* 38C0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30,   // fice Standard 20\n\t/* 38D0 */ 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 16.Office Visio \n\t/* 38E0 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Pro 2016.Office \n\t/* 38F0 */ 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43,   // Visio Pro 2016 C\n\t/* 3900 */ 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 2R.Office Visio \n\t/* 3910 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // Standard 2016.Of\n\t/* 3920 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64,   // fice Visio Stand\n\t/* 3930 */ 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66,   // ard 2016 C2R.Off\n\t/* 3940 */ 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // ice Word 2016.Of\n\t/* 3950 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61,   // fice Professiona\n\t/* 3960 */ 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x43, 0x32, 0x52, 0x20,   // l Plus 2019 C2R \n\t/* 3970 */ 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // Preview.Office P\n\t/* 3980 */ 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20,   // roject Pro 2019 \n\t/* 3990 */ 0x43, 0x32, 0x52, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66, 0x66, 0x69,   // C2R Preview.Offi\n\t/* 39A0 */ 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31,   // ce Visio Pro 201\n\t/* 39B0 */ 0x39, 0x20, 0x43, 0x32, 0x52, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66,   // 9 C2R Preview.Of\n\t/* 39C0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39,   // fice Access 2019\n\t/* 39D0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30,   // .Office Excel 20\n\t/* 39E0 */ 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F,   // 19.Office Outloo\n\t/* 39F0 */ 0x6B, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F,   // k 2019.Office Po\n\t/* 3A00 */ 0x77, 0x65, 0x72, 0x70, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66,   // werpoint 2019.Of\n\t/* 3A10 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61,   // fice Professiona\n\t/* 3A20 */ 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69,   // l Plus 2019.Offi\n\t/* 3A30 */ 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32,   // ce Project Pro 2\n\t/* 3A40 */ 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65,   // 019.Office Proje\n\t/* 3A50 */ 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39,   // ct Standard 2019\n\t/* 3A60 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65,   // .Office Publishe\n\t/* 3A70 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6B,   // r 2019.Office Sk\n\t/* 3A80 */ 0x79, 0x70, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73,   // ype for Business\n\t/* 3A90 */ 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61,   //  2019.Office Sta\n\t/* 3AA0 */ 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // ndard 2019.Offic\n\t/* 3AB0 */ 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x39,   // e Visio Pro 2019\n\t/* 3AC0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74,   // .Office Visio St\n\t/* 3AD0 */ 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69,   // andard 2019.Offi\n\t/* 3AE0 */ 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00,                     // ce Word 2019.\n};\n\n__pure size_t getDefaultKmsDataSize()\n{\n\treturn sizeof(DefaultKmsData);\n}\n\n#endif // NO_INTERNAL_DATA\n\n"
  },
  {
    "path": "src/kmsdata.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef NO_INTERNAL_DATA\n\n#include \"kmsdata.h\"\n\n#if defined(FULL_INTERNAL_DATA)\n\nuint8_t DefaultKmsData[] =\n{\n\t/* 0000 */ 0x4B, 0x4D, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,   // KMD.............\n\t/* 0010 */ 0x1D, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...............\n\t/* 0020 */ 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........h.......\n\t/* 0030 */ 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........H.......\n\t/* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ................\n\t/* 0050 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xC0, 0x97, 0xD7, 0x20,   // .[........ \n\t/* 0060 */ 0xBF, 0xC4, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\"....V.......\n\t/* 0070 */ 0x80, 0x4F, 0x3E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0xDC, 0x0B,   // .O>L....`.....\n\t/* 0080 */ 0x7F, 0x6A, 0xFE, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j.............\n\t/* 0090 */ 0x00, 0x11, 0x07, 0x51, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x8E, 0xF2, 0x0D,   // ...Q..........\n\t/* 00A0 */ 0xFF, 0x3F, 0x42, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?B............\n\t/* 00B0 */ 0x00, 0x9A, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x40, 0x17, 0x0C, 0x1A,   // ...V.......@...\n\t/* 00C0 */ 0xBF, 0xC8, 0x5B, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x31, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // [.....1 ......\n\t/* 00D0 */ 0x80, 0x33, 0xE4, 0x58, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0F, 0x00, 0x00, 0xC0, 0xE1, 0xE4, 0x00,   // .3X.........\n\t/* 00E0 */ 0xFF, 0xC9, 0x9A, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;..... ......\n\t/* 00F0 */ 0x00, 0x29, 0xA8, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x5A, 0xB2, 0x27,   // .)[........Z'\n\t/* 0100 */ 0x7F, 0x87, 0xE3, 0x28, 0x00, 0x00, 0x00, 0x00, 0x34, 0x27, 0xC9, 0x55, 0x82, 0xD6, 0x71, 0x4D,   // ..(....4'U.qM\n\t/* 0110 */ 0x98, 0x3E, 0xD6, 0xEC, 0x3F, 0x16, 0x05, 0x9F, 0x84, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .>?....!......\n\t/* 0120 */ 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x81, 0x28, 0xA5, 0x59, 0x89, 0xA9, 0x9D, 0x47,   // ...2.....(Y..G\n\t/* 0130 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x8C, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c.!......\n\t/* 0140 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x15, 0xCE, 0xF1, 0x0F, 0x89, 0xA9, 0x9D, 0x47,   // ............G\n\t/* 0150 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x97, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c.!......\n\t/* 0160 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x05, 0x00, 0xFB, 0xB1, 0x49, 0x84, 0xEA, 0xF0, 0x7A, 0x49,   // ........I.zI\n\t/* 0170 */ 0x99, 0xAB, 0x66, 0xCA, 0x96, 0xE9, 0xA0, 0xF5, 0xA3, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .f..!......\n\t/* 0180 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x59, 0x56, 0xB1, 0x11, 0x03, 0xE6, 0xF1, 0x4C,   // ........YV..L\n\t/* 0190 */ 0x9C, 0x1F, 0xF0, 0xEC, 0x01, 0xB8, 0x18, 0x88, 0xB7, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....!......\n\t/* 01A0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x36, 0xD6, 0x7C, 0xD2, 0x62, 0x19, 0xE9, 0x44,   // ........6|b.D\n\t/* 01B0 */ 0x8B, 0x4F, 0x27, 0xB6, 0xC2, 0x3E, 0xFB, 0x85, 0xD0, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .O'>.!......\n\t/* 01C0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x23, 0xBF, 0xA0, 0x7B, 0xF5, 0xD0, 0x72, 0x40,   // ........#.{r@\n\t/* 01D0 */ 0x91, 0xD9, 0xD5, 0x5A, 0xF5, 0xA4, 0x81, 0xB6, 0xEC, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.!......\n\t/* 01E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0xC0, 0xE3, 0x9F, 0x96, 0xEC, 0xA3, 0x1A, 0x49,   // ...........I\n\t/* 01F0 */ 0x9F, 0x25, 0x42, 0x36, 0x05, 0xDE, 0xB3, 0x65, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .%B6.޳e.\"......\n\t/* 0200 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x58, 0x13, 0xC5, 0xE1, 0x3E, 0xFE, 0x03, 0x42,   // ........X.>.B\n\t/* 0210 */ 0xA4, 0xA2, 0x3B, 0x6B, 0x20, 0xC9, 0x73, 0x4E, 0x21, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ;k sN!\"......\n\t/* 0220 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x4F, 0x13, 0xE2, 0x58, 0x11, 0x8E, 0x17, 0x4D,   // ........O.X...M\n\t/* 0230 */ 0x9C, 0xB2, 0x91, 0x06, 0x9C, 0x15, 0x11, 0x48, 0x35, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ......H5\"......\n\t/* 0240 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x19, 0x52, 0xDE, 0x7F, 0xFA, 0xFB, 0x4A, 0x48,   // .........R.JH\n\t/* 0250 */ 0x82, 0xC9, 0x34, 0xD1, 0xAD, 0x53, 0xE8, 0x56, 0x4E, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4ѭSVN\"......\n\t/* 0260 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x7B, 0xB9, 0xBB, 0xA4, 0x8C, 0x28, 0x4A,   // ........;{.(J\n\t/* 0270 */ 0x97, 0x17, 0x89, 0xFA, 0xBD, 0x42, 0xC4, 0xAC, 0x58, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...BĬX\"......\n\t/* 0280 */ 0x00, 0x00, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0x58, 0xB3, 0x40, 0x3C, 0x48, 0x59, 0xAF, 0x45,   // ........X@<HYE\n\t/* 0290 */ 0x92, 0x3B, 0x53, 0xD2, 0x1F, 0xCC, 0x7E, 0x79, 0x6B, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;S.~yk\"......\n\t/* 02A0 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x90, 0x68, 0x64, 0x6D, 0x06, 0x36, 0x1A, 0x46,   // .........hdm.6.F\n\t/* 02B0 */ 0x86, 0xAB, 0x59, 0x8B, 0xB8, 0x4A, 0xCE, 0x82, 0x7E, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Y.J.~\"......\n\t/* 02C0 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x80, 0xC7, 0x8F, 0xCB, 0x05, 0x2C, 0x5A, 0x49,   // ...........,ZI\n\t/* 02D0 */ 0x97, 0x10, 0x85, 0xAF, 0xFF, 0xC9, 0x04, 0xD7, 0x93, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....\"......\n\t/* 02E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBB, 0xA0, 0x94, 0x5F, 0xA0, 0xD5, 0x81, 0x40,   // .........._..@\n\t/* 02F0 */ 0xA6, 0x85, 0x58, 0x19, 0x41, 0x8B, 0x2F, 0xE0, 0xA8, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .X.A./\"......\n\t/* 0300 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0xE4, 0x56, 0xE1, 0x33, 0x6F, 0xB7, 0x52, 0x4A,   // ........V3oRJ\n\t/* 0310 */ 0x9F, 0x91, 0xF6, 0x41, 0xDD, 0x95, 0xAC, 0x48, 0xB8, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..A.H\"......\n\t/* 0320 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x87, 0x33, 0xE5, 0x8F, 0x87, 0x30, 0x47, 0x44,   // .........3..0GD\n\t/* 0330 */ 0x89, 0x85, 0xF7, 0x51, 0x32, 0x21, 0x5A, 0xC9, 0xDC, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Q2!Z\"......\n\t/* 0340 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xFD, 0x21, 0x8A, 0xC5, 0xCB, 0xEB, 0x44,   // ........!.D\n\t/* 0350 */ 0x83, 0xF3, 0xFE, 0x28, 0x4E, 0x66, 0x80, 0xA7, 0x0C, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .(Nf..#......\n\t/* 0360 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xCC, 0xC6, 0x0F, 0x0E, 0xFF, 0xAE, 0x4F,   // ..........O\n\t/* 0370 */ 0x9D, 0x08, 0x43, 0x70, 0x78, 0x5B, 0xF7, 0xED, 0x2F, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Cpx[/#......\n\t/* 0380 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xF5, 0x87, 0xCA, 0x46, 0xCD, 0xC0, 0x40,   // .........F@\n\t/* 0390 */ 0xB0, 0x6D, 0x8E, 0xCD, 0x57, 0xA4, 0x37, 0x3F, 0x56, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // m.W7?V#......\n\t/* 03A0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x89, 0x26, 0xCA, 0xB2, 0xA8, 0xA9, 0xD7, 0x42,   // .........&ʲB\n\t/* 03B0 */ 0x93, 0x8D, 0xCF, 0x8E, 0x9F, 0x20, 0x19, 0x58, 0x89, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .... .X.#......\n\t/* 03C0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCB, 0x65, 0x86, 0x8C, 0x46, 0xA3, 0x4A,   // ........qe..FJ\n\t/* 03D0 */ 0xA3, 0x37, 0xCB, 0x9B, 0xC9, 0xD5, 0xEA, 0xAC, 0xAF, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 7.꬯#......\n\t/* 03E0 */ 0x00, 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD3, 0xEF, 0x56, 0x84, 0x04, 0x0C, 0x89, 0x40,   // ........V....@\n\t/* 03F0 */ 0x87, 0x40, 0x5B, 0x72, 0x38, 0x53, 0x5A, 0x65, 0xC3, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .@[r8SZe#......\n\t/* 0400 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x69, 0xC0, 0x9F, 0x6E, 0x7D, 0x25, 0xC4, 0x4B,   // ........i.n}%K\n\t/* 0410 */ 0xB4, 0xA7, 0x75, 0x05, 0x14, 0xD3, 0x27, 0x43, 0xDA, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // u..'C#......\n\t/* 0420 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x70, 0x52, 0x5F, 0x6D, 0xAC, 0x31, 0x3E, 0x43,   // ........pR_m1>C\n\t/* 0430 */ 0xB9, 0x0A, 0x39, 0x89, 0x29, 0x23, 0xC6, 0x57, 0xEE, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .9.)#W#......\n\t/* 0440 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x01, 0x00, 0x00, 0xDC, 0x64, 0x2A, 0x21, 0xB1, 0x43, 0x3D, 0x4D,   // ........d*!C=M\n\t/* 0450 */ 0xA3, 0x0C, 0x2F, 0xC6, 0x9D, 0x20, 0x95, 0xC6, 0x05, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ./. ..$......\n\t/* 0460 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x46, 0xF9, 0x5A, 0xE8, 0x25, 0x2E, 0xB7, 0x47,   // ........FZ%.G\n\t/* 0470 */ 0x83, 0xE1, 0xBE, 0xBC, 0xEB, 0xEA, 0xC6, 0x11, 0x13, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ᾼ..$......\n\t/* 0480 */ 0x01, 0x00, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xBF, 0xF1, 0xA6, 0xE6, 0x40, 0x9D, 0xC3, 0x40,   // ........@.@\n\t/* 0490 */ 0xAA, 0x9F, 0xC7, 0x7B, 0xA2, 0x15, 0x78, 0xC0, 0x1F, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{.x.$......\n\t/* 04A0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x68, 0x79, 0x4C, 0xAA, 0xDA, 0xB9, 0x80, 0x46,   // ........hyLڹ.F\n\t/* 04B0 */ 0x92, 0xB6, 0xAC, 0xB2, 0x5E, 0x2F, 0x86, 0x6C, 0x2B, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^/.l+$......\n\t/* 04C0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1B, 0xF6, 0xB5, 0x85, 0x0B, 0x32, 0xE3, 0x4B,   // ...........2K\n\t/* 04D0 */ 0x81, 0x4A, 0xB7, 0x6B, 0x2B, 0xFA, 0xFC, 0x82, 0x45, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Jk+.E$......\n\t/* 04E0 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xB1, 0x9E, 0x7D, 0x61, 0x36, 0xEF, 0x82, 0x4F,   // .........}a6.O\n\t/* 04F0 */ 0x86, 0xE0, 0xA6, 0x5A, 0xE0, 0x7B, 0x96, 0xC6, 0x51, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z{.Q$......\n\t/* 0500 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x62, 0xEB, 0xE8, 0x8D, 0xE0, 0xBB, 0xAC, 0x40,   // ........b.໬@\n\t/* 0510 */ 0xAC, 0x17, 0xF7, 0x55, 0x95, 0x07, 0x1E, 0xA3, 0x5D, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .U...]$......\n\t/* 0520 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xC1, 0x9C, 0xA9, 0x19, 0x77, 0x06, 0x43,   // ..........w.C\n\t/* 0530 */ 0x96, 0x45, 0x29, 0x41, 0x02, 0xFB, 0xFF, 0x95, 0x77, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .E)A..w$......\n\t/* 0540 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAE, 0xE1, 0x34, 0xF8, 0x27, 0x50, 0x49,   // ........U4'PI\n\t/* 0550 */ 0x88, 0x77, 0x7A, 0x03, 0xBE, 0x5F, 0xB1, 0x81, 0x96, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .wz._..$......\n\t/* 0560 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x3C, 0x4D, 0x03, 0x4B, 0x5D, 0x45, 0x42,   // ........<M.K]EB\n\t/* 0570 */ 0xB3, 0xF8, 0xF8, 0x45, 0x71, 0x31, 0x40, 0x78, 0xB5, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Eq1@x$......\n\t/* 0580 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xEA, 0x32, 0xDE, 0xEE, 0xAA, 0x62, 0x46,   // ........2bF\n\t/* 0590 */ 0x94, 0x44, 0xC1, 0xBE, 0xFB, 0x41, 0xBD, 0xE2, 0xD4, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .DA$......\n\t/* 05A0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xE5, 0x62, 0xC3, 0x90, 0xA1, 0x0D, 0xFD, 0x4B,   // ........b..K\n\t/* 05B0 */ 0xB5, 0x3B, 0xB8, 0x7D, 0x30, 0x9A, 0xDE, 0x43, 0xF1, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ;}0.C$......\n\t/* 05C0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x95, 0xE3, 0x73, 0x0C, 0xFC, 0x0D, 0x40,   // ........|.s..@\n\t/* 05D0 */ 0x91, 0x84, 0x5F, 0x7B, 0x6F, 0x2E, 0xB4, 0x09, 0x26, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .._{o..&%......\n\t/* 05E0 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xFA, 0xD2, 0x32, 0xA8, 0xE4, 0xC2, 0x42,   // ........2B\n\t/* 05F0 */ 0x92, 0x3B, 0x4B, 0xF4, 0xFD, 0x13, 0xE6, 0xEE, 0x59, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;K.Y%......\n\t/* 0600 */ 0x00, 0x01, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x33, 0xA3, 0x03, 0x71, 0xC8, 0xB8, 0xCC, 0x49,   // ........3.qȸI\n\t/* 0610 */ 0x93, 0xCE, 0xD3, 0x7C, 0x09, 0x68, 0x7F, 0x92, 0x79, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|.h..y%......\n\t/* 0620 */ 0x00, 0x01, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x83, 0xD3, 0xB2, 0xE0, 0x12, 0xD1, 0x3F, 0x41,   // .........Ӳ.?A\n\t/* 0630 */ 0x8A, 0x80, 0x97, 0xF3, 0x73, 0xA5, 0x82, 0x0C, 0x9B, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...s...%......\n\t/* 0640 */ 0x00, 0x03, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0xFB, 0x54, 0x84, 0xE3, 0xA4, 0x41, 0x59, 0x4F,   // ........T.AYO\n\t/* 0650 */ 0xA5, 0xDC, 0x25, 0x08, 0x0E, 0x35, 0x47, 0x30, 0xB3, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // %..5G0%......\n\t/* 0660 */ 0x00, 0x03, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0x60, 0x5A, 0x5A, 0x2D, 0x40, 0x30, 0xBF, 0x48,   // ........`ZZ-@0H\n\t/* 0670 */ 0xBE, 0xB0, 0xFC, 0xD7, 0x70, 0xC2, 0x0C, 0xE0, 0xCC, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // p.%......\n\t/* 0680 */ 0x00, 0x04, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x83, 0x6D, 0x77, 0x9F, 0x56, 0x71, 0xB2, 0x45,   // .........mw.VqE\n\t/* 0690 */ 0x8A, 0x5C, 0x35, 0x9B, 0x9C, 0x9F, 0x22, 0xA3, 0xEC, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\\5...\"%......\n\t/* 06A0 */ 0x00, 0x04, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x99, 0x7C, 0xE9, 0x58, 0x77, 0xF3, 0xF1, 0x4E,   // .........|XwN\n\t/* 06B0 */ 0x81, 0xD5, 0x4A, 0xD5, 0x52, 0x2B, 0x5F, 0xD8, 0x0E, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .JR+_.&......\n\t/* 06C0 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x44, 0x75, 0x10, 0xA9, 0xA0, 0xF4, 0x53, 0x40,   // ........Du..S@\n\t/* 06D0 */ 0xA9, 0x6A, 0x14, 0x79, 0xAB, 0xDE, 0xF9, 0x12, 0x1E, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // j.y..&......\n\t/* 06E0 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x51, 0x17, 0x9E, 0x7B, 0xDA, 0xA8, 0x75, 0x4F,   // ........Q..{ڨuO\n\t/* 06F0 */ 0x95, 0x60, 0x5F, 0xAD, 0xFE, 0x3D, 0x8E, 0x38, 0x3F, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`_=.8?&......\n\t/* 0700 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x57, 0x8A, 0x91, 0xCD, 0x1B, 0xA4, 0x82, 0x4C,   // ........W....L\n\t/* 0710 */ 0x8D, 0xCE, 0x1A, 0x53, 0x8E, 0x22, 0x1A, 0x83, 0x51, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..S.\"..Q&......\n\t/* 0720 */ 0x00, 0x05, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x88, 0x22, 0xC4, 0xE0, 0x0C, 0x98, 0x88, 0x47,   // .........\"...G\n\t/* 0730 */ 0xA0, 0x14, 0xC0, 0x80, 0xD2, 0xE1, 0x92, 0x6E, 0x71, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....nq&......\n\t/* 0740 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x55, 0x23, 0x10, 0x3C, 0x27, 0xD0, 0xC6, 0x42,   // ........U#.<'B\n\t/* 0750 */ 0xAD, 0x23, 0x2E, 0x7E, 0xF8, 0xA0, 0x25, 0x85, 0x86, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // #.~.%..&......\n\t/* 0760 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x21, 0x11, 0x11, 0x73, 0x38, 0x56, 0xF6, 0x40,   // ........!..s8V@\n\t/* 0770 */ 0xBC, 0x11, 0xF1, 0xD7, 0xB0, 0xD6, 0x43, 0x00, 0x9D, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .װC..&......\n\t/* 0780 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xA4, 0x51, 0x7B, 0x04, 0x0C, 0x8F, 0x4E,   // ........lQ{...N\n\t/* 0790 */ 0x9A, 0xF4, 0x84, 0x96, 0xCC, 0xA9, 0x0D, 0x5E, 0xB3, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...̩.^&......\n\t/* 07A0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x38, 0xB8, 0x87, 0xB6, 0x41, 0x90, 0x45,   // ........8.A.E\n\t/* 07B0 */ 0x83, 0x18, 0x57, 0x97, 0x95, 0x1D, 0x85, 0x29, 0xD3, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..W....)&......\n\t/* 07C0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xE2, 0xE3, 0x72, 0xE2, 0x2F, 0x73, 0x65, 0x4C,   // ........r/seL\n\t/* 07D0 */ 0xA8, 0xF0, 0x48, 0x47, 0x47, 0xD0, 0xD9, 0x47, 0xF5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // HGGG&......\n\t/* 07E0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x92, 0xC0, 0xBB, 0x82, 0x50, 0xBC, 0x16, 0x4E,   // ..........P.N\n\t/* 07F0 */ 0x8E, 0x18, 0xB7, 0x4F, 0xC4, 0x86, 0xAE, 0xC3, 0x0D, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..O..'......\n\t/* 0800 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xD3, 0x71, 0x15, 0x4B, 0xFB, 0xBA, 0x40, 0x4B,   // ........q.K@K\n\t/* 0810 */ 0x80, 0x87, 0xA9, 0x61, 0xBE, 0x2C, 0xAF, 0x65, 0x31, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..a,e1'......\n\t/* 0820 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x92, 0x73, 0xE6, 0x2D, 0xA7, 0xB7, 0x2A, 0x46,   // .........s-*F\n\t/* 0830 */ 0xB1, 0xCA, 0x10, 0x8D, 0xD1, 0x89, 0xF5, 0x88, 0x57, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....W'......\n\t/* 0840 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x82, 0xFC, 0x1A, 0x3F, 0xAC, 0xF8, 0x6C, 0x4F,   // ..........?lO\n\t/* 0850 */ 0x80, 0x05, 0x1D, 0x23, 0x3E, 0x60, 0x6E, 0xEE, 0x6F, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...#>`no'......\n\t/* 0860 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xB1, 0x00, 0x53, 0x33, 0x2E, 0xC2, 0x4D,   // ..........S3.M\n\t/* 0870 */ 0x82, 0x91, 0x47, 0xFF, 0xCE, 0xC7, 0x46, 0xDD, 0x91, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..GF.'......\n\t/* 0880 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x5A, 0x0B, 0xA8, 0xAD, 0x76, 0x8B, 0x42,   // ........Z.v.B\n\t/* 0890 */ 0xB0, 0x5D, 0xA4, 0x7D, 0x2D, 0xFF, 0xEE, 0xBF, 0xB5, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ]}-'......\n\t/* 08A0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x01, 0x82, 0x80, 0xFF, 0xC6, 0xFE, 0xD4, 0x4F,   // ...........O\n\t/* 08B0 */ 0xAE, 0x16, 0xAB, 0xBD, 0xDA, 0xDE, 0x57, 0x06, 0xCF, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .W.'......\n\t/* 08C0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAB, 0xF2, 0x43, 0x87, 0x7C, 0x56, 0x4D,   // .........C.|VM\n\t/* 08D0 */ 0xB2, 0x7C, 0x44, 0xD0, 0xF9, 0xA3, 0xDA, 0xBD, 0xEF, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // |Dڽ'......\n\t/* 08E0 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x65, 0x8E, 0x86, 0xEC, 0xDF, 0xFA, 0x59, 0x47,   // ........e..YG\n\t/* 08F0 */ 0xB2, 0x3E, 0x93, 0xFE, 0x37, 0xF2, 0xCC, 0x29, 0x0D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // >.7).(......\n\t/* 0900 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x50, 0xDB, 0xE4, 0xA1, 0xBD, 0x66, 0x45,   // ........P䡽fE\n\t/* 0910 */ 0xB0, 0x47, 0x0C, 0xA5, 0x0A, 0xBC, 0x6F, 0x07, 0x38, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // G..o.8(......\n\t/* 0920 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x14, 0xF8, 0xF4, 0x0D, 0x57, 0x3F, 0x8B, 0x4B,   // ..........W?.K\n\t/* 0930 */ 0x9A, 0x9D, 0xFD, 0xDA, 0xDC, 0xD6, 0x9F, 0xAC, 0x51, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...Q(......\n\t/* 0940 */ 0x00, 0x06, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x09, 0xE5, 0x2E, 0xAE, 0x34, 0x1B, 0xC0, 0x41,   // ..........4.A\n\t/* 0950 */ 0xAC, 0xB7, 0x6D, 0x46, 0x50, 0x16, 0x89, 0x15, 0x65, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // mFP...e(......\n\t/* 0960 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x08, 0xED, 0xBB, 0x46, 0x7B, 0x9C, 0xFC, 0x48,   // .........F{.H\n\t/* 0970 */ 0xA6, 0x14, 0x95, 0x25, 0x05, 0x73, 0xF4, 0xEA, 0x7A, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..%.sz(......\n\t/* 0980 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x05, 0xD6, 0xB6, 0x1C, 0xB3, 0x11, 0x14, 0x4E,   // .........ֶ...N\n\t/* 0990 */ 0xBB, 0x30, 0xDA, 0x91, 0xC8, 0xE3, 0x98, 0x3A, 0x91, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 0..:.(......\n\t/* 09A0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x80, 0x99, 0x2E, 0xB9, 0xD5, 0xB9, 0x21, 0x48,   // ...........չ!H\n\t/* 09B0 */ 0x9C, 0x94, 0x14, 0x0F, 0x63, 0x2F, 0x63, 0x12, 0xA8, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....c/c.(......\n\t/* 09C0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0x15, 0x04, 0x5A, 0xF8, 0xFE, 0x07, 0x4D,   // ........)..Z.M\n\t/* 09D0 */ 0xB0, 0x6F, 0xB5, 0x9B, 0x57, 0x3B, 0x32, 0xD2, 0xBF, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // o.W;2ҿ(......\n\t/* 09E0 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0xA0, 0x54, 0x7B, 0xD5, 0x10, 0x4C,   // ...........T{.L\n\t/* 09F0 */ 0x8B, 0x69, 0xA8, 0x42, 0xD6, 0x59, 0x0A, 0xD5, 0xD8, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .iBY.(......\n\t/* 0A00 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x96, 0x78, 0x53, 0xDB, 0x6F, 0x37, 0xAE, 0x48,   // .........xSo7H\n\t/* 0A10 */ 0xA4, 0x92, 0x53, 0xD0, 0x54, 0x77, 0x73, 0xD0, 0xF1, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .STws(......\n\t/* 0A20 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6A, 0x29, 0xA8, 0xE1, 0x37, 0xDB, 0xD1, 0x44,   // ........j)7D\n\t/* 0A30 */ 0x8C, 0xCE, 0x7B, 0xC9, 0x61, 0xD5, 0x9C, 0x54, 0x0D, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{a.T.)......\n\t/* 0A40 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xD3, 0x6D, 0xAA, 0xB4, 0xC2, 0xE2, 0x40,   // ........m@\n\t/* 0A50 */ 0xA5, 0x44, 0xA6, 0xBB, 0xB3, 0xF5, 0xC3, 0x95, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // D.))......\n\t/* 0A60 */ 0x00, 0x07, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBF, 0xD6, 0x4E, 0xC0, 0xC8, 0x55, 0x47, 0x4B,   // ........NUGK\n\t/* 0A70 */ 0x9F, 0x8E, 0x5A, 0x1F, 0x31, 0xCE, 0xEE, 0x60, 0x3A, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z.1`:)......\n\t/* 0A80 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA2, 0x84, 0x55, 0x9D, 0x85, 0x2D, 0x9A, 0x41,   // .........U..-.A\n\t/* 0A90 */ 0x98, 0x2C, 0xA0, 0x08, 0x88, 0xBB, 0x9D, 0xDF, 0x49, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .,....I)......\n\t/* 0AA0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA0, 0x90, 0x73, 0x19, 0xF6, 0x65, 0x95, 0x4A,   // ..........s.e.J\n\t/* 0AB0 */ 0xBD, 0xC4, 0x55, 0xD5, 0x8A, 0x3B, 0x02, 0x53, 0x69, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // U.;.Si)......\n\t/* 0AC0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xD4, 0xFC, 0x60, 0x88, 0x7B, 0xA7, 0x20, 0x4A,   // ........`.{ J\n\t/* 0AD0 */ 0x90, 0x45, 0xA1, 0x50, 0xFF, 0x11, 0xD6, 0x09, 0x7A, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .EP..z)......\n\t/* 0AE0 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xA3, 0x18, 0x00, 0xA0, 0x0F, 0xF2, 0x32, 0x46,   // ............2F\n\t/* 0AF0 */ 0xBF, 0x7C, 0x8D, 0xAA, 0x53, 0x51, 0xC9, 0x14, 0x99, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // |.SQ..)......\n\t/* 0B00 */ 0x00, 0x08, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0xAF, 0x8B, 0x01, 0x10, 0x21, 0xCE, 0x60, 0x40,   // ...........!`@\n\t/* 0B10 */ 0x80, 0xBD, 0x47, 0xFE, 0x74, 0xED, 0x4D, 0xAB, 0xB4, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .GtM)......\n\t/* 0B20 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x48, 0x18, 0xDB, 0x18, 0xE0, 0x12, 0x67, 0x41,   // ........H...gA\n\t/* 0B30 */ 0xB9, 0xD7, 0xDA, 0x7F, 0xCD, 0xA5, 0x07, 0xDB, 0xDD, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ͥ.)......\n\t/* 0B40 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xEC, 0x1B, 0x8E, 0x45, 0x7A, 0x83, 0xF6, 0x45,   // ..........Ez.E\n\t/* 0B50 */ 0xB9, 0xD5, 0x92, 0x5E, 0xD5, 0xD2, 0x99, 0xDE, 0x04, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^..*......\n\t/* 0B60 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x97, 0x49, 0xE1, 0x0A, 0x80, 0xF7, 0x4C,   // .........I..L\n\t/* 0B70 */ 0xAD, 0x10, 0xDE, 0x4B, 0x45, 0xB5, 0x78, 0xDB, 0x19, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .KEx.*......\n\t/* 0B80 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x6D, 0xCD, 0x8B, 0xA9, 0x43, 0x53, 0x03, 0x46,   // ........m.CS.F\n\t/* 0B90 */ 0x8A, 0xFE, 0x59, 0x08, 0xE4, 0x61, 0x11, 0x12, 0x30, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Y.a..0*......\n\t/* 0BA0 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x45, 0xF2, 0xEB, 0xA8, 0x29, 0xAF, 0x4D,   // ........E)M\n\t/* 0BB0 */ 0x9C, 0xB1, 0x38, 0xDF, 0xC6, 0x08, 0xA8, 0xC8, 0x47, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .8.G*......\n\t/* 0BC0 */ 0x00, 0x09, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x38, 0x32, 0x1C, 0xFE, 0x2A, 0x43, 0xA1, 0x43,   // ........82.*CC\n\t/* 0BD0 */ 0x8E, 0x25, 0x97, 0xE7, 0xD1, 0xEF, 0x10, 0xF3, 0x60, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .%..`*......\n\t/* 0BE0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x6A, 0x45, 0xEE, 0xFF, 0x87, 0xCD, 0x90, 0x43,   // ........jE..C\n\t/* 0BF0 */ 0x8E, 0x07, 0x16, 0x14, 0x6C, 0x67, 0x2F, 0xD0, 0x71, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....lg/q*......\n\t/* 0C00 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x4F, 0xB7, 0x78, 0xDB, 0x1C, 0xEF, 0x92, 0x48,   // ........Ox..H\n\t/* 0C10 */ 0xAB, 0xFE, 0x1E, 0x66, 0xB8, 0x23, 0x1D, 0xF6, 0x86, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .f#..*......\n\t/* 0C20 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x64, 0x8A, 0x55, 0x78, 0x19, 0xDC, 0xFE, 0x43,   // ........d.Ux.C\n\t/* 0C30 */ 0xA0, 0xD0, 0x80, 0x75, 0xB2, 0xA3, 0x70, 0xA3, 0xA8, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..up*......\n\t/* 0C40 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x1D, 0x6A, 0x2C, 0xC7, 0x52, 0xF2, 0x7E, 0x4E,   // .........j,R~N\n\t/* 0C50 */ 0xBD, 0xD1, 0x3F, 0xCA, 0x34, 0x2A, 0xCB, 0x35, 0xBB, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?4*5*......\n\t/* 0C60 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0xB5, 0x87, 0x8D, 0xE5, 0x26, 0x81, 0x80, 0x45,   // ..........&..E\n\t/* 0C70 */ 0x80, 0xFB, 0x86, 0x1B, 0x22, 0xF7, 0x92, 0x96, 0xDC, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...\"..*......\n\t/* 0C80 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0xC7, 0x91, 0xB4, 0xCA, 0x18, 0xA9, 0x60, 0x4F,   // ..........`O\n\t/* 0C90 */ 0xB5, 0x02, 0xDA, 0xB7, 0x5E, 0x33, 0x4F, 0x40, 0xFD, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ڷ^3O@*......\n\t/* 0CA0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x3D, 0xE6, 0x6C, 0x09, 0xAC, 0x4F, 0xA9, 0x48,   // ........=l.OH\n\t/* 0CB0 */ 0x82, 0xA9, 0x61, 0xAE, 0x9E, 0x80, 0x0E, 0x5F, 0x20, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .a..._ +......\n\t/* 0CC0 */ 0x00, 0x0A, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x32, 0x2B, 0x94, 0xE9, 0x55, 0x2E, 0x97, 0x41,   // ........2+.U..A\n\t/* 0CD0 */ 0xB0, 0xBD, 0x5F, 0xF5, 0x8C, 0xBA, 0x88, 0x60, 0x3D, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // _..`=+......\n\t/* 0CE0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x12, 0x82, 0x99, 0xBA, 0x0A, 0x46, 0xDB, 0x44,   // ............FD\n\t/* 0CF0 */ 0xBF, 0xB5, 0x71, 0xBF, 0x09, 0xD1, 0xC6, 0x8B, 0x58, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // q..X+......\n\t/* 0D00 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xEC, 0xDD, 0xC6, 0x54, 0x23, 0x19, 0x4C,   // ........T#.L\n\t/* 0D10 */ 0x90, 0x9B, 0x30, 0x6A, 0x30, 0x58, 0x48, 0x4E, 0x84, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..0j0XHN.+......\n\t/* 0D20 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xA3, 0xE3, 0xF5, 0xB8, 0x33, 0xED, 0x08, 0x46,   // ........3.F\n\t/* 0D30 */ 0x81, 0xE1, 0x37, 0xD6, 0xC9, 0xDC, 0xFD, 0x9C, 0xA1, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .7.+......\n\t/* 0D40 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x1A, 0x67, 0x81, 0xD1, 0x79, 0xB1, 0x4E,   // .........g.yN\n\t/* 0D50 */ 0xB0, 0x04, 0x8C, 0xBB, 0xE1, 0x73, 0xAF, 0xEA, 0xCC, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..s+......\n\t/* 0D60 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x70, 0x3E, 0x11, 0x49, 0xFA, 0xA4, 0x48,   // ........\\p>.IH\n\t/* 0D70 */ 0xBE, 0xEA, 0x7D, 0xD8, 0x79, 0xB4, 0x6B, 0x14, 0xE3, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // }yk.+......\n\t/* 0D80 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x81, 0x69, 0x6B, 0xC0, 0xFD, 0xD7, 0x35, 0x4A,   // .........ik5J\n\t/* 0D90 */ 0xB7, 0xB4, 0x05, 0x47, 0x42, 0xB7, 0xAF, 0x67, 0xFC, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .GBg+......\n\t/* 0DA0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xD7, 0x76, 0x74, 0x48, 0x8E, 0xB4, 0x49,   // .........vtH.I\n\t/* 0DB0 */ 0xAB, 0x63, 0x4D, 0x0B, 0x81, 0x3A, 0x16, 0xE4, 0x15, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // cM..:..,......\n\t/* 0DC0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x54, 0x2D, 0xB8, 0x0A, 0xF4, 0x47, 0xCB, 0x4A,   // ........T-.GJ\n\t/* 0DD0 */ 0x81, 0x8C, 0xCC, 0x5B, 0xF0, 0xEC, 0xB6, 0x49, 0x30, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..[I0,......\n\t/* 0DE0 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x90, 0x85, 0xE8, 0xF7, 0xC7, 0xDF, 0x78, 0x4C,   // ..........xL\n\t/* 0DF0 */ 0xBC, 0xCB, 0x6F, 0x38, 0x65, 0xB9, 0x9D, 0x1A, 0x5B, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // o8e..[,......\n\t/* 0E00 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x2D, 0x4E, 0xCD, 0x59, 0x50, 0x50, 0x4A,   // .........-NYPPJ\n\t/* 0E10 */ 0xA9, 0x2D, 0x05, 0xD5, 0xBB, 0x12, 0x67, 0xC7, 0x84, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // -.ջ.g.,......\n\t/* 0E20 */ 0x00, 0x0B, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x52, 0xE9, 0xCD, 0x96, 0x2F, 0x9D, 0x4D,   // ........R./.M\n\t/* 0E30 */ 0x8F, 0x2B, 0x2D, 0x34, 0x9F, 0x64, 0xFC, 0x51, 0xAD, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .+-4.dQ,......\n\t/* 0E40 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x6B, 0x3E, 0x38, 0xA4, 0xDA, 0xDA, 0x3D, 0x42,   // ........k>8=B\n\t/* 0E50 */ 0xA4, 0x3D, 0xF2, 0x56, 0x78, 0x42, 0x96, 0x76, 0xCB, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // =VxB.v,......\n\t/* 0E60 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7B, 0xA0, 0x59, 0xCF, 0x2A, 0x1A, 0xE0, 0x4B,   // ........{.Y*.K\n\t/* 0E70 */ 0xBF, 0xE0, 0x42, 0x3B, 0x58, 0x23, 0xE6, 0x63, 0xEB, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // B;X#c,......\n\t/* 0E80 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7F, 0x33, 0x9C, 0x2B, 0x1D, 0x7A, 0x71, 0x42,   // .........3.+.zqB\n\t/* 0E90 */ 0x90, 0xA3, 0xC6, 0x85, 0x5A, 0x2B, 0x8A, 0x1C, 0x0F, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z+...-......\n\t/* 0EA0 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x72, 0xAD, 0x1E, 0x63, 0xAB, 0xA8, 0xF8, 0x4D,   // ........r.cM\n\t/* 0EB0 */ 0xBB, 0xDF, 0x37, 0x20, 0x29, 0x98, 0x9B, 0xDD, 0x23, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 7 )..#-......\n\t/* 0EC0 */ 0x00, 0x0C, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0x7C, 0x9F, 0xFA, 0xDD, 0x9E, 0xF0, 0xB9, 0x40,   // ........|..@\n\t/* 0ED0 */ 0x8C, 0x1A, 0xBE, 0x87, 0x7A, 0x9A, 0x7F, 0x4B, 0x3B, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...z..K;-......\n\t/* 0EE0 */ 0x00, 0x0D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x56, 0x11, 0xFB, 0x7A, 0x1D, 0x2C, 0xFC, 0x40,   // ........V.z.,@\n\t/* 0EF0 */ 0xB2, 0x60, 0xAA, 0xB7, 0x44, 0x2B, 0x62, 0xFE, 0x53, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // `D+bS-......\n\t/* 0F00 */ 0x00, 0x0D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x42, 0x25, 0xAD, 0x54, 0x91, 0x6D, 0x4C,   // ........B%T.mL\n\t/* 0F10 */ 0x8A, 0x44, 0x30, 0xF1, 0x1E, 0xE9, 0x69, 0x89, 0x77, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D0.i.w-......\n\t/* 0F20 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xE3, 0x01, 0x24, 0x0A, 0xC5, 0x58, 0x4B,   // .........$.XK\n\t/* 0F30 */ 0x87, 0xB2, 0x7E, 0x79, 0x4B, 0x7D, 0x26, 0x07, 0x94, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .~yK}&..-......\n\t/* 0F40 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x90, 0x4D, 0xAF, 0xC1, 0xBC, 0xD1, 0xCA, 0x44,   // .........MD\n\t/* 0F50 */ 0x85, 0xD4, 0x00, 0x3B, 0xA3, 0x3D, 0xB3, 0xB9, 0xC1, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..;=-......\n\t/* 0F60 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x49, 0x98, 0x81, 0xD0, 0xAD, 0xB2, 0x47,   // .........I..ЭG\n\t/* 0F70 */ 0xB3, 0xBA, 0x31, 0x6B, 0x12, 0xD6, 0x47, 0xB4, 0xE0, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 1k.G-......\n\t/* 0F80 */ 0x00, 0x0E, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE2, 0xB6, 0x68, 0x09, 0xCF, 0x6B, 0x46,   // ........ h.kF\n\t/* 0F90 */ 0x92, 0xD3, 0x45, 0xCD, 0x96, 0x4B, 0x95, 0x09, 0x0F, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .E.K..........\n\t/* 0FA0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x77, 0xEF, 0x09, 0xFD, 0x47, 0x56, 0xFF, 0x4E,   // ........w.GVN\n\t/* 0FB0 */ 0x80, 0x9C, 0xAF, 0x2B, 0x64, 0x65, 0x9A, 0x45, 0x2E, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..+de.E........\n\t/* 0FC0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x17, 0xEF, 0x01, 0x0D, 0x3E, 0x2A, 0x42,   // ........k...>*B\n\t/* 0FD0 */ 0xB4, 0xF8, 0x4E, 0xA8, 0x80, 0x03, 0x5E, 0x8F, 0x5D, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // N..^.].......\n\t/* 0FE0 */ 0x00, 0x0F, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x51, 0x72, 0xF7, 0x87, 0x0E, 0xD5, 0x48,   // ........\\Qr..H\n\t/* 0FF0 */ 0xA6, 0x76, 0xE6, 0x96, 0x2C, 0x3E, 0x11, 0x95, 0x7D, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // v.,>..}.......\n\t/* 1000 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD9, 0x8B, 0x8B, 0xA7, 0x17, 0x80, 0xF5, 0x4D,   // ............M\n\t/* 1010 */ 0xB8, 0x6A, 0x09, 0xF7, 0x56, 0xAF, 0xFA, 0x7C, 0x9C, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // j.V|........\n\t/* 1020 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF3, 0x8C, 0xA1, 0xCD, 0x96, 0xC1, 0xAD, 0x46,   // ..........F\n\t/* 1030 */ 0xB2, 0x89, 0x60, 0xC0, 0x72, 0x86, 0x99, 0x94, 0xB7, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`r..........\n\t/* 1040 */ 0x00, 0x10, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB9, 0x1F, 0x53, 0x68, 0x11, 0x55, 0x89, 0x49,   // .........Sh.U.I\n\t/* 1050 */ 0x97, 0xBE, 0xD1, 0x1A, 0x0F, 0x55, 0x63, 0x3F, 0xDA, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...Uc?.......\n\t/* 1060 */ 0x00, 0x11, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x2B, 0x0E, 0x62, 0xE7, 0x09, 0xFD, 0x42,   // ........=+.b.B\n\t/* 1070 */ 0x80, 0x2A, 0x17, 0xA1, 0x36, 0x52, 0xFE, 0x7A, 0xFA, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .*.6Rz.......\n\t/* 1080 */ 0x00, 0x11, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1B, 0xE6, 0x82, 0x74, 0x89, 0xC5, 0x7F, 0x4B,   // ..........t..K\n\t/* 1090 */ 0x8E, 0xCC, 0x46, 0xD4, 0x55, 0xAC, 0x3B, 0x87, 0x1C, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .FU;../......\n\t/* 10A0 */ 0x00, 0x12, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x85, 0x26, 0x8A, 0x7E, 0x1C, 0xD3, 0x48,   // ..........&.~.H\n\t/* 10B0 */ 0xA6, 0x87, 0xFB, 0xCA, 0x9B, 0x9A, 0xC1, 0x6B, 0x3E, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...k>/......\n\t/* 10C0 */ 0x00, 0x12, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3D, 0x64, 0xD3, 0x42, 0x0C, 0x2D, 0x41,   // ........`=dB.-A\n\t/* 10D0 */ 0xA7, 0xD6, 0x52, 0xE6, 0x63, 0x53, 0x27, 0xF6, 0x6C, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // RcS'l/......\n\t/* 10E0 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x83, 0x1C, 0xFD, 0x95, 0xF5, 0x7D, 0x4A, 0x49,   // ...........}JI\n\t/* 10F0 */ 0xBE, 0x8B, 0x13, 0x00, 0xE1, 0xC9, 0xD1, 0xCD, 0x8B, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..../......\n\t/* 1100 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x86, 0x54, 0x7D, 0x20, 0xE1, 0x71, 0x47,   // .........T} qG\n\t/* 1110 */ 0xB7, 0xF1, 0x7B, 0x56, 0xC6, 0xD3, 0x17, 0x0C, 0xB2, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {V../......\n\t/* 1120 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x41, 0xEC, 0xF5, 0xF0, 0x55, 0x0D, 0x32, 0x47,   // ........AU.2G\n\t/* 1130 */ 0xAF, 0x02, 0x44, 0x0A, 0x44, 0xA3, 0xCF, 0x0F, 0xDA, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D.D./......\n\t/* 1140 */ 0x00, 0x13, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xA2, 0x43, 0xB7, 0xD4, 0x68, 0xD3, 0x4D,   // ........ChM\n\t/* 1150 */ 0xAF, 0x32, 0x92, 0x42, 0x5B, 0x7B, 0xB6, 0x23, 0xF7, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 2.B[{#/......\n\t/* 1160 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x44, 0x13, 0x09, 0x00, 0xA4, 0x1E, 0x37, 0x4F,   // ........D....7O\n\t/* 1170 */ 0xB7, 0x89, 0x01, 0x75, 0x0B, 0xA6, 0x98, 0x8C, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..u....0......\n\t/* 1180 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xA4, 0x6B, 0xDB, 0x21, 0x7B, 0x9A, 0x14, 0x4A,   // ........k!{..J\n\t/* 1190 */ 0x9E, 0x29, 0x64, 0xA6, 0x0C, 0x59, 0x30, 0x1D, 0x3E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .)d.Y0.>0......\n\t/* 11A0 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x04, 0xCA, 0xB3, 0x58, 0xA3, 0x68, 0x4D,   // ........N.ʳXhM\n\t/* 11B0 */ 0x98, 0x83, 0xAA, 0xA2, 0x94, 0x1A, 0xCA, 0x99, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....`0......\n\t/* 11C0 */ 0x00, 0x14, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x34, 0xBF, 0x3D, 0x6C, 0x5F, 0xA7, 0x4F,   // .........4=l_O\n\t/* 11D0 */ 0xB9, 0x36, 0x69, 0x9D, 0xCE, 0x9E, 0x26, 0x3F, 0x80, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 6i..&?.0......\n\t/* 11E0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x33, 0x44, 0x7B, 0xE7, 0xB1, 0x88, 0x47,   // ........3D{.G\n\t/* 11F0 */ 0x89, 0x5A, 0xC4, 0x53, 0x78, 0xD3, 0x82, 0x53, 0x9F, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ZSx.S.0......\n\t/* 1200 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x79, 0x67, 0xC5, 0x21, 0x49, 0xB4, 0x20, 0x4D,   // ........yg!I M\n\t/* 1210 */ 0xAD, 0xFC, 0xEE, 0xCE, 0x0E, 0x1A, 0xD7, 0x4B, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..K0......\n\t/* 1220 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1B, 0x5A, 0x2B, 0xAB, 0xA5, 0x54, 0x4C,   // ..........Z+TL\n\t/* 1230 */ 0xAC, 0x2F, 0xA6, 0xD9, 0x48, 0x24, 0xA2, 0x83, 0xE0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // /H$.0......\n\t/* 1240 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x10, 0x54, 0x1C, 0x8C, 0x39, 0x9F, 0x05, 0x48,   // .........T..9..H\n\t/* 1250 */ 0x8C, 0x9D, 0x63, 0xA0, 0x77, 0x06, 0x35, 0x8F, 0xFF, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..c.w.5.0......\n\t/* 1260 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x6E, 0xAF, 0xD9, 0x43, 0x86, 0x5E, 0xE8, 0x4B,   // ........nC.^K\n\t/* 1270 */ 0xA7, 0x97, 0xD0, 0x72, 0xA0, 0x46, 0x89, 0x6C, 0x1C, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .r.F.l.1......\n\t/* 1280 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x08, 0x9C, 0xE4, 0x82, 0xDA, 0xF8, 0x42,   // ...........B\n\t/* 1290 */ 0xBD, 0xE2, 0xB5, 0x70, 0xFB, 0xCA, 0xE7, 0x6C, 0x36, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // pl61......\n\t/* 12A0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x22, 0xEF, 0xC5, 0x61, 0x4F, 0xF1, 0x53, 0x45,   // ........\"aOSE\n\t/* 12B0 */ 0xA8, 0x24, 0xC4, 0xB3, 0x1E, 0x84, 0xB1, 0x00, 0x6B, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // $ĳ...k1......\n\t/* 12C0 */ 0x00, 0x15, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x44, 0x7C, 0x94, 0xBA, 0x9D, 0xD1, 0x86, 0x47,   // ........D|...G\n\t/* 12D0 */ 0xB6, 0xAE, 0x22, 0x77, 0x0B, 0xC9, 0x4C, 0x54, 0x9E, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // \"w.LT.1......\n\t/* 12E0 */ 0x00, 0x16, 0x06, 0x05, 0x00, 0x01, 0x00, 0x00, 0x06, 0x16, 0x3D, 0x4F, 0xEA, 0x3F, 0x01, 0x4C,   // ..........=O?.L\n\t/* 12F0 */ 0xBE, 0x3C, 0x8D, 0x67, 0x1C, 0x40, 0x1E, 0x3B, 0xC5, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // <.g.@.;1......\n\t/* 1300 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x2D, 0x68, 0x2C, 0x68, 0x8B, 0x63, 0x4F,   // ........-h,h.cO\n\t/* 1310 */ 0xA1, 0x65, 0xAE, 0x29, 0x1D, 0x4C, 0xF1, 0x38, 0xDC, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // e).L81......\n\t/* 1320 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xD8, 0xCF, 0xD7, 0xC0, 0x2B, 0x45,   // .........+E\n\t/* 1330 */ 0x9F, 0x60, 0xEF, 0x5C, 0x70, 0xC3, 0x20, 0x94, 0xF5, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`\\p .1......\n\t/* 1340 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x50, 0x49, 0xF5, 0xD4, 0xF2, 0x26, 0xB4, 0x4F,   // ........PI&O\n\t/* 1350 */ 0xBA, 0x21, 0xFF, 0xAB, 0x16, 0xAF, 0xCA, 0xDE, 0x0E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // !..2......\n\t/* 1360 */ 0x00, 0x17, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x72, 0xE8, 0xE7, 0x8C, 0x8C, 0x18, 0x98, 0x4B,   // ........r....K\n\t/* 1370 */ 0x9D, 0x90, 0xF8, 0xF9, 0x0B, 0x7A, 0xAD, 0x02, 0x29, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...z.)2......\n\t/* 1380 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x70, 0xD4, 0xE5, 0xCE, 0x3B, 0x6E, 0xCC, 0x4F,   // ........p;nO\n\t/* 1390 */ 0x8C, 0x2B, 0xD1, 0x74, 0x28, 0x56, 0x8A, 0x9F, 0x3C, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .+t(V..<2......\n\t/* 13A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xB8, 0xD0, 0x47, 0x89, 0x3B, 0xC3, 0xE1, 0x43,   // ........G.;C\n\t/* 13B0 */ 0x8C, 0x56, 0x9B, 0x67, 0x4C, 0x05, 0x28, 0x32, 0x4E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .V.gL.(2N2......\n\t/* 13C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x39, 0x66, 0x6B, 0xCA, 0xD6, 0x4A, 0xAE, 0x40,   // ........9fkJ@\n\t/* 13D0 */ 0xA5, 0x75, 0x14, 0xDE, 0xE0, 0x7F, 0x64, 0x30, 0x61, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // u..d0a2......\n\t/* 13E0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x40, 0x96, 0xED, 0x09, 0x20, 0xF0, 0x0A, 0x40,   // ........@.. .@\n\t/* 13F0 */ 0xAC, 0xD8, 0xD7, 0xD8, 0x67, 0xDF, 0xD9, 0xC2, 0x76, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // gv2......\n\t/* 1400 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x49, 0x4E, 0x3D, 0xEF, 0x3D, 0xA5, 0x81, 0x4D,   // ........IN==.M\n\t/* 1410 */ 0xA2, 0xB1, 0x2C, 0xA6, 0xC2, 0x55, 0x6B, 0x2C, 0x8A, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ,Uk,.2......\n\t/* 1420 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x5C, 0x6F, 0x58, 0xAB, 0x56, 0x52, 0x32, 0x46,   // ........\\oXVR2F\n\t/* 1430 */ 0x96, 0x2F, 0xFE, 0xFD, 0x8B, 0x49, 0xE6, 0xF4, 0x9E, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ./.I.2......\n\t/* 1440 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x92, 0xC1, 0xB7, 0xEC, 0xAB, 0x73, 0xED, 0x4D,   // .........sM\n\t/* 1450 */ 0xAC, 0xF4, 0x23, 0x99, 0xB0, 0x95, 0xD0, 0xCC, 0xB2, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // #..̲2......\n\t/* 1460 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x1D, 0x3B, 0x59, 0x45, 0xB1, 0xDF, 0x91, 0x4E,   // .........;YE.N\n\t/* 1470 */ 0xBB, 0xFB, 0x2D, 0x5D, 0x0C, 0xE2, 0x22, 0x7A, 0xC6, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // -].\"z2......\n\t/* 1480 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x60, 0x77, 0x32, 0x6F, 0x5C, 0x8C, 0x7C, 0x41,   // ........`w2o\\.|A\n\t/* 1490 */ 0x9B, 0x61, 0x83, 0x6A, 0x98, 0x28, 0x7E, 0x0C, 0xDD, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .a.j.(~.2......\n\t/* 14A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xF7, 0x3F, 0x13, 0xDF, 0x14, 0xBF, 0x95, 0x4F,   // ........?...O\n\t/* 14B0 */ 0xAF, 0xE3, 0x7B, 0x48, 0xE7, 0xE3, 0x31, 0xEF, 0xFB, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {H12......\n\t/* 14C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x61, 0xBF, 0xC7, 0x5D, 0xC9, 0x5E, 0x96, 0x49,   // ........a]^.I\n\t/* 14D0 */ 0x9C, 0xCB, 0xDF, 0x80, 0x6A, 0x2D, 0x0E, 0xFE, 0x13, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..j-..3......\n\t/* 14E0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x75, 0x4F, 0x0C, 0xB5, 0x9B, 0x59, 0xE8, 0x43,   // ........uO..YC\n\t/* 14F0 */ 0x8D, 0xCD, 0x10, 0x81, 0xA7, 0x96, 0x72, 0x41, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....rA03......\n\t/* 1500 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x87, 0x9E, 0x50, 0xEA, 0xA1, 0x07, 0x45, 0x4A,   // ..........P.EJ\n\t/* 1510 */ 0x9E, 0xDC, 0xEB, 0xA5, 0xA3, 0x9F, 0x36, 0xAF, 0x46, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .륣.6F3......\n\t/* 1520 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x78, 0xA6, 0xA2, 0x9D, 0x6B, 0xFB, 0x67, 0x4E,   // ........x.kgN\n\t/* 1530 */ 0xAB, 0x84, 0x60, 0xDD, 0x6A, 0x9C, 0x81, 0x9A, 0x68, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .`j...h3......\n\t/* 1540 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x05, 0x61, 0x23, 0x92, 0x67, 0xBB, 0x4F, 0x49,   // .........a#.gOI\n\t/* 1550 */ 0x94, 0xC7, 0x7F, 0x7A, 0x60, 0x79, 0x29, 0xBD, 0x7D, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..z`y)}3......\n\t/* 1560 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x9C, 0x38, 0x58, 0xE5, 0xC3, 0x83, 0x29, 0x4B,   // .........8X.)K\n\t/* 1570 */ 0xAD, 0xFE, 0x5E, 0x4D, 0x7F, 0x46, 0xC3, 0x58, 0x97, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ^M.FX.3......\n\t/* 1580 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xFF, 0x33, 0xD8, 0x9E, 0x92, 0x4F, 0x36, 0x4F,   // ........3..O6O\n\t/* 1590 */ 0xB3, 0x70, 0x86, 0x83, 0xA4, 0xF1, 0x32, 0x75, 0xAD, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // p..2u3......\n\t/* 15A0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xE7, 0x82, 0x08, 0x2D, 0xE7, 0xA4, 0x3B, 0x42,   // ..........-;B\n\t/* 15B0 */ 0x8C, 0xCC, 0x70, 0xD9, 0x1E, 0x01, 0x58, 0xB1, 0xC8, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .p..X3......\n\t/* 15C0 */ 0x01, 0x18, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x2C, 0x62, 0xE7, 0x6E, 0xD8, 0x18, 0x05, 0x40,   // ........,bn..@\n\t/* 15D0 */ 0x9F, 0xB7, 0x92, 0xDB, 0x64, 0x4A, 0x27, 0x9B, 0xD9, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..dJ'.3......\n\t/* 15E0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x52, 0x1D, 0x46, 0xF7, 0x2B, 0x7C, 0xB2, 0x43,   // ........R.F+|C\n\t/* 15F0 */ 0x87, 0x44, 0xEA, 0x95, 0x8E, 0x0B, 0xD0, 0x9A, 0xEC, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .D....3......\n\t/* 1600 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x40, 0x80, 0x0B, 0xA3, 0x8A, 0xD6, 0x3F, 0x42,   // ........@...?B\n\t/* 1610 */ 0xB0, 0xB5, 0x9C, 0xE2, 0x92, 0xEA, 0x5A, 0x8F, 0xFE, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Z.3......\n\t/* 1620 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE3, 0x11, 0x9F, 0x1B, 0x5C, 0xC8, 0x1B, 0x4E,   // ...........\\.N\n\t/* 1630 */ 0xBB, 0x29, 0x87, 0x9A, 0xD2, 0xC9, 0x09, 0xE3, 0x13, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // )....4......\n\t/* 1640 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x6B, 0x1C, 0x98, 0xDC, 0x8E, 0xFC, 0x0F, 0x42,   // ........k....B\n\t/* 1650 */ 0xAA, 0x43, 0xF8, 0xF3, 0x3E, 0x5C, 0x09, 0x23, 0x24, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // C>\\.#$4......\n\t/* 1660 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE6, 0xF3, 0xE1, 0xEF, 0xA2, 0xAE, 0x44, 0x41,   // ........DA\n\t/* 1670 */ 0xA2, 0x08, 0x32, 0xAA, 0x87, 0x2B, 0x65, 0x45, 0x36, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2.+eE64......\n\t/* 1680 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xFA, 0x3A, 0x1C, 0x77, 0xC5, 0x50, 0x3F, 0x44,   // ........:.wP?D\n\t/* 1690 */ 0xB1, 0x51, 0xFF, 0x25, 0x46, 0xD8, 0x63, 0xA0, 0x4A, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Q%Fc.J4......\n\t/* 16A0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x49, 0x26, 0x76, 0x8C, 0xD1, 0x97, 0x53, 0x49,   // ........I&v..SI\n\t/* 16B0 */ 0xAD, 0x27, 0xB7, 0xE2, 0xC2, 0x5B, 0x97, 0x2E, 0x5E, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // '[..^4......\n\t/* 16C0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x9C, 0xDA, 0x22, 0xB3, 0xE2, 0xA2, 0x58, 0x40,   // .........\"X@\n\t/* 16D0 */ 0x9E, 0x4E, 0xF5, 0x9A, 0x69, 0x70, 0xBD, 0x69, 0x75, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .N.ipiu4......\n\t/* 16E0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x4A, 0x12, 0x5D, 0x4A, 0x20, 0xE6, 0xBA, 0x44,   // ........J.]J D\n\t/* 16F0 */ 0xB6, 0xFF, 0x65, 0x89, 0x61, 0xB3, 0x3B, 0x9A, 0x93, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // e.a;..4......\n\t/* 1700 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xD1, 0x28, 0x7A, 0x42, 0x7C, 0xD1, 0xBF, 0x4A,   // ........(zB|ѿJ\n\t/* 1710 */ 0xB7, 0x17, 0x32, 0xC7, 0x80, 0xBA, 0x6F, 0x07, 0xAB, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2.o.4......\n\t/* 1720 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xF1, 0x9F, 0xC7, 0x00, 0x50, 0x68, 0x3D, 0x44,   // ..........Ph=D\n\t/* 1730 */ 0xBF, 0x61, 0x71, 0xCD, 0xE0, 0xDE, 0x30, 0x5F, 0xC8, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // aq0_4......\n\t/* 1740 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x38, 0xFB, 0x3A, 0xB1, 0x79, 0xCD, 0xE5, 0x4A,   // ........8:yJ\n\t/* 1750 */ 0x9F, 0x7F, 0xEE, 0xD0, 0x58, 0xD7, 0x50, 0xCA, 0xDE, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..XP4......\n\t/* 1760 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x0E, 0xC1, 0x3A, 0xE1, 0xD0, 0x75, 0xFF, 0x4A,   // .........:uJ\n\t/* 1770 */ 0xA0, 0xCD, 0x76, 0x49, 0x82, 0xCF, 0x54, 0x1C, 0xF3, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .vI.T.4......\n\t/* 1780 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xF0, 0xFA, 0x4E, 0xAC, 0x1F, 0xF8, 0x61, 0x4F,   // ........N.aO\n\t/* 1790 */ 0xBD, 0xF7, 0xEA, 0x32, 0xB0, 0x2A, 0xB1, 0x17, 0x09, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 2*..5......\n\t/* 17A0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xC6, 0xB1, 0xF5, 0xD9, 0x86, 0x53, 0x5A, 0x49,   // ........Ʊ.SZI\n\t/* 17B0 */ 0x88, 0xF9, 0x9A, 0xD6, 0xB4, 0x1A, 0xC9, 0xB3, 0x24, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..ִ.ɳ$5......\n\t/* 17C0 */ 0x02, 0x19, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0xE2, 0x38, 0xB5, 0x44, 0x34, 0xFB, 0x32, 0x47,   // ........8D42G\n\t/* 17D0 */ 0x81, 0xE4, 0x64, 0x4C, 0x17, 0xD2, 0xE7, 0x46, 0x35, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .dL.F55......\n\t/* 17E0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xA0, 0xBF, 0x73, 0x93, 0xB3, 0x97, 0x87, 0x45,   // .........s...E\n\t/* 17F0 */ 0xAB, 0x73, 0x30, 0x93, 0x44, 0x61, 0xD5, 0x5C, 0x56, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // s0.Da\\V5......\n\t/* 1800 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xB4, 0x6E, 0x28, 0xAA, 0x6F, 0x55, 0xEB, 0x4E,   // ........n(oUN\n\t/* 1810 */ 0x96, 0x7C, 0xC1, 0xB7, 0x71, 0xB7, 0x67, 0x3E, 0x76, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|qg>v5......\n\t/* 1820 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x56, 0x82, 0xCC, 0x7C, 0xAA, 0xFB, 0xC6, 0x49,   // ........V.|I\n\t/* 1830 */ 0xB2, 0xA9, 0xF5, 0xAF, 0xB4, 0x25, 0x7C, 0xD2, 0x97, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // %|.5......\n\t/* 1840 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x17, 0xFE, 0x3D, 0xC5, 0x00, 0xCC, 0x67, 0x49,   // .........=.gI\n\t/* 1850 */ 0xB1, 0x88, 0xA0, 0x88, 0xA9, 0x65, 0x49, 0x4D, 0xBA, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...eIM5......\n\t/* 1860 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x7D, 0xA8, 0x16, 0x28, 0xED, 0xE1, 0x97, 0x40,   // ........}.(.@\n\t/* 1870 */ 0xB3, 0x11, 0xE2, 0x34, 0x1C, 0x57, 0xB1, 0x79, 0xD9, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4.Wy5......\n\t/* 1880 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x08, 0xF9, 0xC0, 0x67, 0x4F, 0x18, 0x64, 0x4F,   // .........gO.dO\n\t/* 1890 */ 0x82, 0x50, 0x12, 0xDB, 0x79, 0x7A, 0xB3, 0xC3, 0xF9, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .P.yz5......\n\t/* 18A0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x7A, 0x4E, 0xCE, 0x7B, 0x80, 0xDD, 0x82, 0x46,   // ........zN{..F\n\t/* 18B0 */ 0x98, 0xFA, 0xF9, 0x93, 0x72, 0x58, 0x03, 0xD2, 0x1B, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..rX..6......\n\t/* 18C0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0A, 0x0C, 0xC1, 0x1E, 0xF6, 0x54, 0x3E, 0x45,   // ...........T>E\n\t/* 18D0 */ 0xB8, 0x5A, 0x6F, 0xA1, 0xBB, 0xFE, 0xA9, 0xB7, 0x3D, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Zo=6......\n\t/* 18E0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xBF, 0xB5, 0xD2, 0x87, 0x7B, 0xD4, 0xFB, 0x41,   // .........{A\n\t/* 18F0 */ 0xAF, 0x62, 0x71, 0xC3, 0x82, 0xF5, 0xCC, 0x85, 0x62, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // bq..b6......\n\t/* 1900 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xA9, 0x50, 0xFE, 0x3C, 0x03, 0x0E, 0x29, 0x4B,   // ........P<..)K\n\t/* 1910 */ 0x97, 0x54, 0x9F, 0x19, 0x3F, 0x07, 0xB7, 0x1F, 0x8E, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .T..?...6......\n\t/* 1920 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x57, 0x9E, 0xE4, 0x39, 0x68, 0xAE, 0xE3, 0x4E,   // ........W.9hN\n\t/* 1930 */ 0xB0, 0x98, 0x26, 0x48, 0x0D, 0xF3, 0xDA, 0x96, 0xB4, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .&H..6......\n\t/* 1940 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x17, 0x21, 0xAA, 0x15, 0x79, 0x8F, 0xA8, 0x49,   // .........!.y.I\n\t/* 1950 */ 0x83, 0x17, 0x75, 0x30, 0x26, 0xD6, 0xA0, 0x54, 0xDF, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..u0&.T6......\n\t/* 1960 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0E, 0xD6, 0xBF, 0xCF, 0x5F, 0x0B, 0x7D, 0x42,   // .........ֿ_.}B\n\t/* 1970 */ 0x91, 0x7C, 0xA4, 0xDF, 0x42, 0xA8, 0x0E, 0x44, 0x03, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .|B.D.7......\n\t/* 1980 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x81, 0xCC, 0x12, 0x70, 0x87, 0x88, 0xE9, 0x42,   // ..........p..B\n\t/* 1990 */ 0xB1, 0x7D, 0x4E, 0x5E, 0x42, 0x76, 0x0F, 0x0D, 0x27, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // }N^Bv..'7......\n\t/* 19A0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0xB6, 0x7E, 0x9C, 0xDE, 0x85, 0x5A, 0x0D, 0x42,   // ........~..Z.B\n\t/* 19B0 */ 0x97, 0x03, 0xFF, 0xF1, 0x1B, 0xDD, 0x4D, 0x43, 0x50, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...MCP7......\n\t/* 19C0 */ 0x02, 0x1A, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0C, 0xFC, 0xC0, 0x67, 0xBA, 0xDE, 0x1B, 0x40,   // .........g.@\n\t/* 19D0 */ 0xBF, 0x8B, 0x9C, 0x8A, 0xD8, 0x39, 0x58, 0x04, 0x6F, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...9X.o7......\n\t/* 19E0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x36, 0x5D, 0xE6, 0xC3, 0x1F, 0x14, 0x2F, 0x4D,   // ........6]../M\n\t/* 19F0 */ 0xA3, 0x03, 0xA8, 0x42, 0xEE, 0x75, 0x6A, 0x29, 0x82, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Buj).7......\n\t/* 1A00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xCB, 0xBC, 0xAA, 0x9C, 0xB1, 0x61, 0x4B, 0x4B,   // ........˼.aKK\n\t/* 1A10 */ 0x8B, 0xEC, 0xD1, 0x0A, 0x3C, 0x3A, 0xC2, 0xCE, 0x94, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..<:.7......\n\t/* 1A20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x6E, 0xEA, 0x14, 0xE9, 0xFA, 0xA5, 0x39, 0x44,   // ........n.9D\n\t/* 1A30 */ 0xA3, 0x94, 0xA9, 0xBB, 0x32, 0x93, 0xCA, 0x09, 0xA6, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .2..7......\n\t/* 1A40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x59, 0xCE, 0xCA, 0xD8, 0xD2, 0x33, 0xC7, 0x4A,   // ........Y3J\n\t/* 1A50 */ 0x9B, 0x1B, 0x9B, 0x72, 0x33, 0x9C, 0x51, 0xC8, 0xBA, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...r3.QȺ7......\n\t/* 1A60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x65, 0x92, 0x9D, 0xEC, 0x1E, 0x9D, 0xD0, 0x4E,   // ........e....N\n\t/* 1A70 */ 0x83, 0x8A, 0xCD, 0xC2, 0x0F, 0x25, 0x51, 0xA1, 0xCE, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...%Q7......\n\t/* 1A80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xBA, 0x1B, 0x0B, 0xD7, 0x93, 0xB8, 0x44, 0x45,   // ...........DE\n\t/* 1A90 */ 0x96, 0xE2, 0xB7, 0xA3, 0x18, 0x09, 0x1C, 0x33, 0xE2, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ⷣ...37......\n\t/* 1AA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x6F, 0x59, 0x50, 0xD4, 0x4D, 0x89, 0xE0, 0x49,   // ........oYPM.I\n\t/* 1AB0 */ 0x96, 0x6A, 0xFD, 0x39, 0xED, 0x4C, 0x4C, 0x64, 0xF9, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j9LLd7......\n\t/* 1AC0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x97, 0x41, 0x41, 0x4F, 0xC2, 0x0F, 0x01, 0x4C,   // .........AAO..L\n\t/* 1AD0 */ 0xB6, 0x8A, 0x86, 0xCB, 0xB9, 0xAC, 0x25, 0x4C, 0x17, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..˹%L.8......\n\t/* 1AE0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x10, 0x81, 0x9B, 0x82, 0x6F, 0x0E, 0x49, 0x43,   // ............o.IC\n\t/* 1AF0 */ 0xBC, 0xA4, 0x42, 0x80, 0x35, 0x77, 0x78, 0x8D, 0x2F, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // B.5wx./8......\n\t/* 1B00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xBC, 0xDA, 0x7D, 0xDA, 0xBE, 0x3F, 0x47, 0x44,   // ........}ھ?GD\n\t/* 1B10 */ 0x9E, 0x01, 0x6A, 0xB7, 0x44, 0x0B, 0x4C, 0xD4, 0x4B, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..jD.LK8......\n\t/* 1B20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x45, 0xCA, 0xBA, 0xCB, 0x6A, 0x55, 0x16, 0x44,   // ........EʺjU.D\n\t/* 1B30 */ 0xAD, 0x03, 0xBD, 0xA5, 0x98, 0xEA, 0xA7, 0xC8, 0x68, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..h8......\n\t/* 1B40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xCB, 0x06, 0x1A, 0x04, 0xB8, 0xC5, 0x72, 0x47,   // ...........rG\n\t/* 1B50 */ 0x80, 0x9F, 0x41, 0x6D, 0x03, 0xD1, 0x66, 0x54, 0x89, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Am.fT.8......\n\t/* 1B60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xE1, 0x4E, 0xE0, 0x83, 0x8D, 0xFA, 0x6D, 0x43,   // ........N..mC\n\t/* 1B70 */ 0x89, 0x94, 0xD3, 0x1A, 0x86, 0x2C, 0xAB, 0x77, 0x9F, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....,w.8......\n\t/* 1B80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x3D, 0xA2, 0xDF, 0xDE, 0xD1, 0x6E, 0xA6, 0x45,   // ........=nE\n\t/* 1B90 */ 0x85, 0xDC, 0x63, 0xCA, 0xE0, 0x54, 0x6D, 0xE6, 0xBE, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .cTm8......\n\t/* 1BA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xC1, 0x01, 0xF3, 0x6B, 0x4A, 0xB9, 0xE9, 0x43,   // .........kJC\n\t/* 1BB0 */ 0xBA, 0x31, 0xD4, 0x94, 0x59, 0x8C, 0x47, 0xFB, 0xD3, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 1.Y.G8......\n\t/* 1BC0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xE3, 0xAB, 0x34, 0xB2, 0x57, 0x08, 0x9C, 0x4F,   // ........4W..O\n\t/* 1BD0 */ 0xB0, 0x5A, 0x4D, 0xC3, 0x14, 0xF8, 0x55, 0x57, 0xE9, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ZM.UW8......\n\t/* 1BE0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x21, 0x78, 0x2A, 0xAA, 0x27, 0x18, 0x2C, 0x4C,   // ........!x*'.,L\n\t/* 1BF0 */ 0x8F, 0x1D, 0x45, 0x13, 0xA3, 0x4D, 0xDA, 0x97, 0x03, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..E.M..9......\n\t/* 1C00 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x20, 0xE6, 0x1F, 0x36, 0xF4, 0x64, 0xB5, 0x41,   // ........ .6dA\n\t/* 1C10 */ 0xBA, 0x77, 0x84, 0xF8, 0xE0, 0x79, 0xB1, 0xF7, 0x1E, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // w.y.9......\n\t/* 1C20 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xDF, 0xBA, 0x11, 0xBB, 0xAA, 0xD8, 0x0E, 0x47,   // ........ߺ..G\n\t/* 1C30 */ 0x93, 0x11, 0x20, 0xEA, 0xF8, 0x0F, 0xE5, 0xCC, 0x3D, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .. .=9......\n\t/* 1C40 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x85, 0x88, 0xC8, 0x0B, 0x8C, 0x71, 0x1D, 0x49,   // ............q.I\n\t/* 1C50 */ 0x92, 0x1F, 0x6F, 0x21, 0x43, 0x49, 0xE7, 0x9C, 0x4E, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..o!CI.N9......\n\t/* 1C60 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x4D, 0x7C, 0xFC, 0x85, 0x2E, 0xB9, 0x4B,   // .........M|..K\n\t/* 1C70 */ 0xAF, 0xD4, 0x01, 0xED, 0x14, 0x76, 0xB5, 0xE9, 0x78, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..vx9......\n\t/* 1C80 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0x19, 0x66, 0x0F, 0x50, 0x93, 0xEF, 0x75, 0x4B,   // .........f.P.uK\n\t/* 1C90 */ 0xBC, 0xB4, 0x82, 0x81, 0x99, 0x98, 0xA3, 0xCA, 0x9C, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....9......\n\t/* 1CA0 */ 0x02, 0x1B, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xEB, 0xCE, 0x9B, 0x9E, 0x36, 0xE7, 0x26, 0x4F,   // ..........6&O\n\t/* 1CB0 */ 0x88, 0xDE, 0x76, 0x3F, 0x87, 0xDC, 0xC4, 0x85, 0xBE, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .v?..9......\n\t/* 1CC0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xE9, 0x54, 0x78, 0x23, 0xFC, 0x79, 0x97, 0x44,   // ........Tx#y.D\n\t/* 1CD0 */ 0xA0, 0xC1, 0xA7, 0x09, 0x69, 0x69, 0x1C, 0x6B, 0xD1, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..ii.k9......\n\t/* 1CE0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x01, 0xA3, 0xF8, 0xC8, 0xF5, 0x19, 0x32, 0x41,   // ..........2A\n\t/* 1CF0 */ 0x96, 0xCE, 0x2D, 0xE9, 0xD4, 0xAD, 0xBD, 0x33, 0xE3, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .-ԭ39......\n\t/* 1D00 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x61, 0xFD, 0x31, 0x31, 0x4F, 0x5E, 0x08, 0x43,   // ........a11O^.C\n\t/* 1D10 */ 0x8D, 0x6D, 0x62, 0xBE, 0x19, 0x87, 0xC9, 0x2C, 0xF7, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .mb..,9......\n\t/* 1D20 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x5F, 0x8B, 0xDD, 0x85, 0xA4, 0xEA, 0xF3, 0x4A,   // ........_..J\n\t/* 1D30 */ 0xA6, 0x28, 0xCC, 0xE9, 0xE7, 0x7C, 0x9A, 0x03, 0x0E, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // (|...:......\n\t/* 1D40 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x3F, 0xBF, 0xA2, 0x2C, 0x9E, 0x94, 0x6A, 0x44,   // ........?,..jD\n\t/* 1D50 */ 0x82, 0xC7, 0xE2, 0x5A, 0x15, 0xEC, 0x78, 0xC4, 0x2C, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.x,:......\n\t/* 1D60 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xE3, 0xF0, 0x77, 0x17, 0x92, 0x73, 0x98, 0x41,   // ........w..s.A\n\t/* 1D70 */ 0x97, 0xEA, 0x8A, 0xE4, 0xDE, 0x6F, 0x63, 0x81, 0x44, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..oc.D:......\n\t/* 1D80 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xCA, 0x4C, 0x3E, 0x9D, 0x72, 0xE1, 0xF1, 0x46,   // ........L>.rF\n\t/* 1D90 */ 0xA2, 0xF4, 0x1D, 0x21, 0x07, 0x05, 0x14, 0x44, 0x61, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .!...Da:......\n\t/* 1DA0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x6E, 0x6C, 0x4C, 0x73, 0xBA, 0xB0, 0x98, 0x42,   // ........nlLs.B\n\t/* 1DB0 */ 0xA8, 0x91, 0x67, 0x17, 0x72, 0xB2, 0xBD, 0x1B, 0x77, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .g.r.w:......\n\t/* 1DC0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x4B, 0xA7, 0x12, 0x69, 0xFB, 0xA5, 0x1A, 0x40,   // ........K.i.@\n\t/* 1DD0 */ 0xBF, 0xDB, 0x2E, 0x3A, 0xB4, 0x6F, 0x4B, 0x02, 0x96, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .:oK..:......\n\t/* 1DE0 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x8F, 0xF0, 0x5C, 0x5B, 0x1A, 0xB8, 0x1D, 0x43,   // .........\\[..C\n\t/* 1DF0 */ 0xB0, 0x80, 0x34, 0x50, 0xD8, 0x62, 0x05, 0x65, 0xAB, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4Pb.e:......\n\t/* 1E00 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xF3, 0x7D, 0x6D, 0xE0, 0xD0, 0xAA, 0x9D, 0x41,   // ........}mЪ.A\n\t/* 1E10 */ 0x8D, 0xFB, 0x0A, 0xC3, 0x7E, 0x2B, 0xDF, 0x39, 0xC1, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..~+9:......\n\t/* 1E20 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xFE, 0x34, 0x98, 0x05, 0xEA, 0xA8, 0xFF, 0x4B,   // ........4..K\n\t/* 1E30 */ 0xB6, 0x7B, 0x4D, 0x00, 0x6B, 0x54, 0x47, 0xD3, 0xDC, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // {M.kTG:......\n\t/* 1E40 */ 0x02, 0x1C, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0xD4, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........ ......\n\t/* 1E50 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x63, 0x45, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // .[....cE......\n\t/* 1E60 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........ ......\n\t/* 1E70 */ 0x80, 0xE2, 0x9F, 0x57, 0x00, 0x00, 0x00, 0x00, 0x39, 0x38, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // ..W....98......\n\t/* 1E80 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .........!......\n\t/* 1E90 */ 0x00, 0x7A, 0x60, 0x52, 0x00, 0x00, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x19, 0x00, 0x00,   // .z`R.....%......\n\t/* 1EA0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........-!......\n\t/* 1EB0 */ 0x80, 0xD2, 0x89, 0x50, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x23, 0x00, 0x00, 0x32, 0x15, 0x00, 0x00,   // ..P....#..2...\n\t/* 1EC0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........E!......\n\t/* 1ED0 */ 0x80, 0xFC, 0x62, 0x4D, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x1D, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .bM..........\n\t/* 1EE0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........d!......\n\t/* 1EF0 */ 0x00, 0x31, 0x1B, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x72, 0x17, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .1.J....r......\n\t/* 1F00 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ........03612-00\n\t/* 1F10 */ 0x32, 0x30, 0x36, 0x2D, 0x35, 0x35, 0x36, 0x2D, 0x31, 0x32, 0x33, 0x37, 0x32, 0x37, 0x2D, 0x30,   // 206-556-123727-0\n\t/* 1F20 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 1F30 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // 0-2972018.Window\n\t/* 1F40 */ 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // s.Windows Server\n\t/* 1F50 */ 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x30, 0x39,   //  2019.03612-0009\n\t/* 1F60 */ 0x36, 0x2D, 0x31, 0x39, 0x39, 0x2D, 0x37, 0x39, 0x39, 0x31, 0x38, 0x38, 0x2D, 0x30, 0x33, 0x2D,   // 6-199-799188-03-\n\t/* 1F70 */ 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D,   // 1033-17763.0000-\n\t/* 1F80 */ 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30,   // 2972018.Office20\n\t/* 1F90 */ 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x30,   // 10.Office 2010.0\n\t/* 1FA0 */ 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x32, 0x34, 0x30, 0x2D, 0x37,   // 3612-00206-240-7\n\t/* 1FB0 */ 0x31, 0x39, 0x36, 0x33, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37,   // 19639-03-1033-17\n\t/* 1FC0 */ 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38,   // 763.0000-2972018\n\t/* 1FD0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69,   // .Office2013.Offi\n\t/* 1FE0 */ 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ce 2013.03612-00\n\t/* 1FF0 */ 0x32, 0x30, 0x36, 0x2D, 0x34, 0x33, 0x38, 0x2D, 0x30, 0x30, 0x34, 0x35, 0x33, 0x32, 0x2D, 0x30,   // 206-438-004532-0\n\t/* 2000 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 2010 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // 0-2972018.Office\n\t/* 2020 */ 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36,   // 2016.Office 2016\n\t/* 2030 */ 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x33, 0x38, 0x35, 0x38, 0x2D, 0x30, 0x35, 0x33,   // .03612-03858-053\n\t/* 2040 */ 0x2D, 0x30, 0x38, 0x39, 0x35, 0x31, 0x36, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D,   // -089516-03-1033-\n\t/* 2050 */ 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30,   // 17763.0000-29720\n\t/* 2060 */ 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x47, 0x6F, 0x76, 0x00, 0x57,   // 18.WinChinaGov.W\n\t/* 2070 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20,   // indows 10 China \n\t/* 2080 */ 0x47, 0x6F, 0x76, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32,   // Government.03612\n\t/* 2090 */ 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x36, 0x38, 0x34, 0x2D, 0x31, 0x33, 0x37, 0x36, 0x36,   // -00206-684-13766\n\t/* 20A0 */ 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E,   // 9-03-1033-17763.\n\t/* 20B0 */ 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66,   // 0000-2972018.Off\n\t/* 20C0 */ 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32,   // ice2019.Office 2\n\t/* 20D0 */ 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x31,   // 019.Windows 10 1\n\t/* 20E0 */ 0x38, 0x30, 0x39, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // 809 / Server 201\n\t/* 20F0 */ 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x31, 0x36, 0x30,   // 9.Windows 10 160\n\t/* 2100 */ 0x37, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00,   // 7 / Server 2016.\n\t/* 2110 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x2F, 0x20, 0x53, 0x65,   // Windows 8.1 / Se\n\t/* 2120 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x00, 0x57, 0x69, 0x6E,   // rver 2012 R2.Win\n\t/* 2130 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // dows 8 / Server \n\t/* 2140 */ 0x32, 0x30, 0x31, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x2F,   // 2012.Windows 7 /\n\t/* 2150 */ 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20,   //  Server 2008 R2 \n\t/* 2160 */ 0x53, 0x50, 0x31, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74,   // SP1.Windows Vist\n\t/* 2170 */ 0x61, 0x20, 0x2F, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // a / Server 2008 \n\t/* 2180 */ 0x53, 0x50, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x00, 0x4F, 0x66, 0x66, 0x69,   // SP2.Windows.Offi\n\t/* 2190 */ 0x63, 0x65, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31,   // ce2010.Office201\n\t/* 21A0 */ 0x33, 0x2B, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // 3+.Windows Serve\n\t/* 21B0 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31,   // r 2019.Windows 1\n\t/* 21C0 */ 0x30, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00,   // 0 2019 (Volume).\n\t/* 21D0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x55, 0x6E, 0x6B, 0x6E, 0x6F,   // Windows 10 Unkno\n\t/* 21E0 */ 0x77, 0x6E, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // wn (Volume).Wind\n\t/* 21F0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20, 0x47, 0x6F, 0x76,   // ows 10 China Gov\n\t/* 2200 */ 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ernment.Windows \n\t/* 2210 */ 0x31, 0x30, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29,   // 10 2016 (Volume)\n\t/* 2220 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x28, 0x52, 0x65, 0x74,   // .Windows 10 (Ret\n\t/* 2230 */ 0x61, 0x69, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // ail).Windows 10 \n\t/* 2240 */ 0x32, 0x30, 0x31, 0x35, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69,   // 2015 (Volume).Wi\n\t/* 2250 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ndows 7.Windows \n\t/* 2260 */ 0x38, 0x20, 0x28, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // 8 (Retail).Windo\n\t/* 2270 */ 0x77, 0x73, 0x20, 0x38, 0x20, 0x28, 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69,   // ws 8 (Volume).Wi\n\t/* 2280 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x28, 0x52, 0x65, 0x74, 0x61, 0x69,   // ndows 8.1 (Retai\n\t/* 2290 */ 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x28,   // l).Windows 8.1 (\n\t/* 22A0 */ 0x56, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // Volume).Windows \n\t/* 22B0 */ 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // Preview.Windows \n\t/* 22C0 */ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x41, 0x20, 0x28, 0x57,   // Server 2008 A (W\n\t/* 22D0 */ 0x65, 0x62, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x48, 0x50, 0x43, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // eb and HPC).Wind\n\t/* 22E0 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 22F0 */ 0x42, 0x20, 0x28, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x61, 0x6E, 0x64, 0x20,   // B (Standard and \n\t/* 2300 */ 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64,   // Enterprise).Wind\n\t/* 2310 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2320 */ 0x43, 0x20, 0x28, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x29, 0x00, 0x57,   // C (Datacenter).W\n\t/* 2330 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 2340 */ 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x41, 0x20, 0x28, 0x57, 0x65, 0x62, 0x20, 0x61, 0x6E, 0x64,   // 08 R2 A (Web and\n\t/* 2350 */ 0x20, 0x48, 0x50, 0x43, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   //  HPC).Windows Se\n\t/* 2360 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x42, 0x20, 0x28,   // rver 2008 R2 B (\n\t/* 2370 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x45, 0x6E, 0x74,   // Standard and Ent\n\t/* 2380 */ 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // erprise).Windows\n\t/* 2390 */ 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20,   //  Server 2008 R2 \n\t/* 23A0 */ 0x43, 0x20, 0x28, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x29, 0x00, 0x57,   // C (Datacenter).W\n\t/* 23B0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 23C0 */ 0x31, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // 12.Windows Serve\n\t/* 23D0 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // r 2012 R2.Window\n\t/* 23E0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x57, 0x69,   // s Server 2016.Wi\n\t/* 23F0 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x50, 0x72, 0x65,   // ndows Server Pre\n\t/* 2400 */ 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // view.Windows Vis\n\t/* 2410 */ 0x74, 0x61, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F,   // ta.Office 2010.O\n\t/* 2420 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // ffice 2013.Offic\n\t/* 2430 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65,   // e 2013 (Pre-Rele\n\t/* 2440 */ 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36,   // ase).Office 2016\n\t/* 2450 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E,   // .Office 2019.Win\n\t/* 2460 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39,   // dows Server 2019\n\t/* 2470 */ 0x20, 0x41, 0x52, 0x4D, 0x36, 0x34, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   //  ARM64.Windows S\n\t/* 2480 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x41, 0x7A, 0x75, 0x72, 0x65,   // erver 2019 Azure\n\t/* 2490 */ 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   //  Core.Windows Se\n\t/* 24A0 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65,   // rver 2019 Datace\n\t/* 24B0 */ 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72,   // nter.Windows Ser\n\t/* 24C0 */ 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69,   // ver 2019 Essenti\n\t/* 24D0 */ 0x61, 0x6C, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76,   // als.Windows Serv\n\t/* 24E0 */ 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64,   // er 2019 Standard\n\t/* 24F0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 2500 */ 0x32, 0x30, 0x31, 0x39, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20,   // 2019 Datacenter \n\t/* 2510 */ 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x43, 0x68, 0x61,   // (Semi-Annual Cha\n\t/* 2520 */ 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   // nnel).Windows Se\n\t/* 2530 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // rver 2019 Standa\n\t/* 2540 */ 0x72, 0x64, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61, 0x6C, 0x20,   // rd (Semi-Annual \n\t/* 2550 */ 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Channel).Windows\n\t/* 2560 */ 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4C,   //  10 Enterprise L\n\t/* 2570 */ 0x54, 0x53, 0x43, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // TSC 2019.Windows\n\t/* 2580 */ 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4C,   //  10 Enterprise L\n\t/* 2590 */ 0x54, 0x53, 0x43, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // TSC 2019 N.Windo\n\t/* 25A0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65,   // ws 10 Enterprise\n\t/* 25B0 */ 0x20, 0x47, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   //  G.Windows 10 En\n\t/* 25C0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x47, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64,   // terprise GN.Wind\n\t/* 25D0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73,   // ows 10 Enterpris\n\t/* 25E0 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x4C, 0x54, 0x53, 0x42, 0x00, 0x57, 0x69, 0x6E, 0x64,   // e 2016 LTSB.Wind\n\t/* 25F0 */ 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73,   // ows 10 Enterpris\n\t/* 2600 */ 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x4C, 0x54, 0x53, 0x42, 0x20, 0x4E, 0x00, 0x57, 0x69,   // e 2016 LTSB N.Wi\n\t/* 2610 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x00, 0x57, 0x69,   // ndows 10 Home.Wi\n\t/* 2620 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x20, 0x43, 0x6F,   // ndows 10 Home Co\n\t/* 2630 */ 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57,   // untry Specific.W\n\t/* 2640 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65, 0x20, 0x4E,   // indows 10 Home N\n\t/* 2650 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x48, 0x6F, 0x6D, 0x65,   // .Windows 10 Home\n\t/* 2660 */ 0x20, 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65,   //  Single Language\n\t/* 2670 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x64, 0x75, 0x63,   // .Windows 10 Educ\n\t/* 2680 */ 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30,   // ation.Windows 10\n\t/* 2690 */ 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E,   //  Education N.Win\n\t/* 26A0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 26B0 */ 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   // se.Windows 10 En\n\t/* 26C0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x4C, 0x54,   // terprise 2015 LT\n\t/* 26D0 */ 0x53, 0x42, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E,   // SB.Windows 10 En\n\t/* 26E0 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x4C, 0x54,   // terprise 2015 LT\n\t/* 26F0 */ 0x53, 0x42, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // SB N.Windows 10 \n\t/* 2700 */ 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E,   // Enterprise N.Win\n\t/* 2710 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // dows 10 Professi\n\t/* 2720 */ 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E,   // onal Workstation\n\t/* 2730 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66,   // .Windows 10 Prof\n\t/* 2740 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x74, 0x61,   // essional Worksta\n\t/* 2750 */ 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31,   // tion N.Windows 1\n\t/* 2760 */ 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57,   // 0 Professional.W\n\t/* 2770 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // indows 10 Profes\n\t/* 2780 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E,   // sional Education\n\t/* 2790 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66,   // .Windows 10 Prof\n\t/* 27A0 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69,   // essional Educati\n\t/* 27B0 */ 0x6F, 0x6E, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20,   // on N.Windows 10 \n\t/* 27C0 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00, 0x57,   // Professional N.W\n\t/* 27D0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // indows 10 Profes\n\t/* 27E0 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57,   // sional Preview.W\n\t/* 27F0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70,   // indows 10 Enterp\n\t/* 2800 */ 0x72, 0x69, 0x73, 0x65, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E,   // rise Preview.Win\n\t/* 2810 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 2820 */ 0x73, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x20, 0x44,   // se for Virtual D\n\t/* 2830 */ 0x65, 0x73, 0x6B, 0x74, 0x6F, 0x70, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // esktops.Windows \n\t/* 2840 */ 0x31, 0x30, 0x20, 0x52, 0x65, 0x6D, 0x6F, 0x74, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // 10 Remote Server\n\t/* 2850 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x53, 0x20, 0x28, 0x4C,   // .Windows 10 S (L\n\t/* 2860 */ 0x65, 0x61, 0x6E, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45,   // ean).Windows 7 E\n\t/* 2870 */ 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // nterprise.Window\n\t/* 2880 */ 0x73, 0x20, 0x37, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x45,   // s 7 Enterprise E\n\t/* 2890 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72,   // .Windows 7 Enter\n\t/* 28A0 */ 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // prise N.Windows \n\t/* 28B0 */ 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57,   // 7 Professional.W\n\t/* 28C0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // indows 7 Profess\n\t/* 28D0 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x45, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // ional E.Windows \n\t/* 28E0 */ 0x37, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E,   // 7 Professional N\n\t/* 28F0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64,   // .Windows 7 Embed\n\t/* 2900 */ 0x64, 0x65, 0x64, 0x20, 0x50, 0x4F, 0x53, 0x52, 0x65, 0x61, 0x64, 0x79, 0x00, 0x57, 0x69, 0x6E,   // ded POSReady.Win\n\t/* 2910 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x37, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // dows 7 Embedded \n\t/* 2920 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Standard.Windows\n\t/* 2930 */ 0x20, 0x37, 0x20, 0x54, 0x68, 0x69, 0x6E, 0x50, 0x43, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  7 ThinPC.Window\n\t/* 2940 */ 0x73, 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // s 8 Core.Windows\n\t/* 2950 */ 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20,   //  8 Core Country \n\t/* 2960 */ 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Specific.Windows\n\t/* 2970 */ 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  8 Core N.Window\n\t/* 2980 */ 0x73, 0x20, 0x38, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20,   // s 8 Core Single \n\t/* 2990 */ 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // Language.Windows\n\t/* 29A0 */ 0x20, 0x38, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20,   //  8 Professional \n\t/* 29B0 */ 0x57, 0x4D, 0x43, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6D,   // WMC.Windows 8 Em\n\t/* 29C0 */ 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20,   // bedded Industry \n\t/* 29D0 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E,   // Professional.Win\n\t/* 29E0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // dows 8 Embedded \n\t/* 29F0 */ 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72,   // Industry Enterpr\n\t/* 2A00 */ 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x45, 0x6E,   // ise.Windows 8 En\n\t/* 2A10 */ 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73,   // terprise.Windows\n\t/* 2A20 */ 0x20, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00,   //  8 Enterprise N.\n\t/* 2A30 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73,   // Windows 8 Profes\n\t/* 2A40 */ 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38,   // sional.Windows 8\n\t/* 2A50 */ 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00,   //  Professional N.\n\t/* 2A60 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65,   // Windows 8.1 Core\n\t/* 2A70 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72,   // .Windows 8.1 Cor\n\t/* 2A80 */ 0x65, 0x20, 0x41, 0x52, 0x4D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E,   // e ARM.Windows 8.\n\t/* 2A90 */ 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53,   // 1 Core Country S\n\t/* 2AA0 */ 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // pecific.Windows \n\t/* 2AB0 */ 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // 8.1 Core N.Windo\n\t/* 2AC0 */ 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x53, 0x69, 0x6E, 0x67,   // ws 8.1 Core Sing\n\t/* 2AD0 */ 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // le Language.Wind\n\t/* 2AE0 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // ows 8.1 Professi\n\t/* 2AF0 */ 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6E, 0x74, 0x00, 0x57, 0x69, 0x6E,   // onal Student.Win\n\t/* 2B00 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // dows 8.1 Profess\n\t/* 2B10 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6E, 0x74, 0x20, 0x4E, 0x00,   // ional Student N.\n\t/* 2B20 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66,   // Windows 8.1 Prof\n\t/* 2B30 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x4D, 0x43, 0x00, 0x57, 0x69, 0x6E,   // essional WMC.Win\n\t/* 2B40 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F,   // dows 8.1 Core Co\n\t/* 2B50 */ 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20,   // nnected.Windows \n\t/* 2B60 */ 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74,   // 8.1 Core Connect\n\t/* 2B70 */ 0x65, 0x64, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69,   // ed Country Speci\n\t/* 2B80 */ 0x66, 0x69, 0x63, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20,   // fic.Windows 8.1 \n\t/* 2B90 */ 0x43, 0x6F, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x4E,   // Core Connected N\n\t/* 2BA0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x43, 0x6F, 0x72,   // .Windows 8.1 Cor\n\t/* 2BB0 */ 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x53, 0x69, 0x6E, 0x67,   // e Connected Sing\n\t/* 2BC0 */ 0x6C, 0x65, 0x20, 0x4C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // le Language.Wind\n\t/* 2BD0 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // ows 8.1 Enterpri\n\t/* 2BE0 */ 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45,   // se.Windows 8.1 E\n\t/* 2BF0 */ 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64,   // nterprise N.Wind\n\t/* 2C00 */ 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69,   // ows 8.1 Professi\n\t/* 2C10 */ 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31,   // onal.Windows 8.1\n\t/* 2C20 */ 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x4E, 0x00,   //  Professional N.\n\t/* 2C30 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6D, 0x62, 0x65,   // Windows 8.1 Embe\n\t/* 2C40 */ 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x50, 0x72,   // dded Industry Pr\n\t/* 2C50 */ 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // ofessional.Windo\n\t/* 2C60 */ 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20,   // ws 8.1 Embedded \n\t/* 2C70 */ 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x20, 0x41, 0x75, 0x74, 0x6F, 0x6D, 0x6F, 0x74,   // Industry Automot\n\t/* 2C80 */ 0x69, 0x76, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x31, 0x20,   // ive.Windows 8.1 \n\t/* 2C90 */ 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x49, 0x6E, 0x64, 0x75, 0x73, 0x74, 0x72,   // Embedded Industr\n\t/* 2CA0 */ 0x79, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E,   // y Enterprise.Win\n\t/* 2CB0 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69,   // dows 10 Enterpri\n\t/* 2CC0 */ 0x73, 0x65, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // se Preview.Windo\n\t/* 2CD0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E,   // ws 10 Profession\n\t/* 2CE0 */ 0x61, 0x6C, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // al Preview.Windo\n\t/* 2CF0 */ 0x77, 0x73, 0x20, 0x31, 0x30, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E,   // ws 10 Profession\n\t/* 2D00 */ 0x61, 0x6C, 0x20, 0x57, 0x4D, 0x43, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x57,   // al WMC Preview.W\n\t/* 2D10 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x78, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69,   // indows 8.x Previ\n\t/* 2D20 */ 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x38, 0x2E, 0x78, 0x20, 0x50,   // ew.Windows 8.x P\n\t/* 2D30 */ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x41, 0x52, 0x4D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // review ARM.Windo\n\t/* 2D40 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x57,   // ws Server 2008 W\n\t/* 2D50 */ 0x65, 0x62, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65,   // eb.Windows Serve\n\t/* 2D60 */ 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x20, 0x43,   // r 2008 Compute C\n\t/* 2D70 */ 0x6C, 0x75, 0x73, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // luster.Windows S\n\t/* 2D80 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64,   // erver 2008 Stand\n\t/* 2D90 */ 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76,   // ard.Windows Serv\n\t/* 2DA0 */ 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64,   // er 2008 Standard\n\t/* 2DB0 */ 0x20, 0x77, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56,   //  without Hyper-V\n\t/* 2DC0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 2DD0 */ 0x32, 0x30, 0x30, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00,   // 2008 Enterprise.\n\t/* 2DE0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 2DF0 */ 0x30, 0x30, 0x38, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x77,   // 008 Enterprise w\n\t/* 2E00 */ 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56, 0x00, 0x57,   // ithout Hyper-V.W\n\t/* 2E10 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 2E20 */ 0x30, 0x38, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // 08 Datacenter.Wi\n\t/* 2E30 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30,   // ndows Server 200\n\t/* 2E40 */ 0x38, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74,   // 8 Datacenter wit\n\t/* 2E50 */ 0x68, 0x6F, 0x75, 0x74, 0x20, 0x48, 0x79, 0x70, 0x65, 0x72, 0x2D, 0x56, 0x00, 0x57, 0x69, 0x6E,   // hout Hyper-V.Win\n\t/* 2E60 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38,   // dows Server 2008\n\t/* 2E70 */ 0x20, 0x66, 0x6F, 0x72, 0x20, 0x49, 0x74, 0x61, 0x6E, 0x69, 0x75, 0x6D, 0x00, 0x57, 0x69, 0x6E,   //  for Itanium.Win\n\t/* 2E80 */ 0x64, 0x6F, 0x77, 0x73, 0x20, 0x4D, 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20,   // dows MultiPoint \n\t/* 2E90 */ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x57, 0x69, 0x6E, 0x64,   // Server 2010.Wind\n\t/* 2EA0 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2EB0 */ 0x52, 0x32, 0x20, 0x57, 0x65, 0x62, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // R2 Web.Windows S\n\t/* 2EC0 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32, 0x20, 0x48, 0x50,   // erver 2008 R2 HP\n\t/* 2ED0 */ 0x43, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // C Edition.Window\n\t/* 2EE0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32,   // s Server 2008 R2\n\t/* 2EF0 */ 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  Standard.Window\n\t/* 2F00 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x52, 0x32,   // s Server 2008 R2\n\t/* 2F10 */ 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   //  Enterprise.Wind\n\t/* 2F20 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20,   // ows Server 2008 \n\t/* 2F30 */ 0x52, 0x32, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // R2 Datacenter.Wi\n\t/* 2F40 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x30,   // ndows Server 200\n\t/* 2F50 */ 0x38, 0x20, 0x52, 0x32, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x49, 0x74, 0x61, 0x6E, 0x69, 0x75, 0x6D,   // 8 R2 for Itanium\n\t/* 2F60 */ 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   //  Enterprise.Wind\n\t/* 2F70 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20,   // ows Server 2012 \n\t/* 2F80 */ 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // Datacenter.Windo\n\t/* 2F90 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x4D,   // ws Server 2012 M\n\t/* 2FA0 */ 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x50, 0x72, 0x65, 0x6D, 0x69, 0x75,   // ultiPoint Premiu\n\t/* 2FB0 */ 0x6D, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,   // m.Windows Server\n\t/* 2FC0 */ 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x4D, 0x75, 0x6C, 0x74, 0x69, 0x50, 0x6F, 0x69, 0x6E, 0x74,   //  2012 MultiPoint\n\t/* 2FD0 */ 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   //  Standard.Window\n\t/* 2FE0 */ 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x53, 0x74,   // s Server 2012 St\n\t/* 2FF0 */ 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53,   // andard.Windows S\n\t/* 3000 */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x20, 0x43, 0x6C,   // erver 2012 R2 Cl\n\t/* 3010 */ 0x6F, 0x75, 0x64, 0x20, 0x53, 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65, 0x00, 0x57, 0x69, 0x6E, 0x64,   // oud Storage.Wind\n\t/* 3020 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20,   // ows Server 2012 \n\t/* 3030 */ 0x52, 0x32, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x57, 0x69,   // R2 Datacenter.Wi\n\t/* 3040 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // ndows Server 201\n\t/* 3050 */ 0x32, 0x20, 0x52, 0x32, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69, 0x61, 0x6C, 0x73, 0x00,   // 2 R2 Essentials.\n\t/* 3060 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 3070 */ 0x30, 0x31, 0x32, 0x20, 0x52, 0x32, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00,   // 012 R2 Standard.\n\t/* 3080 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 3090 */ 0x30, 0x31, 0x36, 0x20, 0x41, 0x7A, 0x75, 0x72, 0x65, 0x20, 0x43, 0x6F, 0x72, 0x65, 0x00, 0x57,   // 016 Azure Core.W\n\t/* 30A0 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 30B0 */ 0x31, 0x36, 0x20, 0x43, 0x6C, 0x6F, 0x75, 0x64, 0x20, 0x53, 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65,   // 16 Cloud Storage\n\t/* 30C0 */ 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,   // .Windows Server \n\t/* 30D0 */ 0x32, 0x30, 0x31, 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x00,   // 2016 Datacenter.\n\t/* 30E0 */ 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32,   // Windows Server 2\n\t/* 30F0 */ 0x30, 0x31, 0x36, 0x20, 0x45, 0x73, 0x73, 0x65, 0x6E, 0x74, 0x69, 0x61, 0x6C, 0x73, 0x00, 0x57,   // 016 Essentials.W\n\t/* 3100 */ 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30,   // indows Server 20\n\t/* 3110 */ 0x31, 0x36, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x00, 0x57, 0x69, 0x6E, 0x64,   // 16 Standard.Wind\n\t/* 3120 */ 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20,   // ows Server 2016 \n\t/* 3130 */ 0x41, 0x52, 0x4D, 0x36, 0x34, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65,   // ARM64.Windows Se\n\t/* 3140 */ 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65,   // rver 2016 Datace\n\t/* 3150 */ 0x6E, 0x74, 0x65, 0x72, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E, 0x6E, 0x75, 0x61,   // nter (Semi-Annua\n\t/* 3160 */ 0x6C, 0x20, 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F,   // l Channel).Windo\n\t/* 3170 */ 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x53,   // ws Server 2016 S\n\t/* 3180 */ 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x28, 0x53, 0x65, 0x6D, 0x69, 0x2D, 0x41, 0x6E,   // tandard (Semi-An\n\t/* 3190 */ 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x43, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, 0x29, 0x00, 0x57, 0x69,   // nual Channel).Wi\n\t/* 31A0 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31,   // ndows Server 201\n\t/* 31B0 */ 0x36, 0x20, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x50, 0x72, 0x65,   // 6 Datacenter Pre\n\t/* 31C0 */ 0x76, 0x69, 0x65, 0x77, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // view.Windows Vis\n\t/* 31D0 */ 0x74, 0x61, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x57, 0x69, 0x6E, 0x64,   // ta Business.Wind\n\t/* 31E0 */ 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74, 0x61, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65,   // ows Vista Busine\n\t/* 31F0 */ 0x73, 0x73, 0x20, 0x4E, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73,   // ss N.Windows Vis\n\t/* 3200 */ 0x74, 0x61, 0x20, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x00, 0x57, 0x69,   // ta Enterprise.Wi\n\t/* 3210 */ 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x56, 0x69, 0x73, 0x74, 0x61, 0x20, 0x45, 0x6E, 0x74, 0x65,   // ndows Vista Ente\n\t/* 3220 */ 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x4E, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // rprise N.Office \n\t/* 3230 */ 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69,   // Access 2010.Offi\n\t/* 3240 */ 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66,   // ce Excel 2010.Of\n\t/* 3250 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x47, 0x72, 0x6F, 0x6F, 0x76, 0x65, 0x20, 0x32, 0x30, 0x31, 0x30,   // fice Groove 2010\n\t/* 3260 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E, 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68,   // .Office InfoPath\n\t/* 3270 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E,   //  2010.Office Mon\n\t/* 3280 */ 0x64, 0x6F, 0x20, 0x31, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // do 1 2010.Office\n\t/* 3290 */ 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F, 0x20, 0x32, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66,   //  Mondo 2 2010.Of\n\t/* 32A0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31,   // fice OneNote 201\n\t/* 32B0 */ 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x4C, 0x6F, 0x6F, 0x6B,   // 0.Office OutLook\n\t/* 32C0 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77,   //  2010.Office Pow\n\t/* 32D0 */ 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // erPoint 2010.Off\n\t/* 32E0 */ 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C,   // ice Professional\n\t/* 32F0 */ 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   //  Plus 2010.Offic\n\t/* 3300 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30,   // e Project Pro 20\n\t/* 3310 */ 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63,   // 10.Office Projec\n\t/* 3320 */ 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00,   // t Standard 2010.\n\t/* 3330 */ 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72,   // Office Publisher\n\t/* 3340 */ 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6D, 0x61,   //  2010.Office Sma\n\t/* 3350 */ 0x6C, 0x6C, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x20, 0x42, 0x61, 0x73, 0x69,   // ll Business Basi\n\t/* 3360 */ 0x63, 0x73, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53,   // cs 2010.Office S\n\t/* 3370 */ 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // tandard 2010.Off\n\t/* 3380 */ 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x65, 0x6D, 0x69, 0x75,   // ice Visio Premiu\n\t/* 3390 */ 0x6D, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69,   // m 2010.Office Vi\n\t/* 33A0 */ 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66,   // sio Pro 2010.Off\n\t/* 33B0 */ 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // ice Visio Standa\n\t/* 33C0 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57,   // rd 2010.Office W\n\t/* 33D0 */ 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x30, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // ord 2010.Office \n\t/* 33E0 */ 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69,   // Access 2013.Offi\n\t/* 33F0 */ 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   // ce Excel 2013.Of\n\t/* 3400 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E, 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68, 0x20, 0x32, 0x30,   // fice InfoPath 20\n\t/* 3410 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4C, 0x79, 0x6E, 0x63, 0x20, 0x32,   // 13.Office Lync 2\n\t/* 3420 */ 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F,   // 013.Office Mondo\n\t/* 3430 */ 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x6E, 0x65,   //  2013.Office One\n\t/* 3440 */ 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // Note 2013.Office\n\t/* 3450 */ 0x20, 0x4F, 0x75, 0x74, 0x4C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   //  OutLook 2013.Of\n\t/* 3460 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20,   // fice PowerPoint \n\t/* 3470 */ 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66,   // 2013.Office Prof\n\t/* 3480 */ 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30,   // essional Plus 20\n\t/* 3490 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63,   // 13.Office Projec\n\t/* 34A0 */ 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // t Pro 2013.Offic\n\t/* 34B0 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // e Project Standa\n\t/* 34C0 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // rd 2013.Office P\n\t/* 34D0 */ 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66,   // ublisher 2013.Of\n\t/* 34E0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30,   // fice Standard 20\n\t/* 34F0 */ 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 13.Office Visio \n\t/* 3500 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Pro 2013.Office \n\t/* 3510 */ 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32,   // Visio Standard 2\n\t/* 3520 */ 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20,   // 013.Office Word \n\t/* 3530 */ 0x32, 0x30, 0x31, 0x33, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65,   // 2013.Office Acce\n\t/* 3540 */ 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C,   // ss 2013 (Pre-Rel\n\t/* 3550 */ 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63,   // ease).Office Exc\n\t/* 3560 */ 0x65, 0x6C, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C,   // el 2013 (Pre-Rel\n\t/* 3570 */ 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x47, 0x72, 0x6F,   // ease).Office Gro\n\t/* 3580 */ 0x6F, 0x76, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65,   // ove 2013 (Pre-Re\n\t/* 3590 */ 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x49, 0x6E,   // lease).Office In\n\t/* 35A0 */ 0x66, 0x6F, 0x50, 0x61, 0x74, 0x68, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65,   // foPath 2013 (Pre\n\t/* 35B0 */ 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // -Release).Office\n\t/* 35C0 */ 0x20, 0x4C, 0x79, 0x6E, 0x63, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D,   //  Lync 2013 (Pre-\n\t/* 35D0 */ 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Release).Office \n\t/* 35E0 */ 0x4D, 0x6F, 0x6E, 0x64, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D,   // Mondo 2013 (Pre-\n\t/* 35F0 */ 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Release).Office \n\t/* 3600 */ 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72,   // OneNote 2013 (Pr\n\t/* 3610 */ 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // e-Release).Offic\n\t/* 3620 */ 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28,   // e Outlook 2013 (\n\t/* 3630 */ 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66,   // Pre-Release).Off\n\t/* 3640 */ 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32,   // ice PowerPoint 2\n\t/* 3650 */ 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65,   // 013 (Pre-Release\n\t/* 3660 */ 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73,   // ).Office Profess\n\t/* 3670 */ 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20,   // ional Plus 2013 \n\t/* 3680 */ 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66,   // (Pre-Release).Of\n\t/* 3690 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F,   // fice Project Pro\n\t/* 36A0 */ 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61,   //  2013 (Pre-Relea\n\t/* 36B0 */ 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65,   // se).Office Proje\n\t/* 36C0 */ 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33,   // ct Standard 2013\n\t/* 36D0 */ 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F,   //  (Pre-Release).O\n\t/* 36E0 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20,   // ffice Publisher \n\t/* 36F0 */ 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73,   // 2013 (Pre-Releas\n\t/* 3700 */ 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // e).Office Visio \n\t/* 3710 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65,   // Pro 2013 (Pre-Re\n\t/* 3720 */ 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69,   // lease).Office Vi\n\t/* 3730 */ 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31,   // sio Standard 201\n\t/* 3740 */ 0x33, 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00,   // 3 (Pre-Release).\n\t/* 3750 */ 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x33,   // Office Word 2013\n\t/* 3760 */ 0x20, 0x28, 0x50, 0x72, 0x65, 0x2D, 0x52, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x29, 0x00, 0x4F,   //  (Pre-Release).O\n\t/* 3770 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31,   // ffice Access 201\n\t/* 3780 */ 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32,   // 6.Office Excel 2\n\t/* 3790 */ 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E, 0x64, 0x6F,   // 016.Office Mondo\n\t/* 37A0 */ 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4D, 0x6F, 0x6E,   //  2016.Office Mon\n\t/* 37B0 */ 0x64, 0x6F, 0x20, 0x52, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65,   // do R 2016.Office\n\t/* 37C0 */ 0x20, 0x4F, 0x6E, 0x65, 0x4E, 0x6F, 0x74, 0x65, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   //  OneNote 2016.Of\n\t/* 37D0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F, 0x6B, 0x20, 0x32, 0x30, 0x31,   // fice Outlook 201\n\t/* 37E0 */ 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F, 0x77, 0x65, 0x72, 0x70, 0x6F,   // 6.Office Powerpo\n\t/* 37F0 */ 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // int 2016.Office \n\t/* 3800 */ 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x50, 0x6C, 0x75,   // Professional Plu\n\t/* 3810 */ 0x73, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72,   // s 2016.Office Pr\n\t/* 3820 */ 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F,   // oject Pro 2016.O\n\t/* 3830 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72,   // ffice Project Pr\n\t/* 3840 */ 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // o 2016 C2R.Offic\n\t/* 3850 */ 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61,   // e Project Standa\n\t/* 3860 */ 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // rd 2016.Office P\n\t/* 3870 */ 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20,   // roject Standard \n\t/* 3880 */ 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // 2016 C2R.Office \n\t/* 3890 */ 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65, 0x72, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F,   // Publisher 2016.O\n\t/* 38A0 */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6B, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20,   // ffice Skype for \n\t/* 38B0 */ 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // Business 2016.Of\n\t/* 38C0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30,   // fice Standard 20\n\t/* 38D0 */ 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 16.Office Visio \n\t/* 38E0 */ 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20,   // Pro 2016.Office \n\t/* 38F0 */ 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43,   // Visio Pro 2016 C\n\t/* 3900 */ 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20,   // 2R.Office Visio \n\t/* 3910 */ 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // Standard 2016.Of\n\t/* 3920 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64,   // fice Visio Stand\n\t/* 3930 */ 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x43, 0x32, 0x52, 0x00, 0x4F, 0x66, 0x66,   // ard 2016 C2R.Off\n\t/* 3940 */ 0x69, 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x36, 0x00, 0x4F, 0x66,   // ice Word 2016.Of\n\t/* 3950 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61,   // fice Professiona\n\t/* 3960 */ 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20, 0x43, 0x32, 0x52, 0x20,   // l Plus 2019 C2R \n\t/* 3970 */ 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50,   // Preview.Office P\n\t/* 3980 */ 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x39, 0x20,   // roject Pro 2019 \n\t/* 3990 */ 0x43, 0x32, 0x52, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66, 0x66, 0x69,   // C2R Preview.Offi\n\t/* 39A0 */ 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31,   // ce Visio Pro 201\n\t/* 39B0 */ 0x39, 0x20, 0x43, 0x32, 0x52, 0x20, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x00, 0x4F, 0x66,   // 9 C2R Preview.Of\n\t/* 39C0 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39,   // fice Access 2019\n\t/* 39D0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x32, 0x30,   // .Office Excel 20\n\t/* 39E0 */ 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x4F, 0x75, 0x74, 0x6C, 0x6F, 0x6F,   // 19.Office Outloo\n\t/* 39F0 */ 0x6B, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x6F,   // k 2019.Office Po\n\t/* 3A00 */ 0x77, 0x65, 0x72, 0x70, 0x6F, 0x69, 0x6E, 0x74, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66,   // werpoint 2019.Of\n\t/* 3A10 */ 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x66, 0x65, 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x61,   // fice Professiona\n\t/* 3A20 */ 0x6C, 0x20, 0x50, 0x6C, 0x75, 0x73, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69,   // l Plus 2019.Offi\n\t/* 3A30 */ 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32,   // ce Project Pro 2\n\t/* 3A40 */ 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65,   // 019.Office Proje\n\t/* 3A50 */ 0x63, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39,   // ct Standard 2019\n\t/* 3A60 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x65,   // .Office Publishe\n\t/* 3A70 */ 0x72, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x6B,   // r 2019.Office Sk\n\t/* 3A80 */ 0x79, 0x70, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x42, 0x75, 0x73, 0x69, 0x6E, 0x65, 0x73, 0x73,   // ype for Business\n\t/* 3A90 */ 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61,   //  2019.Office Sta\n\t/* 3AA0 */ 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63,   // ndard 2019.Offic\n\t/* 3AB0 */ 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x50, 0x72, 0x6F, 0x20, 0x32, 0x30, 0x31, 0x39,   // e Visio Pro 2019\n\t/* 3AC0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x20, 0x56, 0x69, 0x73, 0x69, 0x6F, 0x20, 0x53, 0x74,   // .Office Visio St\n\t/* 3AD0 */ 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00, 0x4F, 0x66, 0x66, 0x69,   // andard 2019.Offi\n\t/* 3AE0 */ 0x63, 0x65, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x32, 0x30, 0x31, 0x39, 0x00,                     // ce Word 2019.\n};\n\n#elif defined(NO_STRICT_MODES)\n\nuint8_t DefaultKmsData[] =\n{\n\t/* 0000 */ 0x4B, 0x4D, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,   // KMD.............\n\t/* 0010 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ................\n\t/* 0020 */ 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........h.......\n\t/* 0030 */ 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // (.......(.......\n\t/* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...............\n\t/* 0050 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xC0, 0x97, 0xD7, 0x20,   // .[........ \n\t/* 0060 */ 0xBF, 0xC4, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x23, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\"....#.......\n\t/* 0070 */ 0x80, 0x4F, 0x3E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0xDC, 0x0B,   // .O>L....`.....\n\t/* 0080 */ 0x7F, 0x6A, 0xFE, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x61, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j.....a.......\n\t/* 0090 */ 0x00, 0x11, 0x07, 0x51, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x8E, 0xF2, 0x0D,   // ...Q..........\n\t/* 00A0 */ 0xFF, 0x3F, 0x42, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?B.............\n\t/* 00B0 */ 0x00, 0x9A, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x40, 0x17, 0x0C, 0x1A,   // ...V.......@...\n\t/* 00C0 */ 0xBF, 0xC8, 0x5B, 0x1B, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // [............\n\t/* 00D0 */ 0x80, 0x33, 0xE4, 0x58, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0F, 0x00, 0x00, 0xC0, 0xE1, 0xE4, 0x00,   // .3X.........\n\t/* 00E0 */ 0xFF, 0xC9, 0x9A, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;............\n\t/* 00F0 */ 0x00, 0x29, 0xA8, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x5A, 0xB2, 0x27,   // .)[........Z'\n\t/* 0100 */ 0x7F, 0x87, 0xE3, 0x28, 0x00, 0x00, 0x00, 0x00, 0x34, 0x27, 0xC9, 0x55, 0x82, 0xD6, 0x71, 0x4D,   // ..(....4'U.qM\n\t/* 0110 */ 0x98, 0x3E, 0xD6, 0xEC, 0x3F, 0x16, 0x05, 0x9F, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .>?...Z.......\n\t/* 0120 */ 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x81, 0x28, 0xA5, 0x59, 0x89, 0xA9, 0x9D, 0x47,   // ...2.....(Y..G\n\t/* 0130 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.cZ.......\n\t/* 0140 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x15, 0xCE, 0xF1, 0x0F, 0x89, 0xA9, 0x9D, 0x47,   // ............G\n\t/* 0150 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.cZ.......\n\t/* 0160 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x05, 0x00, 0x23, 0xBF, 0xA0, 0x7B, 0xF5, 0xD0, 0x72, 0x40,   // ........#.{r@\n\t/* 0170 */ 0x91, 0xD9, 0xD5, 0x5A, 0xF5, 0xA4, 0x81, 0xB6, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.Z.......\n\t/* 0180 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0x46, 0xF9, 0x5A, 0xE8, 0x25, 0x2E, 0xB7, 0x47,   // ........FZ%.G\n\t/* 0190 */ 0x83, 0xE1, 0xBE, 0xBC, 0xEB, 0xEA, 0xC6, 0x11, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ᾼ.Z.......\n\t/* 01A0 */ 0x01, 0x00, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xBF, 0xF1, 0xA6, 0xE6, 0x40, 0x9D, 0xC3, 0x40,   // ........@.@\n\t/* 01B0 */ 0xAA, 0x9F, 0xC7, 0x7B, 0xA2, 0x15, 0x78, 0xC0, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{.xZ.......\n\t/* 01C0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x68, 0x79, 0x4C, 0xAA, 0xDA, 0xB9, 0x80, 0x46,   // ........hyLڹ.F\n\t/* 01D0 */ 0x92, 0xB6, 0xAC, 0xB2, 0x5E, 0x2F, 0x86, 0x6C, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^/.lZ.......\n\t/* 01E0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1B, 0xF6, 0xB5, 0x85, 0x0B, 0x32, 0xE3, 0x4B,   // ...........2K\n\t/* 01F0 */ 0x81, 0x4A, 0xB7, 0x6B, 0x2B, 0xFA, 0xFC, 0x82, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Jk+.Z.......\n\t/* 0200 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xB1, 0x9E, 0x7D, 0x61, 0x36, 0xEF, 0x82, 0x4F,   // .........}a6.O\n\t/* 0210 */ 0x86, 0xE0, 0xA6, 0x5A, 0xE0, 0x7B, 0x96, 0xC6, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z{.Z.......\n\t/* 0220 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 0230 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x63, 0x45, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // .[....cE......\n\t/* 0240 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 0250 */ 0x80, 0xE2, 0x9F, 0x57, 0x00, 0x00, 0x00, 0x00, 0x39, 0x38, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // ..W....98......\n\t/* 0260 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 0270 */ 0x00, 0x7A, 0x60, 0x52, 0x00, 0x00, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x19, 0x00, 0x00,   // .z`R.....%......\n\t/* 0280 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 0290 */ 0x80, 0xD2, 0x89, 0x50, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x23, 0x00, 0x00, 0x32, 0x15, 0x00, 0x00,   // ..P....#..2...\n\t/* 02A0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 02B0 */ 0x80, 0xFC, 0x62, 0x4D, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x1D, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .bM..........\n\t/* 02C0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........Z.......\n\t/* 02D0 */ 0x00, 0x31, 0x1B, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x72, 0x17, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .1.J....r......\n\t/* 02E0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ........03612-00\n\t/* 02F0 */ 0x32, 0x30, 0x36, 0x2D, 0x35, 0x35, 0x36, 0x2D, 0x31, 0x32, 0x33, 0x37, 0x32, 0x37, 0x2D, 0x30,   // 206-556-123727-0\n\t/* 0300 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 0310 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // 0-2972018.Window\n\t/* 0320 */ 0x73, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x30, 0x39, 0x36, 0x2D, 0x31,   // s..03612-00096-1\n\t/* 0330 */ 0x39, 0x39, 0x2D, 0x37, 0x39, 0x39, 0x31, 0x38, 0x38, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33,   // 99-799188-03-103\n\t/* 0340 */ 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37,   // 3-17763.0000-297\n\t/* 0350 */ 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x30, 0x00,   // 2018.Office2010.\n\t/* 0360 */ 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x32, 0x34, 0x30,   // .03612-00206-240\n\t/* 0370 */ 0x2D, 0x37, 0x31, 0x39, 0x36, 0x33, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D,   // -719639-03-1033-\n\t/* 0380 */ 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30,   // 17763.0000-29720\n\t/* 0390 */ 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x33, 0x00, 0x00, 0x30,   // 18.Office2013..0\n\t/* 03A0 */ 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x34, 0x33, 0x38, 0x2D, 0x30,   // 3612-00206-438-0\n\t/* 03B0 */ 0x30, 0x34, 0x35, 0x33, 0x32, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37,   // 04532-03-1033-17\n\t/* 03C0 */ 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38,   // 763.0000-2972018\n\t/* 03D0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x36, 0x00, 0x00, 0x30, 0x33, 0x36,   // .Office2016..036\n\t/* 03E0 */ 0x31, 0x32, 0x2D, 0x30, 0x33, 0x38, 0x35, 0x38, 0x2D, 0x30, 0x35, 0x33, 0x2D, 0x30, 0x38, 0x39,   // 12-03858-053-089\n\t/* 03F0 */ 0x35, 0x31, 0x36, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36,   // 516-03-1033-1776\n\t/* 0400 */ 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57,   // 3.0000-2972018.W\n\t/* 0410 */ 0x69, 0x6E, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x47, 0x6F, 0x76, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31,   // inChinaGov..0361\n\t/* 0420 */ 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x36, 0x38, 0x34, 0x2D, 0x31, 0x33, 0x37, 0x36,   // 2-00206-684-1376\n\t/* 0430 */ 0x36, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33,   // 69-03-1033-17763\n\t/* 0440 */ 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66,   // .0000-2972018.Of\n\t/* 0450 */ 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x39, 0x00, 0x00, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77,   // fice2019..Unknow\n\t/* 0460 */ 0x6E, 0x00,                                                                                       // n.\n};\n\n#else // !defined(NO_STRICT_MODES)\n\nuint8_t DefaultKmsData[] =\n{\n\t/* 0000 */ 0x4B, 0x4D, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,   // KMD.............\n\t/* 0010 */ 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ................\n\t/* 0020 */ 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........h.......\n\t/* 0030 */ 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ................\n\t/* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...............\n\t/* 0050 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xC0, 0x97, 0xD7, 0x20,   // .[........ \n\t/* 0060 */ 0xBF, 0xC4, 0x08, 0x22, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .\"............\n\t/* 0070 */ 0x80, 0x4F, 0x3E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0xDC, 0x0B,   // .O>L....`.....\n\t/* 0080 */ 0x7F, 0x6A, 0xFE, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x41, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .j.....A.......\n\t/* 0090 */ 0x00, 0x11, 0x07, 0x51, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x8E, 0xF2, 0x0D,   // ...Q..........\n\t/* 00A0 */ 0xFF, 0x3F, 0x42, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ?B.............\n\t/* 00B0 */ 0x00, 0x9A, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x40, 0x17, 0x0C, 0x1A,   // ...V.......@...\n\t/* 00C0 */ 0xBF, 0xC8, 0x5B, 0x1B, 0x00, 0x00, 0x00, 0x00, 0xBD, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // [............\n\t/* 00D0 */ 0x80, 0x33, 0xE4, 0x58, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0F, 0x00, 0x00, 0xC0, 0xE1, 0xE4, 0x00,   // .3X.........\n\t/* 00E0 */ 0xFF, 0xC9, 0x9A, 0x3B, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;...........\n\t/* 00F0 */ 0x00, 0x29, 0xA8, 0x5B, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x80, 0x5A, 0xB2, 0x27,   // .)[........Z'\n\t/* 0100 */ 0x7F, 0x87, 0xE3, 0x28, 0x00, 0x00, 0x00, 0x00, 0x34, 0x27, 0xC9, 0x55, 0x82, 0xD6, 0x71, 0x4D,   // ..(....4'U.qM\n\t/* 0110 */ 0x98, 0x3E, 0xD6, 0xEC, 0x3F, 0x16, 0x05, 0x9F, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .>?...:.......\n\t/* 0120 */ 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x81, 0x28, 0xA5, 0x59, 0x89, 0xA9, 0x9D, 0x47,   // ...2.....(Y..G\n\t/* 0130 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c:.......\n\t/* 0140 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x15, 0xCE, 0xF1, 0x0F, 0x89, 0xA9, 0x9D, 0x47,   // ............G\n\t/* 0150 */ 0xAF, 0x46, 0xF2, 0x75, 0xC6, 0x37, 0x06, 0x63, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Fu7.c:.......\n\t/* 0160 */ 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x05, 0x00, 0xFB, 0xB1, 0x49, 0x84, 0xEA, 0xF0, 0x7A, 0x49,   // ........I.zI\n\t/* 0170 */ 0x99, 0xAB, 0x66, 0xCA, 0x96, 0xE9, 0xA0, 0xF5, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .f..:.......\n\t/* 0180 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x59, 0x56, 0xB1, 0x11, 0x03, 0xE6, 0xF1, 0x4C,   // ........YV..L\n\t/* 0190 */ 0x9C, 0x1F, 0xF0, 0xEC, 0x01, 0xB8, 0x18, 0x88, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .....:.......\n\t/* 01A0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x36, 0xD6, 0x7C, 0xD2, 0x62, 0x19, 0xE9, 0x44,   // ........6|b.D\n\t/* 01B0 */ 0x8B, 0x4F, 0x27, 0xB6, 0xC2, 0x3E, 0xFB, 0x85, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .O'>.:.......\n\t/* 01C0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x23, 0xBF, 0xA0, 0x7B, 0xF5, 0xD0, 0x72, 0x40,   // ........#.{r@\n\t/* 01D0 */ 0x91, 0xD9, 0xD5, 0x5A, 0xF5, 0xA4, 0x81, 0xB6, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z.:.......\n\t/* 01E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x04, 0x00, 0xC0, 0xE3, 0x9F, 0x96, 0xEC, 0xA3, 0x1A, 0x49,   // ...........I\n\t/* 01F0 */ 0x9F, 0x25, 0x42, 0x36, 0x05, 0xDE, 0xB3, 0x65, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .%B6.޳e:.......\n\t/* 0200 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x58, 0x13, 0xC5, 0xE1, 0x3E, 0xFE, 0x03, 0x42,   // ........X.>.B\n\t/* 0210 */ 0xA4, 0xA2, 0x3B, 0x6B, 0x20, 0xC9, 0x73, 0x4E, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ;k sN:.......\n\t/* 0220 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x4F, 0x13, 0xE2, 0x58, 0x11, 0x8E, 0x17, 0x4D,   // ........O.X...M\n\t/* 0230 */ 0x9C, 0xB2, 0x91, 0x06, 0x9C, 0x15, 0x11, 0x48, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ......H:.......\n\t/* 0240 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0x19, 0x52, 0xDE, 0x7F, 0xFA, 0xFB, 0x4A, 0x48,   // .........R.JH\n\t/* 0250 */ 0x82, 0xC9, 0x34, 0xD1, 0xAD, 0x53, 0xE8, 0x56, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .4ѭSV:.......\n\t/* 0260 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x7B, 0xB9, 0xBB, 0xA4, 0x8C, 0x28, 0x4A,   // ........;{.(J\n\t/* 0270 */ 0x97, 0x17, 0x89, 0xFA, 0xBD, 0x42, 0xC4, 0xAC, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ...BĬ:.......\n\t/* 0280 */ 0x00, 0x00, 0x05, 0x19, 0x01, 0x00, 0x00, 0x00, 0x58, 0xB3, 0x40, 0x3C, 0x48, 0x59, 0xAF, 0x45,   // ........X@<HYE\n\t/* 0290 */ 0x92, 0x3B, 0x53, 0xD2, 0x1F, 0xCC, 0x7E, 0x79, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .;S.~y:.......\n\t/* 02A0 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x90, 0x68, 0x64, 0x6D, 0x06, 0x36, 0x1A, 0x46,   // .........hdm.6.F\n\t/* 02B0 */ 0x86, 0xAB, 0x59, 0x8B, 0xB8, 0x4A, 0xCE, 0x82, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Y.J.:.......\n\t/* 02C0 */ 0x00, 0x00, 0x06, 0x19, 0x01, 0x00, 0x00, 0x00, 0x80, 0xC7, 0x8F, 0xCB, 0x05, 0x2C, 0x5A, 0x49,   // ...........,ZI\n\t/* 02D0 */ 0x97, 0x10, 0x85, 0xAF, 0xFF, 0xC9, 0x04, 0xD7, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ....:.......\n\t/* 02E0 */ 0x00, 0x00, 0x06, 0x19, 0x00, 0x00, 0x00, 0x00, 0xBB, 0xA0, 0x94, 0x5F, 0xA0, 0xD5, 0x81, 0x40,   // .........._..@\n\t/* 02F0 */ 0xA6, 0x85, 0x58, 0x19, 0x41, 0x8B, 0x2F, 0xE0, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .X.A./:.......\n\t/* 0300 */ 0x00, 0x00, 0x05, 0x19, 0x00, 0x01, 0x00, 0x00, 0xE4, 0x56, 0xE1, 0x33, 0x6F, 0xB7, 0x52, 0x4A,   // ........V3oRJ\n\t/* 0310 */ 0x9F, 0x91, 0xF6, 0x41, 0xDD, 0x95, 0xAC, 0x48, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..A.H:.......\n\t/* 0320 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x87, 0x33, 0xE5, 0x8F, 0x87, 0x30, 0x47, 0x44,   // .........3..0GD\n\t/* 0330 */ 0x89, 0x85, 0xF7, 0x51, 0x32, 0x21, 0x5A, 0xC9, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Q2!Z:.......\n\t/* 0340 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xFD, 0x21, 0x8A, 0xC5, 0xCB, 0xEB, 0x44,   // ........!.D\n\t/* 0350 */ 0x83, 0xF3, 0xFE, 0x28, 0x4E, 0x66, 0x80, 0xA7, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .(Nf.:.......\n\t/* 0360 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xCC, 0xC6, 0x0F, 0x0E, 0xFF, 0xAE, 0x4F,   // ..........O\n\t/* 0370 */ 0x9D, 0x08, 0x43, 0x70, 0x78, 0x5B, 0xF7, 0xED, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ..Cpx[:.......\n\t/* 0380 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xF5, 0x87, 0xCA, 0x46, 0xCD, 0xC0, 0x40,   // .........F@\n\t/* 0390 */ 0xB0, 0x6D, 0x8E, 0xCD, 0x57, 0xA4, 0x37, 0x3F, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // m.W7?:.......\n\t/* 03A0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x89, 0x26, 0xCA, 0xB2, 0xA8, 0xA9, 0xD7, 0x42,   // .........&ʲB\n\t/* 03B0 */ 0x93, 0x8D, 0xCF, 0x8E, 0x9F, 0x20, 0x19, 0x58, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .... .X:.......\n\t/* 03C0 */ 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCB, 0x65, 0x86, 0x8C, 0x46, 0xA3, 0x4A,   // ........qe..FJ\n\t/* 03D0 */ 0xA3, 0x37, 0xCB, 0x9B, 0xC9, 0xD5, 0xEA, 0xAC, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // 7.:.......\n\t/* 03E0 */ 0x00, 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0xD3, 0xEF, 0x56, 0x84, 0x04, 0x0C, 0x89, 0x40,   // ........V....@\n\t/* 03F0 */ 0x87, 0x40, 0x5B, 0x72, 0x38, 0x53, 0x5A, 0x65, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .@[r8SZe:.......\n\t/* 0400 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x69, 0xC0, 0x9F, 0x6E, 0x7D, 0x25, 0xC4, 0x4B,   // ........i.n}%K\n\t/* 0410 */ 0xB4, 0xA7, 0x75, 0x05, 0x14, 0xD3, 0x27, 0x43, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // u..'C:.......\n\t/* 0420 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x70, 0x52, 0x5F, 0x6D, 0xAC, 0x31, 0x3E, 0x43,   // ........pR_m1>C\n\t/* 0430 */ 0xB9, 0x0A, 0x39, 0x89, 0x29, 0x23, 0xC6, 0x57, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .9.)#W:.......\n\t/* 0440 */ 0x00, 0x00, 0x06, 0x05, 0x00, 0x01, 0x00, 0x00, 0xDC, 0x64, 0x2A, 0x21, 0xB1, 0x43, 0x3D, 0x4D,   // ........d*!C=M\n\t/* 0450 */ 0xA3, 0x0C, 0x2F, 0xC6, 0x9D, 0x20, 0x95, 0xC6, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ./. .:.......\n\t/* 0460 */ 0x00, 0x00, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x46, 0xF9, 0x5A, 0xE8, 0x25, 0x2E, 0xB7, 0x47,   // ........FZ%.G\n\t/* 0470 */ 0x83, 0xE1, 0xBE, 0xBC, 0xEB, 0xEA, 0xC6, 0x11, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .ᾼ.:.......\n\t/* 0480 */ 0x01, 0x00, 0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0xBF, 0xF1, 0xA6, 0xE6, 0x40, 0x9D, 0xC3, 0x40,   // ........@.@\n\t/* 0490 */ 0xAA, 0x9F, 0xC7, 0x7B, 0xA2, 0x15, 0x78, 0xC0, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .{.x:.......\n\t/* 04A0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x00, 0x02, 0x00, 0x68, 0x79, 0x4C, 0xAA, 0xDA, 0xB9, 0x80, 0x46,   // ........hyLڹ.F\n\t/* 04B0 */ 0x92, 0xB6, 0xAC, 0xB2, 0x5E, 0x2F, 0x86, 0x6C, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .^/.l:.......\n\t/* 04C0 */ 0x02, 0x00, 0x05, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1B, 0xF6, 0xB5, 0x85, 0x0B, 0x32, 0xE3, 0x4B,   // ...........2K\n\t/* 04D0 */ 0x81, 0x4A, 0xB7, 0x6B, 0x2B, 0xFA, 0xFC, 0x82, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Jk+.:.......\n\t/* 04E0 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x03, 0x00, 0xB1, 0x9E, 0x7D, 0x61, 0x36, 0xEF, 0x82, 0x4F,   // .........}a6.O\n\t/* 04F0 */ 0x86, 0xE0, 0xA6, 0x5A, 0xE0, 0x7B, 0x96, 0xC6, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // .Z{.:.......\n\t/* 0500 */ 0x02, 0x00, 0x06, 0x05, 0x00, 0x00, 0x05, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 0510 */ 0x00, 0xB5, 0xB2, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x63, 0x45, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // .[....cE......\n\t/* 0520 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 0530 */ 0x80, 0xE2, 0x9F, 0x57, 0x00, 0x00, 0x00, 0x00, 0x39, 0x38, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00,   // ..W....98......\n\t/* 0540 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 0550 */ 0x00, 0x7A, 0x60, 0x52, 0x00, 0x00, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x19, 0x00, 0x00,   // .z`R.....%......\n\t/* 0560 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 0570 */ 0x80, 0xD2, 0x89, 0x50, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x23, 0x00, 0x00, 0x32, 0x15, 0x00, 0x00,   // ..P....#..2...\n\t/* 0580 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 0590 */ 0x80, 0xFC, 0x62, 0x4D, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x1D, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .bM..........\n\t/* 05A0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // ........:.......\n\t/* 05B0 */ 0x00, 0x31, 0x1B, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x72, 0x17, 0x00, 0x00, 0x01, 0xD7, 0x00, 0x00,   // .1.J....r......\n\t/* 05C0 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30,   // ........03612-00\n\t/* 05D0 */ 0x32, 0x30, 0x36, 0x2D, 0x35, 0x35, 0x36, 0x2D, 0x31, 0x32, 0x33, 0x37, 0x32, 0x37, 0x2D, 0x30,   // 206-556-123727-0\n\t/* 05E0 */ 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30,   // 3-1033-17763.000\n\t/* 05F0 */ 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77,   // 0-2972018.Window\n\t/* 0600 */ 0x73, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x30, 0x39, 0x36, 0x2D, 0x31,   // s..03612-00096-1\n\t/* 0610 */ 0x39, 0x39, 0x2D, 0x37, 0x39, 0x39, 0x31, 0x38, 0x38, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33,   // 99-799188-03-103\n\t/* 0620 */ 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37,   // 3-17763.0000-297\n\t/* 0630 */ 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x30, 0x00,   // 2018.Office2010.\n\t/* 0640 */ 0x00, 0x30, 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x32, 0x34, 0x30,   // .03612-00206-240\n\t/* 0650 */ 0x2D, 0x37, 0x31, 0x39, 0x36, 0x33, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D,   // -719639-03-1033-\n\t/* 0660 */ 0x31, 0x37, 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30,   // 17763.0000-29720\n\t/* 0670 */ 0x31, 0x38, 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x33, 0x00, 0x00, 0x30,   // 18.Office2013..0\n\t/* 0680 */ 0x33, 0x36, 0x31, 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x34, 0x33, 0x38, 0x2D, 0x30,   // 3612-00206-438-0\n\t/* 0690 */ 0x30, 0x34, 0x35, 0x33, 0x32, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37,   // 04532-03-1033-17\n\t/* 06A0 */ 0x37, 0x36, 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38,   // 763.0000-2972018\n\t/* 06B0 */ 0x00, 0x4F, 0x66, 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x36, 0x00, 0x00, 0x30, 0x33, 0x36,   // .Office2016..036\n\t/* 06C0 */ 0x31, 0x32, 0x2D, 0x30, 0x33, 0x38, 0x35, 0x38, 0x2D, 0x30, 0x35, 0x33, 0x2D, 0x30, 0x38, 0x39,   // 12-03858-053-089\n\t/* 06D0 */ 0x35, 0x31, 0x36, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36,   // 516-03-1033-1776\n\t/* 06E0 */ 0x33, 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x57,   // 3.0000-2972018.W\n\t/* 06F0 */ 0x69, 0x6E, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x47, 0x6F, 0x76, 0x00, 0x00, 0x30, 0x33, 0x36, 0x31,   // inChinaGov..0361\n\t/* 0700 */ 0x32, 0x2D, 0x30, 0x30, 0x32, 0x30, 0x36, 0x2D, 0x36, 0x38, 0x34, 0x2D, 0x31, 0x33, 0x37, 0x36,   // 2-00206-684-1376\n\t/* 0710 */ 0x36, 0x39, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x30, 0x33, 0x33, 0x2D, 0x31, 0x37, 0x37, 0x36, 0x33,   // 69-03-1033-17763\n\t/* 0720 */ 0x2E, 0x30, 0x30, 0x30, 0x30, 0x2D, 0x32, 0x39, 0x37, 0x32, 0x30, 0x31, 0x38, 0x00, 0x4F, 0x66,   // .0000-2972018.Of\n\t/* 0730 */ 0x66, 0x69, 0x63, 0x65, 0x32, 0x30, 0x31, 0x39, 0x00, 0x00, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77,   // fice2019..Unknow\n\t/* 0740 */ 0x6E, 0x00,                                                                                       // n.\n};\n\n#endif // // !defined(NO_STRICT_MODES)\n\n__pure size_t getDefaultKmsDataSize()\n{\n\treturn sizeof(DefaultKmsData);\n}\n\n#endif // NO_INTERNAL_DATA\n\n"
  },
  {
    "path": "src/kmsdata.h",
    "content": "#ifndef KMSDATA_SERVER_H\n#define KMSDATA_SERVER_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef NO_INTERNAL_DATA\n\n#include \"types.h\"\n\nextern uint8_t DefaultKmsData[];\n__pure size_t getDefaultKmsDataSize();\n\n#endif // NO_INTERNAL_DATA\n\n#endif // KMSDATA_SERVER_H\n\n"
  },
  {
    "path": "src/libkms-test.c",
    "content": "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libkms.h\"\n#include \"kms.h\"\n#include \"endian.h\"\n\nstatic const char ePID[] = { 'T', 0, 'E', 0, 'S', 0, 'T', 0, 0, 0 };\n\n__stdcall BOOL KmsCallBack(const REQUEST *const baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr)\n{\n\tprintf(\"libvlmcs-test.c: Entered KmsCallBack for client %s\\n\", ipstr);\n\n\tmemcpy(&baseResponse->CMID, &baseRequest->CMID, sizeof(GUID));\n\tmemcpy(&baseResponse->ClientTime, &baseRequest->ClientTime, sizeof(FILETIME));\n\tmemcpy(&baseResponse->KmsPID, ePID, sizeof(ePID));\n\n\tbaseResponse->Version = baseRequest->Version;\n\tbaseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);\n\tbaseResponse->PIDSize = sizeof(ePID);\n\tbaseResponse->VLActivationInterval = LE32(120);\n\tbaseResponse->VLRenewalInterval = LE32(10080);\n\n\tif (hwId && baseResponse->MajorVer > 5) memcpy(hwId, \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\", 8);\n\n\treturn TRUE;\n}\n\nint main(int argc, char** argv)\n{\n\tint version = GetLibKmsVersion();\n\n\tif (version < 0x30001)\n\t{\n\t\tfprintf(stderr, \"KMS library version %u.%u or greater required\\n\", (unsigned int)(version >> 16), (unsigned int)(version & 0xffff));\n\t}\n\n\tprintf(\"%s: Program start\\n\", GetEmulatorVersion());\n\tStartKmsServer(1688, KmsCallBack);\n\treturn 0;\n}\n"
  },
  {
    "path": "src/libkms.c",
    "content": "/*\n * libkms.c\n */\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef EXTERNAL\n#undef EXTERNAL\n#endif\n\n#define EXTERNAL dllexport\n\n#define DLLVERSION 0x40000\n\n#include \"libkms.h\"\n#include \"shared_globals.h\"\n#include \"network.h\"\n#include \"helpers.h\"\n\n#ifndef _WIN32\n#include <signal.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <netinet/in.h>\n#endif // WIN32\n\nstatic int_fast8_t IsServerStarted = FALSE;\n\n#ifdef _WIN32\n#ifndef USE_MSRPC\n\nstatic int_fast8_t SocketsInitialized = FALSE;\nWSADATA wsadata;\n\nstatic int initializeWinSockets()\n{\n\tif (SocketsInitialized) return 0;\n\tSocketsInitialized = TRUE;\n\treturn WSAStartup(0x0202, &wsadata);\n}\n\n#endif // USE_MSRPC\n#endif // _WIN32\n\nEXTERNC __declspec(EXTERNAL) char* __cdecl GetErrorMessage()\n{\n\treturn ErrorMessage;\n}\n\nEXTERNC __declspec(EXTERNAL)SOCKET __cdecl ConnectToServer(const char* host, const char* port, const int addressFamily)\n{\n\tSOCKET sock;\n\t*ErrorMessage = 0;\n\n#\tif defined(_WIN32) && !defined(USE_MSRPC)\n\tinitializeWinSockets();\n#\tendif // defined(_WIN32) && !defined(USE_MSRPC)\n\n\tsize_t adrlen = strlen(host) + 16;\n\tchar* RemoteAddr = (char*)alloca(adrlen);\n\tvlmcsd_snprintf(RemoteAddr, adrlen, \"[%s]:%s\", host, port);\n\tsock = connectToAddress(RemoteAddr, addressFamily, FALSE);\n\n\tif (sock == INVALID_RPCCTX)\n\t{\n\t\tprinterrorf(\"Fatal: Could not connect to %s\\n\", RemoteAddr);\n\t\treturn sock;\n\t}\n\n\treturn sock;\n}\n\nEXTERNC __declspec(EXTERNAL)RpcStatus __cdecl BindRpc(const SOCKET sock, const int_fast8_t useMultiplexedRpc, const int_fast8_t useRpcNDR64, const int_fast8_t useRpcBTFN, PRpcDiag_t rpcDiag)\n{\n\t*ErrorMessage = 0;\n\tUseMultiplexedRpc = useMultiplexedRpc;\n\tUseClientRpcNDR64 = useRpcNDR64;\n\tUseClientRpcBTFN = useRpcBTFN;\n\treturn rpcBindClient(sock, FALSE, rpcDiag);\n}\n\nEXTERNC __declspec(EXTERNAL) void __cdecl CloseConnection(const SOCKET sock)\n{\n\tsocketclose(sock);\n}\n\n\nEXTERNC __declspec(EXTERNAL)DWORD __cdecl SendKMSRequest(const SOCKET sock, RESPONSE* baseResponse, REQUEST* baseRequest, RESPONSE_RESULT* result, BYTE *hwid)\n{\n\t*ErrorMessage = 0;\n\treturn SendActivationRequest(sock, baseResponse, baseRequest, result, hwid);\n}\n\nEXTERNC __declspec(EXTERNAL)int_fast8_t __cdecl IsDisconnected(const SOCKET sock)\n{\n\treturn isDisconnected(sock);\n}\n\n\nEXTERNC __declspec(EXTERNAL)DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback)\n{\n#ifndef SIMPLE_SOCKETS\n\tchar listenAddress[64];\n\n\tif (IsServerStarted) return SOCKET_EALREADY;\n\n#\tifdef _WIN32\n\tint error = initializeWinSockets();\n\tif (error) return error;\n#\tendif // _WIN32\n\n\tCreateResponseBase = requestCallback;\n\n\tint maxsockets = 0;\n\tint_fast8_t haveIPv4 = FALSE;\n\tint_fast8_t haveIPv6 = FALSE;\n\n\tif (checkProtocolStack(AF_INET)) { haveIPv4 = TRUE; maxsockets++; }\n\tif (checkProtocolStack(AF_INET6)) { haveIPv6 = TRUE; maxsockets++; }\n\n\tif (!maxsockets) return SOCKET_EAFNOSUPPORT;\n\n\tSocketList = (SOCKET*)vlmcsd_malloc(sizeof(SOCKET) * (size_t)maxsockets);\n\tnumsockets = 0;\n\n\tif (haveIPv4)\n\t{\n\t\tsnprintf(listenAddress, 64, \"0.0.0.0:%u\", (unsigned int)port);\n\t\taddListeningSocket(listenAddress);\n\t}\n\n\tif (haveIPv6)\n\t{\n\t\tsnprintf(listenAddress, 64, \"[::]:%u\", (unsigned int)port);\n\t\taddListeningSocket(listenAddress);\n\t}\n\n\tif (!numsockets)\n\t{\n\t\tfree(SocketList);\n\t\treturn SOCKET_EADDRNOTAVAIL;\n\t}\n\n\tIsServerStarted = TRUE;\n\n\trunServer();\n\n\tIsServerStarted = FALSE;\n\treturn 0;\n\n#\telse // SIMPLE_SOCKETS\n\n\tif (IsServerStarted) return SOCKET_EALREADY;\n\tint error;\n\n#\tifdef _WIN32\n\terror = initializeWinSockets();\n\tif (error) return error;\n#\tendif // _WIN32\n\n\tdefaultport = vlmcsd_malloc(16);\n\tvlmcsd_snprintf((char*)defaultport, (size_t)16, \"%i\", port);\n\n\tCreateResponseBase = requestCallback;\n\terror = listenOnAllAddresses();\n\tfree(defaultport);\n\tif (error) return error;\n\n\tIsServerStarted = TRUE;\n\trunServer();\n\tIsServerStarted = FALSE;\n\n\treturn 0;\n\n\n#\tendif // SIMPLE_SOCKETS\n}\n\n\nEXTERNC __declspec(EXTERNAL)DWORD __cdecl StopKmsServer()\n{\n\tif (!IsServerStarted) return VLMCSD_EPERM;\n\n\tcloseAllListeningSockets();\n\n#\tifndef SIMPLE_SOCKETS\n\tif (SocketList) free(SocketList);\n#\tendif\n\n\treturn 0;\n}\n\n\nEXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion()\n{\n\treturn DLLVERSION;\n}\n\n\nEXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion()\n{\n\treturn VERSION;\n}\n\n"
  },
  {
    "path": "src/libkms.h",
    "content": "/*\n * libkms.h\n */\n\n#ifndef LIBKMS_H_\n#define LIBKMS_H_\n\n#include \"types.h\"\n#include \"kms.h\"\n#include \"rpc.h\"\n#include \"vlmcs.h\"\n\n#ifndef EXTERNC\n#ifdef __cplusplus\n#define EXTERNC EXTERN \"C\"\n#else\n#define EXTERNC\n#endif\n#endif\n\nEXTERNC __declspec(EXTERNAL) DWORD __cdecl SendKMSRequest(const SOCKET sock, RESPONSE* baseResponse, REQUEST* baseRequest, RESPONSE_RESULT* result, BYTE *hwid);\nEXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback);\nEXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer();\nEXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion();\nEXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion();\nEXTERNC __declspec(EXTERNAL) SOCKET __cdecl ConnectToServer(const char* host, const char* port, const int addressFamily);\nEXTERNC __declspec(EXTERNAL) char* __cdecl GetErrorMessage();\nEXTERNC __declspec(EXTERNAL) void __cdecl CloseConnection(const SOCKET sock);\nEXTERNC __declspec(EXTERNAL) RpcStatus __cdecl BindRpc(const SOCKET sock, const int_fast8_t useMultiplexedRpc, const int_fast8_t useRpcNDR64, const int_fast8_t useRpcBTFN, PRpcDiag_t rpcDiag);\nEXTERNC __declspec(EXTERNAL) int_fast8_t __cdecl IsDisconnected(const SOCKET sock);\n//EXTERN_C __declspec(EXTERNAL) unsigned int __cdecl GetRandom32();\n\n\n#endif /* LIBKMS_H_ */\n"
  },
  {
    "path": "src/msrpc-client.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef USE_MSRPC\n\n#if !defined(_WIN32) && !defined(__CYGWIN__)\n#error MSRPC is only available with native Windows or Cygwin\n#endif\n\n#include \"msrpc-client.h\"\n#include <stdio.h>\n#include \"output.h\"\n#include \"helpers.h\"\n\n#if __amd64 || defined(_M_AMD64) // 64-bit\n\n#ifndef _M_AMD64\n#define _M_AMD64\n#endif // _M_AMD64\n\n#include \"KMSServer_c_x64_mingw_gcc.c\"\n\n#else // 32-bit\n\n#include \"KMSServer_c_mingw_gcc.c\"\n\n#endif // 32-bit\n\nstatic RPC_CSTR stringBinding;\njmp_buf jmp;\nRPC_STATUS PreviousRpcCallFailed = RPC_S_OK;\n\n\n/*\n * Creates an RPC string binding that is used to connect to the server.\n * Input is host:port, e.g. \"[::1]:1688\" or \"127.0.0.1:1688\"\n * Output is for example \"ncacn_ip_tcp:127.0.0.1[endpoint=1688]\"\n */\n#if !__amd64\n#pragma GCC optimize(\"O0\") ////TODO: Find out why gcc needs -O0 for RPC handling\n#endif\n\nstatic RPC_STATUS createStringBinding(char *const addr, RPC_CSTR* stringBinding)\n{\n\tchar *szHost, *szPort;\n\n\tparseAddress(addr, &szHost, &szPort);\n\n\treturn RpcStringBindingComposeA\n\t(\n\t\tNULL,\t\t\t\t\t\t/* UUID */\n\t\t(RPC_CSTR)\"ncacn_ip_tcp\",\t/* use TCP */\n\t\t(RPC_CSTR)szHost,\t\t\t/* host name or IP address */\n\t\t(RPC_CSTR)szPort,\t\t\t/* endpoint (TCP port here) */\n\t\tNULL,\t\t\t\t\t\t/* options */\n\t\tstringBinding\t\t\t\t/* resulting string binding */\n\t);\n}\n\n\n/*\n * This does not actually connect to a TCP port because MS RPC doesn't connect\n * before the actual RPC call is made. So this a stub\n */\nRpcCtx connectToAddress(char *const addr, const int AddressFamily_unused, int_fast8_t showHostName_unused)\n{\n\tRPC_STATUS status;\n\n\tprintf(\"Connecting to %s ... \", addr);\n\n\tif ((status = createStringBinding(addr, &stringBinding)) != RPC_S_OK)\n\t{\n\t\tprinterrorf(\"%s\\n\", win_strerror(status));\n\t\treturn !0;\n\t}\n\n\tif (PreviousRpcCallFailed)\n\t{\n\t\tprinterrorf(\"%s\\n\", win_strerror(PreviousRpcCallFailed));\n\t\treturn !0;\n\t}\n\n\tprintf(\"successful\\n\");\n\treturn 0;\n}\n\n\n/*\n * Does not do RPC binding on the wire. Just initializes the interface\n */\nRpcStatus rpcBindClient(const RpcCtx handle, const int_fast8_t verbose, PRpcDiag_t rpcDiag)\n{\n\tRPC_STATUS status;\n\n\tif ((status = RpcBindingFromStringBindingA(stringBinding, &KMSServer_v1_0_c_ifspec)) != RPC_S_OK)\n\t{\n\t\terrorout(\"\\n%s\\n\", win_strerror(status));\n\t}\n\n\trpcDiag->HasRpcDiag = FALSE;\n\treturn status;\n}\n\n\n/*\n * You never know if you have a TCP connection or not\n * This returns true if the previous RPC call failed\n */\nint_fast8_t isDisconnected(const RpcCtx handle)\n{\n\treturn PreviousRpcCallFailed;\n}\n\n\n/*\n * This is the exception handler because the RPC call may\n * throw an SEH exception and gcc does not support\n * __try / __except as MSVC does.\n */\nstatic LONG WINAPI rpcException (LPEXCEPTION_POINTERS exception_pointers)\n{\n\tDWORD exception = exception_pointers->ExceptionRecord->ExceptionCode;\n\tif (!exception) exception = (DWORD)~0;\n\tlongjmp(jmp, exception_pointers->ExceptionRecord->ExceptionCode);\n\treturn EXCEPTION_EXECUTE_HANDLER;\n}\n\n/*\n * This actually calls the RPC server\n */\n#define try SetUnhandledExceptionFilter(rpcException); RPC_STATUS exception = setjmp(jmp); if (!exception)\n#define catch else\nRpcStatus rpcSendRequest(const RpcCtx handle, BYTE* KmsRequest, const size_t requestSize, BYTE **KmsResponse, size_t* responseSize)\n{\n\t*KmsResponse = NULL; // Let midl_user_allocate do the job\n\n\ttry\n\t{\n\t\texception = RequestActivation(KMSServer_v1_0_c_ifspec, (int)requestSize, KmsRequest, (int*)responseSize, KmsResponse);\n\t}\n\tcatch\n\t{\n\t\terrorout(\"\\n%s\", win_strerror(exception));\n\t}\n\n\tPreviousRpcCallFailed = exception;\n\tSetUnhandledExceptionFilter(NULL);\n\n\treturn exception;\n\n}\n#undef catch\n#undef try\n\n\n/*\n * Only frees local handles. Cannot close the TCP connection\n */\nRpcStatus closeRpc(const RpcCtx handle)\n{\n\tRPC_STATUS status;\n\n\tif ((status = RpcBindingFree(&KMSServer_v1_0_c_ifspec)) != RPC_S_OK) return status;\n\tstatus = RpcStringFreeA(&stringBinding);\n\t//Ctx = INVALID_RPCCTX;\n\treturn status;\n}\n\n\n#if !MULTI_CALL_BINARY\n// Memory allocation function for RPC.\nvoid *__RPC_USER midl_user_allocate(size_t len)\n{\n\treturn vlmcsd_malloc(len);\n}\n\n\n// Memory deallocation function for RPC.\nvoid __RPC_USER midl_user_free(void __RPC_FAR *ptr)\n{\n\tif (ptr) free(ptr);\n\tptr = NULL;\n}\n\n#endif // !MULTI_CALL_BINARY\n\n\n#endif // USE_MSRPC\n\n\n"
  },
  {
    "path": "src/msrpc-client.h",
    "content": "/*\n * msrpc-client.h\n */\n\n#ifdef USE_MSRPC\n#ifndef MSRPC_CLIENT_H_\n#define MSRPC_CLIENT_H_\n\n#include \"types.h\"\n#include \"shared_globals.h\"\n#include <setjmp.h>\n#include \"output.h\"\n\ntypedef int_fast8_t RpcCtx;\ntypedef RPC_STATUS RpcStatus;\n\nRpcCtx connectToAddress(char *const addr, const int AddressFamily_unused, int_fast8_t showHostName);\nint_fast8_t isDisconnected(const RpcCtx handle);\nRpcStatus rpcBindClient(const RpcCtx handle, const int_fast8_t verbose, PRpcDiag_t rpcDiag);\nRpcStatus rpcSendRequest(const RpcCtx handle, BYTE* KmsRequest, size_t requestSize, BYTE **KmsResponse, size_t *responseSize);\nRpcStatus closeRpc(RpcCtx s);\n\n#define INVALID_RPCCTX ((RpcCtx)~0)\n#endif // USE_MSRPC\n\n#endif /* MSRPC_CLIENT_H_ */\n"
  },
  {
    "path": "src/msrpc-server.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef USE_MSRPC\n\n#if !defined(_WIN32) && !defined(__CYGWIN__)\n#error MSRPC is only available with native Windows or Cygwin\n#endif\n\n#if _WIN32 && !defined(NO_PRIVATE_IP_DETECT)\n#include <winsock2.h>\n#endif\n\n#include \"msrpc-server.h\"\n#include \"output.h\"\n#include \"kms.h\"\n#include \"helpers.h\"\n#include \"shared_globals.h\"\n#include \"ntservice.h\"\n#include \"endian.h\"\n#include \"types.h\"\n\n#if __amd64 || defined(_M_AMD64) // 64-bit\n\n#ifndef _M_AMD64\n#define _M_AMD64\n#endif // _M_AMD64\n\n#include \"KMSServer_s2_x64_mingw_gcc.c\"\n\n#else // 32-bit\n\n#include \"KMSServer_s2_mingw_gcc.c\"\n\n#endif // 32-bit\n\n\n#if !defined(NO_LIMIT)\n#define MAXCALLS MaxTasks\n#else // defined(NO_LIMIT)\n#define MAXCALLS RPC_C_LISTEN_MAX_CALLS_DEFAULT\n#endif\n\n\n\n\n/*\n * This is the main run loop for the KMS server\n * We actually just setup things (must be after Cygwin fork) and then sleep\n */\nint runServer()\n{\n#\tif !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\n\t// The RPC setup survives a Cygwin exec without problems but no daemonizing\n\t// SIGHUP is currently disabled for Cygwin. So this code should never compile\n\n\tif (IsRestarted)\n\t{\n#\t\tifndef NO_LOG\n\t\tlogger(\"vlmcsd %s started successfully\\n\", Version);\n#\t\tendif // NO_LOG\n\t}\n\telse\n#\tendif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\t{\n\t\tRPC_STATUS status;\n\n\t\t// Endpoint is actually a TCP port for \"ncacn_ip_tcp\"\n\t\tstatus = RpcServerUseProtseqEpA\n\t\t(\n\t\t\t(RPC_CSTR)\"ncacn_ip_tcp\",\n\t\t\tRPC_C_PROTSEQ_MAX_REQS_DEFAULT,\n\t\t\t(RPC_CSTR)defaultport,\n\t\t\tNULL\n\t\t);\n\n\t\tif (status)\n\t\t{\n\t\t\tprinterrorf(\"Fatal: Cannot bind to port %s: %s\\n\", defaultport, win_strerror(status));\n\t\t\treturn status;\n\t\t}\n\n#\t\tifndef NO_LOG\n\t\tlogger(\"Listening on port %s\\n\", defaultport);\n#\t\tendif // NO_LOG\n\n\t\t// Registers the KMSServer interface.\n\t\tstatus = RpcServerRegisterIf2\n\t\t(\n\t\t\tKMSServer_v1_0_s_ifspec,\n\t\t\tNULL,\n\t\t\tNULL,\n\t\t\tRPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH | RPC_IF_AUTOLISTEN,\n\t\t\tMAXCALLS,\n\t\t\tMAX_RESPONSE_SIZE, \t// currently set to sizeof(RESPONSE_V6)\n\t\t\tNULL\n\t\t);\n\n\t\tif (status)\n\t\t{\n\t\t\tprinterrorf(\"Fatal: Cannot register RPC interface: %s\\n\", win_strerror(status));\n\t\t\treturn status;\n\t\t}\n\n#\t\tifndef NO_LOG\n\t\tlogger(\"vlmcsd %s started successfully\\n\", Version);\n#\t\tendif // NO_LOG\n\n\t\tif (IsNTService) ReportServiceStatus(SERVICE_RUNNING, NO_ERROR, 200);\n\t}\n\n\t// We could run RpcServerListen here but we need something\n\t// that can be signaled from Cygwin. So we just sleep 24h (POSIX sleep, no Windows Sleep),\n\t// wake up for some nanoseconds and sleep again.\n\n\twhile(TRUE) sleep(86400); // Sleep one day\n}\n\n\n\n/*\n * Get's the IP address from an RPC_BINDING_HANDLE. Caller must call RpcStringFreeA to\n * release memory allocated in *ipAddress\n */\n#ifndef NO_LOG\nRPC_STATUS getClientIp(const RPC_BINDING_HANDLE clientBinding, RPC_CSTR *ipAddress)\n{\n\tRPC_STATUS result;\n\tRPC_CSTR stringBinding;\n\tRPC_BINDING_HANDLE serverBinding;\n\n\t// Fix for wine (disabled by default, because vlmcsd runs natively on all platforms where wine runs)\n\t// Feel free to #define SUPPORT_WINE if you really want to run the Windows version with MS RPC (Wine RPC in this case)\n\t#ifdef SUPPORT_WINE\n\tHMODULE h = GetModuleHandleA(\"kernel32.dll\");\n\n\tif (h)\n\t{\n\t\t// Since wine simply terminates the thread when RpcBindingServerFromClient is called, we exit with an error\n\t\tif (GetProcAddress(h, \"wine_get_unix_file_name\")) return RPC_S_CANNOT_SUPPORT;\n\t}\n\t#endif // SUPPORT_WINE\n\n\tif ((result = RpcBindingServerFromClient(clientBinding, &serverBinding)) != RPC_S_OK) return result;\n\n\tif ((result = RpcBindingToStringBindingA(serverBinding, &stringBinding)) != RPC_S_OK)\n\t{\n\t\tRpcBindingFree(&serverBinding);\n\t\treturn result;\n\t}\n\n\tresult = RpcStringBindingParseA(stringBinding, NULL, NULL, ipAddress, NULL, NULL);\n\tRpcStringFreeA(&stringBinding);\n\tRpcBindingFree(&serverBinding);\n\n\treturn result;\n}\n#endif // NO_LOG\n\n\n#ifndef NO_PRIVATE_IP_DETECT\nstatic int_fast8_t IsPrivateIPAddress(char* ipAddress)\n{\n\tint family = strchr(ipAddress,'.') ? AF_INET : AF_INET6;\n\n\tswitch(family)\n\t{\n\t\tcase AF_INET:\n\t\t{\n\t\t\tint i;\n\t\t\tchar* current;\n\t\t\tchar* next;\n\t\t\tuint32_t ip;\n\n\t\t\tfor (ip = 0, i = 0, current = ipAddress; i < 4; i++, current = next + 1)\n\t\t\t{\n\t\t\t\tip = (ip << 8) | strtoul(current, &next, 10);\n\t\t\t\tif (*next != '.') break;\n\t\t\t}\n\n\t\t\tif\n\t\t\t(\n\t\t\t\t(ip & 0xff000000) == 0x7f000000 || // 127.x.x.x localhost\n\t\t\t\t(ip & 0xffff0000) == 0xc0a80000 || // 192.168.x.x private routeable\n\t\t\t\t(ip & 0xffff0000) == 0xa9fe0000 || // 169.254.x.x link local\n\t\t\t\t(ip & 0xff000000) == 0x0a000000 || // 10.x.x.x private routeable\n\t\t\t\t(ip & 0xfff00000) == 0xac100000    // 172.16-31.x.x private routeable\n\t\t\t)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase AF_INET6:\n\t\t{\n\t\t\tif (!strcmp(ipAddress, \"::1\")) return TRUE;\n\t\t\tif (strchr(ipAddress, ':') - ipAddress != 4) break;\n\n\t\t\tint16_t firstWord;\n\t\t\thex2bin((BYTE*)&firstWord, ipAddress, 2);\n\t\t\tif ((BE16(firstWord) & 0xe000) != 0x2000) return TRUE;\n\t\t}\n\n\t}\n\n\treturn FALSE;\n}\n#endif // NO_PRIVATE_IP_DETECT\n\n/*\n * This is the callback function for the RPC request as defined in KMSServer.idl\n * Output from the MIDL compiler has been modified manually to support gcc (and compatible compilers)\n * as well as Cygwin and MingW-w64 toolchains.\n */\nint ProcessActivationRequest(handle_t IDL_handle, int requestSize, unsigned char *request, int *responseSize, unsigned char **response)\n{\n\tRPC_CSTR clientIpAddress;\n\tRPC_STATUS result;\n\tint status = 0;\n\n\tresult = getClientIp(IDL_handle, &clientIpAddress);\n\n#\tifndef NO_LOG\n\n\tlogger(\"RPC connection accepted: %s\\n\", !result ? (const char*)clientIpAddress : \"Unknown IP\");\n\n#\tendif // NO_LOG\n\n#\tifndef NO_PRIVATE_IP_DETECT\n\tif (result && (PublicIPProtectionLevel & 2))\n\t{\n#\t\tifndef NO_LOG\n\t\tlogger (\"Cannot verify that client has a private IP address\\n\");\n#\t\tendif\n\n\t\treturn 0x80070000 | RPC_S_ACCESS_DENIED;\n\t}\n\n\tif (!result && (PublicIPProtectionLevel & 2) && !IsPrivateIPAddress((char*)clientIpAddress))\n\t{\n#\t\tifndef NO_LOG\n\t\tlogger(\"Client with public IP address rejected\\n\");\n#\t\tendif\n\n\t\tRpcStringFreeA(&clientIpAddress);\n\t\treturn 0x80070000 | RPC_S_ACCESS_DENIED;\n\t}\n#\tendif // NO_PRIVATE_IP_DETECT\n\n\t// Discard any packet smaller than a v4 request\n\tif (requestSize < (int)sizeof(REQUEST_V4))\n\t{\n\t\tif (!result) RpcStringFreeA(&clientIpAddress);\n\t\treturn 0x8007000D;\n\t}\n\n\t*response = (uint8_t *)midl_user_allocate(MAX_RESPONSE_SIZE);\n\tint kmsStatus = 0x8007000D;\n\tint version = LE32(((REQUEST*)(request))->Version);\n\n\tswitch(version)\n\t{\n\t\tcase 0x40000:\n\t\t\tkmsStatus = CreateResponseV4((REQUEST_V4 *)request, *response, (char*)clientIpAddress);\n\t\t\tbreak;\n\t\tcase 0x50000:\n\t\tcase 0x60000:\n\t\t\tkmsStatus = CreateResponseV6((REQUEST_V6 *) request, *response, (char*)clientIpAddress);\n\t\t\tbreak;\n\t\tdefault:\n#\t\t\tifndef NO_LOG\n\t\t\tlogger(\"Fatal: KMSv%u.%u unsupported\\n\", version >> 16, version & 0xffff);\n#\t\t\tendif // NO_LOG\n\t\t\tbreak;\n\t}\n\n\tif (kmsStatus < 0)\n\t{\n\t\tstatus = kmsStatus;\n\t}\n\telse\n\t{\n\t\t*responseSize = kmsStatus;\n\t}\n\n\tif (!result) RpcStringFreeA(&clientIpAddress);\n\treturn status;\n}\n\n\n// Memory allocation function for RPC.\nvoid *__RPC_USER midl_user_allocate(size_t len)\n{\n\treturn vlmcsd_malloc(len);\n}\n\n\n// Memory deallocation function for RPC.\nvoid __RPC_USER midl_user_free(void __RPC_FAR *ptr)\n{\n\tif (ptr) free(ptr);\n\tptr = NULL;\n}\n\n\n#endif // USE_MSRPC\n"
  },
  {
    "path": "src/msrpc-server.h",
    "content": "/*\n * msrpc-server.h\n */\n\n#ifndef MSRPC_SERVER_H_\n#define MSRPC_SERVER_H_\n\nint runServer();\n\n#endif /* MSRPC_SERVER_H_ */\n"
  },
  {
    "path": "src/nameser.h",
    "content": "/*    $NetBSD: nameser.h,v 1.19 2005/12/26 19:01:47 perry Exp $    */\n\n/*\n * Copyright (c) 1983, 1989, 1993\n *    The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*\n * Copyright (c) 2004 by Internet Systems Consortium, Inc. (\"ISC\")\n * Copyright (c) 1996-1999 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND ISC DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n *    Id: nameser.h,v 1.2.2.4.4.1 2004/03/09 08:33:30 marka Exp\n */\n\n#ifndef _ARPA_NAMESER_H_\n#define _ARPA_NAMESER_H_\n\n#define BIND_4_COMPAT\n\n#include <sys/types.h>\n#include <sys/cdefs.h>\n\n/*\n * Revision information.  This is the release date in YYYYMMDD format.\n * It can change every day so the right thing to do with it is use it\n * in preprocessor commands such as \"#if (__NAMESER > 19931104)\".  Do not\n * compare for equality; rather, use it to determine whether your libbind.a\n * contains a new enough lib/nameser/ to support the feature you need.\n */\n\n#define __NAMESER    19991006    /* New interface version stamp. */\n\n/*\n * Define constants based on RFC 883, RFC 1034, RFC 1035\n */\n#define NS_PACKETSZ    512    /* default UDP packet size */\n#define NS_MAXDNAME    1025    /* maximum domain name */\n#define NS_MAXMSG    65535    /* maximum message size */\n#define NS_MAXCDNAME    255    /* maximum compressed domain name */\n#define NS_MAXLABEL    63    /* maximum length of domain label */\n#define NS_HFIXEDSZ    12    /* #/bytes of fixed data in header */\n#define NS_QFIXEDSZ    4    /* #/bytes of fixed data in query */\n#define NS_RRFIXEDSZ    10    /* #/bytes of fixed data in r record */\n#define NS_INT32SZ    4    /* #/bytes of data in a uint32_t */\n#define NS_INT16SZ    2    /* #/bytes of data in a uint16_t */\n#define NS_INT8SZ    1    /* #/bytes of data in a uint8_t */\n#define NS_INADDRSZ    4    /* IPv4 T_A */\n#define NS_IN6ADDRSZ    16    /* IPv6 T_AAAA */\n#define NS_CMPRSFLGS    0xc0    /* Flag bits indicating name compression. */\n#define NS_DEFAULTPORT    53    /* For both TCP and UDP. */\n\n/*\n * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()\n * in synch with it.\n */\ntypedef enum __ns_sect {\n    ns_s_qd = 0,        /* Query: Question. */\n    ns_s_zn = 0,        /* Update: Zone. */\n    ns_s_an = 1,        /* Query: Answer. */\n    ns_s_pr = 1,        /* Update: Prerequisites. */\n    ns_s_ns = 2,        /* Query: Name servers. */\n    ns_s_ud = 2,        /* Update: Update. */\n    ns_s_ar = 3,        /* Query|Update: Additional records. */\n    ns_s_max = 4\n} ns_sect;\n\n/*\n * This is a message handle.  It is caller allocated and has no dynamic data.\n * This structure is intended to be opaque to all but ns_parse.c, thus the\n * leading _'s on the member names.  Use the accessor functions, not the _'s.\n */\ntypedef struct __ns_msg {\n    const u_char    *_msg, *_eom;\n    uint16_t    _id, _flags, _counts[ns_s_max];\n    const u_char    *_sections[ns_s_max];\n    ns_sect        _sect;\n    int        _rrnum;\n    const u_char    *_msg_ptr;\n} ns_msg;\n\n/* Private data structure - do not use from outside library. */\nstruct _ns_flagdata {  int mask, shift;  };\nextern const struct _ns_flagdata _ns_flagdata[];\n\n/* Accessor macros - this is part of the public interface. */\n\n#define ns_msg_id(handle) ((handle)._id + 0)\n#define ns_msg_base(handle) ((handle)._msg + 0)\n#define ns_msg_end(handle) ((handle)._eom + 0)\n#define ns_msg_size(handle) ((size_t)((handle)._eom - (handle)._msg))\n#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)\n\n/*\n * This is a parsed record.  It is caller allocated and has no dynamic data.\n */\ntypedef    struct __ns_rr {\n    char        name[NS_MAXDNAME];\n    uint16_t    type;\n    uint16_t    rr_class;\n    uint32_t    ttl;\n    uint16_t    rdlength;\n    const u_char *    rdata;\n} ns_rr;\n\n/* Accessor macros - this is part of the public interface. */\n#define ns_rr_name(rr)    (((rr).name[0] != '\\0') ? (rr).name : \".\")\n#define ns_rr_type(rr)    ((ns_type)((rr).type + 0))\n#define ns_rr_class(rr)    ((ns_class)((rr).rr_class + 0))\n#define ns_rr_ttl(rr)    ((u_long)(rr).ttl + 0)\n#define ns_rr_rdlen(rr)    ((size_t)(rr).rdlength + 0)\n#define ns_rr_rdata(rr)    ((rr).rdata + 0)\n\n/*\n * These don't have to be in the same order as in the packet flags word,\n * and they can even overlap in some cases, but they will need to be kept\n * in synch with ns_parse.c:ns_flagdata[].\n */\ntypedef enum __ns_flag {\n    ns_f_qr,        /* Question/Response. */\n    ns_f_opcode,        /* Operation code. */\n    ns_f_aa,        /* Authoritative Answer. */\n    ns_f_tc,        /* Truncation occurred. */\n    ns_f_rd,        /* Recursion Desired. */\n    ns_f_ra,        /* Recursion Available. */\n    ns_f_z,            /* MBZ. */\n    ns_f_ad,        /* Authentic Data (DNSSEC). */\n    ns_f_cd,        /* Checking Disabled (DNSSEC). */\n    ns_f_rcode,        /* Response code. */\n    ns_f_max\n} ns_flag;\n\n/*\n * Currently defined opcodes.\n */\ntypedef enum __ns_opcode {\n    ns_o_query = 0,        /* Standard query. */\n    ns_o_iquery = 1,    /* Inverse query (deprecated/unsupported). */\n    ns_o_status = 2,    /* Name server status query (unsupported). */\n                /* Opcode 3 is undefined/reserved. */\n    ns_o_notify = 4,    /* Zone change notification. */\n    ns_o_update = 5,    /* Zone update message. */\n    ns_o_max = 6\n} ns_opcode;\n\n/*\n * Currently defined response codes.\n */\ntypedef    enum __ns_rcode {\n    ns_r_noerror = 0,    /* No error occurred. */\n    ns_r_formerr = 1,    /* Format error. */\n    ns_r_servfail = 2,    /* Server failure. */\n    ns_r_nxdomain = 3,    /* Name error. */\n    ns_r_notimpl = 4,    /* Unimplemented. */\n    ns_r_refused = 5,    /* Operation refused. */\n    /* these are for BIND_UPDATE */\n    ns_r_yxdomain = 6,    /* Name exists */\n    ns_r_yxrrset = 7,    /* RRset exists */\n    ns_r_nxrrset = 8,    /* RRset does not exist */\n    ns_r_notauth = 9,    /* Not authoritative for zone */\n    ns_r_notzone = 10,    /* Zone of record different from zone section */\n    ns_r_max = 11,\n    /* The following are EDNS extended rcodes */\n    ns_r_badvers = 16,\n    /* The following are TSIG errors */\n    ns_r_badsig = 16,\n    ns_r_badkey = 17,\n    ns_r_badtime = 18\n} ns_rcode;\n\n/* BIND_UPDATE */\ntypedef enum __ns_update_operation {\n    ns_uop_delete = 0,\n    ns_uop_add = 1,\n    ns_uop_max = 2\n} ns_update_operation;\n\n/*\n * This structure is used for TSIG authenticated messages\n */\nstruct ns_tsig_key {\n        char name[NS_MAXDNAME], alg[NS_MAXDNAME];\n        unsigned char *data;\n        int len;\n};\ntypedef struct ns_tsig_key ns_tsig_key;\n\n/*\n * This structure is used for TSIG authenticated TCP messages\n */\nstruct ns_tcp_tsig_state {\n    int counter;\n    struct dst_key *key;\n    void *ctx;\n    unsigned char sig[NS_PACKETSZ];\n    int siglen;\n};\ntypedef struct ns_tcp_tsig_state ns_tcp_tsig_state;\n\n#define NS_TSIG_FUDGE 300\n#define NS_TSIG_TCP_COUNT 100\n#define NS_TSIG_ALG_HMAC_MD5 \"HMAC-MD5.SIG-ALG.REG.INT\"\n\n#define NS_TSIG_ERROR_NO_TSIG -10\n#define NS_TSIG_ERROR_NO_SPACE -11\n#define NS_TSIG_ERROR_FORMERR -12\n\n/*\n * Currently defined type values for resources and queries.\n */\ntypedef enum __ns_type {\n    ns_t_invalid = 0,    /* Cookie. */\n    ns_t_a = 1,        /* Host address. */\n    ns_t_ns = 2,        /* Authoritative server. */\n    ns_t_md = 3,        /* Mail destination. */\n    ns_t_mf = 4,        /* Mail forwarder. */\n    ns_t_cname = 5,        /* Canonical name. */\n    ns_t_soa = 6,        /* Start of authority zone. */\n    ns_t_mb = 7,        /* Mailbox domain name. */\n    ns_t_mg = 8,        /* Mail group member. */\n    ns_t_mr = 9,        /* Mail rename name. */\n    ns_t_null = 10,        /* Null resource record. */\n    ns_t_wks = 11,        /* Well known service. */\n    ns_t_ptr = 12,        /* Domain name pointer. */\n    ns_t_hinfo = 13,    /* Host information. */\n    ns_t_minfo = 14,    /* Mailbox information. */\n    ns_t_mx = 15,        /* Mail routing information. */\n    ns_t_txt = 16,        /* Text strings. */\n    ns_t_rp = 17,        /* Responsible person. */\n    ns_t_afsdb = 18,    /* AFS cell database. */\n    ns_t_x25 = 19,        /* X_25 calling address. */\n    ns_t_isdn = 20,        /* ISDN calling address. */\n    ns_t_rt = 21,        /* Router. */\n    ns_t_nsap = 22,        /* NSAP address. */\n    ns_t_nsap_ptr = 23,    /* Reverse NSAP lookup (deprecated). */\n    ns_t_sig = 24,        /* Security signature. */\n    ns_t_key = 25,        /* Security key. */\n    ns_t_px = 26,        /* X.400 mail mapping. */\n    ns_t_gpos = 27,        /* Geographical position (withdrawn). */\n    ns_t_aaaa = 28,        /* Ip6 Address. */\n    ns_t_loc = 29,        /* Location Information. */\n    ns_t_nxt = 30,        /* Next domain (security). */\n    ns_t_eid = 31,        /* Endpoint identifier. */\n    ns_t_nimloc = 32,    /* Nimrod Locator. */\n    ns_t_srv = 33,        /* Server Selection. */\n    ns_t_atma = 34,        /* ATM Address */\n    ns_t_naptr = 35,    /* Naming Authority PoinTeR */\n    ns_t_kx = 36,        /* Key Exchange */\n    ns_t_cert = 37,        /* Certification record */\n    ns_t_a6 = 38,        /* IPv6 address (deprecates AAAA) */\n    ns_t_dname = 39,    /* Non-terminal DNAME (for IPv6) */\n    ns_t_sink = 40,        /* Kitchen sink (experimentatl) */\n    ns_t_opt = 41,        /* EDNS0 option (meta-RR) */\n    ns_t_apl = 42,        /* Address prefix list (RFC 3123) */\n    ns_t_tkey = 249,    /* Transaction key */\n    ns_t_tsig = 250,    /* Transaction signature. */\n    ns_t_ixfr = 251,    /* Incremental zone transfer. */\n    ns_t_axfr = 252,    /* Transfer zone of authority. */\n    ns_t_mailb = 253,    /* Transfer mailbox records. */\n    ns_t_maila = 254,    /* Transfer mail agent records. */\n    ns_t_any = 255,        /* Wildcard match. */\n    ns_t_zxfr = 256,    /* BIND-specific, nonstandard. */\n    ns_t_max = 65536\n} ns_type;\n\n/* Exclusively a QTYPE? (not also an RTYPE) */\n#define    ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \\\n              (t) == ns_t_mailb || (t) == ns_t_maila)\n/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */\n#define    ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)\n/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */\n#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))\n#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)\n#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \\\n               (t) == ns_t_zxfr)\n\n/*\n * Values for class field\n */\ntypedef enum __ns_class {\n    ns_c_invalid = 0,    /* Cookie. */\n    ns_c_in = 1,        /* Internet. */\n    ns_c_2 = 2,        /* unallocated/unsupported. */\n    ns_c_chaos = 3,        /* MIT Chaos-net. */\n    ns_c_hs = 4,        /* MIT Hesiod. */\n    /* Query class values which do not appear in resource records */\n    ns_c_none = 254,    /* for prereq. sections in update requests */\n    ns_c_any = 255,        /* Wildcard match. */\n    ns_c_max = 65536\n} ns_class;\n\n/* DNSSEC constants. */\n\ntypedef enum __ns_key_types {\n    ns_kt_rsa = 1,        /* key type RSA/MD5 */\n    ns_kt_dh  = 2,        /* Diffie Hellman */\n    ns_kt_dsa = 3,        /* Digital Signature Standard (MANDATORY) */\n    ns_kt_private = 254    /* Private key type starts with OID */\n} ns_key_types;\n\ntypedef enum __ns_cert_types {\n    cert_t_pkix = 1,    /* PKIX (X.509v3) */\n    cert_t_spki = 2,    /* SPKI */\n    cert_t_pgp  = 3,    /* PGP */\n    cert_t_url  = 253,    /* URL private type */\n    cert_t_oid  = 254    /* OID private type */\n} ns_cert_types;\n\n/* Flags field of the KEY RR rdata. */\n#define    NS_KEY_TYPEMASK        0xC000    /* Mask for \"type\" bits */\n#define    NS_KEY_TYPE_AUTH_CONF    0x0000    /* Key usable for both */\n#define    NS_KEY_TYPE_CONF_ONLY    0x8000    /* Key usable for confidentiality */\n#define    NS_KEY_TYPE_AUTH_ONLY    0x4000    /* Key usable for authentication */\n#define    NS_KEY_TYPE_NO_KEY    0xC000    /* No key usable for either; no key */\n/* The type bits can also be interpreted independently, as single bits: */\n#define    NS_KEY_NO_AUTH        0x8000    /* Key unusable for authentication */\n#define    NS_KEY_NO_CONF        0x4000    /* Key unusable for confidentiality */\n#define    NS_KEY_RESERVED2    0x2000    /* Security is *mandatory* if bit=0 */\n#define    NS_KEY_EXTENDED_FLAGS    0x1000    /* reserved - must be zero */\n#define    NS_KEY_RESERVED4    0x0800  /* reserved - must be zero */\n#define    NS_KEY_RESERVED5    0x0400  /* reserved - must be zero */\n#define    NS_KEY_NAME_TYPE    0x0300    /* these bits determine the type */\n#define    NS_KEY_NAME_USER    0x0000    /* key is assoc. with user */\n#define    NS_KEY_NAME_ENTITY    0x0200    /* key is assoc. with entity eg host */\n#define    NS_KEY_NAME_ZONE    0x0100    /* key is zone key */\n#define    NS_KEY_NAME_RESERVED    0x0300    /* reserved meaning */\n#define    NS_KEY_RESERVED8    0x0080  /* reserved - must be zero */\n#define    NS_KEY_RESERVED9    0x0040  /* reserved - must be zero */\n#define    NS_KEY_RESERVED10    0x0020  /* reserved - must be zero */\n#define    NS_KEY_RESERVED11    0x0010  /* reserved - must be zero */\n#define    NS_KEY_SIGNATORYMASK    0x000F    /* key can sign RR's of same name */\n#define    NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \\\n                  NS_KEY_RESERVED4 | \\\n                  NS_KEY_RESERVED5 | \\\n                  NS_KEY_RESERVED8 | \\\n                  NS_KEY_RESERVED9 | \\\n                  NS_KEY_RESERVED10 | \\\n                  NS_KEY_RESERVED11 )\n#define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */\n\n/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */\n#define    NS_ALG_MD5RSA        1    /* MD5 with RSA */\n#define    NS_ALG_DH               2    /* Diffie Hellman KEY */\n#define    NS_ALG_DSA              3    /* DSA KEY */\n#define    NS_ALG_DSS              NS_ALG_DSA\n#define    NS_ALG_EXPIRE_ONLY    253    /* No alg, no security */\n#define    NS_ALG_PRIVATE_OID    254    /* Key begins with OID giving alg */\n\n/* Protocol values  */\n/* value 0 is reserved */\n#define NS_KEY_PROT_TLS         1\n#define NS_KEY_PROT_EMAIL       2\n#define NS_KEY_PROT_DNSSEC      3\n#define NS_KEY_PROT_IPSEC       4\n#define NS_KEY_PROT_ANY        255\n\n/* Signatures */\n#define    NS_MD5RSA_MIN_BITS     512    /* Size of a mod or exp in bits */\n#define    NS_MD5RSA_MAX_BITS    4096\n    /* Total of binary mod and exp */\n#define    NS_MD5RSA_MAX_BYTES    ((NS_MD5RSA_MAX_BITS+7/8)*2+3)\n    /* Max length of text sig block */\n#define    NS_MD5RSA_MAX_BASE64    (((NS_MD5RSA_MAX_BYTES+2)/3)*4)\n#define NS_MD5RSA_MIN_SIZE    ((NS_MD5RSA_MIN_BITS+7)/8)\n#define NS_MD5RSA_MAX_SIZE    ((NS_MD5RSA_MAX_BITS+7)/8)\n\n#define NS_DSA_SIG_SIZE         41\n#define NS_DSA_MIN_SIZE         213\n#define NS_DSA_MAX_BYTES        405\n\n/* Offsets into SIG record rdata to find various values */\n#define    NS_SIG_TYPE    0    /* Type flags */\n#define    NS_SIG_ALG    2    /* Algorithm */\n#define    NS_SIG_LABELS    3    /* How many labels in name */\n#define    NS_SIG_OTTL    4    /* Original TTL */\n#define    NS_SIG_EXPIR    8    /* Expiration time */\n#define    NS_SIG_SIGNED    12    /* Signature time */\n#define    NS_SIG_FOOT    16    /* Key footprint */\n#define    NS_SIG_SIGNER    18    /* Domain name of who signed it */\n\n/* How RR types are represented as bit-flags in NXT records */\n#define    NS_NXT_BITS 8\n#define    NS_NXT_BIT_SET(  n,p) (p[(n)/NS_NXT_BITS] |=  (0x80>>((n)%NS_NXT_BITS)))\n#define    NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))\n#define    NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] &   (0x80>>((n)%NS_NXT_BITS)))\n#define NS_NXT_MAX 127\n\n/*\n * EDNS0 extended flags, host order.\n */\n#define NS_OPT_DNSSEC_OK    0x8000U\n\n/*\n * Inline versions of get/put short/long.  Pointer is advanced.\n */\n#define NS_GET16(s, cp) do { \\\n    const u_char *t_cp = (const u_char *)(cp); \\\n    (s) = ((uint16_t)t_cp[0] << 8) \\\n        | ((uint16_t)t_cp[1]) \\\n        ; \\\n    (cp) += NS_INT16SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_GET32(l, cp) do { \\\n    const u_char *t_cp = (const u_char *)(cp); \\\n    (l) = ((uint32_t)t_cp[0] << 24) \\\n        | ((uint32_t)t_cp[1] << 16) \\\n        | ((uint32_t)t_cp[2] << 8) \\\n        | ((uint32_t)t_cp[3]) \\\n        ; \\\n    (cp) += NS_INT32SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_PUT16(s, cp) do { \\\n    uint32_t t_s = (uint32_t)(s); \\\n    u_char *t_cp = (u_char *)(cp); \\\n    *t_cp++ = t_s >> 8; \\\n    *t_cp   = t_s; \\\n    (cp) += NS_INT16SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_PUT32(l, cp) do { \\\n    uint32_t t_l = (uint32_t)(l); \\\n    u_char *t_cp = (u_char *)(cp); \\\n    *t_cp++ = t_l >> 24; \\\n    *t_cp++ = t_l >> 16; \\\n    *t_cp++ = t_l >> 8; \\\n    *t_cp   = t_l; \\\n    (cp) += NS_INT32SZ; \\\n} while (/*CONSTCOND*/0)\n\n/*\n * ANSI C identifier hiding for bind's lib/nameser.\n */\n#define    ns_msg_getflag        __ns_msg_getflag\n#define ns_get16        __ns_get16\n#define ns_get32        __ns_get32\n#define ns_put16        __ns_put16\n#define ns_put32        __ns_put32\n#define ns_initparse        __ns_initparse\n#define ns_skiprr        __ns_skiprr\n#define ns_parserr        __ns_parserr\n#define    ns_sprintrr        __ns_sprintrr\n#define    ns_sprintrrf        __ns_sprintrrf\n#define    ns_format_ttl        __ns_format_ttl\n#define    ns_parse_ttl        __ns_parse_ttl\n#define ns_datetosecs        __ns_datetosecs\n#define    ns_name_ntol        __ns_name_ntol\n#define    ns_name_ntop        __ns_name_ntop\n#define    ns_name_pton        __ns_name_pton\n#define    ns_name_unpack        __ns_name_unpack\n#define    ns_name_pack        __ns_name_pack\n#define    ns_name_compress    __ns_name_compress\n#define    ns_name_uncompress    __ns_name_uncompress\n#define    ns_name_skip        __ns_name_skip\n#define    ns_name_rollback    __ns_name_rollback\n#define    ns_sign            __ns_sign\n#define    ns_sign2        __ns_sign2\n#define    ns_sign_tcp        __ns_sign_tcp\n#define    ns_sign_tcp2        __ns_sign_tcp2\n#define    ns_sign_tcp_init    __ns_sign_tcp_init\n#define ns_find_tsig        __ns_find_tsig\n#define    ns_verify        __ns_verify\n#define    ns_verify_tcp        __ns_verify_tcp\n#define    ns_verify_tcp_init    __ns_verify_tcp_init\n#define    ns_samedomain        __ns_samedomain\n#define    ns_subdomain        __ns_subdomain\n#define    ns_makecanon        __ns_makecanon\n#define    ns_samename        __ns_samename\n\n__BEGIN_DECLS\nint        ns_msg_getflag(ns_msg, int);\nuint16_t    ns_get16(const u_char *);\nuint32_t    ns_get32(const u_char *);\nvoid        ns_put16(uint16_t, u_char *);\nvoid        ns_put32(uint32_t, u_char *);\nint        ns_initparse(const u_char *, int, ns_msg *);\nint        ns_skiprr(const u_char *, const u_char *, ns_sect, int);\nint        ns_parserr(ns_msg *, ns_sect, int, ns_rr *);\nint        ns_sprintrr(const ns_msg *, const ns_rr *,\n                 const char *, const char *, char *, size_t);\nint        ns_sprintrrf(const u_char *, size_t, const char *,\n                  ns_class, ns_type, u_long, const u_char *,\n                  size_t, const char *, const char *,\n                  char *, size_t);\nint        ns_format_ttl(u_long, char *, size_t);\nint        ns_parse_ttl(const char *, u_long *);\nuint32_t    ns_datetosecs(const char *cp, int *errp);\nint        ns_name_ntol(const u_char *, u_char *, size_t);\nint        ns_name_ntop(const u_char *, char *, size_t);\nint        ns_name_pton(const char *, u_char *, size_t);\nint        ns_name_unpack(const u_char *, const u_char *,\n                    const u_char *, u_char *, size_t);\nint        ns_name_pack(const u_char *, u_char *, int,\n                  const u_char **, const u_char **);\nint        ns_name_uncompress(const u_char *, const u_char *,\n                    const u_char *, char *, size_t);\nint        ns_name_compress(const char *, u_char *, size_t,\n                      const u_char **, const u_char **);\nint        ns_name_skip(const u_char **, const u_char *);\nvoid        ns_name_rollback(const u_char *, const u_char **,\n                      const u_char **);\nint        ns_sign(u_char *, int *, int, int, void *,\n                 const u_char *, int, u_char *, int *, time_t);\nint        ns_sign2(u_char *, int *, int, int, void *,\n                  const u_char *, int, u_char *, int *, time_t,\n                  u_char **, u_char **);\nint        ns_sign_tcp(u_char *, int *, int, int,\n                 ns_tcp_tsig_state *, int);\nint        ns_sign_tcp2(u_char *, int *, int, int,\n                  ns_tcp_tsig_state *, int,\n                  u_char **, u_char **);\nint        ns_sign_tcp_init(void *, const u_char *, int,\n                    ns_tcp_tsig_state *);\nu_char        *ns_find_tsig(u_char *, u_char *);\nint        ns_verify(u_char *, int *, void *,\n                   const u_char *, int, u_char *, int *,\n                   time_t *, int);\nint        ns_verify_tcp(u_char *, int *, ns_tcp_tsig_state *, int);\nint        ns_verify_tcp_init(void *, const u_char *, int,\n                    ns_tcp_tsig_state *);\nint        ns_samedomain(const char *, const char *);\nint        ns_subdomain(const char *, const char *);\nint        ns_makecanon(const char *, char *, size_t);\nint        ns_samename(const char *, const char *);\n__END_DECLS\n\n#ifdef BIND_4_COMPAT\n#include \"nameser_compat.h\"\n#endif\n\n#endif /* !_ARPA_NAMESER_H_ */\n"
  },
  {
    "path": "src/nameser_compat.h",
    "content": "/*    $NetBSD: nameser_compat.h,v 1.1.1.2 2004/11/07 01:28:27 christos Exp $    */\n\n/* Copyright (c) 1983, 1989\n *    The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *     This product includes software developed by the University of\n *     California, Berkeley and its contributors.\n * 4. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*\n *      from nameser.h    8.1 (Berkeley) 6/2/93\n *    Id: nameser_compat.h,v 1.1.2.3.4.2 2004/07/01 04:43:41 marka Exp\n */\n\n#ifndef _ARPA_NAMESER_COMPAT_\n#define    _ARPA_NAMESER_COMPAT_\n\n#define    __BIND        19950621    /* (DEAD) interface version stamp. */\n\n#include <endian.h>\n\n#ifndef BYTE_ORDER\n#if (BSD >= 199103)\n# include <machine/endian.h>\n#else\n#ifdef __linux\n# include <endian.h>\n#else\n#define    LITTLE_ENDIAN    1234    /* least-significant byte first (vax, pc) */\n#define    BIG_ENDIAN    4321    /* most-significant byte first (IBM, net) */\n#define    PDP_ENDIAN    3412    /* LSB first in word, MSW first in long (pdp)*/\n\n#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \\\n    defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \\\n    defined(__alpha__) || defined(__alpha) || \\\n    (defined(__Lynx__) && defined(__x86__))\n#define BYTE_ORDER    LITTLE_ENDIAN\n#endif\n\n#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \\\n    defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \\\n    defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\\\n    defined(apollo) || defined(__convex__) || defined(_CRAY) || \\\n    defined(__hppa) || defined(__hp9000) || \\\n    defined(__hp9000s300) || defined(__hp9000s700) || \\\n    defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \\\n    defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) ||  \\\n    (defined(__Lynx__) && \\\n     (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))\n#define BYTE_ORDER    BIG_ENDIAN\n#endif\n#endif /* __linux */\n#endif /* BSD */\n#endif /* BYTE_ORDER */\n\n#if !defined(BYTE_ORDER) || \\\n    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \\\n    BYTE_ORDER != PDP_ENDIAN)\n    /* you must determine what the correct bit order is for\n     * your compiler - the next line is an intentional error\n     * which will force your compiles to bomb until you fix\n     * the above macros.\n     */\n  #error \"Undefined or invalid BYTE_ORDER\";\n#endif\n\n/*\n * Structure for query header.  The order of the fields is machine- and\n * compiler-dependent, depending on the byte/bit order and the layout\n * of bit fields.  We use bit fields only in int variables, as this\n * is all ANSI requires.  This requires a somewhat confusing rearrangement.\n */\n\ntypedef struct {\n    unsigned    id :16;        /* query identification number */\n#if BYTE_ORDER == BIG_ENDIAN\n            /* fields in third byte */\n    unsigned    qr: 1;        /* response flag */\n    unsigned    opcode: 4;    /* purpose of message */\n    unsigned    aa: 1;        /* authoritive answer */\n    unsigned    tc: 1;        /* truncated message */\n    unsigned    rd: 1;        /* recursion desired */\n            /* fields in fourth byte */\n    unsigned    ra: 1;        /* recursion available */\n    unsigned    unused :1;    /* unused bits (MBZ as of 4.9.3a3) */\n    unsigned    ad: 1;        /* authentic data from named */\n    unsigned    cd: 1;        /* checking disabled by resolver */\n    unsigned    rcode :4;    /* response code */\n#endif\n#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN\n            /* fields in third byte */\n    unsigned    rd :1;        /* recursion desired */\n    unsigned    tc :1;        /* truncated message */\n    unsigned    aa :1;        /* authoritive answer */\n    unsigned    opcode :4;    /* purpose of message */\n    unsigned    qr :1;        /* response flag */\n            /* fields in fourth byte */\n    unsigned    rcode :4;    /* response code */\n    unsigned    cd: 1;        /* checking disabled by resolver */\n    unsigned    ad: 1;        /* authentic data from named */\n    unsigned    unused :1;    /* unused bits (MBZ as of 4.9.3a3) */\n    unsigned    ra :1;        /* recursion available */\n#endif\n            /* remaining bytes */\n    unsigned    qdcount :16;    /* number of question entries */\n    unsigned    ancount :16;    /* number of answer entries */\n    unsigned    nscount :16;    /* number of authority entries */\n    unsigned    arcount :16;    /* number of resource entries */\n} HEADER;\n\n#define PACKETSZ    NS_PACKETSZ\n#define MAXDNAME    NS_MAXDNAME\n#define MAXCDNAME    NS_MAXCDNAME\n#define MAXLABEL    NS_MAXLABEL\n#define    HFIXEDSZ    NS_HFIXEDSZ\n#define QFIXEDSZ    NS_QFIXEDSZ\n#define RRFIXEDSZ    NS_RRFIXEDSZ\n#define    INT32SZ        NS_INT32SZ\n#define    INT16SZ        NS_INT16SZ\n#define    INT8SZ        NS_INT8SZ\n#define    INADDRSZ    NS_INADDRSZ\n#define    IN6ADDRSZ    NS_IN6ADDRSZ\n#define    INDIR_MASK    NS_CMPRSFLGS\n#define NAMESERVER_PORT    NS_DEFAULTPORT\n\n#define S_ZONE        ns_s_zn\n#define S_PREREQ    ns_s_pr\n#define S_UPDATE    ns_s_ud\n#define S_ADDT        ns_s_ar\n\n#define QUERY        ns_o_query\n#define IQUERY        ns_o_iquery\n#define STATUS        ns_o_status\n#define    NS_NOTIFY_OP    ns_o_notify\n#define    NS_UPDATE_OP    ns_o_update\n\n#define NOERROR        ns_r_noerror\n#define FORMERR        ns_r_formerr\n#define SERVFAIL    ns_r_servfail\n#define NXDOMAIN    ns_r_nxdomain\n#define NOTIMP        ns_r_notimpl\n#define REFUSED        ns_r_refused\n#define YXDOMAIN    ns_r_yxdomain\n#define YXRRSET        ns_r_yxrrset\n#define NXRRSET        ns_r_nxrrset\n#define NOTAUTH        ns_r_notauth\n#define NOTZONE        ns_r_notzone\n/*#define BADSIG        ns_r_badsig*/\n/*#define BADKEY        ns_r_badkey*/\n/*#define BADTIME        ns_r_badtime*/\n\n\n#define DELETE        ns_uop_delete\n#define ADD        ns_uop_add\n\n#define T_A        ns_t_a\n#define T_NS        ns_t_ns\n#define T_MD        ns_t_md\n#define T_MF        ns_t_mf\n#define T_CNAME        ns_t_cname\n#define T_SOA        ns_t_soa\n#define T_MB        ns_t_mb\n#define T_MG        ns_t_mg\n#define T_MR        ns_t_mr\n#define T_NULL        ns_t_null\n#define T_WKS        ns_t_wks\n#define T_PTR        ns_t_ptr\n#define T_HINFO        ns_t_hinfo\n#define T_MINFO        ns_t_minfo\n#define T_MX        ns_t_mx\n#define T_TXT        ns_t_txt\n#define    T_RP        ns_t_rp\n#define T_AFSDB        ns_t_afsdb\n#define T_X25        ns_t_x25\n#define T_ISDN        ns_t_isdn\n#define T_RT        ns_t_rt\n#define T_NSAP        ns_t_nsap\n#define T_NSAP_PTR    ns_t_nsap_ptr\n#define    T_SIG        ns_t_sig\n#define    T_KEY        ns_t_key\n#define    T_PX        ns_t_px\n#define    T_GPOS        ns_t_gpos\n#define    T_AAAA        ns_t_aaaa\n#define    T_LOC        ns_t_loc\n#define    T_NXT        ns_t_nxt\n#define    T_EID        ns_t_eid\n#define    T_NIMLOC    ns_t_nimloc\n#define    T_SRV        ns_t_srv\n#define T_ATMA        ns_t_atma\n#define T_NAPTR        ns_t_naptr\n#define T_A6        ns_t_a6\n#define    T_TSIG        ns_t_tsig\n#define    T_IXFR        ns_t_ixfr\n#define T_AXFR        ns_t_axfr\n#define T_MAILB        ns_t_mailb\n#define T_MAILA        ns_t_maila\n#define T_ANY        ns_t_any\n\n#define C_IN        ns_c_in\n#define C_CHAOS        ns_c_chaos\n#define C_HS        ns_c_hs\n/* BIND_UPDATE */\n#define C_NONE        ns_c_none\n#define C_ANY        ns_c_any\n\n#define    GETSHORT        NS_GET16\n#define    GETLONG            NS_GET32\n#define    PUTSHORT        NS_PUT16\n#define    PUTLONG            NS_PUT32\n\n#endif /* _ARPA_NAMESER_COMPAT_ */\n"
  },
  {
    "path": "src/netlink-musl.h",
    "content": "#ifndef NETLINK_MUSL_H\n#define NETLINK_MUSL_H\n\n#if !__linux__\n#error netlink-musl.h only works with a linux kernel\n#endif\n\n#if __ANDROID__\n#error netlink-musl.h does not work with Android\n#endif\n\n#include <stdint.h>\n\n/* linux/netlink.h */\n\n#define NETLINK_ROUTE 0\n\nstruct nlmsghdr {\n\tuint32_t\tnlmsg_len;\n\tuint16_t\tnlmsg_type;\n\tuint16_t\tnlmsg_flags;\n\tuint32_t\tnlmsg_seq;\n\tuint32_t\tnlmsg_pid;\n};\n\n#define NLM_F_REQUEST\t1\n#define NLM_F_MULTI\t2\n#define NLM_F_ACK\t4\n\n#define NLM_F_ROOT\t0x100\n#define NLM_F_MATCH\t0x200\n#define NLM_F_ATOMIC\t0x400\n#define NLM_F_DUMP\t(NLM_F_ROOT|NLM_F_MATCH)\n\n#define NLMSG_NOOP\t0x1\n#define NLMSG_ERROR\t0x2\n#define NLMSG_DONE\t0x3\n#define NLMSG_OVERRUN\t0x4\n\n/* linux/rtnetlink.h */\n\n#define RTM_NEWLINK\t16\n#define RTM_GETLINK\t18\n#define RTM_NEWADDR\t20\n#define RTM_GETADDR\t22\n\nstruct rtattr {\n\tunsigned short\trta_len;\n\tunsigned short\trta_type;\n};\n\nstruct rtgenmsg {\n\tunsigned char\trtgen_family;\n};\n\nstruct ifinfomsg {\n\tunsigned char\tifi_family;\n\tunsigned char\t__ifi_pad;\n\tunsigned short\tifi_type;\n\tint\t\tifi_index;\n\tunsigned\tifi_flags;\n\tunsigned\tifi_change;\n};\n\n/* linux/if_link.h */\n\n#define IFLA_ADDRESS\t1\n#define IFLA_BROADCAST\t2\n#define IFLA_IFNAME\t3\n#define IFLA_STATS\t7\n\n/* linux/if_addr.h */\n\nstruct ifaddrmsg {\n\tuint8_t\t\tifa_family;\n\tuint8_t\t\tifa_prefixlen;\n\tuint8_t\t\tifa_flags;\n\tuint8_t\t\tifa_scope;\n\tuint32_t\tifa_index;\n};\n\n#define IFA_ADDRESS\t1\n#define IFA_LOCAL\t2\n#define IFA_LABEL\t3\n#define IFA_BROADCAST\t4\n\n/* musl */\n\n#define NETLINK_ALIGN(len)\t(((len)+3) & ~3)\n#define NLMSG_DATA(nlh)\t\t((void*)((char*)(nlh)+sizeof(struct nlmsghdr)))\n#define NLMSG_DATALEN(nlh)\t((nlh)->nlmsg_len-sizeof(struct nlmsghdr))\n#define NLMSG_DATAEND(nlh)\t((char*)(nlh)+(nlh)->nlmsg_len)\n#define NLMSG_NEXT(nlh)\t\t(struct nlmsghdr*)((char*)(nlh)+NETLINK_ALIGN((nlh)->nlmsg_len))\n#define NLMSG_OK(nlh,end)\t((char*)(end)-(char*)(nlh) >= sizeof(struct nlmsghdr))\n\n#define RTA_DATA(rta)\t\t((void*)((char*)(rta)+sizeof(struct rtattr)))\n#define RTA_DATALEN(rta)\t((rta)->rta_len-sizeof(struct rtattr))\n#define RTA_DATAEND(rta)\t((char*)(rta)+(rta)->rta_len)\n#define RTA_NEXT(rta)\t\t(struct rtattr*)((char*)(rta)+NETLINK_ALIGN((rta)->rta_len))\n#define RTA_OK(nlh,end)\t\t((char*)(end)-(char*)(rta) >= sizeof(struct rtattr))\n\n#define NLMSG_RTA(nlh,len)\t((void*)((char*)(nlh)+sizeof(struct nlmsghdr)+NETLINK_ALIGN(len)))\n#define NLMSG_RTAOK(rta,nlh)\tRTA_OK(rta,NLMSG_DATAEND(nlh))\n\nint __rtnetlink_enumerate(int link_af, int addr_af, int (*cb)(void *ctx, struct nlmsghdr *h), void *ctx);\n\n#endif // NETLINK_MUSL_H\n"
  },
  {
    "path": "src/network.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef USE_MSRPC\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n\n#include \"types.h\"\n\n#if HAVE_GETIFADDR && _WIN32\n#include <iphlpapi.h>\n#endif\n\n#include <string.h>\n\n#ifndef _WIN32\n#include <signal.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <netinet/in.h>\n#include <sys/types.h>\n\n#if HAVE_GETIFADDR\n\n#if __ANDROID__\n#include \"ifaddrs-android.h\"\n#elif defined(GETIFADDRS_MUSL)\n#include \"ifaddrs-musl.h\"\n#else // getifaddrs from OS\n#include <ifaddrs.h>\n#endif // getifaddrs from OS\n\n#endif // HAVE_GETIFADDR\n#endif // !WIN32\n\n#include \"network.h\"\n#include \"endian.h\"\n//#include \"output.h\"\n#include \"helpers.h\"\n#include \"shared_globals.h\"\n#include \"rpc.h\"\n\n#ifndef _WIN32\ntypedef ssize_t(*sendrecv_t)(int, void*, size_t, int);\n#else\ntypedef int (WINAPI *sendrecv_t)(SOCKET, void*, int, int);\n#endif\n\n\n// Send or receive a fixed number of bytes regardless if received in one or more chunks\nint_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send)\n{\n\tint n;\n\tsendrecv_t  f = do_send\n\t\t? (sendrecv_t)send\n\t\t: (sendrecv_t)recv;\n\n\tdo\n\t{\n\t\tn = f(sock, data, len, 0);\n\t} while (\n\t\t(n < 0 && socket_errno == SOCKET_EINTR) || (n > 0 && (data += n, (len -= n) > 0)));\n\n\treturn !len;\n}\n\n\nstatic int_fast8_t ip2str(char *restrict result, const size_t resultLength, const struct sockaddr *const restrict socketAddress, const socklen_t socketLength)\n{\n\tstatic const char *const fIPv4 = \"%s:%s\";\n\tstatic const char *const fIPv6 = \"[%s]:%s\";\n\tchar ipAddress[64], portNumber[8];\n\n\tif (getnameinfo\n\t(\n\t\tsocketAddress,\n\t\tsocketLength,\n\t\tipAddress,\n\t\tsizeof(ipAddress),\n\t\tportNumber,\n\t\tsizeof(portNumber),\n\t\tNI_NUMERICHOST | NI_NUMERICSERV\n\t))\n\t{\n\t\treturn FALSE;\n\t}\n\n\tif ((unsigned int)vlmcsd_snprintf(result, resultLength, socketAddress->sa_family == AF_INET6 ? fIPv6 : fIPv4, ipAddress, portNumber) > resultLength) return FALSE;\n\treturn TRUE;\n}\n\n\nstatic int_fast8_t getSocketList(struct addrinfo **saList, const char *const addr, const int flags, const int AddressFamily)\n{\n\tint status;\n\tchar *szHost, *szPort;\n\tconst size_t len = strlen(addr) + 1;\n\n\t// Don't alloca too much\n\tif (len > 264) return FALSE;\n\n\tchar *addrcopy = (char*)alloca(len);\n\tmemcpy(addrcopy, addr, len);\n\n\tparseAddress(addrcopy, &szHost, &szPort);\n\n\tstruct addrinfo hints;\n\n\tmemset(&hints, 0, sizeof(struct addrinfo));\n\n\thints.ai_family = AddressFamily;\n\thints.ai_socktype = SOCK_STREAM;\n\thints.ai_protocol = IPPROTO_TCP;\n\thints.ai_flags = flags;\n\n\tif ((status = getaddrinfo(szHost, szPort, &hints, saList)))\n\t{\n\t\tprinterrorf(\"Warning: %s: %s\\n\", addr, gai_strerror(status));\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n\nstatic int_fast8_t setBlockingEnabled(SOCKET fd, int_fast8_t blocking)\n{\n\tif (fd == INVALID_SOCKET) return FALSE;\n\n#ifdef _WIN32\n\n\tunsigned long mode = blocking ? 0 : 1;\n\treturn (ioctlsocket(fd, FIONBIO, &mode) == 0) ? TRUE : FALSE;\n\n#else // POSIX\n\n\tint flags = fcntl(fd, F_GETFL, 0);\n\n\tif (flags < 0) return FALSE;\n\n\tflags = blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK);\n\treturn (fcntl(fd, F_SETFL, flags) == 0) ? TRUE : FALSE;\n\n#endif // POSIX\n}\n\n\nint_fast8_t isDisconnected(const SOCKET s)\n{\n\tchar buffer[1];\n\n\tif (!setBlockingEnabled(s, FALSE)) return TRUE;\n\n\tconst int n = recv(s, buffer, 1, MSG_PEEK);\n\n\tif (!setBlockingEnabled(s, TRUE)) return TRUE;\n\tif (n == 0) return TRUE;\n\n\treturn FALSE;\n}\n\n\n#if !defined(NO_PRIVATE_IP_DETECT)\n// Check, if a sockaddr is a private IPv4 or IPv6 address\nstatic int_fast8_t isPrivateIPAddress(struct sockaddr* addr, socklen_t* length)\n{\n\tunion v6addr\n\t{\n\t\tuint8_t bytes[16];\n\t\tuint16_t words[8];\n\t\tuint32_t dwords[4];\n\t\tuint64_t qwords[2];\n\t};\n\n\tif (addr == NULL) return FALSE;\n\n\tswitch (addr->sa_family)\n\t{\n\tcase AF_INET6:\n\t{\n\t\tunion v6addr* ipv6addr = (union v6addr*)&((struct sockaddr_in6*)addr)->sin6_addr;\n\n\t\tif\n\t\t\t(\n\t\t\t(ipv6addr->qwords[0] != 0 || BE64(ipv6addr->qwords[1]) != 1) && // ::1 IPv6 localhost\n\t\t\t\t(BE16(ipv6addr->words[0]) & 0xe000) == 0x2000 // !2000::/3\n\t\t\t\t)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (length) *length = sizeof(struct sockaddr_in6);\n\t\tbreak;\n\t}\n\n\tcase AF_INET:\n\t{\n\t\tconst uint32_t ipv4addr = BE32(((struct sockaddr_in*)addr)->sin_addr.s_addr);\n\n\t\tif\n\t\t\t(\n\t\t\t(ipv4addr & 0xff000000) != 0x7f000000 && // 127.x.x.x localhost\n\t\t\t\t(ipv4addr & 0xffff0000) != 0xc0a80000 && // 192.168.x.x private routeable\n\t\t\t\t(ipv4addr & 0xffff0000) != 0xa9fe0000 && // 169.254.x.x link local\n\t\t\t\t(ipv4addr & 0xff000000) != 0x0a000000 && // 10.x.x.x private routeable\n\t\t\t\t(ipv4addr & 0xfff00000) != 0xac100000    // 172.16-31.x.x private routeable\n\t\t\t\t)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (length) *length = sizeof(struct sockaddr_in);\n\t\tbreak;\n\t}\n\n\tdefault:\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n#endif // !defined(NO_PRIVATE_IP_DETECT)\n\n\n// Connect to TCP address addr (e.g. \"kms.example.com:1688\") and return an\n// open socket for the connection if successful or INVALID_SOCKET otherwise\nSOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fast8_t showHostName)\n{\n\tstruct addrinfo *saList, *sa;\n\tSOCKET s = INVALID_SOCKET;\n\tchar szAddr[128];\n\n\tif (!getSocketList(&saList, addr, 0, AddressFamily)) return INVALID_SOCKET;\n\n\tfor (sa = saList; sa; sa = sa->ai_next)\n\t{\n\t\t// struct sockaddr_in* addr4 = (struct sockaddr_in*)sa->ai_addr;\n\t\t// struct sockaddr_in6* addr6 = (struct sockaddr_in6*)sa->ai_addr;\n\n\t\tif (ip2str(szAddr, sizeof(szAddr), sa->ai_addr, (socklen_t)sa->ai_addrlen))\n\t\t{\n\t\t\tshowHostName ? printf(\"Connecting to %s (%s) ... \", addr, szAddr) : printf(\"Connecting to %s ... \", szAddr);\n\t\t\tfflush(stdout);\n\t\t}\n\n\t\ts = socket(sa->ai_family, SOCK_STREAM, IPPROTO_TCP);\n\n#\t\tif !defined(NO_TIMEOUT) && !__minix__\n#\t\tifndef _WIN32 // Standard Posix timeout structure\n\n\t\tstruct timeval to;\n\t\tto.tv_sec = 10;\n\t\tto.tv_usec = 0;\n\n#\t\telse // Windows requires a DWORD with milliseconds\n\n\t\tDWORD to = 10000;\n\n#\t\tendif // _WIN32\n\n\t\tsetsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (sockopt_t)&to, sizeof(to));\n\t\tsetsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (sockopt_t)&to, sizeof(to));\n#\t\tendif // !defined(NO_TIMEOUT) && !__minix__\n\n\t\tif (!connect(s, sa->ai_addr, (int)sa->ai_addrlen))\n\t\t{\n\t\t\tprintf(\"successful\\n\");\n\t\t\tbreak;\n\t\t}\n\n\t\tprinterrorf(\"%s: %s\\n\", szAddr, socket_errno == SOCKET_EINPROGRESS ? \"Timed out\" : vlmcsd_strerror(socket_errno));\n\n\t\tsocketclose(s);\n\t\ts = INVALID_SOCKET;\n\t}\n\n\tfreeaddrinfo(saList);\n\treturn s;\n}\n\n// fix for lame tomato toolchain\n#\tif !defined(IPV6_V6ONLY) && defined(__linux__)\n#\tdefine IPV6_V6ONLY (26)\n#\tendif // !defined(IPV6_V6ONLY) && defined(__linux__)\n\n\n#ifndef NO_SOCKETS\n\nstatic int_fast8_t allowSocketReuse(SOCKET s)\n{\n#\tif !__CYGWIN__\n\n\tBOOL socketOption = TRUE;\n\n#\tif !_WIN32\n#\tdefine VLMCSD_SOCKET_OPTION SO_REUSEADDR\n#\telse // _WIN32\n#\tdefine VLMCSD_SOCKET_OPTION SO_EXCLUSIVEADDRUSE\n#\tendif // _WIN32\n\n\tif (setsockopt(s, SOL_SOCKET, VLMCSD_SOCKET_OPTION, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t{\n#\t\tifdef _PEDANTIC\n\t\tprinterrorf(\"Warning: Socket option SO_REUSEADDR unsupported: %s\\n\", vlmcsd_strerror(socket_errno));\n#\t\tendif // _PEDANTIC\n\t}\n\n#\tundef VLMCSD_SOCKET_OPTION\n#\tendif // !__CYGWIN__\n\n\treturn 0;\n}\n\n\n#ifdef SIMPLE_SOCKETS\n\nint listenOnAllAddresses()\n{\n\tuint32_t port_listen;\n\n\tif (!stringToInt(defaultport, 1, 65535, &port_listen))\n\t{\n\t\tprinterrorf(\"Fatal: Port must be numeric between 1 and 65535.\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n#\tif defined(AF_INET6) && defined(IPV6_V6ONLY)\n\n\tstruct sockaddr_in6 addr;\n\tmemset(&addr, 0, sizeof(addr));\n\taddr.sin6_family = AF_INET6;\n\taddr.sin6_port = BE16((uint16_t)port_listen);\n\taddr.sin6_addr = in6addr_any;\n\tBOOL v6only = FALSE;\n\ts_server = socket(AF_INET6, SOCK_STREAM, 0);\n\n\tif (s_server == INVALID_SOCKET\n\t\t|| allowSocketReuse(s_server)\n\t\t|| setsockopt(s_server, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&v6only, sizeof(v6only))\n\t\t|| bind(s_server, (struct sockaddr *)&addr, sizeof(addr))\n\t\t|| listen(s_server, SOMAXCONN))\n\t{\n\t\tsocketclose(s_server);\n#\tendif // defined(AF_INET6) && defined(IPV6_V6ONLY)\n\t\tstruct sockaddr_in addr4 = {\n\t\t\t\t.sin_family = AF_INET,\n\t\t\t\t.sin_port = BE16((uint16_t)port_listen),\n\t\t\t\t.sin_addr.s_addr = BE32(INADDR_ANY)\n\t\t};\n\n\t\ts_server = socket(AF_INET, SOCK_STREAM, 0);\n\n\t\tif (s_server == INVALID_SOCKET\n\t\t\t|| allowSocketReuse(s_server)\n\t\t\t|| bind(s_server, (struct sockaddr *)&addr4, sizeof(addr4))\n\t\t\t|| listen(s_server, SOMAXCONN))\n\t\t{\n\t\t\tint error = socket_errno;\n\t\t\tprinterrorf(\"Fatal: Cannot bind to TCP port %u: %s\\n\", port_listen, vlmcsd_strerror(error));\n\t\t\treturn error;\n\t\t}\n\n#\tif defined(AF_INET6) && defined(IPV6_V6ONLY)\n\t}\n#\tendif // defined(AF_INET6) && defined(IPV6_V6ONLY)\n\n#ifndef NO_LOG\n\tlogger(\"Listening on TCP port %u\\n\", port_listen);\n#endif // NO_LOG\n\n\treturn 0;\n}\n\n#else // !SIMPLE_SOCKETS\n\n\n#if HAVE_GETIFADDR && !defined(NO_PRIVATE_IP_DETECT)\n// Get list of private IP addresses.\n// Returns 0 on success or an errno error code on failure\nvoid getPrivateIPAddresses(int* numAddresses, char*** ipAddresses)\n{\n#\tif _WIN32\n\n\tPIP_ADAPTER_ADDRESSES firstAdapter, currentAdapter;\n\n\tDWORD dwRetVal;\n\tULONG outBufLen = 16384;\n\tconst ULONG flags = GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME;\n\n\tfirstAdapter = (PIP_ADAPTER_ADDRESSES)vlmcsd_malloc(outBufLen);\n\n\tif ((dwRetVal = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, firstAdapter, &outBufLen)) == ERROR_BUFFER_OVERFLOW)\n\t{\n\t\tfree(firstAdapter);\n\t\tfirstAdapter = (PIP_ADAPTER_ADDRESSES)vlmcsd_malloc(outBufLen);\n\t\tdwRetVal = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, firstAdapter, &outBufLen);\n\t}\n\n\tif (dwRetVal != NO_ERROR)\n\t{\n\t\tprinterrorf(\"FATAL: Could not get network address list: %s\\n\", vlmcsd_strerror(dwRetVal));\n\t\texit(dwRetVal);\n\t}\n\n\tfor (currentAdapter = firstAdapter, *numAddresses = 0; currentAdapter != NULL; currentAdapter = currentAdapter->Next)\n\t{\n\t\tPIP_ADAPTER_UNICAST_ADDRESS currentAddress;\n\t\tint length;\n\n\t\tif (currentAdapter->OperStatus != IfOperStatusUp) continue;\n\n\t\tfor (currentAddress = currentAdapter->FirstUnicastAddress; currentAddress != NULL; currentAddress = currentAddress->Next)\n\t\t{\n\t\t\tif (isPrivateIPAddress(currentAddress->Address.lpSockaddr, &length)) (*numAddresses)++;\n\t\t}\n\t}\n\n\t*ipAddresses = (char**)vlmcsd_malloc(*numAddresses * sizeof(char*));\n\n\tfor (currentAdapter = firstAdapter, *numAddresses = 0; currentAdapter != NULL; currentAdapter = currentAdapter->Next)\n\t{\n\t\tPIP_ADAPTER_UNICAST_ADDRESS currentAddress;\n\t\tint length;\n\n\t\tif (currentAdapter->OperStatus != IfOperStatusUp) continue;\n\n\t\tfor (currentAddress = currentAdapter->FirstUnicastAddress; currentAddress != NULL; currentAddress = currentAddress->Next)\n\t\t{\n\t\t\tif (!isPrivateIPAddress(currentAddress->Address.lpSockaddr, &length)) continue;\n\n\t\t\tchar *ipAddress = (char*)vlmcsd_malloc(64);\n\t\t\tconst int error = getnameinfo(currentAddress->Address.lpSockaddr, currentAddress->Address.iSockaddrLength, ipAddress, 64, NULL, 0, NI_NUMERICHOST);\n\n\t\t\tif (error)\n\t\t\t{\n\t\t\t\tprinterrorf(\"WARNING: Could not get IP address from interface list: %s\\n\", gai_strerror(error));\n\t\t\t\t*ipAddress = 0;\n\t\t\t}\n\n\t\t\t(*ipAddresses)[(*numAddresses)++] = ipAddress;\n\t\t}\n\t}\n\n\tfree(firstAdapter);\n\n#\telse // !_WIN32\n\n\tstruct ifaddrs *addrs, *addr;\n\n\tif (getifaddrs(&addrs))\n\t{\n\t\tprinterrorf(\"FATAL: Could not get network address list: %s\\n\", vlmcsd_strerror(errno));\n\t\texit(errno);\n\t}\n\n\tsocklen_t length;\n\n\tfor (addr = addrs, *numAddresses = 0; addr != NULL; addr = addr->ifa_next)\n\t{\n\t\tif (!isPrivateIPAddress(addr->ifa_addr, &length)) continue;\n\t\t(*numAddresses)++;\n\t}\n\n\t*ipAddresses = (char**)vlmcsd_malloc(*numAddresses * sizeof(char*));\n\n\tfor (addr = addrs, *numAddresses = 0; addr != NULL; addr = addr->ifa_next)\n\t{\n\t\tif (!isPrivateIPAddress(addr->ifa_addr, &length)) continue;\n\n\t\tchar *ipAddress = (char*)vlmcsd_malloc(64);\n\t\tint error = getnameinfo(addr->ifa_addr, length, ipAddress, 64, NULL, 0, NI_NUMERICHOST);\n\n\t\tif (error)\n\t\t{\n\t\t\tprinterrorf(\"WARNING: Could not get IP address from interface list: %s\\n\", gai_strerror(error));\n\t\t\t*ipAddress = 0;\n\t\t}\n\n#\t\tif __UCLIBC__ || __gnu_hurd__\n\n\t\tsize_t adrlen = strlen(ipAddress);\n\n\t\tif\n\t\t\t(\n\t\t\t\taddr->ifa_addr->sa_family == AF_INET6 &&\n\t\t\t\tadrlen > 5 &&\n\t\t\t\t!strchr(ipAddress, '%') &&\n\t\t\t\t(BE16(*(uint16_t*)&((struct sockaddr_in6*)addr->ifa_addr)->sin6_addr) & 0xffc0) == 0xfe80\n\t\t\t\t)\n\t\t{\n\t\t\tsize_t ifnamelen = strlen(addr->ifa_name);\n\t\t\tchar* workaroundIpAddress = (char*)vlmcsd_malloc(adrlen + ifnamelen + 2);\n\t\t\tstrcpy(workaroundIpAddress, ipAddress);\n\t\t\tstrcat(workaroundIpAddress, \"%\");\n\t\t\tstrcat(workaroundIpAddress, addr->ifa_name);\n\t\t\t(*ipAddresses)[(*numAddresses)++] = workaroundIpAddress;\n\t\t\tfree(ipAddress);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t(*ipAddresses)[(*numAddresses)++] = ipAddress;\n\t\t}\n#\t\telse // !(__UCLIBC__ || __gnu_hurd__)\n\n\t\t(*ipAddresses)[(*numAddresses)++] = ipAddress;\n\n#\t\tendif // !(__UCLIBC__ || __gnu_hurd__)\n\t}\n\n\tfreeifaddrs(addrs);\n\n#\tendif // !_WIN32\n}\n#endif // HAVE_GETIFADDR && !defined(NO_PRIVATE_IP_DETECT)\n\n\n\n// Create a Listening socket for addrinfo sa and return socket s\n// szHost and szPort are for logging only\nstatic int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)\n{\n\tint error;\n\tchar ipstr[64];\n\n\tip2str(ipstr, sizeof(ipstr), ai->ai_addr, (socklen_t)ai->ai_addrlen);\n\n\t//*s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);\n\t*s = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);\n\n\tif (*s == INVALID_SOCKET)\n\t{\n\t\terror = socket_errno;\n\t\tprinterrorf(\"Warning: %s error. %s\\n\", ai->ai_family == AF_INET6 ? cIPv6 : cIPv4, vlmcsd_strerror(error));\n\t\treturn error;\n\t}\n\n#\tif !defined(_WIN32) && !defined(NO_SIGHUP)\n\n\tint flags = fcntl(*s, F_GETFD, 0);\n\n\tif (flags != -1)\n\t{\n\t\tflags |= FD_CLOEXEC;\n\t\tfcntl(*s, F_SETFD, flags);\n\t}\n#\tifdef _PEDANTIC\n\telse\n\t{\n\t\tprinterrorf(\"Warning: Could not set FD_CLOEXEC flag on %s: %s\\n\", ipstr, vlmcsd_strerror(errno));\n\t}\n#\tendif // _PEDANTIC\n\n#\tendif // !defined(_WIN32) && !defined(NO_SIGHUP)\n\n\tBOOL socketOption = TRUE;\n\n#\tifdef IPV6_V6ONLY\n\tif (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t{\n#\t\tifdef _PEDANTIC\n#\t\tif defined(_WIN32) || defined(__CYGWIN__)\n\t\t//\t\tif (IsWindowsVistaOrGreater()) //Doesn't work with older version of MingW32-w64 toolchain\n\t\tif ((GetVersion() & 0xff) > 5)\n\t\t{\n#\t\tendif // _WIN32\n\t\t\tprinterrorf(\"Warning: %s does not support socket option IPV6_V6ONLY: %s\\n\", ipstr, vlmcsd_strerror(socket_errno));\n#\t\tif defined(_WIN32) || defined(__CYGWIN__)\n\t\t}\n#\t\tendif // _WIN32\n#\t\tendif // _PEDANTIC\n\t}\n#\tendif\n\n\tallowSocketReuse(*s);\n\n#\tif HAVE_FREEBIND\n#\tif (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)\n#\tdefine IPV6_BINDANY 64\n#\tendif // (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)\n\n\tif (freebind)\n\t{\n#\t\tif defined(IP_FREEBIND) // Linux\n\t\tif (setsockopt(*s, IPPROTO_IP, IP_FREEBIND, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t\t{\n\t\t\tprinterrorf(\"Warning: Cannot use FREEBIND on %s: %s\\n\", ipstr, vlmcsd_strerror(socket_errno));\n\t\t}\n#\t\tendif // defined(IP_FREEBIND)\n\n#\t\tif defined(IP_BINDANY) // FreeBSD IPv4\n\t\tif (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t\t{\n\t\t\tprinterrorf(\"Warning: Cannot use BINDANY on %s: %s\\n\", ipstr, vlmcsd_strerror(socket_errno));\n\t\t}\n#\t\tendif // defined(IP_BINDANY)\n\n#\t\tif defined(IPV6_BINDANY) // FreeBSD IPv6\n\t\tif (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IP, IPV6_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t\t{\n#\t\t\tifdef _PEDANTIC // FreeBSD defines the symbol but doesn't have BINDANY in IPv6 (Kame stack doesn't have it)\n\t\t\tprinterrorf(\"Warning: Cannot use BINDANY on %s: %s\\n\", ipstr, vlmcsd_strerror(socket_errno));\n#\t\t\tendif\n\t\t}\n#\t\tendif // defined(IPV6_BINDANY)\n\n#\t\tif defined(IP_NONLOCALOK) && !defined(IP_BINDANY) // FreeBSD with GNU userspace IPv4\n\t\tif (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_NONLOCALOK, (sockopt_t)&socketOption, sizeof(socketOption)))\n\t\t{\n\t\t\tprinterrorf(\"Warning: Cannot use BINDANY on %s: %s\\n\", ipstr, vlmcsd_strerror(socket_errno));\n\t\t}\n#\t\tendif // defined(IP_NONLOCALOK) && !defined(IP_BINDANY)\n\t}\n\n#\tendif // HAVE_FREEBIND\n\n\tif (bind(*s, ai->ai_addr, (int)ai->ai_addrlen) || listen(*s, SOMAXCONN))\n\t{\n\t\terror = socket_errno;\n\t\tprinterrorf(\"Warning: %s: %s\\n\", ipstr, vlmcsd_strerror(error));\n\t\tsocketclose(*s);\n\t\treturn error;\n\t}\n\n#\tifndef NO_LOG\n\tlogger(\"Listening on %s\\n\", ipstr);\n#\tendif\n\n\treturn 0;\n}\n\n// Adds a listening socket for an address string,\n// e.g. 127.0.0.1:1688 or [2001:db8:dead:beef::1]:1688\nBOOL addListeningSocket(const char *const addr)\n{\n\tstruct addrinfo *aiList, *ai;\n\tint result = FALSE;\n\tSOCKET *s = SocketList + numsockets;\n\n\tif (getSocketList(&aiList, addr, AI_PASSIVE | AI_NUMERICHOST, AF_UNSPEC))\n\t{\n\t\tfor (ai = aiList; ai; ai = ai->ai_next)\n\t\t{\n\t\t\t// struct sockaddr_in* addr4 = (struct sockaddr_in*)sa->ai_addr;\n\t\t\t// struct sockaddr_in6* addr6 = (struct sockaddr_in6*)sa->ai_addr;\n\n\t\t\tif (numsockets >= FD_SETSIZE)\n\t\t\t{\n#ifdef _PEDANTIC // Do not report this error in normal builds to keep file size low\n\t\t\t\tprinterrorf(\"Warning: Cannot listen on %s. Your OS only supports %u listening sockets in an FD_SET.\\n\", addr, FD_SETSIZE);\n#endif\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!listenOnAddress(ai, s))\n\t\t\t{\n\t\t\t\tnumsockets++;\n\t\t\t\tresult = TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texitOnWarningLevel(1);\n\t\t\t}\n\t\t}\n\n\t\tfreeaddrinfo(aiList);\n\t}\n\treturn result;\n}\n\n\n// Just create some dummy sockets to see if we have a specific protocol (IPv4 or IPv6)\n__pure int_fast8_t checkProtocolStack(const int addressfamily)\n{\n\tSOCKET s; // = INVALID_SOCKET;\n\n\ts = socket(addressfamily, SOCK_STREAM, 0);\n\tconst int_fast8_t success = (s != INVALID_SOCKET);\n\n\tsocketclose(s);\n\treturn success;\n}\n\n\n// Build an fd_set of all listening socket then use select to wait for an incoming connection\nstatic SOCKET network_accept_any()\n{\n\tfd_set ListeningSocketsList;\n\tSOCKET maxSocket, sock;\n\tint i;\n\tint status;\n\n\tFD_ZERO(&ListeningSocketsList);\n\tmaxSocket = 0;\n\n\tfor (i = 0; i < numsockets; i++)\n\t{\n\t\tFD_SET(SocketList[i], &ListeningSocketsList);\n\t\tif (SocketList[i] > maxSocket) maxSocket = SocketList[i];\n\t}\n\n\tstatus = select((int)maxSocket + 1, &ListeningSocketsList, NULL, NULL, NULL);\n\n\tif (status < 0) return INVALID_SOCKET;\n\n\tsock = INVALID_SOCKET;\n\n\tfor (i = 0; i < numsockets; i++)\n\t{\n\t\tif (FD_ISSET(SocketList[i], &ListeningSocketsList))\n\t\t{\n\t\t\tsock = SocketList[i];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (sock == INVALID_SOCKET)\n\t\treturn INVALID_SOCKET;\n\telse\n\t\treturn accept(sock, NULL, NULL);\n}\n#endif // !SIMPLE_SOCKETS\n\n\nvoid closeAllListeningSockets()\n{\n#\tifdef SIMPLE_SOCKETS\n\n\tsocketclose(s_server);\n\n#\telse // !SIMPLE_SOCKETS\n\n\tint i;\n\n\tfor (i = 0; i < numsockets; i++)\n\t{\n\t\tsocketclose(SocketList[i]);\n\t}\n\n#endif // !SIMPLE_SOCKETS\n}\n#endif // NO_SOCKETS\n\n\nstatic void serveClient(const SOCKET s_client, const DWORD RpcAssocGroup)\n{\n#\tif !defined(NO_TIMEOUT) && !__minix__\n\n#\tifndef _WIN32 // Standard Posix timeout structure\n\n\tstruct timeval to;\n\tto.tv_sec = ServerTimeout;\n\tto.tv_usec = 0;\n\n#else // Windows requires a DWORD with milliseconds\n\n\tDWORD to = ServerTimeout * 1000;\n\n#\tendif // _WIN32\n\n#\tif !defined(NO_LOG) && defined(_PEDANTIC)\n\n\tconst int result =\n\t\tsetsockopt(s_client, SOL_SOCKET, SO_RCVTIMEO, (sockopt_t)&to, sizeof(to)) ||\n\t\tsetsockopt(s_client, SOL_SOCKET, SO_SNDTIMEO, (sockopt_t)&to, sizeof(to));\n\n\tif (result) logger(\"Warning: Set timeout failed: %s\\n\", vlmcsd_strerror(socket_errno));\n\n#\telse // !(!defined(NO_LOG) && defined(_PEDANTIC))\n\n\tsetsockopt(s_client, SOL_SOCKET, SO_RCVTIMEO, (sockopt_t)&to, sizeof(to));\n\tsetsockopt(s_client, SOL_SOCKET, SO_SNDTIMEO, (sockopt_t)&to, sizeof(to));\n\n#   endif // !(!defined(NO_LOG) && defined(_PEDANTIC))\n\n#\tendif // !defined(NO_TIMEOUT) && !__minix__\n\n\tchar ipstr[64];\n\tsocklen_t len;\n\tstruct sockaddr_storage addr;\n\n\tlen = sizeof(addr);\n\n\tif (getpeername(s_client, (struct sockaddr*)&addr, &len) ||\n\t\t!ip2str(ipstr, sizeof(ipstr), (struct sockaddr*)&addr, len))\n\t{\n#\t\tif !defined(NO_LOG) && defined(_PEDANTIC)\n\t\tlogger(\"Fatal: Cannot determine client's IP address: %s\\n\", vlmcsd_strerror(errno));\n#\t\tendif // !defined(NO_LOG) && defined(_PEDANTIC)\n\t\tsocketclose(s_client);\n\t\treturn;\n\t}\n\n\n#\tifndef NO_LOG\n\tconst char *const connection_type = addr.ss_family == AF_INET6 ? cIPv6 : cIPv4;\n\tstatic const char *const cAccepted = \"accepted\";\n\tstatic const char *const cClosed = \"closed\";\n\tstatic const char *const fIP = \"%s connection %s: %s.\\n\";\n\n\tlogger(fIP, connection_type, cAccepted, ipstr);\n#endif // NO_LOG\n\n#\tif !defined(NO_PRIVATE_IP_DETECT)\n\n\tif (!(PublicIPProtectionLevel & 2) || isPrivateIPAddress((struct sockaddr*)&addr, NULL))\n\t{\n\t\trpcServer(s_client, RpcAssocGroup, ipstr);\n\t}\n#\tifndef NO_LOG\n\telse\n\t{\n\t\tlogger(\"Client with public IP address rejected\\n\");\n\t}\n#\tendif // NO_LOG\n\n#   else // defined(NO_PRIVATE_IP_DETECT)\n\n\trpcServer(s_client, RpcAssocGroup, ipstr);\n\n#\tendif // defined(NO_PRIVATE_IP_DETECT)\n\n#\tifndef NO_LOG\n\tlogger(fIP, connection_type, cClosed, ipstr);\n#\tendif // NO_LOG\n\n\tsocketclose(s_client);\n}\n\n\n#ifndef NO_SOCKETS\nstatic void post_sem(void)\n{\n#if !defined(NO_LIMIT) && !__minix__\n\tif (!InetdMode && MaxTasks != SEM_VALUE_MAX)\n\t{\n\t\tsemaphore_post(MaxTaskSemaphore);\n\t}\n#endif // !defined(NO_LIMIT) && !__minix__\n}\n\n\nstatic void wait_sem(void)\n{\n#if !defined(NO_LIMIT) && !__minix__\n\tif (!InetdMode && MaxTasks != SEM_VALUE_MAX)\n\t{\n\t\tsemaphore_wait(MaxTaskSemaphore);\n\t}\n#endif // !defined(NO_LIMIT) && !__minix__\n}\n#endif // NO_SOCKETS\n\n#if defined(USE_THREADS) && !defined(NO_SOCKETS)\n\n#if defined(_WIN32) || defined(__CYGWIN__) // Win32 Threads\nstatic DWORD WINAPI serveClientThreadProc(PCLDATA clData)\n#else // Posix threads\nstatic void *serveClientThreadProc(PCLDATA clData)\n#endif // Thread proc is identical in WIN32 and Posix threads\n{\n\tserveClient(clData->socket, clData->RpcAssocGroup);\n\tfree(clData);\n\tpost_sem();\n\n\treturn 0;\n}\n\n#endif // USE_THREADS\n\n\n#ifndef NO_SOCKETS\n\n#if defined(USE_THREADS) && (defined(_WIN32) || defined(__CYGWIN__)) // Windows Threads\nstatic int serveClientAsyncWinThreads(PCLDATA thr_CLData)\n{\n\twait_sem();\n\n\tHANDLE h = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)serveClientThreadProc, thr_CLData, 0, NULL);\n\n\tif (h)\n\t{\n\t\tCloseHandle(h);\n\t\treturn NO_ERROR;\n\t}\n\telse\n\t{\n\t\tsocketclose(thr_CLData->socket);\n\t\tfree(thr_CLData);\n\t\tpost_sem();\n\t\treturn GetLastError();\n\t}\n}\n#endif // defined(USE_THREADS) && defined(_WIN32) // Windows Threads\n\n\n#if defined(USE_THREADS) && !defined(_WIN32) && !defined(__CYGWIN__) // Posix Threads\nstatic int ServeClientAsyncPosixThreads(const PCLDATA thr_CLData)\n{\n\tpthread_t p_thr;\n\tpthread_attr_t attr;\n\tint error;\n\n\twait_sem();\n\n\t// Must set detached state to avoid memory leak\n\tif ((error = pthread_attr_init(&attr)) ||\n\t\t(error = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) ||\n\t\t(error = pthread_create(&p_thr, &attr, (void * (*)(void *))serveClientThreadProc, thr_CLData)))\n\t{\n\t\tsocketclose(thr_CLData->socket);\n\t\tfree(thr_CLData);\n\t\tpost_sem();\n\t\treturn error;\n\t}\n\n\treturn 0;\n}\n#endif //  defined(USE_THREADS) && !defined(_WIN32) // Posix Threads\n\n#ifndef USE_THREADS // fork() implementation\nstatic void ChildSignalHandler(const int signal)\n{\n\tif (signal == SIGHUP) return;\n\n\tpost_sem();\n\n#ifndef NO_LOG\n\tlogger(\"Warning: Child killed/crashed by %s\\n\", strsignal(signal));\n#endif // NO_LOG\n\n\texit(ECHILD);\n}\n\nstatic int ServeClientAsyncFork(const SOCKET s_client, const DWORD RpcAssocGroup)\n{\n\tint pid;\n\twait_sem();\n\n\tif ((pid = fork()) < 0)\n\t{\n\t\treturn errno;\n\t}\n\telse if (pid)\n\t{\n\t\t// Parent process\n\t\tsocketclose(s_client);\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\t// Child process\n\n\t\t// Setup a Child Handler for most common termination signals\n\t\tstruct sigaction sa;\n\n\t\tsa.sa_flags = 0;\n\t\tsa.sa_handler = ChildSignalHandler;\n\n\t\tstatic int signallist[] = { SIGHUP, SIGINT, SIGTERM, SIGSEGV, SIGILL, SIGFPE, SIGBUS };\n\n\t\tif (!sigemptyset(&sa.sa_mask))\n\t\t{\n\t\t\tuint_fast8_t i;\n\n\t\t\tfor (i = 0; i < vlmcsd_countof(signallist); i++)\n\t\t\t{\n\t\t\t\tsigaction(signallist[i], &sa, NULL);\n\t\t\t}\n\t\t}\n\n\t\tserveClient(s_client, RpcAssocGroup);\n\t\tpost_sem();\n\t\texit(0);\n\t}\n}\n#endif\n\n\nint serveClientAsync(const SOCKET s_client, const DWORD RpcAssocGroup)\n{\n#ifndef USE_THREADS // fork() implementation\n\n\treturn ServeClientAsyncFork(s_client, RpcAssocGroup);\n\n#else // threads implementation\n\n\tPCLDATA thr_CLData = (PCLDATA)vlmcsd_malloc(sizeof(CLDATA));\n\tthr_CLData->socket = s_client;\n\tthr_CLData->RpcAssocGroup = RpcAssocGroup;\n\n#if defined(_WIN32) || defined (__CYGWIN__) // Windows threads\n\n\treturn serveClientAsyncWinThreads(thr_CLData);\n\n#else // Posix Threads\n\n\treturn ServeClientAsyncPosixThreads(thr_CLData);\n\n#endif // Posix Threads\n\n#endif // USE_THREADS\n}\n\n#endif // NO_SOCKETS\n\n\nint runServer()\n{\n\tDWORD RpcAssocGroup = rand32();\n\n\t// If compiled for inetd-only mode just serve the stdin socket\n#ifdef NO_SOCKETS\n\tserveClient(STDIN_FILENO, RpcAssocGroup);\n\treturn 0;\n#else\n// In inetd mode just handle the stdin socket\n\tif (InetdMode)\n\t{\n\t\tserveClient(STDIN_FILENO, RpcAssocGroup);\n\t\treturn 0;\n\t}\n\n\tfor (;;)\n\t{\n\t\tint error;\n\t\tSOCKET s_client;\n\n#\t\tifdef SIMPLE_SOCKETS\n\t\tif ((s_client = accept(s_server, NULL, NULL)) == INVALID_SOCKET)\n#\t\telse // Standalone mode fully featured sockets\n\t\tif ((s_client = network_accept_any()) == INVALID_SOCKET)\n#\t\tendif // Standalone mode fully featured sockets\n\t\t{\n\t\t\terror = socket_errno;\n\t\t\tif (error == SOCKET_EINTR || error == SOCKET_ECONNABORTED) continue;\n\n#\t\t\tifdef _NTSERVICE\n\t\t\tif (ServiceShutdown) return 0;\n#\t\t\tendif\n\n#\t\t\tifndef NO_LOG\n\t\t\tlogger(\"Fatal: %s\\n\", vlmcsd_strerror(error));\n#\t\t\tendif\n\n\t\t\treturn error;\n\t\t}\n\n\t\tRpcAssocGroup++;\n\n#\t\tif !defined(NO_LOG) && defined(_PEDANTIC)\n\t\tif ((error = serveClientAsync(s_client, RpcAssocGroup)))\n\t\t{\n#\t\t\tifdef USE_THREADS\n\t\t\tlogger(\"Warning: Could not create client thread: %s\\n\", vlmcsd_strerror(error));\n#\t\t\telse // !USE_THREADS\n\t\t\tlogger(\"Warning: Could not fork client: %s\\n\", vlmcsd_strerror(error));\n#\t\t\tendif // !USE_THREADS\n\t\t}\n#\t\telse // NO_LOG || !_PEDANTIC\n\t\tserveClientAsync(s_client, RpcAssocGroup);\n#\t\tendif // NO_LOG || !_PEDANTIC\n\t}\n#\tendif // NO_SOCKETS\n}\n\n#endif // USE_MSRPC\n"
  },
  {
    "path": "src/network.h",
    "content": "#ifndef INCLUDED_NETWORK_H\n#define INCLUDED_NETWORK_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n\n#include \"types.h\"\n#include \"output.h\"\n\n#if _MSC_VER\n//typedef signed char int_fast8_t;\n//typedef unsigned char BYTE;\n//typedef UINT_PTR size_t;\n//typedef unsigned long DWORD;\n#define STDIN_FILENO 0\n#endif\n\nint_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send);\n\n#define _recv(s, d, l)  sendrecv(s, (BYTE *)d, l,  0)\n#define _send(s, d, l)  sendrecv(s, (BYTE *)d, l, !0)\n\n#ifndef NO_SOCKETS\n\nvoid closeAllListeningSockets();\n#ifdef SIMPLE_SOCKETS\nint listenOnAllAddresses();\n#endif // SIMPLE_SOCKETS\nBOOL addListeningSocket(const char *const addr);\n__pure int_fast8_t checkProtocolStack(const int addressfamily);\n\n#if HAVE_GETIFADDR\nvoid getPrivateIPAddresses(int* numAddresses, char*** ipAddresses);\n#endif // HAVE_GETIFADDR\n\n#endif // NO_SOCKETS\n\nint runServer();\nSOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fast8_t showHostName);\nint_fast8_t isDisconnected(const SOCKET s);\n\n#endif // INCLUDED_NETWORK_H\n"
  },
  {
    "path": "src/ns_name.c",
    "content": "/*\n * Copyright (c) 1996,1999 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\n * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\n * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\n * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n * SOFTWARE.\n */\n\n/*\n * Modified by Hotbird64 for use with vlmcs.\n */\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef DNS_PARSER_INTERNAL\n#ifndef NO_DNS\n\n#include <sys/types.h>\n#include <errno.h>\n#include <string.h>\n#include <ctype.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <limits.h>\n\n#include \"types.h\"\n#include \"ns_name.h\"\n\n#ifdef SPRINTF_CHAR\n# define SPRINTF(x) strlen(sprintf/**/x)\n#else\n# define SPRINTF(x) ((size_t)sprintf x)\n#endif\n\n#define NS_TYPE_ELT\t\t\t0x40 /* EDNS0 extended label type */\n#define DNS_LABELTYPE_BITSTRING\t\t0x41\n\n#define NS_MAXCDNAME 255\n#define NS_CMPRSFLGS 0xc0\n\n/* Data. */\n\nstatic char\tdigits[] = \"0123456789\";\n\n\n/* Forward. */\n\nstatic int\t\tspecial_vlmcsd(int);\nstatic int\t\tprintable_vlmcsd(int);\nstatic int\t\tlabellen_vlmcsd(const uint8_t *);\nstatic int\t\tdecode_bitstring_vlmcsd(const char **, char *, const char *);\n\n/*\n * ns_name_ntop(src, dst, dstsiz)\n *\tConvert an encoded domain name to printable ascii as per RFC1035.\n * return:\n *\tNumber of bytes written to buffer, or -1 (with errno set)\n * notes:\n *\tThe root is returned as \".\"\n *\tAll other domains are returned in non absolute form\n */\nstatic int\nns_name_ntop_vlmcsd(const uint8_t *src, char *dst, size_t dstsiz)\n{\n\tconst uint8_t *cp;\n\tchar *dn, *eom;\n\tuint8_t c;\n\tuint32_t n;\n\tint l;\n\n\tcp = src;\n\tdn = dst;\n\teom = dst + dstsiz;\n\n\twhile ((n = *cp++) != 0) {\n\t\tif ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {\n\t\t\t/* Some kind of compression pointer. */\n\t\t\terrno = EMSGSIZE;\n\t\t\treturn (-1);\n\t\t}\n\t\tif (dn != dst) {\n\t\t\tif (dn >= eom) {\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn (-1);\n\t\t\t}\n\t\t\t*dn++ = '.';\n\t\t}\n\t\tif ((l = labellen_vlmcsd(cp - 1)) < 0) {\n\t\t\terrno = EMSGSIZE; /* XXX */\n\t\t\treturn(-1);\n\t\t}\n\t\tif (dn + l >= eom) {\n\t\t\terrno = EMSGSIZE;\n\t\t\treturn (-1);\n\t\t}\n\t\tif ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) {\n\t\t\tint m;\n\n\t\t\tif (n != DNS_LABELTYPE_BITSTRING) {\n\t\t\t\t/* XXX: labellen should reject this case */\n\t\t\t\terrno = EINVAL;\n\t\t\t\treturn(-1);\n\t\t\t}\n\t\t\tif ((m = decode_bitstring_vlmcsd((const char **)&cp, dn, eom)) < 0)\n\t\t\t{\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn(-1);\n\t\t\t}\n\t\t\tdn += m; \n\t\t\tcontinue;\n\t\t}\n\t\tfor ((void)NULL; l > 0; l--) {\n\t\t\tc = *cp++;\n\t\t\tif (special_vlmcsd(c)) {\n\t\t\t\tif (dn + 1 >= eom) {\n\t\t\t\t\terrno = EMSGSIZE;\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\t\t\t\t*dn++ = '\\\\';\n\t\t\t\t*dn++ = (char)c;\n\t\t\t} else if (!printable_vlmcsd(c)) {\n\t\t\t\tif (dn + 3 >= eom) {\n\t\t\t\t\terrno = EMSGSIZE;\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\t\t\t\t*dn++ = '\\\\';\n\t\t\t\t*dn++ = digits[c / 100];\n\t\t\t\t*dn++ = digits[(c % 100) / 10];\n\t\t\t\t*dn++ = digits[c % 10];\n\t\t\t} else {\n\t\t\t\tif (dn >= eom) {\n\t\t\t\t\terrno = EMSGSIZE;\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\t\t\t\t*dn++ = (char)c;\n\t\t\t}\n\t\t}\n\t}\n\tif (dn == dst) {\n\t\tif (dn >= eom) {\n\t\t\terrno = EMSGSIZE;\n\t\t\treturn (-1);\n\t\t}\n\t\t*dn++ = '.';\n\t}\n\tif (dn >= eom) {\n\t\terrno = EMSGSIZE;\n\t\treturn (-1);\n\t}\n\t*dn++ = '\\0';\n\treturn (dn - dst);\n}\n\nstatic int\nns_name_unpack_vlmcsd(const uint8_t *msg, const uint8_t *eom, const uint8_t *src,\n\t       uint8_t *dst, size_t dstsiz)\n{\n\tconst uint8_t *srcp, *dstlim;\n\tuint8_t *dstp;\n\tint n, len, checked, l;\n\n\tlen = -1;\n\tchecked = 0;\n\tdstp = dst;\n\tsrcp = src;\n\tdstlim = dst + dstsiz;\n\tif (srcp < msg || srcp >= eom) {\n\t\terrno = EMSGSIZE;\n\t\treturn (-1);\n\t}\n\t/* Fetch next label in domain name. */\n\twhile ((n = *srcp++) != 0) {\n\t\t/* Check for indirection. */\n\t\tswitch (n & NS_CMPRSFLGS) {\n\t\tcase 0:\n\t\tcase NS_TYPE_ELT:\n\t\t\t/* Limit checks. */\n\t\t\tif ((l = labellen_vlmcsd(srcp - 1)) < 0) {\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn(-1);\n\t\t\t}\n\t\t\tif (dstp + l + 1 >= dstlim || srcp + l >= eom) {\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn (-1);\n\t\t\t}\n\t\t\tchecked += l + 1;\n\t\t\t*dstp++ = n;\n\t\t\tmemcpy(dstp, srcp, l);\n\t\t\tdstp += l;\n\t\t\tsrcp += l;\n\t\t\tbreak;\n\n\t\tcase NS_CMPRSFLGS:\n\t\t\tif (srcp >= eom) {\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn (-1);\n\t\t\t}\n\t\t\tif (len < 0)\n\t\t\t\tlen = srcp - src + 1;\n\t\t\tsrcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));\n\t\t\tif (srcp < msg || srcp >= eom) {  /* Out of range. */\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn (-1);\n\t\t\t}\n\t\t\tchecked += 2;\n\t\t\t/*\n\t\t\t * Check for loops in the compressed name;\n\t\t\t * if we've looked at the whole message,\n\t\t\t * there must be a loop.\n\t\t\t */\n\t\t\tif (checked >= eom - msg) {\n\t\t\t\terrno = EMSGSIZE;\n\t\t\t\treturn (-1);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\terrno = EMSGSIZE;\n\t\t\treturn (-1);\t\t\t/* flag error */\n\t\t}\n\t}\n\t*dstp = '\\0';\n\tif (len < 0)\n\t\tlen = srcp - src;\n\treturn (len);\n}\n\n\n/*\n * ns_name_uncompress_vlmcsd(msg, eom, src, dst, dstsiz)\n *\tExpand compressed domain name to presentation format.\n * return:\n *\tNumber of bytes read out of `src', or -1 (with errno set).\n * note:\n *\tRoot domain returns as \".\" not \"\".\n */\nint\nns_name_uncompress_vlmcsd(uint8_t *msg, uint8_t *eom, uint8_t *src,\n\t\t   char *dst, size_t dstsiz)\n{\n\tuint8_t tmp[NS_MAXCDNAME];\n\tint n;\n\t\n\tif ((n = ns_name_unpack_vlmcsd(msg, eom, src, tmp, sizeof tmp)) == -1)\n\t\treturn (-1);\n\tif (ns_name_ntop_vlmcsd(tmp, dst, dstsiz) == -1)\n\t\treturn (-1);\n\treturn (n);\n}\n\n/*\n * special(ch)\n *\tThinking in noninternationalized USASCII (per the DNS spec),\n *\tis this characted special (\"in need of quoting\") ?\n * return:\n *\tboolean.\n */\nstatic int\nspecial_vlmcsd(int ch) {\n\tswitch (ch) {\n\tcase 0x22: /* '\"' */\n\tcase 0x2E: /* '.' */\n\tcase 0x3B: /* ';' */\n\tcase 0x5C: /* '\\\\' */\n\tcase 0x28: /* '(' */\n\tcase 0x29: /* ')' */\n\t/* Special modifiers in zone files. */\n\tcase 0x40: /* '@' */\n\tcase 0x24: /* '$' */\n\t\treturn (1);\n\tdefault:\n\t\treturn (0);\n\t}\n}\n\n/*\n * printable(ch)\n *\tThinking in noninternationalized USASCII (per the DNS spec),\n *\tis this character visible and not a space when printed ?\n * return:\n *\tboolean.\n */\nstatic int\nprintable_vlmcsd(int ch) {\n\treturn (ch > 0x20 && ch < 0x7f);\n}\n\nstatic int\ndecode_bitstring_vlmcsd(const char **cpp, char *dn, const char *eom)\n{\n\tconst char *cp = *cpp;\n\tchar *beg = dn, tc;\n\tint b, blen, plen;\n\n\tif ((blen = (*cp & 0xff)) == 0)\n\t\tblen = 256;\n\tplen = (blen + 3) / 4;\n\tplen += sizeof(\"\\\\[x/]\") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1);\n\tif (dn + plen >= eom)\n\t\treturn(-1);\n\n\tcp++;\n\tdn += SPRINTF((dn, \"\\\\[x\"));\n\tfor (b = blen; b > 7; b -= 8, cp++)\n\t\tdn += SPRINTF((dn, \"%02x\", *cp & 0xff));\n\tif (b > 4) {\n\t\ttc = *cp++;\n\t\tdn += SPRINTF((dn, \"%02x\", tc & (0xff << (8 - b))));\n\t} else if (b > 0) {\n\t\ttc = *cp++;\n\t\tdn += SPRINTF((dn, \"%1x\",\n\t\t\t       ((tc >> 4) & 0x0f) & (0x0f << (4 - b)))); \n\t}\n\tdn += SPRINTF((dn, \"/%d]\", blen));\n\n\t*cpp = cp;\n\treturn(dn - beg);\n}\n\nstatic int\nlabellen_vlmcsd(const uint8_t *lp)\n{\n\tint bitlen;\n\tuint8_t l = *lp;\n\n\tif ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {\n\t\t/* should be avoided by the caller */\n\t\treturn(-1);\n\t}\n\n\tif ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {\n\t\tif (l == DNS_LABELTYPE_BITSTRING) {\n\t\t\tif ((bitlen = *(lp + 1)) == 0)\n\t\t\t\tbitlen = 256;\n\t\t\treturn((bitlen + 7 ) / 8 + 1);\n\t\t}\n\t\treturn(-1);\t/* unknwon ELT */\n\t}\n\treturn(l);\n}\n\n#endif // !NO_DNS\n#endif // DNS_PARSER_INTERNAL\n"
  },
  {
    "path": "src/ns_name.h",
    "content": "\n#ifndef NS_NAME_H_\n#define NS_NAME_H_\n\nint\nns_name_uncompress_vlmcsd(uint8_t *msg, uint8_t *eom, uint8_t *src,\n\t\t   char *dst, size_t dstsiz);\n\n#endif /* NS_NAME_H_ */\n"
  },
  {
    "path": "src/ns_parse.c",
    "content": "/*\n * Copyright (c) 1996,1999 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\n * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\n * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\n * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n * SOFTWARE.\n */\n\n/*\n * Modified by Hotbird64 for use with vlmcs.\n */\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifdef DNS_PARSER_INTERNAL\n#ifndef NO_DNS\n\n/* Import. */\n\n#include <sys/types.h>\n#include <errno.h>\n#include <string.h>\n\n#include \"types.h\"\n#include \"endian.h\"\n#include \"ns_name.h\"\n#include \"ns_parse.h\"\n\n/* Macros. */\n\n#define NS_GET16_VLMCSD(s, cp) do { \\\n\t(s) = GET_UA16BE(cp); \\\n\t(cp) += NS_INT16SZ; \\\n} while (0)\n\n#define NS_GET32_VLMCSD(l, cp) do { \\\n\t(l) = GET_UA32BE(cp); \\\n\t(cp) += NS_INT32SZ; \\\n} while (0)\n\n#define RETERR(err) do { errno = (err); return (-1); } while (0)\n\n/* Forward. */\n\nstatic void\tsetsection_vlmcsd(ns_msg_vlmcsd *msg, ns_sect_vlmcsd sect);\n\n\nstatic int dn_skipname_vlmcsd(unsigned char *s, unsigned char *end)\n{\n\tunsigned char *p;\n\tfor (p=s; p<end; p++)\n\t\tif (!*p) return p-s+1;\n\t\telse if (*p>=192)\n\t\t\t{if (p+1<end) return p-s+2;\n\t\t\telse break;}\n\treturn -1;\n}\n\nstatic int\nns_skiprr_vlmcsd(uint8_t *ptr, uint8_t *eom, ns_sect_vlmcsd section, int count) {\n\tuint8_t *optr = ptr;\n\n\tfor ((void)NULL; count > 0; count--) {\n\t\tint b, rdlength;\n\n\t\tb = dn_skipname_vlmcsd(ptr, eom);\n\t\tif (b < 0)\n\t\t\tRETERR(EMSGSIZE);\n\t\tptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;\n\t\tif (section != ns_s_qd_vlmcsd) {\n\t\t\tif (ptr + NS_INT32SZ + NS_INT16SZ > eom)\n\t\t\t\tRETERR(EMSGSIZE);\n\t\t\tptr += NS_INT32SZ/*TTL*/;\n\t\t\tNS_GET16_VLMCSD(rdlength, ptr);\n\t\t\tptr += rdlength/*RData*/;\n\t\t}\n\t}\n\tif (ptr > eom)\n\t\tRETERR(EMSGSIZE);\n\treturn (ptr - optr);\n}\n\nint\nns_initparse_vlmcsd(uint8_t *msg, int msglen, ns_msg_vlmcsd *handle) {\n\tuint8_t *eom = msg + msglen;\n\tint i;\n\n\tmemset(handle, 0x5e, sizeof *handle);\n\thandle->_msg = msg;\n\thandle->_eom = eom;\n\tif (msg + NS_INT16SZ > eom)\n\t\tRETERR(EMSGSIZE);\n\tNS_GET16_VLMCSD(handle->_id, msg);\n\tif (msg + NS_INT16SZ > eom)\n\t\tRETERR(EMSGSIZE);\n\tNS_GET16_VLMCSD(handle->_flags, msg);\n\tfor (i = 0; i < ns_s_max_vlmcsd; i++) {\n\t\tif (msg + NS_INT16SZ > eom)\n\t\t\tRETERR(EMSGSIZE);\n\t\tNS_GET16_VLMCSD(handle->_counts[i], msg);\n\t}\n\tfor (i = 0; i < ns_s_max_vlmcsd; i++)\n\t\tif (handle->_counts[i] == 0)\n\t\t\thandle->_sections[i] = NULL;\n\t\telse {\n\t\t\tint b = ns_skiprr_vlmcsd(msg, eom, (ns_sect_vlmcsd)i,\n\t\t\t\t\t  handle->_counts[i]);\n\n\t\t\tif (b < 0)\n\t\t\t\treturn (-1);\n\t\t\thandle->_sections[i] = msg;\n\t\t\tmsg += b;\n\t\t}\n\tif (msg > eom)\n\t\tRETERR(EMSGSIZE);\n\thandle->_eom = msg;\n\tsetsection_vlmcsd(handle, ns_s_max_vlmcsd);\n\treturn (0);\n}\n\nint\nns_parserr_vlmcsd(ns_msg_vlmcsd *handle, ns_sect_vlmcsd section, int rrnum, ns_rr_vlmcsd *rr) {\n\tint b;\n\n\t/* Make section right. */\n\tif (section >= ns_s_max_vlmcsd)\n\t\tRETERR(ENODEV);\n\tif (section != handle->_sect)\n\t\tsetsection_vlmcsd(handle, section);\n\n\t/* Make rrnum right. */\n\tif (rrnum == -1)\n\t\trrnum = handle->_rrnum;\n\tif (rrnum < 0 || rrnum >= handle->_counts[(int)section])\n\t\tRETERR(ENODEV);\n\tif (rrnum < handle->_rrnum)\n\t\tsetsection_vlmcsd(handle, section);\n\tif (rrnum > handle->_rrnum) {\n\t\tb = ns_skiprr_vlmcsd(handle->_msg_ptr, handle->_eom, section,\n\t\t\t      rrnum - handle->_rrnum);\n\n\t\tif (b < 0)\n\t\t\treturn (-1);\n\t\thandle->_msg_ptr += b;\n\t\thandle->_rrnum = rrnum;\n\t}\n\n\t/* Do the parse. */\n\tb = ns_name_uncompress_vlmcsd(handle->_msg, handle->_eom,\n\t\t      handle->_msg_ptr, rr->name, NS_MAXDNAME);\n\tif (b < 0)\n\t\treturn (-1);\n\thandle->_msg_ptr += b;\n\tif (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)\n\t\tRETERR(EMSGSIZE);\n\tNS_GET16_VLMCSD(rr->type, handle->_msg_ptr);\n\tNS_GET16_VLMCSD(rr->rr_class, handle->_msg_ptr);\n\tif (section == ns_s_qd_vlmcsd) {\n\t\trr->ttl = 0;\n\t\trr->rdlength = 0;\n\t\trr->rdata = NULL;\n\t} else {\n\t\tif (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)\n\t\t\tRETERR(EMSGSIZE);\n\t\tNS_GET32_VLMCSD(rr->ttl, handle->_msg_ptr);\n\t\tNS_GET16_VLMCSD(rr->rdlength, handle->_msg_ptr);\n\t\tif (handle->_msg_ptr + rr->rdlength > handle->_eom)\n\t\t\tRETERR(EMSGSIZE);\n\t\trr->rdata = handle->_msg_ptr;\n\t\thandle->_msg_ptr += rr->rdlength;\n\t}\n\tif (++handle->_rrnum > handle->_counts[(int)section])\n\t\tsetsection_vlmcsd(handle, (ns_sect_vlmcsd)((int)section + 1));\n\n\t/* All done. */\n\treturn (0);\n}\n\n/* Private. */\n\nstatic void\nsetsection_vlmcsd(ns_msg_vlmcsd *msg, ns_sect_vlmcsd sect) {\n\tmsg->_sect = sect;\n\tif (sect == ns_s_max_vlmcsd) {\n\t\tmsg->_rrnum = -1;\n\t\tmsg->_msg_ptr = NULL;\n\t} else {\n\t\tmsg->_rrnum = 0;\n\t\tmsg->_msg_ptr = msg->_sections[(int)sect];\n\t}\n}\n\n#endif // !NO_DNS\n#endif // DNS_PARSER_INTERNAL\n"
  },
  {
    "path": "src/ns_parse.h",
    "content": "\n#ifndef NS_PARSE_H_\n#define NS_PARSE_H_\n\n#ifndef NS_INT16SZ\n#define NS_INT16SZ (sizeof(uint16_t))\n#endif // NS_INT16SZ\n\n#ifndef NS_INT32SZ\n#define NS_INT32SZ (sizeof(uint32_t))\n#endif // NS_INT32SZ\n\n#ifndef NS_MAXDNAME\n#define NS_MAXDNAME 1025\n#endif\n\n#define ns_msg_id_vlmcsd(handle) ((handle)._id + 0)\n#define ns_msg_base_vlmcsd(handle) ((handle)._msg + 0)\n#define ns_msg_end_vlmcsd(handle) ((handle)._eom + 0)\n#define ns_msg_size_vlmcsd(handle) ((handle)._eom - (handle)._msg)\n#define ns_msg_count_vlmcsd(handle, section) ((handle)._counts[section] + 0)\n\n#define ns_rr_name_vlmcsd(rr)\t(((rr).name[0] != '\\0') ? (rr).name : \".\")\n#define ns_rr_type_vlmcsd(rr)\t((ns_type)((rr).type + 0))\n#define ns_rr_class_vlmcsd(rr)\t((ns_class)((rr).rr_class + 0))\n#define ns_rr_ttl_vlmcsd(rr)\t((rr).ttl + 0)\n#define ns_rr_rdlen_vlmcsd(rr)\t((rr).rdlength + 0)\n#define ns_rr_rdata_vlmcsd(rr)\t((rr).rdata + 0)\n\n#define ns_msg_id_vlmcsd(handle) ((handle)._id + 0)\n#define ns_msg_base_vlmcsd(handle) ((handle)._msg + 0)\n#define ns_msg_end_vlmcsd(handle) ((handle)._eom + 0)\n#define ns_msg_size_vlmcsd(handle) ((handle)._eom - (handle)._msg)\n#define ns_msg_count_vlmcsd(handle, section) ((handle)._counts[section] + 0)\n\n\ntypedef enum __ns_sect_vlmcsd {\n\tns_s_qd_vlmcsd = 0,\t\t/*%< Query: Question. */\n\tns_s_zn_vlmcsd = 0,\t\t/*%< Update: Zone. */\n\tns_s_an_vlmcsd = 1,\t\t/*%< Query: Answer. */\n\tns_s_pr_vlmcsd = 1,\t\t/*%< Update: Prerequisites. */\n\tns_s_ns_vlmcsd = 2,\t\t/*%< Query: Name servers. */\n\tns_s_ud_vlmcsd = 2,\t\t/*%< Update: Update. */\n\tns_s_ar_vlmcsd = 3,\t\t/*%< Query|Update: Additional records. */\n\tns_s_max_vlmcsd = 4\n} ns_sect_vlmcsd;\n\ntypedef struct __ns_msg_vlmcsd {\n\tuint8_t\t*_msg, *_eom;\n\tuint16_t\t_id, _flags, _counts[ns_s_max_vlmcsd];\n\tuint8_t\t*_sections[ns_s_max_vlmcsd];\n\tns_sect_vlmcsd\t\t_sect;\n\tint\t\t_rrnum;\n\tuint8_t\t*_msg_ptr;\n} ns_msg_vlmcsd;\n\n\ntypedef\tstruct __ns_rr_vlmcsd {\n\tchar\t\tname[NS_MAXDNAME];\n\tuint16_t\ttype;\n\tuint16_t\trr_class;\n\tuint32_t\tttl;\n\tuint16_t\trdlength;\n\tuint8_t *\trdata;\n} ns_rr_vlmcsd;\n\nint ns_initparse_vlmcsd(uint8_t *msg, int msglen, ns_msg_vlmcsd *handle);\n\nint ns_parserr_vlmcsd(ns_msg_vlmcsd *handle, ns_sect_vlmcsd section, int rrnum, ns_rr_vlmcsd *rr);\n\n\n\n#endif /* NS_PARSE_H_ */\n"
  },
  {
    "path": "src/ntservice.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"ntservice.h\"\n#include \"shared_globals.h\"\n#include \"vlmcsd.h\"\n#include \"output.h\"\n#include \"helpers.h\"\n\n#ifdef _NTSERVICE\n\nSERVICE_STATUS          gSvcStatus;\nSERVICE_STATUS_HANDLE   gSvcStatusHandle;\n\nVOID WINAPI ServiceCtrlHandler(DWORD dwCtrl)\n{\n\t// Handle the requested control code.\n\tswitch (dwCtrl)\n\t{\n\tcase SERVICE_CONTROL_STOP:\n\tcase SERVICE_CONTROL_SHUTDOWN:\n\n\t\tServiceShutdown = TRUE;\n\t\tReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);\n\n\t\t// Remove PID file and free ressources\n\t\tcleanup();\n#\t\t\tif __CYGWIN__ || defined(USE_MSRPC)\n\t\tReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);\n#\t\t\tendif // __CYGWIN__\n\n\tdefault:\n\t\tbreak;\n\t}\n}\n\nstatic VOID WINAPI ServiceMain(const int argc_unused, CARGV argv_unused)\n{\n\t// Register the handler function for the service\n\n\tif (!((gSvcStatusHandle = RegisterServiceCtrlHandler(NT_SERVICE_NAME, ServiceCtrlHandler))))\n\t{\n\t\treturn;\n\t}\n\n\t// These SERVICE_STATUS members remain as set here\n\n\tgSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;\n\tgSvcStatus.dwServiceSpecificExitCode = 0;\n\n\t// Run the actual program\n\tReportServiceStatus(SERVICE_STOPPED, newmain(), 3000);\n}\n\nSERVICE_TABLE_ENTRY NTServiceDispatchTable[] = {\n\t{\n\t\t(LPSTR)NT_SERVICE_NAME,\n\t\t(LPSERVICE_MAIN_FUNCTION)ServiceMain\n\t},\n\t{\n\t\tNULL,\n\t\tNULL\n\t}\n};\n\nVOID ReportServiceStatus(const DWORD dwCurrentState, const DWORD dwWin32ExitCode, const DWORD dwWaitHint)\n{\n\tstatic DWORD dwCheckPoint = 1;\n\n\t// Fill in the SERVICE_STATUS structure.\n\n\tgSvcStatus.dwCurrentState = dwCurrentState;\n\tgSvcStatus.dwWin32ExitCode = dwWin32ExitCode;\n\tgSvcStatus.dwWaitHint = dwWaitHint;\n\n\tif (dwCurrentState == SERVICE_START_PENDING)\n\t\tgSvcStatus.dwControlsAccepted = 0;\n\telse\n\t\tgSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;\n\n\tif ((dwCurrentState == SERVICE_RUNNING) ||\n\t\t(dwCurrentState == SERVICE_STOPPED))\n\t\tgSvcStatus.dwCheckPoint = 0;\n\telse\n\t\tgSvcStatus.dwCheckPoint = dwCheckPoint++;\n\n\t// Report the status of the service to the SCM.\n\tSetServiceStatus(gSvcStatusHandle, &gSvcStatus);\n}\n\n/*VOID ServiceReportEvent(char *szFunction)\n{\n\tHANDLE hEventSource;\n\tconst char *eventStrings[2];\n\tTCHAR Buffer[80];\n\n\thEventSource = RegisterEventSource(NULL, NT_SERVICE_NAME);\n\n\tif (hEventSource)\n\t{\n\t\tsnprintf(Buffer, 80, \"%s failed with %d\", szFunction, GetLastError());\n\n\t\teventStrings[0] = NT_SERVICE_NAME;\n\t\teventStrings[1] = Buffer;\n\n\t\tReportEvent(hEventSource,        // event log handle\n\t\t\t\t\tEVENTLOG_ERROR_TYPE, // event type\n\t\t\t\t\t0,                   // event category\n\t\t\t\t\t00,           // event identifier\n\t\t\t\t\tNULL,                // no security identifier\n\t\t\t\t\t2,                   // size of lpszStrings array\n\t\t\t\t\t0,                   // no binary data\n\t\t\t\t\teventStrings,         // array of strings\n\t\t\t\t\tNULL);               // no binary data\n\n\t\tDeregisterEventSource(hEventSource);\n\t}\n}*/\n\n//Returns 0=Error, 1=Success, 2=Doesn't exist\n\n\nstatic uint_fast8_t OpenAndRemoveService(DWORD *dwPreviousState, SC_HANDLE *schSCManager)\n{\n\tSERVICE_STATUS status;\n\tuint_fast8_t i;\n\tSC_HANDLE installedService;\n\tuint_fast8_t result = 1;\n\tBOOL closeManager = FALSE;\n\n\t// Allow NULL for both Arguments\n\tif (!dwPreviousState) dwPreviousState = (DWORD*)alloca(sizeof(*dwPreviousState));\n\tif (!schSCManager)\n\t{\n\t\tschSCManager = (SC_HANDLE*)alloca(sizeof(*schSCManager));\n\t\tcloseManager = TRUE;\n\t}\n\n\t*schSCManager = OpenSCManager(\n\t\tNULL,                    // local computer\n\t\tNULL,                    // ServicesActive database\n\t\tSC_MANAGER_ALL_ACCESS);  // full access rights\n\n\tif (!*schSCManager) return 0;\n\n\tif (!((installedService = OpenService(*schSCManager, NT_SERVICE_NAME, SERVICE_ALL_ACCESS))))\n\t{\n\t\tresult = 2;\n\t}\n\telse\n\t{\n\t\t*dwPreviousState = SERVICE_STOPPED;\n\t\tif (QueryServiceStatus(installedService, &status)) *dwPreviousState = status.dwCurrentState;\n\n\t\tControlService(installedService, SERVICE_CONTROL_STOP, &status);\n\n\t\tfor (i = 0; i < 10; i++)\n\t\t{\n\t\t\tQueryServiceStatus(installedService, &status);\n\t\t\t// Give it 100 ms after it reported SERVICE_STOPPED. Subsequent CreateService will fail otherwise\n\t\t\tSleep(100);\n\t\t\tif (status.dwCurrentState == SERVICE_STOPPED) break;\n\t\t}\n\n\t\tif (!DeleteService(installedService)) result = 0;\n\t\tCloseServiceHandle(installedService);\n\t}\n\n\tif (closeManager) CloseServiceHandle(*schSCManager);\n\treturn result;\n}\n\nstatic VOID ServiceInstaller(const char *restrict ServiceUser, const char *const ServicePassword)\n{\n\tSC_HANDLE schSCManager;\n\tSC_HANDLE schService;\n\tchar szPath[MAX_PATH] = \"\\\"\";\n\n\tif (!GetModuleFileName(NULL, szPath + sizeof(char), MAX_PATH - 1))\n\t{\n\t\terrorout(\"Cannot install service (%d)\\n\", (uint32_t)GetLastError());\n\t\treturn;\n\t}\n\n\tstrcat(szPath, \"\\\"\");\n\n\tint i;\n\tfor (i = 1; i < global_argc; i++)\n\t{\n\t\t// Strip unneccessary parameters, especially the password\n\t\tif (!strcmp(global_argv[i], \"-s\")) continue;\n\n\t\tif (!strcmp(global_argv[i], \"-W\") ||\n\t\t\t!strcmp(global_argv[i], \"-U\"))\n\t\t{\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tstrcat(szPath, \" \");\n\n\t\tif (strchr(global_argv[i], ' '))\n\t\t{\n\t\t\tstrcat(szPath, \"\\\"\");\n\t\t\tstrcat(szPath, global_argv[i]);\n\t\t\tstrcat(szPath, \"\\\"\");\n\t\t}\n\t\telse\n\t\t\tstrcat(szPath, global_argv[i]);\n\t}\n\n\t// Get a handle to the SCM database.\n\n\tSERVICE_STATUS status;\n\tDWORD dwPreviousState;\n\n\tif (!OpenAndRemoveService(&dwPreviousState, &schSCManager))\n\t{\n\t\terrorout(\"Service removal failed (%d)\\n\", (uint32_t)GetLastError());\n\t\treturn;\n\t}\n\n\tchar *tempUser = NULL;\n\n\tif (ServiceUser)\n\t{\n\t\t// Shortcuts for some well known users\n\t\tif (!strcasecmp(ServiceUser, \"/l\")) ServiceUser = \"NT AUTHORITY\\\\LocalService\";\n\t\tif (!strcasecmp(ServiceUser, \"/n\")) ServiceUser = \"NT AUTHORITY\\\\NetworkService\";\n\n\t\t// Allow Local Users without .\\ , e.g. \"johndoe\" instead of \".\\johndoe\"\n\t\tif (!strchr(ServiceUser, '\\\\'))\n\t\t{\n\t\t\ttempUser = (char*)vlmcsd_malloc(strlen(ServiceUser) + 3);\n\t\t\tstrcpy(tempUser, \".\\\\\");\n\t\t\tstrcat(tempUser, ServiceUser);\n\t\t\tServiceUser = tempUser;\n\t\t}\n\t}\n\n\tschService = CreateService(\n\t\tschSCManager,\t\t\t\t// SCM database\n\t\tNT_SERVICE_NAME,\t\t\t// name of service\n\t\tNT_SERVICE_DISPLAY_NAME,\t// service name to display\n\t\tSERVICE_ALL_ACCESS,\t\t\t// desired access\n\t\tSERVICE_WIN32_OWN_PROCESS,\t// service type\n\t\tSERVICE_AUTO_START,\t\t\t// start type\n\t\tSERVICE_ERROR_NORMAL,\t\t// error control type\n\t\tszPath,\t\t\t\t\t\t// path to service's binary\n\t\tNULL,\t\t\t\t\t\t// no load ordering group\n\t\tNULL,\t\t\t\t\t\t// no tag identifier\n\t\t\"tcpip\\0\",\t\t\t        // depends on TCP/IP\n\t\tServiceUser,\t\t\t\t// LocalSystem account\n\t\tServicePassword);\t\t\t// no password\n\n#\tif __clang__ && (__CYGWIN__ || __MINGW64__ )\n\t// Workaround for clang not understanding some GCC asm syntax used in <w32api/psdk_inc/intrin-impl.h>\n\tZeroMemory((char*)ServicePassword, strlen(ServicePassword));\n#\telse\n\tSecureZeroMemory((char*)ServicePassword, strlen(ServicePassword));\n#\tendif\n\tif (tempUser) free(tempUser);\n\n\tif (schService == NULL)\n\t{\n\t\terrorout(\"CreateService failed (%u)\\n\", (uint32_t)GetLastError());\n\t\tCloseServiceHandle(schSCManager);\n\t\treturn;\n\t}\n\telse\n\t{\n\t\terrorout(\"Service installed successfully\\n\");\n\n\t\tif (dwPreviousState == SERVICE_RUNNING)\n\t\t{\n\t\t\tprintf(\"Restarting \" NT_SERVICE_NAME \" service => \");\n\t\t\tstatus.dwCurrentState = SERVICE_STOPPED;\n\n\t\t\tif (StartService(schService, 0, NULL))\n\t\t\t{\n\t\t\t\tfor (i = 0; i < 10; i++)\n\t\t\t\t{\n\t\t\t\t\tif (!QueryServiceStatus(schService, &status) || status.dwCurrentState != SERVICE_START_PENDING) break;\n\t\t\t\t\tSleep(100);\n\t\t\t\t}\n\n\t\t\t\tif (status.dwCurrentState == SERVICE_RUNNING)\n\t\t\t\t\tprintf(\"Success\\n\");\n\t\t\t\telse if (status.dwCurrentState == SERVICE_START_PENDING)\n\t\t\t\t\tprintf(\"Not ready within a second\\n\");\n\t\t\t\telse\n\t\t\t\t\terrorout(\"Error\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t\terrorout(\"Error %u\\n\", (uint32_t)GetLastError());\n\t\t}\n\t}\n\n\tCloseServiceHandle(schService);\n\tCloseServiceHandle(schSCManager);\n}\n\nint NtServiceInstallation(const int_fast8_t installService, const char *restrict ServiceUser, const char *const ServicePassword)\n{\n\tif (IsNTService) return 0;\n\n\tif (installService == 1) // Install\n\t{\n\t\tServiceInstaller(ServiceUser, ServicePassword);\n\t\treturn(0);\n\t}\n\n\tif (installService == 2) // Remove\n\t{\n\t\tswitch (OpenAndRemoveService(NULL, NULL))\n\t\t{\n\t\tcase 0:\n\t\t\terrorout(\"Error removing service %s\\n\", NT_SERVICE_NAME);\n\t\t\treturn(!0);\n\t\tcase 1:\n\t\t\tprintf(\"Service %s removed successfully\\n\", NT_SERVICE_NAME);\n\t\t\treturn(0);\n\t\tdefault:\n\t\t\terrorout(\"Service %s does not exist.\\n\", NT_SERVICE_NAME);\n\t\t\treturn(!0);\n\t\t}\n\t}\n\n\t// Do nothing\n\n\treturn(0);\n}\n#endif // _NTSERVICE\n"
  },
  {
    "path": "src/ntservice.h",
    "content": "#ifndef INCLUDED_NTSERVICE_H\n#define INCLUDED_NTSERVICE_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"types.h\"\n#ifdef _NTSERVICE\n\n//#include <strsafe.h>\n\n#define NT_SERVICE_NAME \"vlmcsd\"\n#define NT_SERVICE_DISPLAY_NAME \"Key Management Server\"\n\nextern SERVICE_TABLE_ENTRY NTServiceDispatchTable[];\n\nVOID ReportServiceStatus(const DWORD, const DWORD, const DWORD);\nint NtServiceInstallation(const int_fast8_t installService, const char *restrict ServiceUser, const char *const ServicePassword);\n\n#else // !_NTSERVICE\n\n#define ReportServiceStatus(x,y,z)\n\n#endif // _NTSERVICE\n\n#endif // INCLUDED_NTSERVICE_H\n"
  },
  {
    "path": "src/output.c",
    "content": "#ifndef _DEFAULT_SOURCE\n#define _DEFAULT_SOURCE\n#endif // _DEFAULT_SOURCE\n\n#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"output.h\"\n#include \"shared_globals.h\"\n#include \"endian.h\"\n#include \"helpers.h\"\n\n// ReSharper disable All\n\n#ifndef NO_LOG\nstatic void vlogger(const char *message, va_list args)\n{\n\tFILE *log;\n\n#\tifdef _NTSERVICE\n\tif (!IsNTService && logstdout) log = stdout;\n#\telse\n\tif (logstdout) log = stdout;\n#\tendif\n\telse\n\t{\n\t\tif (fn_log == NULL) return;\n\n#\t\tifndef _WIN32\n\t\tif (!strcmp(fn_log, \"syslog\"))\n\t\t{\n\t\t\topenlog(\"vlmcsd\", LOG_CONS | LOG_PID, LOG_USER);\n\n\t\t\t////PORTABILITY: vsyslog is not in Posix but virtually all Unixes have it\n\t\t\tvsyslog(LOG_INFO, message, args);\n\n\t\t\tcloselog();\n\t\t\treturn;\n\t\t}\n#\t\tendif // _WIN32\n\n\t\tlog = fopen(fn_log, \"a\");\n\t\tif (!log) return;\n\t}\n\n\ttime_t now = time(0);\n\n#\tifdef USE_THREADS\n\tchar mbstr[2048];\n#\telse\n\tchar mbstr[24];\n#\tendif\n\n\tif (LogDateAndTime)\n\t\tstrftime(mbstr, sizeof(mbstr), \"%Y-%m-%d %X: \", localtime(&now));\n\telse\n\t\t*mbstr = 0;\n\n#\tifndef USE_THREADS\n\n\tfprintf(log, \"%s\", mbstr);\n\tvfprintf(log, message, args);\n\tfflush(log);\n\n#\telse // USE_THREADS\n\n\t// We write everything to a string before we really log inside the critical section\n\t// so formatting the output can be concurrent\n\tint len = (int)strlen(mbstr);\n\t//#\tif !_MSC_VER\n\n\tvlmcsd_vsnprintf(mbstr + len, sizeof(mbstr) - len, message, args);\n\t//#\telse\n\t//\twvsprintf(mbstr + len, message, args);\n\t//#\tendif\n\n\tlock_mutex(&logmutex);\n\tfprintf(log, \"%s\", mbstr);\n\tfflush(log);\n\tunlock_mutex(&logmutex);\n\n#\tendif // USE_THREADS\n\tif (log != stdout) fclose(log);\n}\n\n\n// Always sends to log output\nint logger(const char *const fmt, ...)\n{\n\tva_list args;\n\n\tva_start(args, fmt);\n\tvlogger(fmt, args);\n\tva_end(args);\n\treturn 0;\n}\n\n#endif //NO_LOG\n\n\n// Output to stderr if it is available or to log otherwise (e.g. if running as daemon/service)\nint printerrorf(const char *const fmt, ...)\n{\n\tint error = errno;\n\tva_list arglist;\n\n\tva_start(arglist, fmt);\n\n#\tifdef IS_LIBRARY\n\n\tsize_t len = strlen(ErrorMessage);\n\tvlmcsd_vsnprintf(ErrorMessage + len, MESSAGE_BUFFER_SIZE - len - 1, fmt, arglist);\n\n#\telse // !IS_LIBRARY\n\n#\tifndef NO_LOG\n#\tifdef _NTSERVICE\n\tif (InetdMode || IsNTService)\n#\telse // !_NTSERVICE\n\tif (InetdMode)\n#\tendif // NTSERVIICE\n\t\tvlogger(fmt, arglist);\n\telse\n#\tendif //NO_LOG\n\n#\tendif // IS_LIBRARY\n\t{\n\t\tvfprintf(stderr, fmt, arglist);\n\t\tfflush(stderr);\n\t}\n\n\tva_end(arglist);\n\terrno = error;\n\treturn 0;\n}\n\n\n// Always output to stderr\nint errorout(const char* fmt, ...)\n{\n\tva_list args;\n\n\tva_start(args, fmt);\n\tint i = vfprintf(stderr, fmt, args);\n\tva_end(args);\n\tfflush(stderr);\n\n\treturn i;\n}\n\n\n#if !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)\nstatic const char *LicenseStatusText[] =\n{\n\t\"Unlicensed\", \"Licensed\", \"OOB grace\", \"OOT grace\", \"Non-Genuine\", \"Notification\", \"Extended grace\"\n};\n#endif // !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)\n\n\nvoid uuid2StringLE(const GUID *const guid, char *const string)\n{\n\tsprintf(string,\n#\t\tifdef _WIN32\n\t\t\"%08x-%04x-%04x-%04x-%012I64x\",\n#\t\telse\n\t\t\"%08x-%04x-%04x-%04x-%012llx\",\n#\t\tendif\n\t\t(unsigned int)LE32(guid->Data1),\n\t\t(unsigned int)LE16(guid->Data2),\n\t\t(unsigned int)LE16(guid->Data3),\n\t\t(unsigned int)BE16(*(uint16_t*)guid->Data4),\n\t\t(unsigned long long)BE64(*(uint64_t*)(guid->Data4)) & 0xffffffffffffLL\n\t);\n}\n\n#if !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)\nvoid logRequestVerbose(REQUEST* Request, const PRINTFUNC p)\n{\n\tchar guidBuffer[GUID_STRING_LENGTH + 1];\n\tchar WorkstationBuffer[3 * WORKSTATION_NAME_BUFFER];\n\tchar* productName;\n\n\tp(\"Protocol version                : %u.%u\\n\", LE16(Request->MajorVer), LE16(Request->MinorVer));\n\tp(\"Client is a virtual machine     : %s\\n\", LE32(Request->VMInfo) ? \"Yes\" : \"No\");\n\tp(\"Licensing status                : %u (%s)\\n\", (uint32_t)LE32(Request->LicenseStatus), LE32(Request->LicenseStatus) < vlmcsd_countof(LicenseStatusText) ? LicenseStatusText[LE32(Request->LicenseStatus)] : \"Unknown\");\n\tp(\"Remaining time (0 = forever)    : %i minutes\\n\", (uint32_t)LE32(Request->BindingExpiration));\n\n\tuuid2StringLE(&Request->AppID, guidBuffer);\n\tgetProductIndex(&Request->AppID, KmsData->AppItemList, KmsData->AppItemCount, &productName, NULL);\n\tp(\"Application ID                  : %s (%s)\\n\", guidBuffer, productName);\n\n\tuuid2StringLE(&Request->ActID, guidBuffer);\n\tgetProductIndex(&Request->ActID, KmsData->SkuItemList, KmsData->SkuItemCount, &productName, NULL);\n\tp(\"SKU ID (aka Activation ID)      : %s (%s)\\n\", guidBuffer, productName);\n\n\tuuid2StringLE(&Request->KMSID, guidBuffer);\n\tgetProductIndex(&Request->KMSID, KmsData->KmsItemList, KmsData->KmsItemCount, &productName, NULL);\n\tp(\"KMS ID (aka KMS counted ID)     : %s (%s)\\n\", guidBuffer, productName);\n\n\tuuid2StringLE(&Request->CMID, guidBuffer);\n\tp(\"Client machine ID               : %s\\n\", guidBuffer);\n\n\tuuid2StringLE(&Request->CMID_prev, guidBuffer);\n\tp(\"Previous client machine ID      : %s\\n\", guidBuffer);\n\n\n\tchar mbstr[64];\n\ttime_t st;\n\tst = fileTimeToUnixTime(&Request->ClientTime);\n\tstrftime(mbstr, sizeof(mbstr), \"%Y-%m-%d %X\", gmtime(&st));\n\tp(\"Client request timestamp (UTC)  : %s\\n\", mbstr);\n\n\tucs2_to_utf8(Request->WorkstationName, WorkstationBuffer, WORKSTATION_NAME_BUFFER, sizeof(WorkstationBuffer));\n\n\tp(\"Workstation name                : %s\\n\", WorkstationBuffer);\n\tp(\"N count policy (minimum clients): %u\\n\", (uint32_t)LE32(Request->N_Policy));\n}\n\nvoid logResponseVerbose(const char *const ePID, const BYTE *const hwid, RESPONSE* response, const PRINTFUNC p)\n{\n\tchar guidBuffer[GUID_STRING_LENGTH + 1];\n\n\tp(\"Protocol version                : %u.%u\\n\", (uint32_t)LE16(response->MajorVer), (uint32_t)LE16(response->MinorVer));\n\tp(\"KMS host extended PID           : %s\\n\", ePID);\n\tif (LE16(response->MajorVer) > 5)\n#\tifndef _WIN32\n\t\tp(\"KMS host Hardware ID            : %016llX\\n\", (unsigned long long)BE64(*(uint64_t*)hwid));\n#\telse // _WIN32\n\t\tp(\"KMS host Hardware ID            : %016I64X\\n\", (unsigned long long)BE64(*(uint64_t*)hwid));\n#\tendif // WIN32\n\n\tuuid2StringLE(&response->CMID, guidBuffer);\n\tp(\"Client machine ID               : %s\\n\", guidBuffer);\n\n\tchar mbstr[64];\n\ttime_t st;\n\n\tst = fileTimeToUnixTime(&response->ClientTime);\n\tstrftime(mbstr, sizeof(mbstr), \"%Y-%m-%d %X\", gmtime(&st));\n\tp(\"Client request timestamp (UTC)  : %s\\n\", mbstr);\n\n\tp(\"KMS host current active clients : %u\\n\", (uint32_t)LE32(response->Count));\n\tp(\"Renewal interval policy         : %u\\n\", (uint32_t)LE32(response->VLRenewalInterval));\n\tp(\"Activation interval policy      : %u\\n\", (uint32_t)LE32(response->VLActivationInterval));\n}\n#endif // !defined(NO_VERBOSE_LOG) && !defined(NO_LOG)\n\n\n#ifndef NO_VERSION_INFORMATION\nvoid printPlatform()\n{\n\tint testNumber = 0x1234;\n\n#\tif _MSC_VER\n\tprintf(\"Compiler: VC++ %02i.%02i build %i\\n\", _MSC_VER / 100, _MSC_VER % 100, _MSC_FULL_VER % 100000);\n#\telif defined(VLMCSD_COMPILER)\n\tprintf\n\t(\n\t\t\"Compiler: %s\\n\", VLMCSD_COMPILER\n#\t\tifdef __VERSION__\n\t\t\" \" __VERSION__\n#\t\tendif // __VERSION__\n\t);\n#\tendif // VLMCSD_COMPILER\n\n\tprintf\n\t(\n\t\t\"Intended platform:%s %s\\n\", \"\"\n\n#\t\tif __i386__ || _M_IX86\n\t\t\" Intel x86\"\n#\t\tendif\n\n#\t\tif __x86_64__ || __amd64__ || _M_X64 || _M_AMD64\n\t\t\" Intel x86_64\"\n#\t\tendif\n\n#\t\tif _M_ARM || __arm__\n\t\t\" ARM\"\n#\t\tendif\n\n#\t\tif __thumb__\n\t\t\" thumb\"\n#\t\tendif\n\n#\t\tif __aarch64__\n\t\t\" ARM64\"\n#\t\tendif\n\n#\t\tif __hppa__\n\t\t\" HP/PA RISC\"\n#\t\tendif\n\n#\t\tif __ia64__\n\t\t\" Intel Itanium\"\n#\t\tendif\n\n#\t\tif __mips__\n\t\t\" MIPS\"\n#\t\tendif\n\n#\t\tif defined(_MIPS_ARCH)\n\t\t\" \" _MIPS_ARCH\n#\t\tendif\n\n#\t\tif __mips16\n\t\t\" mips16\"\n#\t\tendif\n\n#\t\tif __mips_micromips\n\t\t\" micromips\"\n#\t\tendif\n\n#\t\tif __ppc__ || __powerpc__\n\t\t\" PowerPC\"\n#\t\tendif\n\n#\t\tif __powerpc64__ || __ppc64__\n\t\t\" PowerPC64\"\n#\t\tendif\n\n#\t\tif __sparc__\n\t\t\" SPARC\"\n#\t\tendif\n\n#\t\tif defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)\n\t\t\" IBM S/390\"\n#\t\tendif\n\n#\t\tif __zarch__ || __s390x__\n\t\t\" IBM z/Arch (S/390x)\"\n#\t\tendif\n\n#\t\tif __m68k__\n\t\t\" Motorola 68k\"\n#\t\tendif\n\n#\t\tif __ANDROID__\n\t\t\" Android\"\n#\t\tendif\n\n#\t\tif __ANDROID_API__\n\t\t\" (API level \" ANDROID_API_LEVEL \")\"\n#\t\tendif\n\n#\t\tif __FreeBSD__ || __FreeBSD_kernel__\n\t\t\" FreeBSD\"\n#\t\tendif\n\n#\t\tif __NetBSD__\n\t\t\" NetBSD\"\n#\t\tendif\n\n#\t\tif __OpenBSD__\n\t\t\" OpenBSD\"\n#\t\tendif\n\n#\t\tif __DragonFly__\n\t\t\" DragonFly BSD\"\n#\t\tendif\n\n#\t\tif defined(__CYGWIN__) && !defined(_WIN64)\n\t\t\" Cygwin32\"\n#\t\tendif\n\n#\t\tif defined(__CYGWIN__) && defined(_WIN64)\n\t\t\" Cygwin64\"\n#\t\tendif\n\n#\t\tif __GNU__\n\t\t\" GNU\"\n#\t\tendif\n\n#\t\tif __gnu_hurd__\n\t\t\" Hurd\"\n#\t\tendif\n\n#\t\tif __MACH__\n\t\t\" Mach\"\n#\t\tendif\n\n#\t\tif __linux__\n\t\t\" Linux\"\n#\t\tendif\n\n#\t\tif __APPLE__ && __MACH__\n\t\t\" Darwin\"\n#\t\tendif\n\n#\t\tif  __minix__\n\t\t\" Minix\"\n#\t\tendif\n\n#\t\tif __QNX__\n\t\t\" QNX\"\n#\t\tendif\n\n#\t\tif __svr4__ || __SVR4\n\t\t\" SYSV R4\"\n#\t\tendif\t\n\n#\t\tif (defined(__sun__) || defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))\n\t\t\" Solaris\"\n#\t\tendif\n\n#\t\tif (defined(__sun__) || defined(sun) || defined(__sun)) && !defined(__SVR4) && !defined(__svr4__)\n\t\t\" SunOS\"\n#\t\tendif\n\n#\t\tif defined(_WIN32) && !defined(_WIN64)\n\t\t\" Windows32\"\n#\t\tendif\n\n#\t\tif defined(_WIN32) && defined(_WIN64)\n\t\t\" Windows64\"\n#\t\tendif\n\n#\t\tif __MVS__ || __TOS_MVS__\n\t\t\" z/OS\"\n#\t\tendif\n\n#\t\tif defined(__GLIBC__) && !defined(__UCLIBC__)\n\t\t\" glibc\"\n#\t\tendif\n\n#\t\tif __UCLIBC__\n\t\t\" uclibc\"\n#\t\tendif\n\n#\t\tif defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__ANDROID__) && !defined(__BIONIC__)\n\t\t\" musl\"\n#\t\tendif\n\n\t\t//#\t\tif _MIPSEL || __MIPSEL__ || __ARMEL__ || __THUMBEL__\n\t\t//\t\t\" little-endian\"\n\t\t//#\t\tendif\n\t\t//\n\t\t//#\t\tif _MIPSEB || __MIPSEB__ || __ARMEB__ || __THUMBEB__\n\t\t//\t\t\" big-endian\"\n\t\t//#\t\tendif\n\n#\t\tif __PIE__ || __pie__\n\t\t\" PIE\"\n#\t\tendif\n\t\t,\n\t\t*((uint8_t*)&testNumber) == 0x34 ? \"little-endian\" : \"big-endian\"\n\t);\n\n}\n\n\nvoid printCommonFlags()\n{\n\tprintf\n\t(\n\t\t\"Common flags:%s\\n\", \"\"\n\n#\t\tifdef NO_EXTERNAL_DATA\n\t\t\" NO_EXTERNAL_DATA\"\n#\t\tendif // NO_EXTERNAL_DATA\n\n#\t\tifdef NO_INTERNAL_DATA\n\t\t\" NO_INTERNAL_DATA\"\n#\t\tendif // NO_INTERNAL_DATA\n\n#\t\tif !defined(NO_EXTERNAL_DATA)\n\n#\t\tifdef DATA_FILE\n\t\t\" DATA=\" DATA_FILE\n#\t\tendif // DATA_FILE\n\n#\t\tifdef UNSAFE_DATA_LOAD\n\t\t\" UNSAFE_DATA_LOAD\"\n#\t\tendif // UNSAFE_DATA_LOAD\n\n#\t\tendif // !defined(NO_EXTERNAL_DATA)\n\n#\t\tifdef USE_MSRPC\n\t\t\" USE_MSRPC\"\n#\t\tendif // USE_MSRPC\n\n#\t\tifdef _CRYPTO_OPENSSL\n\t\t\" _CRYPTO_OPENSSL\"\n#\t\tendif // _CRYPTO_OPENSSL\n\n#\t\tifdef _CRYPTO_POLARSSL\n\t\t\" _CRYPTO_POLARSSL\"\n#\t\tendif // _CRYPTO_POLARSSL\n\n#\t\tifdef _CRYPTO_WINDOWS\n\t\t\" _CRYPTO_WINDOWS\"\n#\t\tendif // _CRYPTO_WINDOWS\n\n#\t\tif defined(_OPENSSL_SOFTWARE) && defined(_CRYPTO_OPENSSL)\n\t\t\" _OPENSSL_SOFTWARE\"\n#\t\tendif // _OPENSSL_SOFTWARE\n\n#\t\tif defined(_USE_AES_FROM_OPENSSL) && defined(_CRYPTO_OPENSSL)\n\t\t\" _USE_AES_FROM_OPENSSL\"\n#\t\tendif // _USE_AES_FROM_OPENSSL\n\n#\t\tif defined(_OPENSSL_NO_HMAC) && defined(_CRYPTO_OPENSSL)\n\t\t\" OPENSSL_HMAC=0\"\n#\t\tendif // _OPENSSL_NO_HMAC\n\n#\t\tifdef _PEDANTIC\n\t\t\" _PEDANTIC\"\n#\t\tendif // _PEDANTIC\n\n#\t\tifdef INCLUDE_BETAS\n\t\t\" INCLUDE_BETAS\"\n#\t\tendif // INCLUDE_BETAS\n\n#\t\tif __minix__ || defined(NO_TIMEOUT)\n\t\t\" NO_TIMEOUT=1\"\n#\t\tendif // __minix__ || defined(NO_TIMEOUT)\n\t);\n}\n\n\nvoid printClientFlags()\n{\n\tprintf\n\t(\n\t\t\"vlmcs flags:%s\\n\", \"\"\n\n#\t\tifdef NO_DNS\n\t\t\" NO_DNS=1\"\n#\t\tendif\n\n#\t\tif !defined(NO_DNS)\n#\t\tif defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)\n\t\t\" DNS_PARSER=internal\"\n#\t\telse // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)\n\t\t\" DNS_PARSER=OS\"\n#\t\tendif // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)\n#\t\tendif // !defined(NO_DNS)\n\n#\t\tif defined(DISPLAY_WIDTH)\n\t\t\" TERMINAL_WIDTH=\" DISPLAY_WIDTH\n#\t\tendif\n\t);\n}\n\n\nvoid printServerFlags()\n{\n\tprintf\n\t(\n\t\t\"vlmcsd flags:%s\\n\", \"\"\n\n#\t\tifdef NO_LOG\n\t\t\" NO_LOG\"\n#\t\tendif // NO_LOG\n\n#\t\tifdef NO_RANDOM_EPID\n\t\t\" NO_RANDOM_EPID\"\n#\t\tendif // NO_RANDOM_EPID\n\n#\t\tifdef NO_INI_FILE\n\t\t\" NO_INI_FILE\"\n#\t\tendif // NO_INI_FILE\n\n#\t\tif !defined(NO_INI_FILE) && defined(INI_FILE)\n\t\t\" INI=\" INI_FILE\n#\t\tendif // !defined(NO_INI_FILE)\n\n#\t\tifdef NO_PID_FILE\n\t\t\" NO_PID_FILE\"\n#\t\tendif // NO_PID_FILE\n\n#\t\tifdef NO_USER_SWITCH\n\t\t\" NO_USER_SWITCH\"\n#\t\tendif // NO_USER_SWITCH\n\n#\t\tifdef NO_HELP\n\t\t\" NO_HELP\"\n#\t\tendif // NO_HELP\n\n#\t\tifdef NO_STRICT_MODES\n\t\t\" NO_STRICT_MODES\"\n#\t\tendif // NO_STRICT_MODES\n\n#\t\tifdef NO_CUSTOM_INTERVALS\n\t\t\" NO_CUSTOM_INTERVALS\"\n#\t\tendif // NO_CUSTOM_INTERVALS\n\n#\t\tifdef NO_SOCKETS\n\t\t\" NO_SOCKETS\"\n#\t\tendif // NO_SOCKETS\n\n#\t\tifdef NO_CL_PIDS\n\t\t\" NO_CL_PIDS\"\n#\t\tendif // NO_CL_PIDS\n\n#\t\tifdef NO_LIMIT\n\t\t\" NO_LIMIT\"\n#\t\tendif // NO_LIMIT\n\n#\t\tifdef NO_SIGHUP\n\t\t\" NO_SIGHUP\"\n#\t\tendif // NO_SIGHUP\n\n#\t\tifdef NO_PROCFS\n\t\t\" NOPROCFS=1\"\n#\t\tendif // NO_PROCFS\n\n#\t\tifdef USE_THREADS\n\t\t\" THREADS=1\"\n#\t\tendif // USE_THREADS\n\n#\t\tifdef USE_AUXV\n\t\t\" AUXV=1\"\n#\t\tendif // USE_AUXV\n\n#\t\tif defined(CHILD_HANDLER) || __minix__\n\t\t\" CHILD_HANDLER=1\"\n#\t\tendif // defined(CHILD_HANDLER) || __minix__\n\n#\t\tif !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)\n\t\t\" SIMPLE_SOCKETS\"\n#\t\tendif // !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)\n\n#\t\tifdef SIMPLE_RPC\n\t\t\" SIMPLE_RPC\"\n#\t\tendif // SIMPLE_RPC\n\n#\t\tifdef NO_STRICT_MODES\n\t\t\" NO_STRICT_MODES\"\n#\t\tendif // NO_STRICT_MODES\n\n#\t\tifdef NO_CLIENT_LIST\n\t\t\" NO_CLIENT_LIST\"\n#\t\tendif // NO_CLIENT_LIST\n\n#\t\tif (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))\n\t\t\" SUPPORT_WINE\"\n#\t\tendif // (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))\n\n#\t\tif (_WIN32 || __CYGWIN__) && defined(NO_TAP)\n\t\t\" NO_TAP\"\n#\t\tendif // (_WIN32 || __CYGWIN__) && defined(NO_TAP)\n\n#\t\tif !HAVE_FREEBIND\n\t\t\" NO_FREEBIND\"\n#\t\tendif //!HAVE_FREEBIND\n\n#\t\tif !HAVE_GETIFADDR\n\t\t\" !HAVE_GETIFADDR\"\n#\t\tendif // !HAVE_GETIFADDR\n\n#\t\tif HAVE_GETIFADDR && defined(GETIFADDRS_MUSL)\n\t\t\" GETIFADDRS=musl\"\n#\t\tendif // HAVE_GETIFADDR && defined(GETIFADDRS_MUSL)\n\n#\t\tif defined(NO_PRIVATE_IP_DETECT)\n\t\t\" NO_PRIVATE_IP_DETECT\"\n#\t\tendif // defined(NO_PRIVATE_IP_DETECT)\n\t);\n}\n#endif // NO_VERSION_INFORMATION\n"
  },
  {
    "path": "src/output.h",
    "content": "#ifndef INCLUDED_OUTPUT_H\n#define INCLUDED_OUTPUT_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include <errno.h>\n#include \"types.h\"\n#include \"kms.h\"\n\ntypedef int (*PRINTFUNC)(const char *const fmt, ...);\n\nint printerrorf(const char *const fmt, ...);\nint errorout(const char* fmt, ...);\nvoid logRequestVerbose(REQUEST* Request, const PRINTFUNC p);\nvoid logResponseVerbose(const char *const ePID, const BYTE *const hwid, RESPONSE* response, const PRINTFUNC p);\n\n#ifndef NO_VERSION_INFORMATION\nvoid printPlatform();\nvoid printCommonFlags();\nvoid printServerFlags();\nvoid printClientFlags();\n#endif // NO_VERSION_INFORMATION\n\n#ifndef NO_LOG\nint logger(const char *const fmt, ...);\n#endif //NO_LOG\n\nvoid uuid2StringLE(const GUID *const guid, char *const string);\n\n//void copy_arguments(int argc, char **argv, char ***new_argv);\n//void destroy_arguments(int argc, char **argv);\n\n#endif // INCLUDED_OUTPUT_H\n"
  },
  {
    "path": "src/resolv.h",
    "content": "/*    $NetBSD: resolv.h,v 1.31 2005/12/26 19:01:47 perry Exp $    */\n\n/*\n * Copyright (c) 1983, 1987, 1989\n *    The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*\n * Copyright (c) 2004 by Internet Systems Consortium, Inc. (\"ISC\")\n * Portions Copyright (c) 1996-1999 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND ISC DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n *    @(#)resolv.h    8.1 (Berkeley) 6/2/93\n *    Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 marka Exp\n */\n\n#ifndef _RESOLV_PRIVATE_H_\n#define    _RESOLV_PRIVATE_H_\n\n#include <resolv.h>\n#include \"resolv_static.h\"\n\n/*\n * Revision information.  This is the release date in YYYYMMDD format.\n * It can change every day so the right thing to do with it is use it\n * in preprocessor commands such as \"#if (__RES > 19931104)\".  Do not\n * compare for equality; rather, use it to determine whether your resolver\n * is new enough to contain a certain feature.\n */\n\n#define    __RES    20030124\n\n/*\n * This used to be defined in res_query.c, now it's in herror.c.\n * [XXX no it's not.  It's in irs/irs_data.c]\n * It was\n * never extern'd by any *.h file before it was placed here.  For thread\n * aware programs, the last h_errno value set is stored in res->h_errno.\n *\n * XXX:    There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO\n *    (and __h_errno_set) to the public via <resolv.h>.\n * XXX:    __h_errno_set is really part of IRS, not part of the resolver.\n *    If somebody wants to build and use a resolver that doesn't use IRS,\n *    what do they do?  Perhaps something like\n *        #ifdef WANT_IRS\n *        # define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)\n *        #else\n *        # define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))\n *        #endif\n */\n\n#define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))\nstruct __res_state; /* forward */\n\n/*\n * Resolver configuration file.\n * Normally not present, but may contain the address of the\n * initial name server(s) to query and the domain search list.\n */\n\n#ifndef _PATH_RESCONF\n#ifdef ANDROID_CHANGES\n#define _PATH_RESCONF        \"/etc/ppp/resolv.conf\"\n#else\n#define _PATH_RESCONF        \"/etc/resolv.conf\"\n#endif\n#endif\n\ntypedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }\n    res_sendhookact;\n\ntypedef res_sendhookact (*res_send_qhook)(struct sockaddr * const *,\n                          const u_char **, int *,\n                          u_char *, int, int *);\n\ntypedef res_sendhookact (*res_send_rhook)(const struct sockaddr *,\n                          const u_char *, int, u_char *,\n                          int, int *);\n\nstruct res_sym {\n    int        number;       /* Identifying number, like T_MX */\n    const char *    name;       /* Its symbolic name, like \"MX\" */\n    const char *    humanname; /* Its fun name, like \"mail exchanger\" */\n};\n\n/*\n * Global defines and variables for resolver stub.\n */\n#define    MAXNS            3    /* max # name servers we'll track */\n#define    MAXDFLSRCH        3    /* # default domain levels to try */\n#define    MAXDNSRCH        6    /* max # domains in search path */\n#define    LOCALDOMAINPARTS    2    /* min levels in name that is \"local\" */\n\n#define    RES_TIMEOUT        5    /* min. seconds between retries */\n#define    MAXRESOLVSORT        10    /* number of net to sort on */\n#define    RES_MAXNDOTS        15    /* should reflect bit field size */\n#define    RES_MAXRETRANS        30    /* only for resolv.conf/RES_OPTIONS */\n#define    RES_MAXRETRY        5    /* only for resolv.conf/RES_OPTIONS */\n#define    RES_DFLRETRY        2    /* Default #/tries. */\n#define    RES_MAXTIME        65535    /* Infinity, in milliseconds. */\n\nstruct __res_state_ext;\n\nstruct __res_state {\n    int    retrans;         /* retransmission time interval */\n    int    retry;            /* number of times to retransmit */\n#ifdef sun\n    u_int    options;        /* option flags - see below. */\n#else\n    u_long    options;        /* option flags - see below. */\n#endif\n    int    nscount;        /* number of name servers */\n    struct sockaddr_in\n        nsaddr_list[MAXNS];    /* address of name server */\n#define    nsaddr    nsaddr_list[0]        /* for backward compatibility */\n    u_short    id;            /* current message id */\n    char    *dnsrch[MAXDNSRCH+1];    /* components of domain to search */\n    char    defdname[256];        /* default domain (deprecated) */\n#ifdef sun\n    u_int    pfcode;            /* RES_PRF_ flags - see below. */\n#else\n    u_long    pfcode;            /* RES_PRF_ flags - see below. */\n#endif\n    unsigned ndots:4;        /* threshold for initial abs. query */\n    unsigned nsort:4;        /* number of elements in sort_list[] */\n    char    unused[3];\n    struct {\n        struct in_addr    addr;\n        uint32_t    mask;\n    } sort_list[MAXRESOLVSORT];\n#ifdef __OLD_RES_STATE\n    char lookups[4];\n#else\n    res_send_qhook qhook;        /* query hook */\n    res_send_rhook rhook;        /* response hook */\n    int    res_h_errno;        /* last one set for this context */\n    int    _vcsock;        /* PRIVATE: for res_send VC i/o */\n    u_int    _flags;            /* PRIVATE: see below */\n    u_int    _pad;            /* make _u 64 bit aligned */\n    union {\n        /* On an 32-bit arch this means 512b total. */\n        char    pad[72 - 4*sizeof (int) - 2*sizeof (void *)];\n        struct {\n            uint16_t        nscount;\n            uint16_t        nstimes[MAXNS];    /* ms. */\n            int            nssocks[MAXNS];\n            struct __res_state_ext *ext;    /* extention for IPv6 */\n        } _ext;\n    } _u;\n#endif\n        struct res_static   rstatic[1];\n};\n\ntypedef struct __res_state *res_state;\n\nunion res_sockaddr_union {\n    struct sockaddr_in    sin;\n#ifdef IN6ADDR_ANY_INIT\n    struct sockaddr_in6    sin6;\n#endif\n#ifdef ISC_ALIGN64\n    int64_t            __align64;    /* 64bit alignment */\n#else\n    int32_t            __align32;    /* 32bit alignment */\n#endif\n    char            __space[128];   /* max size */\n};\n\n/*\n * Resolver flags (used to be discrete per-module statics ints).\n */\n#define    RES_F_VC    0x00000001    /* socket is TCP */\n#define    RES_F_CONN    0x00000002    /* socket is connected */\n#define    RES_F_EDNS0ERR    0x00000004    /* EDNS0 caused errors */\n#define    RES_F__UNUSED    0x00000008    /* (unused) */\n#define    RES_F_LASTMASK    0x000000F0    /* ordinal server of last res_nsend */\n#define    RES_F_LASTSHIFT    4        /* bit position of LASTMASK \"flag\" */\n#define    RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)\n\n/* res_findzonecut2() options */\n#define    RES_EXHAUSTIVE    0x00000001    /* always do all queries */\n#define    RES_IPV4ONLY    0x00000002    /* IPv4 only */\n#define    RES_IPV6ONLY    0x00000004    /* IPv6 only */\n\n/*\n * Resolver options (keep these in synch with res_debug.c, please)\n */\n#define RES_INIT    0x00000001    /* address initialized */\n#define RES_DEBUG    0x00000002    /* print debug messages */\n#define RES_AAONLY    0x00000004    /* authoritative answers only (!IMPL)*/\n#define RES_USEVC    0x00000008    /* use virtual circuit */\n#define RES_PRIMARY    0x00000010    /* query primary server only (!IMPL) */\n#define RES_IGNTC    0x00000020    /* ignore trucation errors */\n#define RES_RECURSE    0x00000040    /* recursion desired */\n#define RES_DEFNAMES    0x00000080    /* use default domain name */\n#define RES_STAYOPEN    0x00000100    /* Keep TCP socket open */\n#define RES_DNSRCH    0x00000200    /* search up local domain tree */\n#define    RES_INSECURE1    0x00000400    /* type 1 security disabled */\n#define    RES_INSECURE2    0x00000800    /* type 2 security disabled */\n#define    RES_NOALIASES    0x00001000    /* shuts off HOSTALIASES feature */\n#define    RES_USE_INET6    0x00002000    /* use/map IPv6 in gethostbyname() */\n#define RES_ROTATE    0x00004000    /* rotate ns list after each query */\n#define    RES_NOCHECKNAME    0x00008000    /* do not check names for sanity. */\n#define    RES_KEEPTSIG    0x00010000    /* do not strip TSIG records */\n#define    RES_BLAST    0x00020000    /* blast all recursive servers */\n#define RES_NOTLDQUERY    0x00100000    /* don't unqualified name as a tld */\n#define RES_USE_DNSSEC    0x00200000    /* use DNSSEC using OK bit in OPT */\n/* #define RES_DEBUG2    0x00400000 */    /* nslookup internal */\n/* KAME extensions: use higher bit to avoid conflict with ISC use */\n#define RES_USE_DNAME    0x10000000    /* use DNAME */\n#define RES_USE_EDNS0    0x40000000    /* use EDNS0 if configured */\n#define RES_NO_NIBBLE2    0x80000000    /* disable alternate nibble lookup */\n\n#define RES_DEFAULT    (RES_RECURSE | RES_DEFNAMES | \\\n             RES_DNSRCH | RES_NO_NIBBLE2)\n\n/*\n * Resolver \"pfcode\" values.  Used by dig.\n */\n#define RES_PRF_STATS    0x00000001\n#define RES_PRF_UPDATE    0x00000002\n#define RES_PRF_CLASS   0x00000004\n#define RES_PRF_CMD    0x00000008\n#define RES_PRF_QUES    0x00000010\n#define RES_PRF_ANS    0x00000020\n#define RES_PRF_AUTH    0x00000040\n#define RES_PRF_ADD    0x00000080\n#define RES_PRF_HEAD1    0x00000100\n#define RES_PRF_HEAD2    0x00000200\n#define RES_PRF_TTLID    0x00000400\n#define RES_PRF_HEADX    0x00000800\n#define RES_PRF_QUERY    0x00001000\n#define RES_PRF_REPLY    0x00002000\n#define RES_PRF_INIT    0x00004000\n#define RES_PRF_TRUNC    0x00008000\n/*            0x00010000    */\n\n/* Things involving an internal (static) resolver context. */\n__BEGIN_DECLS\nextern struct __res_state *__res_get_state(void);\nextern void __res_put_state(struct __res_state *);\n\n#ifndef ANDROID_CHANGES\n/*\n * Source and Binary compatibility; _res will not work properly\n * with multi-threaded programs.\n */\nextern struct __res_state *__res_state(void);\n#define _res (*__res_state())\n#endif\n\n__END_DECLS\n\n#ifndef __BIND_NOSTATIC\n#define fp_nquery        __fp_nquery\n#define fp_query        __fp_query\n#define hostalias        __hostalias\n#define p_query            __p_query\n#define res_close        __res_close\n#define res_opt            __res_opt\n#define res_isourserver        __res_isourserver\n#define    res_querydomain        __res_querydomain\n#define res_send        __res_send\n#define res_sendsigned        __res_sendsigned\n\n#ifdef BIND_RES_POSIX3\n#define    dn_expand    __dn_expand\n#define    res_init    __res_init\n#define    res_query    __res_query\n#define    res_search    __res_search\n#define    res_mkquery    __res_mkquery\n#endif\n\n__BEGIN_DECLS\nvoid        fp_nquery(const u_char *, int, FILE *);\nvoid        fp_query(const u_char *, FILE *);\nconst char *    hostalias(const char *);\nvoid        p_query(const u_char *);\nvoid        res_close(void);\nint        res_init(void);\nint        res_opt(int, u_char *, int, int);\nint        res_isourserver(const struct sockaddr_in *);\nint        res_mkquery(int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int);\nint        res_query(const char *, int, int, u_char *, int);\nint        res_querydomain(const char *, const char *, int, int, u_char *, int);\nint        res_search(const char *, int, int, u_char *, int);\nint        res_send(const u_char *, int, u_char *, int);\nint        res_sendsigned(const u_char *, int, ns_tsig_key *, u_char *, int);\n__END_DECLS\n#endif\n\n#if !defined(SHARED_LIBBIND) || defined(LIB)\n/*\n * If libbind is a shared object (well, DLL anyway)\n * these externs break the linker when resolv.h is\n * included by a lib client (like named)\n * Make them go away if a client is including this\n *\n */\nextern const struct res_sym __p_key_syms[];\nextern const struct res_sym __p_cert_syms[];\nextern const struct res_sym __p_class_syms[];\nextern const struct res_sym __p_type_syms[];\nextern const struct res_sym __p_rcode_syms[];\n#endif /* SHARED_LIBBIND */\n\n#ifndef ADNROID_CHANGES\n#define b64_ntop        __b64_ntop\n#define b64_pton        __b64_pton\n#endif\n\n#define dn_comp            __dn_comp\n#define dn_count_labels        __dn_count_labels\n#define dn_skipname        __dn_skipname\n#define fp_resstat        __fp_resstat\n#define loc_aton        __loc_aton\n#define loc_ntoa        __loc_ntoa\n#define p_cdname        __p_cdname\n#define p_cdnname        __p_cdnname\n#define p_class            __p_class\n#define p_fqname        __p_fqname\n#define p_fqnname        __p_fqnname\n#define p_option        __p_option\n#define p_secstodate        __p_secstodate\n#define p_section        __p_section\n#define p_time            __p_time\n#define p_type            __p_type\n#define p_rcode            __p_rcode\n#define p_sockun        __p_sockun\n#define putlong            __putlong\n#define putshort        __putshort\n#define res_dnok        __res_dnok\n#define res_findzonecut        __res_findzonecut\n#define res_findzonecut2    __res_findzonecut2\n#define res_hnok        __res_hnok\n#define res_hostalias        __res_hostalias\n#define res_mailok        __res_mailok\n#define res_nameinquery        __res_nameinquery\n#define res_nclose        __res_nclose\n#define res_ninit        __res_ninit\n#define res_nmkquery        __res_nmkquery\n#define res_pquery        __res_pquery\n#define res_nquery        __res_nquery\n#define res_nquerydomain    __res_nquerydomain\n#define res_nsearch        __res_nsearch\n#define res_nsend        __res_nsend\n#define res_nsendsigned        __res_nsendsigned\n#define res_nisourserver    __res_nisourserver\n#define res_ownok        __res_ownok\n#define res_queriesmatch    __res_queriesmatch\n#define res_randomid        __res_randomid\n#define sym_ntop        __sym_ntop\n#define sym_ntos        __sym_ntos\n#define sym_ston        __sym_ston\n#define res_nopt        __res_nopt\n#define res_ndestroy        __res_ndestroy\n#define    res_nametoclass        __res_nametoclass\n#define    res_nametotype        __res_nametotype\n#define    res_setservers        __res_setservers\n#define    res_getservers        __res_getservers\n#define    res_buildprotolist    __res_buildprotolist\n#define    res_destroyprotolist    __res_destroyprotolist\n#define    res_destroyservicelist    __res_destroyservicelist\n#define    res_get_nibblesuffix    __res_get_nibblesuffix\n#define    res_get_nibblesuffix2    __res_get_nibblesuffix2\n#define    res_ourserver_p        __res_ourserver_p\n#define    res_protocolname    __res_protocolname\n#define    res_protocolnumber    __res_protocolnumber\n#define    res_send_setqhook    __res_send_setqhook\n#define    res_send_setrhook    __res_send_setrhook\n#define    res_servicename        __res_servicename\n#define    res_servicenumber    __res_servicenumber\n__BEGIN_DECLS\nint        res_hnok(const char *);\nint        res_ownok(const char *);\nint        res_mailok(const char *);\nint        res_dnok(const char *);\nint        sym_ston(const struct res_sym *, const char *, int *);\nconst char *    sym_ntos(const struct res_sym *, int, int *);\nconst char *    sym_ntop(const struct res_sym *, int, int *);\n#ifndef ANDROID_CHANGES\nint        b64_ntop(u_char const *, size_t, char *, size_t);\nint        b64_pton(char const *, u_char *, size_t);\n#endif\nint        loc_aton(const char *, u_char *);\nconst char *    loc_ntoa(const u_char *, char *);\nint        dn_skipname(const u_char *, const u_char *);\nvoid        putlong(uint32_t, u_char *);\nvoid        putshort(uint16_t, u_char *);\n#ifndef __ultrix__\nuint16_t    _getshort(const u_char *);\nuint32_t    _getlong(const u_char *);\n#endif\nconst char *    p_class(int);\nconst char *    p_time(uint32_t);\nconst char *    p_type(int);\nconst char *    p_rcode(int);\nconst char *    p_sockun(union res_sockaddr_union, char *, size_t);\nconst u_char *    p_cdnname(const u_char *, const u_char *, int, FILE *);\nconst u_char *    p_cdname(const u_char *, const u_char *, FILE *);\nconst u_char *    p_fqnname(const u_char *, const u_char *,\n                   int, char *, int);\nconst u_char *    p_fqname(const u_char *, const u_char *, FILE *);\nconst char *    p_option(u_long);\nchar *        p_secstodate(u_long);\nint        dn_count_labels(const char *);\nint        dn_comp(const char *, u_char *, int, u_char **, u_char **);\nint        dn_expand(const u_char *, const u_char *, const u_char *,\n                   char *, int);\nu_int        res_randomid(void);\nint        res_nameinquery(const char *, int, int, const u_char *,\n                     const u_char *);\nint        res_queriesmatch(const u_char *, const u_char *,\n                      const u_char *, const u_char *);\nconst char *    p_section(int, int);\n/* Things involving a resolver context. */\nint        res_ninit(res_state);\nint        res_nisourserver(const res_state, const struct sockaddr_in *);\nvoid        fp_resstat(const res_state, FILE *);\nvoid        res_pquery(const res_state, const u_char *, int, FILE *);\nconst char *    res_hostalias(const res_state, const char *, char *, size_t);\nint        res_nquery(res_state, const char *, int, int, u_char *, int);\nint        res_nsearch(res_state, const char *, int, int, u_char *, int);\nint        res_nquerydomain(res_state, const char *, const char *,\n                      int, int, u_char *, int);\nint        res_nmkquery(res_state, int, const char *, int, int,\n                  const u_char *, int, const u_char *,\n                  u_char *, int);\nint        res_nsend(res_state, const u_char *, int, u_char *, int);\nint        res_nsendsigned(res_state, const u_char *, int,\n                     ns_tsig_key *, u_char *, int);\nint        res_findzonecut(res_state, const char *, ns_class, int,\n                     char *, size_t, struct in_addr *, int);\nint        res_findzonecut2(res_state, const char *, ns_class, int,\n                      char *, size_t,\n                      union res_sockaddr_union *, int);\nvoid        res_nclose(res_state);\nint        res_nopt(res_state, int, u_char *, int, int);\nvoid        res_send_setqhook(res_send_qhook);\nvoid        res_send_setrhook(res_send_rhook);\nint        __res_vinit(res_state, int);\nvoid        res_destroyservicelist(void);\nconst char *    res_servicename(uint16_t, const char *);\nconst char *    res_protocolname(int);\nvoid        res_destroyprotolist(void);\nvoid        res_buildprotolist(void);\nconst char *    res_get_nibblesuffix(res_state);\nconst char *    res_get_nibblesuffix2(res_state);\nvoid        res_ndestroy(res_state);\nuint16_t    res_nametoclass(const char *, int *);\nuint16_t    res_nametotype(const char *, int *);\nvoid        res_setservers(res_state,\n                    const union res_sockaddr_union *, int);\nint        res_getservers(res_state,\n                    union res_sockaddr_union *, int);\n\nint res_get_dns_changed();\nu_int  res_randomid(void);\n\n__END_DECLS\n\n#endif /* !_RESOLV_PRIVATE_H_ */\n"
  },
  {
    "path": "src/resolv_static.h",
    "content": "#ifndef _RESOLV_STATIC_H\n#define _RESOLV_STATIC_H\n\n#include <netdb.h>\n\n/* this structure contains all the variables that were declared\n * 'static' in the original NetBSD resolver code.\n *\n * this caused vast amounts of crashes and memory corruptions\n * when the resolver was being used by multiple threads.\n *\n * (note: the OpenBSD/FreeBSD resolver has similar 'issues')\n */\n\n#define    MAXALIASES    35\n#define    MAXADDRS    35\n\ntypedef struct res_static {\n    char*           h_addr_ptrs[MAXADDRS + 1];\n    char*           host_aliases[MAXALIASES];\n    char            hostbuf[8*1024];\n    u_int32_t       host_addr[16 / sizeof(u_int32_t)];  /* IPv4 or IPv6 */\n    FILE*           hostf;\n    int             stayopen;\n    const char*     servent_ptr;\n    struct servent  servent;\n    struct hostent  host;\n} *res_static;\n\nextern res_static __res_get_static(void);\n\n#endif /* _RESOLV_STATIC_H */\n"
  },
  {
    "path": "src/rpc.c",
    "content": "#ifndef _DEFAULT_SOURCE\n#define _DEFAULT_SOURCE\n#endif // _DEFAULT_SOURCE\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef USE_MSRPC\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n//#include <ctype.h>\n//#include <time.h>\n#if !defined(_WIN32)\n#include <sys/socket.h>\n#include <netdb.h>\n#endif\n#include \"rpc.h\"\n#include \"output.h\"\n//#include \"crypto.h\"\n#include \"endian.h\"\n#include \"helpers.h\"\n#include \"network.h\"\n#include \"shared_globals.h\"\n\n/* Forwards */\n\nstatic int checkRpcHeader(const RPC_HEADER *const header, const BYTE desiredPacketType, const PRINTFUNC p);\n\n\n/* Data definitions */\n\n// All GUIDs are defined as BYTE[16] here. No big-endian/little-endian byteswapping required.\nstatic const BYTE TransferSyntaxNDR32[] = {\n\t0x04, 0x5D, 0x88, 0x8A, 0xEB, 0x1C, 0xC9, 0x11, 0x9F, 0xE8, 0x08, 0x00, 0x2B, 0x10, 0x48, 0x60\n};\n\nstatic const BYTE InterfaceUuid[] = {\n\t0x75, 0x21, 0xc8, 0x51, 0x4e, 0x84, 0x50, 0x47, 0xB0, 0xD8, 0xEC, 0x25, 0x55, 0x55, 0xBC, 0x06\n};\n\n//#ifndef SIMPLE_RPC\nstatic const BYTE TransferSyntaxNDR64[] = {\n\t0x33, 0x05, 0x71, 0x71, 0xba, 0xbe, 0x37, 0x49, 0x83, 0x19, 0xb5, 0xdb, 0xef, 0x9c, 0xcc, 0x36\n};\n\nstatic const BYTE BindTimeFeatureNegotiation[] = {\n\t0x2c, 0x1c, 0xb7, 0x6c, 0x12, 0x98, 0x40, 0x45, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n//#endif // SIMPLE_RPC\n\n//\n// Dispatch RPC payload to kms.c\n//\ntypedef int(*CreateResponse_t)(const void *const, void *const, const char* const);\n\n// ReSharper disable CppIncompatiblePointerConversion\nstatic const struct {\n\tunsigned int  RequestSize;\n\tCreateResponse_t CreateResponse;\n} _Versions[] = {\n\t{ sizeof(REQUEST_V4), (CreateResponse_t)CreateResponseV4 },\n\t{ sizeof(REQUEST_V6), (CreateResponse_t)CreateResponseV6 },\n\t{ sizeof(REQUEST_V6), (CreateResponse_t)CreateResponseV6 }\n};\n// ReSharper restore CppIncompatiblePointerConversion\n\nRPC_FLAGS RpcFlags;\nstatic int_fast8_t firstPacketSent;\nstatic DWORD CallId = 2; // M$ starts with CallId 2. So we do the same.\n\n//\n// RPC request (server)\n//\n#if defined(_PEDANTIC) && !defined(NO_LOG)\nstatic void CheckRpcRequest(const RPC_REQUEST64 *const Request, const unsigned int len, WORD* NdrCtx, WORD* Ndr64Ctx, WORD Ctx)\n{\n\tuint_fast8_t kmsMajorVersion;\n\tuint32_t requestSize = Ctx != *Ndr64Ctx ? sizeof(RPC_REQUEST) : sizeof(RPC_REQUEST64);\n\n\tif (len < requestSize)\n\t{\n\t\tlogger(\"Fatal: RPC request (including header) must be at least %i bytes but is only %i bytes.\\n\",\n\t\t\t(int)(sizeof(RPC_HEADER) + requestSize),\n\t\t\t(int)(len + sizeof(RPC_HEADER))\n\t\t);\n\n\t\treturn;\n\t}\n\n\tif (len < requestSize + sizeof(DWORD))\n\t{\n\t\tlogger(\"Fatal: KMS Request too small to contain version info (less than 4 bytes).\\n\");\n\t\treturn;\n\t}\n\n\tif (Ctx != *Ndr64Ctx)\n\t\tkmsMajorVersion = (uint_fast8_t)LE16(((WORD*)Request->Ndr.Data)[1]);\n\telse\n\t\tkmsMajorVersion = (uint_fast8_t)LE16(((WORD*)Request->Ndr64.Data)[1]);\n\n\tif (kmsMajorVersion > 6)\n\t{\n\t\tlogger(\"Fatal: KMSv%u is not supported.\\n\", (unsigned int)kmsMajorVersion);\n\t}\n\telse\n\t{\n\t\tif (len > _Versions[kmsMajorVersion - 4].RequestSize + requestSize)\n\t\t\tlogger(\"Warning: %u excess bytes in RPC request.\\n\",\n\t\t\t\tlen - (_Versions[kmsMajorVersion - 4].RequestSize + requestSize)\n\t\t\t);\n\t}\n\n\tif (Ctx != *Ndr64Ctx && Ctx != *NdrCtx)\n\t{\n\t\tif (*Ndr64Ctx == RPC_INVALID_CTX)\n\t\t{\n\t\t\tlogger(\"Warning: Context id should be %u but is %u.\\n\", (unsigned int)*NdrCtx, Ctx);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlogger(\"Warning: Context id should be %u (NDR32) or %u (NDR64) but is %u.\\n\",\n\t\t\t\t(unsigned int)*NdrCtx,\n\t\t\t\t(unsigned int)*Ndr64Ctx,\n\t\t\t\tCtx\n\t\t\t);\n\t\t}\n\t}\n\n\tif (Request->Opnum)\n\t\tlogger(\"Warning: OpNum should be 0 but is %u.\\n\",\n\t\t(unsigned int)LE16(Request->Opnum)\n\t\t);\n\n\tif (LE32(Request->AllocHint) != len - sizeof(RPC_REQUEST) + sizeof(Request->Ndr))\n\t\tlogger(\"Warning: Allocation hint should be %u but is %u.\\n\",\n\t\t\tlen + sizeof(Request->Ndr),\n\t\t\tLE32(Request->AllocHint)\n\t\t);\n\n\tif (Ctx != *Ndr64Ctx)\n\t{\n\t\tif (LE32(Request->Ndr.DataLength) != len - sizeof(RPC_REQUEST))\n\t\t\tlogger(\"Warning: NDR32 data length field should be %u but is %u.\\n\",\n\t\t\t\tlen - sizeof(RPC_REQUEST),\n\t\t\t\tLE32(Request->Ndr.DataLength)\n\t\t\t);\n\n\t\tif (LE32(Request->Ndr.DataSizeIs) != len - sizeof(RPC_REQUEST))\n\t\t\tlogger(\"Warning: NDR32 data size field should be %u but is %u.\\n\",\n\t\t\t\tlen - sizeof(RPC_REQUEST),\n\t\t\t\tLE32(Request->Ndr.DataSizeIs)\n\t\t\t);\n\t}\n\telse\n\t{\n\t\tif (LE64(Request->Ndr64.DataLength) != len - sizeof(RPC_REQUEST64))\n\t\t\tlogger(\"Warning: NDR32 data length field should be %u but is %u.\\n\",\n\t\t\t\tlen - sizeof(RPC_REQUEST) + sizeof(Request->Ndr),\n\t\t\t\tLE64(Request->Ndr64.DataLength)\n\t\t\t);\n\n\t\tif (LE64(Request->Ndr64.DataSizeIs) != len - sizeof(RPC_REQUEST64))\n\t\t\tlogger(\"Warning: NDR32 data size field should be %u but is %u.\\n\",\n\t\t\t\tlen - sizeof(RPC_REQUEST64),\n\t\t\t\tLE64(Request->Ndr64.DataSizeIs)\n\t\t\t);\n\t}\n}\n#endif // defined(_PEDANTIC) && !defined(NO_LOG)\n\n/*\n * check RPC request for (somewhat) correct size\n * allow any size that does not cause CreateResponse to fail badly\n */\nstatic unsigned int checkRpcRequestSize(const RPC_REQUEST64 *const Request, const unsigned int requestSize, WORD* NdrCtx, WORD* Ndr64Ctx)\n{\n\tWORD Ctx = LE16(Request->ContextId);\n\n#\tif defined(_PEDANTIC) && !defined(NO_LOG)\n\tCheckRpcRequest(Request, requestSize, NdrCtx, Ndr64Ctx, Ctx);\n#\tendif // defined(_PEDANTIC) && !defined(NO_LOG)\n\n\t// Anything that is smaller than a v4 request is illegal\n\tif (requestSize < sizeof(REQUEST_V4) + (Ctx != *Ndr64Ctx ? sizeof(RPC_REQUEST) : sizeof(RPC_REQUEST64))) return 0;\n\n\t// Get KMS major version\n\tuint16_t majorIndex, minor;\n\tDWORD version;\n\n#\tifndef SIMPLE_RPC\n\n\tif (Ctx != *Ndr64Ctx)\n\t{\n\t\tversion = LE32(*(DWORD*)Request->Ndr.Data);\n\t}\n\telse\n\t{\n\t\tversion = LE32(*(DWORD*)Request->Ndr64.Data);\n\t}\n\n#\telse // SIMPLE_RPC\n\n\tversion = LE32(*(DWORD*)Request->Ndr.Data);\n\n#\tendif // SIMPLE_RPC\n\n\tmajorIndex = (uint16_t)(version >> 16) - 4;\n\tminor = (uint16_t)(version & 0xffff);\n\n\t// Only KMS v4, v5 and v6 are supported\n\tif (majorIndex >= vlmcsd_countof(_Versions) || minor)\n\t{\n#\t\tifndef NO_LOG\n\t\tlogger(\"Fatal: KMSv%hu.%hu unsupported\\n\", (unsigned short)majorIndex + 4, (unsigned short)minor);\n#\t\tendif // NO_LOG\n\t\treturn 0;\n\t}\n\n\t// Could check for equality but allow bigger requests to support buggy RPC clients (e.g. wine)\n\t// Buffer overrun is check by caller.\n\treturn (requestSize >= _Versions[majorIndex].RequestSize);\n}\n\n#ifndef SIMPLE_RPC\nstatic int SendError(RPC_RESPONSE64 *const Response, DWORD nca_error)\n{\n\tResponse->Error.Code = nca_error;\n\tResponse->Error.Padding = 0;\n\tResponse->AllocHint = LE32(32);\n\tResponse->ContextId = 0;\n\treturn 32;\n}\n#endif // SIMPLE_RPC\n\n/*\n * Handles the actual KMS request from the client.\n * Calls KMS functions (CreateResponseV4 or CreateResponseV6) in kms.c\n * Returns size of the KMS response packet or 0 on failure.\n *\n * The RPC packet size (excluding header) is actually in Response->AllocHint\n */\nstatic int rpcRequest(const RPC_REQUEST64 *const Request, RPC_RESPONSE64 *const Response, const DWORD RpcAssocGroup_unused, const SOCKET sock_unused, WORD* NdrCtx, WORD* Ndr64Ctx, BYTE isValid, const char* const ipstr)\n{\n\tint ResponseSize; // <0 = Errorcode (HRESULT)\n\tBYTE* requestData;\n\tBYTE* responseData;\n\tBYTE* pRpcReturnCode;\n\tint len;\n\n#\tifndef SIMPLE_RPC\n\n\tconst WORD Ctx = LE16(Request->ContextId);\n\n\tif (Ctx == *NdrCtx)\n\t{\n\t\trequestData = (BYTE*)&Request->Ndr.Data;\n\t\tresponseData = (BYTE*)&Response->Ndr.Data;\n\t}\n\telse if (Ctx == *Ndr64Ctx)\n\t{\n\t\trequestData = (BYTE*)&Request->Ndr64.Data;\n\t\tresponseData = (BYTE*)&Response->Ndr64.Data;\n\t}\n\telse\n\t{\n\t\treturn SendError(Response, RPC_NCA_UNK_IF);\n\t}\n\n#\telse // SIMPLE_RPC\n\n\trequestData = (BYTE*)&Request->Ndr.Data;\n\tresponseData = (BYTE*)&Response->Ndr.Data;\n\n#\tendif // SIMPLE_RPC\n\n\tResponseSize = 0x8007000D; // Invalid Data\n\n\tif (isValid)\n\t{\n\t\tconst uint16_t majorIndex = LE16(((WORD*)requestData)[1]) - 4;\n\t\tif (!((ResponseSize = _Versions[majorIndex].CreateResponse(requestData, responseData, ipstr)))) ResponseSize = 0x8007000D;\n\t}\n\n#\tifndef SIMPLE_RPC\n\n\tif (Ctx != *Ndr64Ctx)\n\t{\n\n#\tendif // !SIMPLE_RPC\n\t\tif (ResponseSize < 0)\n\t\t{\n\t\t\tResponse->Ndr.DataSizeMax = Response->Ndr.DataLength = 0;\n\t\t\tlen = sizeof(Response->Ndr) - sizeof(Response->Ndr.DataSizeIs);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tResponse->Ndr.DataSizeMax = LE32(0x00020000);\n\t\t\tResponse->Ndr.DataLength = Response->Ndr.DataSizeIs = LE32(ResponseSize);\n\t\t\tlen = ResponseSize + sizeof(Response->Ndr);\n\t\t}\n\n#\tifndef SIMPLE_RPC\n\n\t}\n\telse\n\t{\n\t\tif (ResponseSize < 0)\n\t\t{\n\t\t\tResponse->Ndr64.DataSizeMax = Response->Ndr64.DataLength = 0;\n\t\t\tlen = sizeof(Response->Ndr64) - sizeof(Response->Ndr64.DataSizeIs);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tResponse->Ndr64.DataSizeMax = LE64(0x00020000ULL);\n\t\t\tResponse->Ndr64.DataLength = Response->Ndr64.DataSizeIs = LE64((uint64_t)ResponseSize);\n\t\t\tlen = ResponseSize + sizeof(Response->Ndr64);\n\t\t}\n\t}\n\n#\tendif // !SIMPLE_RPC\n\n\tpRpcReturnCode = ((BYTE*)&Response->Ndr) + len;\n\tPUT_UA32LE(pRpcReturnCode, ResponseSize < 0 ? ResponseSize : 0);\n\tlen += sizeof(DWORD);\n\n\t// Pad zeros to 32-bit align (seems not neccassary but Windows RPC does it this way)\n\tconst int pad = ((~len & 3) + 1) & 3;\n\tmemset(pRpcReturnCode + sizeof(DWORD), 0, pad);\n\tlen += pad;\n\n\tResponse->AllocHint = LE32(len);\n\tResponse->ContextId = Request->ContextId;\n\n\t*((WORD*)&Response->CancelCount) = 0; // CancelCount + Pad1\n\n\treturn len + 8;\n}\n\n\n#if defined(_PEDANTIC) && !defined(NO_LOG)\nstatic void CheckRpcBindRequest(const RPC_BIND_REQUEST *const Request, const unsigned int len)\n{\n\tuint_fast8_t i, HasTransferSyntaxNDR32 = FALSE;\n\tchar guidBuffer1[GUID_STRING_LENGTH + 1], guidBuffer2[GUID_STRING_LENGTH + 1];\n\n\tconst uint32_t CapCtxItems = (len - sizeof(*Request) + sizeof(Request->CtxItems)) / sizeof(Request->CtxItems);\n\tconst DWORD NumCtxItems = LE32(Request->NumCtxItems);\n\n\tif (NumCtxItems < CapCtxItems) // Can't be too small because already handled by RpcBindSize\n\t\tlogger(\"Warning: Excess bytes in RPC bind request.\\n\");\n\n\tfor (i = 0; i < NumCtxItems; i++)\n\t{\n\t\tstruct CtxItem const* ctxItem = Request->CtxItems + i;\n\t\tif (!IsEqualGUID(&ctxItem->InterfaceUUID, InterfaceUuid))\n\t\t{\n\t\t\tuuid2StringLE(&ctxItem->InterfaceUUID, guidBuffer1);\n\t\t\tuuid2StringLE((GUID*)InterfaceUuid, guidBuffer2);\n\t\t\tlogger(\"Fatal: Interface UUID is %s but should be %s in Ctx item %u.\\n\", guidBuffer1, guidBuffer2, (unsigned int)i);\n\t\t}\n\n\t\tif (ctxItem->NumTransItems != LE16(1))\n\t\t\tlogger(\"Fatal: %u NDR32 transfer items detected in Ctx item %u, but only one is supported.\\n\",\n\t\t\t(unsigned int)LE16(ctxItem->NumTransItems), (unsigned int)i\n\t\t\t);\n\n\t\tif (ctxItem->InterfaceVerMajor != LE16(1) || ctxItem->InterfaceVerMinor != 0)\n\t\t\tlogger(\"Warning: Interface version is %u.%u but should be 1.0.\\n\",\n\t\t\t(unsigned int)LE16(ctxItem->InterfaceVerMajor),\n\t\t\t\t(unsigned int)LE16(ctxItem->InterfaceVerMinor)\n\t\t\t);\n\n\t\tif (ctxItem->ContextId != LE16((WORD)i))\n\t\t\tlogger(\"Warning: context id of Ctx item %u is %u.\\n\", (unsigned int)i, (unsigned int)ctxItem->ContextId);\n\n\t\tif (IsEqualGUID((GUID*)TransferSyntaxNDR32, &ctxItem->TransferSyntax))\n\t\t{\n\t\t\tHasTransferSyntaxNDR32 = TRUE;\n\n\t\t\tif (ctxItem->SyntaxVersion != LE32(2))\n\t\t\t\tlogger(\"NDR32 transfer syntax version is %u but should be 2.\\n\", LE32(ctxItem->SyntaxVersion));\n\t\t}\n\t\telse if (IsEqualGUID((GUID*)TransferSyntaxNDR64, &ctxItem->TransferSyntax))\n\t\t{\n\t\t\tif (ctxItem->SyntaxVersion != LE32(1))\n\t\t\t\tlogger(\"NDR64 transfer syntax version is %u but should be 1.\\n\", LE32(ctxItem->SyntaxVersion));\n\t\t}\n\t\telse if (!memcmp(BindTimeFeatureNegotiation, (BYTE*)(&ctxItem->TransferSyntax), 8))\n\t\t{\n\t\t\tif (ctxItem->SyntaxVersion != LE32(1))\n\t\t\t\tlogger(\"BTFN syntax version is %u but should be 1.\\n\", LE32(ctxItem->SyntaxVersion));\n\t\t}\n\t}\n\n\tif (!HasTransferSyntaxNDR32)\n\t\tlogger(\"Warning: RPC bind request has no NDR32 CtxItem.\\n\");\n}\n#endif // defined(_PEDANTIC) && !defined(NO_LOG)\n\n\n/*\n * Check, if we receive enough bytes to return a valid RPC bind response\n */\nstatic unsigned int checkRpcBindSize(const RPC_BIND_REQUEST *const Request, const unsigned int RequestSize, WORD* NdrCtx_unused, WORD* Ndr64Ctx_unused)\n{\n\tif (RequestSize < sizeof(RPC_BIND_REQUEST)) return FALSE;\n\n\tconst unsigned int numCtxItems = LE32(Request->NumCtxItems);\n\n\tif (RequestSize < sizeof(RPC_BIND_REQUEST) - sizeof(Request->CtxItems[0]) + numCtxItems * sizeof(Request->CtxItems[0])) return FALSE;\n\n#if defined(_PEDANTIC) && !defined(NO_LOG)\n\tCheckRpcBindRequest(Request, RequestSize);\n#endif // defined(_PEDANTIC) && !defined(NO_LOG)\n\n\treturn TRUE;\n}\n\n\n/*\n * Accepts a bind or alter context request from the client and composes the bind response.\n * Needs the socket because the tcp port number is part of the response.\n * len is not used here.\n *\n * Returns TRUE on success.\n */\nstatic 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)\n{\n\tunsigned int i;\n\tconst DWORD numCtxItems = LE32(Request->NumCtxItems);\n\tint_fast8_t IsNDR64possible = FALSE;\n\tuint_fast8_t portNumberSize;\n\n\tsocklen_t socklen;\n\tstruct sockaddr_storage addr;\n\n\t// M$ RPC does not do this. Pad bytes contain apparently random data\n\t// memset(Response->SecondaryAddress, 0, sizeof(Response->SecondaryAddress));\n\n\tsocklen = sizeof addr;\n\n\tif (\n\t\tpacketType == RPC_PT_ALTERCONTEXT_REQ ||\n\t\tgetsockname(sock, (struct sockaddr*)&addr, &socklen) ||\n\t\tgetnameinfo((struct sockaddr*)&addr, socklen, NULL, 0, (char*)Response->SecondaryAddress, sizeof(Response->SecondaryAddress), NI_NUMERICSERV))\n\t{\n\t\tportNumberSize = 0;\n\t\tResponse->SecondaryAddressLength = 0;\n\t}\n\telse\n\t{\n\t\tportNumberSize = (uint_fast8_t)strlen((char*)Response->SecondaryAddress) + 1;\n\t\tResponse->SecondaryAddressLength = LE16(portNumberSize);\n\t}\n\n\tResponse->MaxXmitFrag = Request->MaxXmitFrag;\n\tResponse->MaxRecvFrag = Request->MaxRecvFrag;\n\tResponse->AssocGroup = LE32(RpcAssocGroup);\n\n\t// This is really ugly (but efficient) code to support padding after the secondary address field\n\tif (portNumberSize < 3)\n\t{\n\t\tResponse = (RPC_BIND_RESPONSE*)((BYTE*)Response - 4);\n\t}\n\n\tResponse->NumResults = Request->NumCtxItems;\n\n#\tifndef SIMPLE_RPC\n\n\tfor (i = 0; i < numCtxItems; i++)\n\t{\n\t\tconst struct CtxItem* ctxItem = &Request->CtxItems[i];\n\t\tif (IsEqualGUID((GUID*)TransferSyntaxNDR32, &ctxItem->TransferSyntax))\n\t\t{\n\t\t\t/*if (packetType == RPC_PT_BIND_REQ)*/\n\t\t\t*NdrCtx = LE16(ctxItem->ContextId);\n\t\t}\n\n\t\tif (UseServerRpcNDR64 && IsEqualGUID((GUID*)TransferSyntaxNDR64, &ctxItem->TransferSyntax))\n\t\t{\n\t\t\tIsNDR64possible = TRUE;\n\n\t\t\t/*if (packetType == RPC_PT_BIND_REQ)*/\n\t\t\t*Ndr64Ctx = LE16(ctxItem->ContextId);\n\t\t}\n\t}\n\n#\tendif // !SIMPLE_RPC\n\n\tfor (i = 0; i < numCtxItems; i++)\n\t{\n\t\tstruct CtxResults* result = Response->Results + i;\n\t\tconst GUID* ctxTransferSyntax = &Request->CtxItems[i].TransferSyntax;\n\n#\t\tifndef SIMPLE_RPC\n\t\tWORD nackReason = RPC_ABSTRACTSYNTAX_UNSUPPORTED;\n#\t\tendif // !SIMPLE_RPC\n\n\t\tmemset(&result->TransferSyntax, 0, sizeof(GUID));\n\n#\t\tifndef SIMPLE_RPC\n\t\tconst int isInterfaceUUID = IsEqualGUID(&Request->CtxItems[i].InterfaceUUID, (GUID*)InterfaceUuid);\n\t\tif (isInterfaceUUID) nackReason = RPC_SYNTAX_UNSUPPORTED;\n#\t\telse // SIMPLE_RPC\n#\t\tdefine isInterfaceUUID TRUE\n#\t\tendif // SIMPLE_RPC\n\n\t\tif (isInterfaceUUID && !IsNDR64possible && IsEqualGUID((GUID*)TransferSyntaxNDR32, ctxTransferSyntax))\n\t\t{\n\t\t\tresult->SyntaxVersion = LE32(2);\n\t\t\tresult->AckResult = result->AckReason = RPC_BIND_ACCEPT;\n\t\t\tmemcpy(&result->TransferSyntax, TransferSyntaxNDR32, sizeof(GUID));\n\t\t\tcontinue;\n\t\t}\n\n#\t\tifndef SIMPLE_RPC\n\n\t\tif (IsEqualGUID((GUID*)TransferSyntaxNDR64, ctxTransferSyntax))\n\t\t{\n\t\t\tif (!UseServerRpcNDR64) nackReason = RPC_SYNTAX_UNSUPPORTED;\n\n\t\t\tif (isInterfaceUUID && IsNDR64possible)\n\t\t\t{\n\t\t\t\tresult->SyntaxVersion = LE32(1);\n\t\t\t\tresult->AckResult = result->AckReason = RPC_BIND_ACCEPT;\n\t\t\t\tmemcpy(&result->TransferSyntax, TransferSyntaxNDR64, sizeof(GUID));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!memcmp(BindTimeFeatureNegotiation, ctxTransferSyntax, 8))\n\t\t{\n\t\t\tnackReason = RPC_SYNTAX_UNSUPPORTED;\n\n\t\t\tif (UseServerRpcBTFN)\n\t\t\t{\n\t\t\t\tresult->SyntaxVersion = 0;\n\t\t\t\tresult->AckResult = RPC_BIND_ACK;\n\n\t\t\t\t// Features requested are actually encoded in the GUID\n\t\t\t\tresult->AckReason =\n\t\t\t\t\t((WORD*)(ctxTransferSyntax))[4] &\n\t\t\t\t\t(RPC_BTFN_SEC_CONTEXT_MULTIPLEX | RPC_BTFN_KEEP_ORPHAN);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n#\t\tendif // !SIMPLE_RPC\n\n\t\tresult->SyntaxVersion = 0;\n\t\tresult->AckResult = RPC_BIND_NACK;\n#\t\tifndef SIMPLE_RPC\n\t\tresult->AckReason = nackReason;\n#\t\telse // SIMPLE_RPC\n#\t\tundef isInterfaceUUID\n\t\tresult->AckReason = RPC_SYNTAX_UNSUPPORTED;\n#\t\tendif // SIMPLE_RPC\n\t}\n\n\t//if (!_st) return 0;\n\n\treturn sizeof(RPC_BIND_RESPONSE) + numCtxItems * sizeof(struct CtxResults) - (portNumberSize < 3 ? 4 : 0);\n}\n\n\n//\n// Main RPC handling routine\n//\ntypedef unsigned int(*GetResponseSize_t)(const void *const request, const unsigned int requestSize, WORD* NdrCtx, WORD* Ndr64Ctx);\ntypedef int(*GetResponse_t)(const void* const request, void* response, const DWORD rpcAssocGroup, const SOCKET socket, WORD* NdrCtx, WORD* Ndr64Ctx, BYTE packetType, const char* const ipstr);\n\n// ReSharper disable CppIncompatiblePointerConversion\nstatic const struct {\n\tBYTE  ResponsePacketType;\n\tGetResponseSize_t CheckRequest;\n\tGetResponse_t GetResponse;\n}\n_Actions[] = {\n\t{ RPC_PT_BIND_ACK,         (GetResponseSize_t)checkRpcBindSize,    (GetResponse_t)rpcBind    },\n\t{ RPC_PT_RESPONSE,         (GetResponseSize_t)checkRpcRequestSize, (GetResponse_t)rpcRequest },\n\t{ RPC_PT_ALTERCONTEXT_ACK, (GetResponseSize_t)checkRpcBindSize,    (GetResponse_t)rpcBind    },\n};\n// ReSharper restore CppIncompatiblePointerConversion\n\n\n/*\n* Initializes an RPC request header as needed for KMS, i.e. packet always fits in one fragment.\n* size cannot be greater than fragment length negotiated during RPC bind.\n*/\nstatic void createRpcHeader(RPC_HEADER* header, BYTE packetType, WORD size)\n{\n\theader->PacketType = packetType;\n\theader->PacketFlags = RPC_PF_FIRST | RPC_PF_LAST;\n\theader->VersionMajor = 5;\n\theader->VersionMinor = 0;\n\theader->AuthLength = 0;\n\theader->DataRepresentation = BE32(0x10000000); // Little endian, ASCII charset, IEEE floating point\n\theader->CallId = LE32(CallId);\n\theader->FragLength = LE16(size);\n}\n\n\n/*\n * This is the main RPC server loop. Returns after KMS request has been serviced\n * or a timeout has occured.\n */\nvoid rpcServer(const SOCKET sock, const DWORD rpcAssocGroup, const char* const ipstr)\n{\n\tRPC_HEADER  rpcRequestHeader;\n\tWORD NdrCtx = RPC_INVALID_CTX, Ndr64Ctx = RPC_INVALID_CTX;\n\n\trandomNumberInit();\n\n\twhile (_recv(sock, &rpcRequestHeader, sizeof(rpcRequestHeader)))\n\t{\n\t\t//int_fast8_t  _st;\n\t\tunsigned int request_len, response_len;\n\t\tuint_fast8_t _a;\n\n#if defined(_PEDANTIC) && !defined(NO_LOG)\n\t\tcheckRpcHeader(&rpcRequestHeader, rpcRequestHeader.PacketType, &logger);\n#endif // defined(_PEDANTIC) && !defined(NO_LOG)\n\n\t\tswitch (rpcRequestHeader.PacketType)\n\t\t{\n\t\tcase RPC_PT_BIND_REQ:         _a = 0; break;\n\t\tcase RPC_PT_REQUEST:          _a = 1; break;\n\t\tcase RPC_PT_ALTERCONTEXT_REQ: _a = 2; break;\n\t\tdefault: return;\n\t\t}\n\n\t\trequest_len = LE16(rpcRequestHeader.FragLength) - sizeof(rpcRequestHeader);\n\n\t\tBYTE requestBuffer[MAX_REQUEST_SIZE + sizeof(RPC_RESPONSE64)];\n\t\tBYTE responseBuffer[MAX_RESPONSE_SIZE + sizeof(RPC_HEADER) + sizeof(RPC_RESPONSE64)];\n\n\t\tRPC_HEADER *rpcResponseHeader = (RPC_HEADER *)responseBuffer;\n\t\tRPC_RESPONSE* rpcResponse = (RPC_RESPONSE*)(responseBuffer + sizeof(rpcRequestHeader));\n\n\t\t// The request is larger than the buffer size\n\t\tif (request_len > MAX_REQUEST_SIZE + sizeof(RPC_REQUEST64)) return;\n\n\t\t// Unable to receive the complete request\n\t\tif (!_recv(sock, requestBuffer, request_len)) return;\n\n#       if !defined(SIMPLE_RPC) && defined(_PEDANTIC)\n\t\tif (rpcRequestHeader.PacketType == RPC_PT_REQUEST && (rpcRequestHeader.VersionMajor != 5 || rpcRequestHeader.VersionMinor != 0))\n\t\t{\n\t\t\tresponse_len = SendError((RPC_RESPONSE64*)rpcResponse, RPC_NCA_PROTO_ERROR);\n\t\t}\n\t\telse\n#\t\tendif // !defined(SIMPLE_RPC) && defined(_PEDANTIC)\n\t\t{\n\t\t\tBYTE isValid = (BYTE)_Actions[_a].CheckRequest(requestBuffer, request_len, &NdrCtx, &Ndr64Ctx);\n\t\t\tif (rpcRequestHeader.PacketType != RPC_PT_REQUEST && !isValid) return;\n\n\t\t\t// Unable to create a valid response from request\n\t\t\tif (!((response_len = _Actions[_a].GetResponse(requestBuffer, rpcResponse, rpcAssocGroup, sock, &NdrCtx, &Ndr64Ctx, rpcRequestHeader.PacketType != RPC_PT_REQUEST ? rpcRequestHeader.PacketType : isValid, ipstr)))) return;\n\t\t}\n\n\t\tmemcpy(rpcResponseHeader, &rpcRequestHeader, sizeof(RPC_HEADER));\n\n#       ifndef SIMPLE_RPC\n\t\tif (response_len == 32)\n\t\t{\n\t\t\tcreateRpcHeader(rpcResponseHeader, RPC_PT_FAULT, 0);\n\t\t\trpcResponseHeader->PacketFlags = RPC_PF_FIRST | RPC_PF_LAST | RPC_PF_NOT_EXEC;\n\t\t}\n\t\telse\n#\t\tendif // SIMPLE_RPC\n\t\t{\n\t\t\tresponse_len += sizeof(RPC_HEADER);\n\t\t\trpcResponseHeader->PacketType = _Actions[_a].ResponsePacketType;\n\n\t\t\tif (rpcResponseHeader->PacketType == RPC_PT_ALTERCONTEXT_ACK)\n\t\t\t{\n\t\t\t\trpcResponseHeader->PacketFlags = RPC_PF_FIRST | RPC_PF_LAST;\n\t\t\t}\n\t\t}\n\n\t\trpcResponseHeader->FragLength = LE16((WORD)response_len);\n\n\t\tif (!_send(sock, responseBuffer, response_len)) return;\n\n\t\tif (DisconnectImmediately && (rpcResponseHeader->PacketType == RPC_PT_RESPONSE || rpcResponseHeader->PacketType == RPC_PT_FAULT))\n\t\t\treturn;\n\t}\n}\n\n\n/* RPC client functions */\n\n\n/*\n * Checks RPC header. Returns 0 on success.\n * This is mainly for debugging a non Microsoft KMS server that uses its own RPC code.\n */\nstatic int checkRpcHeader(const RPC_HEADER *const header, const BYTE desiredPacketType, const PRINTFUNC p)\n{\n\tint status = 0;\n\n\tif (header->PacketType != desiredPacketType)\n\t{\n\t\tp(\"Fatal: Received wrong RPC packet type. Expected %u but got %u\\n\",\n\t\t\t(uint32_t)desiredPacketType,\n\t\t\theader->PacketType\n\t\t);\n\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t}\n\n\tif (header->DataRepresentation != BE32(0x10000000))\n\t{\n\t\tp(\"Fatal: RPC response does not conform to Microsoft's limited support of DCE RPC\\n\");\n\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t}\n\n\tif (header->AuthLength != 0)\n\t{\n\t\tp(\"Fatal: RPC response requests authentication\\n\");\n\t\tstatus = RPC_S_UNKNOWN_AUTHN_TYPE;\n\t}\n\n\t// vlmcsd does not support fragmented packets (not yet neccassary)\n\tif ((header->PacketFlags & (RPC_PF_FIRST | RPC_PF_LAST)) != (RPC_PF_FIRST | RPC_PF_LAST))\n\t{\n\t\tp(\"Fatal: RPC packet flags RPC_PF_FIRST and RPC_PF_LAST are not both set.\\n\");\n\t\tstatus = RPC_S_CANNOT_SUPPORT;\n\t}\n\n\tif (header->PacketFlags & RPC_PF_CANCEL_PENDING)\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_CANCEL_PENDING\");\n\tif (header->PacketFlags & RPC_PF_RESERVED)\t\t\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_RESERVED\");\n\tif (header->PacketFlags & RPC_PF_NOT_EXEC)\t\t\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_NOT_EXEC\");\n\tif (header->PacketFlags & RPC_PF_MAYBE)\t\t\t\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_MAYBE\");\n\tif (header->PacketFlags & RPC_PF_OBJECT)\t\t\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_OBJECT\");\n\n\tif (header->VersionMajor != 5 || header->VersionMinor != 0)\n\t{\n\t\tp(\"Fatal: Expected RPC version 5.0 and got %u.%u\\n\", header->VersionMajor, header->VersionMinor);\n\t\tstatus = RPC_S_INVALID_VERS_OPTION;\n\t}\n\n\treturn status;\n}\n\n\n/*\n * Checks an RPC response header. Does basic header checks by calling checkRpcHeader()\n * and then does additional checks if response header complies with the respective request header.\n * PRINTFUNC p can be anything that has the same prototype as printf.\n * Returns 0 on success.\n */\n // ReSharper disable once CppIncompatiblePointerConversion\nstatic int checkRpcResponseHeader(const RPC_HEADER *const ResponseHeader, const RPC_HEADER *const RequestHeader, const BYTE desiredPacketType, const PRINTFUNC p)\n{\n\tstatic int_fast8_t WineBugDetected = FALSE;\n\tint status = checkRpcHeader(ResponseHeader, desiredPacketType, p);\n\n\tif (desiredPacketType == RPC_PT_BIND_ACK)\n\t{\n\t\tif ((ResponseHeader->PacketFlags & RPC_PF_MULTIPLEX) != (RequestHeader->PacketFlags & RPC_PF_MULTIPLEX))\n\t\t{\n\t\t\tp(\"Warning: RPC_PF_MULTIPLEX of RPC request and response should match\\n\");\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (ResponseHeader->PacketFlags & RPC_PF_MULTIPLEX)\n\t\t{\n\t\t\tp(\"Warning: %s should not be set\\n\", \"RPC_PF_MULTIPLEX\");\n\t\t}\n\t}\n\n\tif (!status && ResponseHeader->CallId == LE32(1))\n\t{\n\t\tif (!WineBugDetected)\n\t\t{\n\t\t\tp(\"Warning: Buggy RPC of Wine detected. Call Id of Response is always 1\\n\");\n\t\t\tWineBugDetected = TRUE;\n\t\t}\n\t}\n\telse if (ResponseHeader->CallId != RequestHeader->CallId)\n\t{\n\t\tp(\"Fatal: Sent Call Id %u but received answer for Call Id %u\\n\",\n\t\t\t(uint32_t)LE32(RequestHeader->CallId),\n\t\t\t(uint32_t)LE32(ResponseHeader->CallId)\n\t\t);\n\n\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t}\n\n\treturn status;\n}\n\n/*\n * Sends a KMS request via RPC and receives a response.\n * Parameters are raw (encrypted) reqeuests / responses.\n * Returns 0 on success.\n */\nRpcStatus rpcSendRequest(const RpcCtx sock, const BYTE *const kmsRequest, const size_t requestSize, BYTE **kmsResponse, size_t *const responseSize)\n{\n#define MAX_EXCESS_BYTES 16\n\tRPC_HEADER *RequestHeader, ResponseHeader;\n\tRPC_REQUEST64 *RpcRequest;\n\tRPC_RESPONSE64 _Response;\n\tint status;\n\tconst int_fast8_t useNdr64 = RpcFlags.HasNDR64 && UseClientRpcNDR64 && firstPacketSent;\n\tsize_t size = sizeof(RPC_HEADER) + (useNdr64 ? sizeof(RPC_REQUEST64) : sizeof(RPC_REQUEST)) + requestSize;\n\tsize_t responseSize2;\n\n\t*kmsResponse = NULL;\n\n\tBYTE *_Request = (BYTE*)vlmcsd_malloc(size);\n\n\tRequestHeader = (RPC_HEADER*)_Request;\n\tRpcRequest = (RPC_REQUEST64*)(_Request + sizeof(RPC_HEADER));\n\n\tcreateRpcHeader(RequestHeader, RPC_PT_REQUEST, (WORD)size);\n\n\t// Increment CallId for next Request\n\tCallId++;\n\n\tRpcRequest->Opnum = 0;\n\n\tif (useNdr64)\n\t{\n\t\tRpcRequest->ContextId = LE16(1); // We negotiate NDR64 always as context 1\n\t\tRpcRequest->AllocHint = LE32((DWORD)(requestSize + sizeof(RpcRequest->Ndr64)));\n\t\tRpcRequest->Ndr64.DataLength = LE64((uint64_t)requestSize);\n\t\tRpcRequest->Ndr64.DataSizeIs = LE64((uint64_t)requestSize);\n\t\tmemcpy(RpcRequest->Ndr64.Data, kmsRequest, requestSize);\n\t}\n\telse\n\t{\n\t\tRpcRequest->ContextId = 0; // We negotiate NDR32 always as context 0\n\t\tRpcRequest->AllocHint = LE32((DWORD)(requestSize + sizeof(RpcRequest->Ndr)));\n\t\tRpcRequest->Ndr.DataLength = LE32((DWORD)requestSize);\n\t\tRpcRequest->Ndr.DataSizeIs = LE32((DWORD)requestSize);\n\t\tmemcpy(RpcRequest->Ndr.Data, kmsRequest, requestSize);\n\t}\n\n\tfor (;;)\n\t{\n\t\tint bytesread;\n\n\t\tif (!_send(sock, _Request, (int)size))\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: Could not send RPC request\\n\");\n\t\t\tstatus = RPC_S_COMM_FAILURE;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (!_recv(sock, &ResponseHeader, sizeof(RPC_HEADER)))\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: No RPC response received from server\\n\");\n\t\t\tstatus = RPC_S_COMM_FAILURE;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ((status = checkRpcResponseHeader(&ResponseHeader, RequestHeader, RPC_PT_RESPONSE, &printerrorf))) break;\n\n\t\tsize = useNdr64 ? sizeof(RPC_RESPONSE64) : sizeof(RPC_RESPONSE);\n\n\t\tif (size > LE16(ResponseHeader.FragLength) - sizeof(ResponseHeader))\n\t\t\tsize = LE16(ResponseHeader.FragLength) - sizeof(ResponseHeader);\n\n\t\tif (!_recv(sock, &_Response, (int)size))\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: RPC response is incomplete\\n\");\n\t\t\tstatus = RPC_S_COMM_FAILURE;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (_Response.CancelCount != 0)\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: RPC response cancel count is not 0\\n\");\n\t\t\tstatus = RPC_S_CALL_CANCELLED;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (_Response.ContextId != (useNdr64 ? LE16(1) : 0))\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: RPC response context id %u is not bound\\n\", (unsigned int)LE16(_Response.ContextId));\n\t\t\tstatus = RPC_X_SS_CONTEXT_DAMAGED;\n\t\t\tbreak;\n\t\t}\n\n\t\tint_fast8_t sizesMatch;\n\n\t\tif (useNdr64)\n\t\t{\n\t\t\t*responseSize = (size_t)LE64(_Response.Ndr64.DataLength);\n\t\t\tresponseSize2 = (size_t)LE64(_Response.Ndr64.DataSizeIs);\n\n\t\t\tif (/*!*responseSize ||*/ !_Response.Ndr64.DataSizeMax)\n\t\t\t{\n\t\t\t\tstatus = (int)LE32(_Response.Ndr64.status);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tsizesMatch = (size_t)LE64(_Response.Ndr64.DataLength) == responseSize2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*responseSize = (size_t)LE32(_Response.Ndr.DataLength);\n\t\t\tresponseSize2 = (size_t)LE32(_Response.Ndr.DataSizeIs);\n\n\t\t\tif (/*!*responseSize ||*/ !_Response.Ndr.DataSizeMax)\n\t\t\t{\n\t\t\t\tstatus = (int)LE32(_Response.Ndr.status);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tsizesMatch = (size_t)LE32(_Response.Ndr.DataLength) == responseSize2;\n\t\t}\n\n\t\tif (!sizesMatch)\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: NDR data length (%u) does not match NDR data size (%u)\\n\",\n\t\t\t\t(uint32_t)*responseSize,\n\t\t\t\t(uint32_t)LE32(_Response.Ndr.DataSizeIs)\n\t\t\t);\n\n\t\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t\t\tbreak;\n\t\t}\n\n\t\t*kmsResponse = (BYTE*)vlmcsd_malloc(*responseSize + MAX_EXCESS_BYTES);\n\n\t\t// If RPC stub is too short, assume missing bytes are zero (same ill behavior as MS RPC)\n\t\tmemset(*kmsResponse, 0, *responseSize + MAX_EXCESS_BYTES);\n\n\t\t// Read up to 16 bytes more than bytes expected to detect faulty KMS emulators\n\t\tif ((bytesread = recv(sock, (char*)*kmsResponse, (int)(*responseSize) + MAX_EXCESS_BYTES, 0)) < (int)*responseSize)\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: No or incomplete KMS response received. Required %u bytes but only got %i\\n\",\n\t\t\t\t(uint32_t)*responseSize,\n\t\t\t\t(int32_t)(bytesread < 0 ? 0 : bytesread)\n\t\t\t);\n\n\t\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t\t\tbreak;\n\t\t}\n\n\t\tDWORD *pReturnCode;\n\n\t\tconst size_t len = *responseSize + (useNdr64 ? sizeof(_Response.Ndr64) : sizeof(_Response.Ndr)) + sizeof(*pReturnCode);\n\t\tconst size_t pad = ((~len & 3) + 1) & 3;\n\n\t\tif (len + pad != LE32(_Response.AllocHint))\n\t\t{\n\t\t\tprinterrorf(\"\\nWarning: RPC stub size is %u, should be %u (probably incorrect padding)\\n\", (uint32_t)LE32(_Response.AllocHint), (uint32_t)(len + pad));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsize_t i;\n\t\t\tfor (i = 0; i < pad; i++)\n\t\t\t{\n\t\t\t\tif (*(*kmsResponse + *responseSize + sizeof(*pReturnCode) + i))\n\t\t\t\t{\n\t\t\t\t\tprinterrorf(\"\\nWarning: RPC stub data not padded to zeros according to Microsoft standard\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpReturnCode = (DWORD*)(*kmsResponse + *responseSize + pad);\n\t\tstatus = GET_UA32LE(pReturnCode);\n\t\t//status = LE32(UA32(pReturnCode));\n\n\t\tbreak;\n\t}\n\n\tfree(_Request);\n\tfirstPacketSent = TRUE;\n\treturn status;\n#undef MAX_EXCESS_BYTES\n}\n\n\nstatic int_fast8_t IsNullGuid(const BYTE* guidPtr)\n{\n\tint_fast8_t i;\n\n\tfor (i = 0; i < 16; i++)\n\t{\n\t\tif (guidPtr[i]) return FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n/*\n * Perform RPC client bind. Accepts a connected client socket.\n * Returns 0 on success. RPC binding is required before any payload can be\n * exchanged. It negotiates about protocol details.\n */\nstatic RpcStatus rpcBindOrAlterClientContext(const RpcCtx sock, const BYTE packetType, const int_fast8_t verbose)\n{\n\tRPC_HEADER *RequestHeader, ResponseHeader;\n\tRPC_BIND_REQUEST *bindRequest;\n\tRPC_BIND_RESPONSE *bindResponse;\n\tint status;\n\tconst WORD ctxItems = 1 + (packetType == RPC_PT_BIND_REQ ? UseClientRpcNDR64 + UseClientRpcBTFN : 0);\n\tconst size_t rpcBindSize = (sizeof(RPC_HEADER) + sizeof(RPC_BIND_REQUEST) + (ctxItems - 1) * sizeof(bindRequest->CtxItems[0]));\n\tWORD ctxIndex = 0;\n\tWORD i;\n\tWORD CtxBTFN = RPC_INVALID_CTX, CtxNDR64 = RPC_INVALID_CTX;\n\tBYTE* request = (BYTE*)alloca(rpcBindSize);\n\n\tRequestHeader = (RPC_HEADER*)request;\n\tbindRequest = (RPC_BIND_REQUEST*)(request + sizeof(RPC_HEADER));\n\n\tcreateRpcHeader(RequestHeader, packetType, (WORD)rpcBindSize);\n\tRequestHeader->PacketFlags |= UseMultiplexedRpc ? RPC_PF_MULTIPLEX : 0;\n\n\tbindRequest->AssocGroup = 0;\n\tbindRequest->MaxRecvFrag = bindRequest->MaxXmitFrag = LE16(5840);\n\tbindRequest->NumCtxItems = LE32(ctxItems);\n\n\t// data that is identical in all Ctx items\n\tfor (i = 0; i < ctxItems; i++)\n\t{\n\t\tstruct CtxItem* ctxItem = bindRequest->CtxItems + i;\n\t\tctxItem->ContextId = LE16(i);\n\t\tctxItem->InterfaceVerMajor = LE16(1);\n\t\tctxItem->InterfaceVerMinor = 0;\n\t\tctxItem->NumTransItems = LE16(1);\n\t\tctxItem->SyntaxVersion = i ? LE32(1) : LE32(2);\n\n\t\tmemcpy(&ctxItem->InterfaceUUID, InterfaceUuid, sizeof(GUID));\n\t}\n\n\tmemcpy(&bindRequest->CtxItems[0].TransferSyntax, TransferSyntaxNDR32, sizeof(GUID));\n\n\tif (UseClientRpcNDR64 && packetType == RPC_PT_BIND_REQ)\n\t{\n\t\tmemcpy(&bindRequest->CtxItems[++ctxIndex].TransferSyntax, TransferSyntaxNDR64, sizeof(GUID));\n\t\tCtxNDR64 = ctxIndex;\n\t}\n\n\tif (UseClientRpcBTFN && packetType == RPC_PT_BIND_REQ)\n\t{\n\t\tmemcpy(&bindRequest->CtxItems[++ctxIndex].TransferSyntax, BindTimeFeatureNegotiation, sizeof(GUID));\n\t\tCtxBTFN = ctxIndex;\n\t}\n\n\tif (!_send(sock, request, (int)rpcBindSize))\n\t{\n\t\tprinterrorf(\"\\nFatal: Sending RPC bind request failed\\n\");\n\t\treturn RPC_S_COMM_FAILURE;\n\t}\n\n\tif (!_recv(sock, &ResponseHeader, sizeof(RPC_HEADER)))\n\t{\n\t\tprinterrorf(\"\\nFatal: Did not receive a response from server\\n\");\n\t\treturn RPC_S_COMM_FAILURE;\n\t}\n\n\tif ((status = checkRpcResponseHeader\n\t(\n\t\t&ResponseHeader,\n\t\tRequestHeader,\n\t\tpacketType == RPC_PT_BIND_REQ ? RPC_PT_BIND_ACK : RPC_PT_ALTERCONTEXT_ACK,\n\t\t&printerrorf\n\t)))\n\t{\n\t\treturn status;\n\t}\n\n\tbindResponse = (RPC_BIND_RESPONSE*)vlmcsd_malloc(LE16(ResponseHeader.FragLength) - sizeof(RPC_HEADER));\n\tBYTE* bindResponseBytePtr = (BYTE*)bindResponse;\n\n\tif (!_recv(sock, bindResponse, LE16(ResponseHeader.FragLength) - sizeof(RPC_HEADER)))\n\t{\n\t\tprinterrorf(\"\\nFatal: Incomplete RPC bind acknowledgement received\\n\");\n\t\tfree(bindResponseBytePtr);\n\t\treturn RPC_S_COMM_FAILURE;\n\t}\n\n\t/*\n\t * checking, whether a bind or alter context response is as expected.\n\t * This check is very strict and checks whether a KMS emulator behaves exactly the same way\n\t * as Microsoft's RPC does.\n\t */\n\tstatus = 0;\n\n\tif (bindResponse->SecondaryAddressLength < LE16(3))\n\t\tbindResponse = (RPC_BIND_RESPONSE*)(bindResponseBytePtr - 4);\n\n\tif (bindResponse->NumResults != bindRequest->NumCtxItems)\n\t{\n\t\tprinterrorf(\"\\nFatal: Expected %u CTX items but got %u\\n\",\n\t\t\t(uint32_t)LE32(bindRequest->NumCtxItems),\n\t\t\t(uint32_t)LE32(bindResponse->NumResults)\n\t\t);\n\n\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t}\n\n\tfor (i = 0; i < ctxItems; i++)\n\t{\n\t\tconst char* transferSyntaxName =\n\t\t\ti == CtxBTFN ? \"BTFN\" : i == CtxNDR64 ? \"NDR64\" : \"NDR32\";\n\n\t\tstruct CtxResults* ctxResult = bindResponse->Results + i;\n\t\tstruct CtxItem* ctxItem = bindRequest->CtxItems + i;\n\t\tif (ctxResult->AckResult == RPC_BIND_NACK) // transfer syntax was declined\n\t\t{\n\t\t\tif (!IsNullGuid((BYTE*)&ctxResult->TransferSyntax))\n\t\t\t{\n\t\t\t\tprinterrorf(\n\t\t\t\t\t\"\\nWarning: Rejected transfer syntax %s did not return NULL Guid\\n\",\n\t\t\t\t\ttransferSyntaxName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (ctxResult->SyntaxVersion)\n\t\t\t{\n\t\t\t\tprinterrorf(\n\t\t\t\t\t\"\\nWarning: Rejected transfer syntax %s did not return syntax version 0 but %u\\n\",\n\t\t\t\t\ttransferSyntaxName,\n\t\t\t\t\tLE32(ctxResult->SyntaxVersion)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (ctxResult->AckReason == RPC_ABSTRACTSYNTAX_UNSUPPORTED)\n\t\t\t{\n\t\t\t\tprinterrorf(\n\t\t\t\t\t\"\\nWarning: Transfer syntax %s does not support KMS activation\\n\",\n\t\t\t\t\ttransferSyntaxName\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if (ctxResult->AckReason != RPC_SYNTAX_UNSUPPORTED)\n\t\t\t{\n\t\t\t\tprinterrorf(\n\t\t\t\t\t\"\\nWarning: Rejected transfer syntax %s did not return ack reason RPC_SYNTAX_UNSUPPORTED\\n\",\n\t\t\t\t\ttransferSyntaxName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i == CtxBTFN) // BTFN\n\t\t{\n\t\t\tif (ctxResult->AckResult != RPC_BIND_ACK)\n\t\t\t{\n\t\t\t\tprinterrorf(\"\\nWarning: BTFN did not respond with RPC_BIND_ACK or RPC_BIND_NACK\\n\");\n\t\t\t}\n\n\t\t\tif (ctxResult->AckReason != LE16(3))\n\t\t\t{\n\t\t\t\tprinterrorf(\"\\nWarning: BTFN did not return expected feature mask 0x3 but 0x%X\\n\", (unsigned int)LE16(ctxResult->AckReason));\n\t\t\t}\n\n\t\t\tif (verbose) printf(\"... BTFN \");\n\t\t\tRpcFlags.HasBTFN = TRUE;\n\n\t\t\tcontinue;\n\t\t}\n\n\t\t// NDR32 or NDR64 Ctx\n\t\tif (ctxResult->AckResult != RPC_BIND_ACCEPT)\n\t\t{\n\t\t\tprinterrorf(\n\t\t\t\t\"\\nFatal: transfer syntax %s returned an invalid status, neither RPC_BIND_ACCEPT nor RPC_BIND_NACK\\n\",\n\t\t\t\ttransferSyntaxName\n\t\t\t);\n\n\t\t\tstatus = RPC_S_PROTOCOL_ERROR;\n\t\t}\n\n\t\tif (!IsEqualGUID(&ctxResult->TransferSyntax, &ctxItem->TransferSyntax))\n\t\t{\n\t\t\tprinterrorf(\n\t\t\t\t\"\\nFatal: Transfer syntax of RPC bind request and response does not match\\n\"\n\t\t\t);\n\n\t\t\tstatus = RPC_S_UNSUPPORTED_TRANS_SYN;\n\t\t}\n\n\t\tif (ctxResult->SyntaxVersion != ctxItem->SyntaxVersion)\n\t\t{\n\t\t\tprinterrorf(\"\\nFatal: Expected transfer syntax version %u for %s but got %u\\n\",\n\t\t\t\t(uint32_t)LE32(ctxItem->SyntaxVersion),\n\t\t\t\ttransferSyntaxName,\n\t\t\t\t(uint32_t)LE32(ctxResult->SyntaxVersion)\n\t\t\t);\n\n\t\t\tstatus = RPC_S_UNSUPPORTED_TRANS_SYN;\n\t\t}\n\n\t\t// The ack reason field is actually undefined here but Microsoft sets this to 0\n\t\tif (ctxResult->AckReason != 0)\n\t\t{\n\t\t\tprinterrorf(\n\t\t\t\t\"\\nWarning: Ack reason should be 0 but is %u\\n\",\n\t\t\t\tLE16(ctxResult->AckReason)\n\t\t\t);\n\t\t}\n\n\t\tif (!status)\n\t\t{\n\t\t\tif (i == CtxNDR64)\n\t\t\t{\n\t\t\t\tRpcFlags.HasNDR64 = TRUE;\n\t\t\t\tif (verbose) printf(\"... NDR64 \");\n\t\t\t}\n\t\t\tif (!i)\n\t\t\t{\n\t\t\t\tRpcFlags.HasNDR32 = TRUE;\n\t\t\t\tif (verbose) printf(\"... NDR32 \");\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfree(bindResponseBytePtr);\n\n\tif (!RpcFlags.HasNDR64 && !RpcFlags.HasNDR32)\n\t{\n\t\tprinterrorf(\"\\nFatal: Could neither negotiate NDR32 nor NDR64 with the RPC server\\n\");\n\t\tstatus = RPC_S_NO_PROTSEQS;\n\t}\n\n\treturn status;\n}\n\nRpcStatus rpcBindClient(const RpcCtx sock, const int_fast8_t verbose, PRpcDiag_t rpcDiag)\n{\n\tfirstPacketSent = FALSE;\n\tRpcFlags.mask = 0;\n\n\tRpcStatus status =\n\t\trpcBindOrAlterClientContext(sock, RPC_PT_BIND_REQ, verbose);\n\n\tif (status) goto end;\n\n\tif (!RpcFlags.HasNDR32)\n\t\tstatus = rpcBindOrAlterClientContext(sock, RPC_PT_ALTERCONTEXT_REQ, verbose);\n\nend:\n\trpcDiag->HasRpcDiag = TRUE;\n\trpcDiag->HasNDR64 = !!RpcFlags.HasNDR64;\n\trpcDiag->HasBTFN = !!RpcFlags.HasBTFN;\n\treturn status;\n}\n\n#endif // USE_MSRPC\n"
  },
  {
    "path": "src/rpc.h",
    "content": "#ifndef __rpc_h\n#define __rpc_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"types.h\"\n#include \"shared_globals.h\"\n\n#if !defined(_WIN32) && !defined(__CYGWIN__)\n#define RPC_S_OK 0\n#define RPC_S_INVALID_ARG 87\n#define RPC_S_OUT_OF_MEMORY 14\n#define RPC_S_OUT_OF_THREADS 164\n#define RPC_S_INVALID_LEVEL RPC_S_INVALID_ARG\n#define RPC_S_BUFFER_TOO_SMALL 122\n#define RPC_S_INVALID_SECURITY_DESC 1338\n#define RPC_S_ACCESS_DENIED 5\n#define RPC_S_SERVER_OUT_OF_MEMORY 1130\n#define RPC_S_ASYNC_CALL_PENDING 997\n#define RPC_S_UNKNOWN_PRINCIPAL 1332\n#define RPC_S_TIMEOUT 1460\n#define RPC_S_INVALID_STRING_BINDING 1700\n#define RPC_S_WRONG_KIND_OF_BINDING 1701\n#define RPC_S_INVALID_BINDING 1702\n#define RPC_S_PROTSEQ_NOT_SUPPORTED 1703\n#define RPC_S_INVALID_RPC_PROTSEQ 1704\n#define RPC_S_INVALID_STRING_UUID 1705\n#define RPC_S_INVALID_ENDPOINT_FORMAT 1706\n#define RPC_S_INVALID_NET_ADDR 1707\n#define RPC_S_NO_ENDPOINT_FOUND 1708\n#define RPC_S_INVALID_TIMEOUT 1709\n#define RPC_S_OBJECT_NOT_FOUND 1710\n#define RPC_S_ALREADY_REGISTERED 1711\n#define RPC_S_TYPE_ALREADY_REGISTERED 1712\n#define RPC_S_ALREADY_LISTENING 1713\n#define RPC_S_NO_PROTSEQS_REGISTERED 1714\n#define RPC_S_NOT_LISTENING 1715\n#define RPC_S_UNKNOWN_MGR_TYPE 1716\n#define RPC_S_UNKNOWN_IF 1717\n#define RPC_S_NO_BINDINGS 1718\n#define RPC_S_NO_PROTSEQS 1719\n#define RPC_S_CANT_CREATE_ENDPOINT 1720\n#define RPC_S_OUT_OF_RESOURCES 1721\n#define RPC_S_SERVER_UNAVAILABLE 1722\n#define RPC_S_SERVER_TOO_BUSY 1723\n#define RPC_S_INVALID_NETWORK_OPTIONS 1724\n#define RPC_S_NO_CALL_ACTIVE 1725\n#define RPC_S_CALL_FAILED 1726\n#define RPC_S_CALL_FAILED_DNE 1727\n#define RPC_S_PROTOCOL_ERROR 1728\n#define RPC_S_PROXY_ACCESS_DENIED 1729\n#define RPC_S_UNSUPPORTED_TRANS_SYN 1730\n#define RPC_S_UNSUPPORTED_TYPE 1732\n#define RPC_S_INVALID_TAG 1733\n#define RPC_S_INVALID_BOUND 1734\n#define RPC_S_NO_ENTRY_NAME 1735\n#define RPC_S_INVALID_NAME_SYNTAX 1736\n#define RPC_S_UNSUPPORTED_NAME_SYNTAX 1737\n#define RPC_S_UUID_NO_ADDRESS 1739\n#define RPC_S_DUPLICATE_ENDPOINT 1740\n#define RPC_S_UNKNOWN_AUTHN_TYPE 1741\n#define RPC_S_MAX_CALLS_TOO_SMALL 1742\n#define RPC_S_STRING_TOO_LONG 1743\n#define RPC_S_PROTSEQ_NOT_FOUND 1744\n#define RPC_S_PROCNUM_OUT_OF_RANGE 1745\n#define RPC_S_BINDING_HAS_NO_AUTH 1746\n#define RPC_S_UNKNOWN_AUTHN_SERVICE 1747\n#define RPC_S_UNKNOWN_AUTHN_LEVEL 1748\n#define RPC_S_INVALID_AUTH_IDENTITY 1749\n#define RPC_S_UNKNOWN_AUTHZ_SERVICE 1750\n#define EPT_S_INVALID_ENTRY 1751\n#define EPT_S_CANT_PERFORM_OP 1752\n#define EPT_S_NOT_REGISTERED 1753\n#define RPC_S_NOTHING_TO_EXPORT 1754\n#define RPC_S_INCOMPLETE_NAME 1755\n#define RPC_S_INVALID_VERS_OPTION 1756\n#define RPC_S_NO_MORE_MEMBERS 1757\n#define RPC_S_NOT_ALL_OBJS_UNEXPORTED 1758\n#define RPC_S_INTERFACE_NOT_FOUND 1759\n#define RPC_S_ENTRY_ALREADY_EXISTS 1760\n#define RPC_S_ENTRY_NOT_FOUND 1761\n#define RPC_S_NAME_SERVICE_UNAVAILABLE 1762\n#define RPC_S_INVALID_NAF_ID 1763\n#define RPC_S_CANNOT_SUPPORT 1764\n#define RPC_S_NO_CONTEXT_AVAILABLE 1765\n#define RPC_S_INTERNAL_ERROR 1766\n#define RPC_S_ZERO_DIVIDE 1767\n#define RPC_S_ADDRESS_ERROR 1768\n#define RPC_S_FP_DIV_ZERO 1769\n#define RPC_S_FP_UNDERFLOW 1770\n#define RPC_S_FP_OVERFLOW 1771\n#define RPC_X_NO_MORE_ENTRIES 1772\n#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL 1773\n#define RPC_X_SS_CHAR_TRANS_SHORT_FILE 1774\n#define RPC_X_SS_IN_NULL_CONTEXT 1775\n#define RPC_X_SS_CONTEXT_DAMAGED 1777\n#define RPC_X_SS_HANDLES_MISMATCH 1778\n#define RPC_X_SS_CANNOT_GET_CALL_HANDLE 1779\n#define RPC_X_NULL_REF_POINTER 1780\n#define RPC_X_ENUM_VALUE_OUT_OF_RANGE 1781\n#define RPC_X_BYTE_COUNT_TOO_SMALL 1782\n#define RPC_X_BAD_STUB_DATA 1783\n#define RPC_S_CALL_IN_PROGRESS 1791\n#define RPC_S_NO_MORE_BINDINGS 1806\n#define RPC_S_NO_INTERFACES 1817\n#define RPC_S_CALL_CANCELLED 1818\n#define RPC_S_BINDING_INCOMPLETE 1819\n#define RPC_S_COMM_FAILURE 1820\n#define RPC_S_UNSUPPORTED_AUTHN_LEVEL 1821\n#define RPC_S_NO_PRINC_NAME 1822\n#define RPC_S_NOT_RPC_ERROR 1823\n#define RPC_S_UUID_LOCAL_ONLY 1824\n#define RPC_S_SEC_PKG_ERROR 1825\n#define RPC_S_NOT_CANCELLED 1826\n#define RPC_X_INVALID_ES_ACTION 1827\n#define RPC_X_WRONG_ES_VERSION 1828\n#define RPC_X_WRONG_STUB_VERSION 1829\n#define RPC_X_INVALID_PIPE_OBJECT 1830\n#define RPC_X_WRONG_PIPE_ORDER 1831\n#define RPC_X_WRONG_PIPE_VERSION 1832\n#define RPC_S_COOKIE_AUTH_FAILED 1833\n#define RPC_S_GROUP_MEMBER_NOT_FOUND 1898\n#define EPT_S_CANT_CREATE 1899\n#define RPC_S_INVALID_OBJECT 1900\n#define RPC_S_SEND_INCOMPLETE 1913\n#define RPC_S_INVALID_ASYNC_HANDLE 1914\n#define RPC_S_INVALID_ASYNC_CALL 1915\n#define RPC_X_PIPE_CLOSED 1916\n#define RPC_X_PIPE_DISCIPLINE_ERROR 1917\n#define RPC_X_PIPE_EMPTY 1918\n#define RPC_S_ENTRY_TYPE_MISMATCH 1922\n#define RPC_S_NOT_ALL_OBJS_EXPORTED 1923\n#define RPC_S_INTERFACE_NOT_EXPORTED 1924\n#define RPC_S_PROFILE_NOT_ADDED 1925\n#define RPC_S_PRF_ELT_NOT_ADDED 1926\n#define RPC_S_PRF_ELT_NOT_REMOVED 1927\n#define RPC_S_GRP_ELT_NOT_ADDED 1928\n#define RPC_S_GRP_ELT_NOT_REMOVED 1929\n#endif // !defined(_WIN32) && !_defined(__CYGWIN__)\n\n\ntypedef struct {\n\tBYTE   VersionMajor;\n\tBYTE   VersionMinor;\n\tBYTE   PacketType;\n\tBYTE   PacketFlags;\n\tDWORD  DataRepresentation;\n\tWORD   FragLength;\n\tWORD   AuthLength;\n\tDWORD  CallId;\n} /*__packed*/ RPC_HEADER;\n\n\ntypedef struct {\n\tWORD   MaxXmitFrag;\n\tWORD   MaxRecvFrag;\n\tDWORD  AssocGroup;\n\tDWORD  NumCtxItems;\n\tstruct CtxItem {\n\t\tWORD   ContextId;\n\t\tWORD   NumTransItems;\n\t\tGUID   InterfaceUUID;\n\t\tWORD   InterfaceVerMajor;\n\t\tWORD   InterfaceVerMinor;\n\t\tGUID   TransferSyntax;\n\t\tDWORD  SyntaxVersion;\n\t} CtxItems[1];\n} /*__packed*/ RPC_BIND_REQUEST;\n\ntypedef struct {\n\tWORD   MaxXmitFrag;\n\tWORD   MaxRecvFrag;\n\tDWORD  AssocGroup;\n\tWORD   SecondaryAddressLength;\n\tBYTE   SecondaryAddress[6];\n\tDWORD  NumResults;\n\tstruct CtxResults {\n\t\tWORD   AckResult;\n\t\tWORD   AckReason;\n\t\tGUID   TransferSyntax;\n\t\tDWORD  SyntaxVersion;\n\t} Results[0];\n} /*__packed*/ RPC_BIND_RESPONSE;\n\n\ntypedef struct {\n\tDWORD  AllocHint;\n\tWORD   ContextId;\n\tWORD   Opnum;\n\tstruct {\n\t\tDWORD  DataLength;\n\t\tDWORD  DataSizeIs;\n\t} Ndr;\n\tBYTE   Data[0];\n} /*__packed*/ RPC_REQUEST;\n\ntypedef struct {\n\tDWORD  AllocHint;\n\tWORD   ContextId;\n\tBYTE   CancelCount;\n\tBYTE   Pad1;\n\tstruct {\n\t\tDWORD  DataLength;\n\t\tDWORD  DataSizeIs1;\n\t\tDWORD  DataSizeIs2;\n\t} Ndr;\n\tBYTE   Data[0];\n} /*__packed*/ RPC_RESPONSE;\n\ntypedef struct {\n\tDWORD  AllocHint;\n\tWORD   ContextId;\n\tWORD   Opnum;\n\tunion {\n\t\tstruct {\n\t\t\tDWORD  DataLength;\n\t\t\tDWORD  DataSizeIs;\n\t\t\tBYTE   Data[0];\n\t\t} Ndr;\n\t\tstruct {\n\t\t\tuint64_t DataLength;\n\t\t\tuint64_t DataSizeIs;\n\t\t\tBYTE     Data[0];\n\t\t} Ndr64;\n\t};\n} /*__packed*/ RPC_REQUEST64;\n\ntypedef struct {\n\tDWORD  AllocHint;\n\tWORD   ContextId;\n\tBYTE   CancelCount;\n\tBYTE   Pad1;\n\tunion {\n\t\tstruct {\n\t\t\tDWORD  DataLength;\n\t\t\tDWORD  DataSizeMax;\n\t\t\tunion\n\t\t\t{\n\t\t\t\tDWORD DataSizeIs;\n\t\t\t\tDWORD status;\n\t\t\t};\n\t\t\tBYTE   Data[0];\n\t\t} Ndr;\n\t\tstruct {\n\t\t\tuint64_t DataLength;\n\t\t\tuint64_t DataSizeMax;\n\t\t\tunion\n\t\t\t{\n\t\t\t\tuint64_t DataSizeIs;\n\t\t\t\tDWORD    status;\n\t\t\t};\n\t\t\tBYTE     Data[0];\n\t\t} Ndr64;\n\t\tstruct\n\t\t{\n\t\t\tDWORD Code;\n\t\t\tDWORD Padding;\n\t\t} Error;\n\n\t};\n} /*__packed*/ RPC_RESPONSE64;\n\n\n//#define RpcCtx SOCKET\ntypedef SOCKET RpcCtx;\ntypedef int RpcStatus;\n\n#define RPC_INVALID_CTX ((WORD)~0)\n\n#define RPC_BIND_ACCEPT (0)\n#define RPC_BIND_NACK   (LE16(2))\n#define RPC_BIND_ACK    (LE16(3))\n\n#define RPC_SYNTAX_UNSUPPORTED         (LE16(2))\n#define RPC_ABSTRACTSYNTAX_UNSUPPORTED (LE16(1))\n#define RPC_NCA_UNK_IF                 (LE32(0x1c010003))\n#define RPC_NCA_PROTO_ERROR            (LE32(0x1c01000b))\n\n#define RPC_BTFN_SEC_CONTEXT_MULTIPLEX (LE16(1))\n#define RPC_BTFN_KEEP_ORPHAN           (LE16(2))\n\n#define INVALID_RPCCTX INVALID_SOCKET\n#define closeRpc socketclose\n\n#define RPC_PT_REQUEST            0\n#define RPC_PT_RESPONSE           2\n#define RPC_PT_FAULT              3\n#define RPC_PT_BIND_REQ          11\n#define RPC_PT_BIND_ACK          12\n#define RPC_PT_ALTERCONTEXT_REQ  14\n#define RPC_PT_ALTERCONTEXT_ACK  15\n\n#define RPC_PF_FIRST\t\t\t  1\n#define RPC_PF_LAST\t\t\t\t  2\n#define RPC_PF_CANCEL_PENDING\t  4\n#define RPC_PF_RESERVED\t\t\t  8\n#define RPC_PF_MULTIPLEX\t\t 16\n#define RPC_PF_NOT_EXEC\t\t\t 32\n#define RPC_PF_MAYBE\t\t\t 64\n#define RPC_PF_OBJECT\t\t\t128\n\n\ntypedef union _RPC_FLAGS\n{\n\tDWORD mask;\n\tstruct {\n\t\tuint32_t FlagsBTFN : 16;\n\t\tBOOL HasNDR32 : 1;\n\t\tBOOL HasNDR64 : 1;\n\t\tBOOL HasBTFN : 1;\n\t};\n} RPC_FLAGS, *PRPC_FLAGS;\n\nextern RPC_FLAGS RpcFlags;\n\nvoid rpcServer(const SOCKET sock, const DWORD rpcAssocGroup, const char* const ipstr);\nRpcStatus rpcBindClient(const RpcCtx sock, const int_fast8_t verbose, PRpcDiag_t rpcDiag);\nRpcStatus rpcSendRequest(const RpcCtx socket, const BYTE *const kmsRequest, const size_t requestSize, BYTE **kmsResponse, size_t *const responseSize);\n\n#endif // __rpc_h\n"
  },
  {
    "path": "src/shared_globals.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include \"shared_globals.h\"\n\nint global_argc, multi_argc = 0;\nCARGV global_argv, multi_argv = NULL;\nconst char *const Version = VERSION;\nDWORD VLActivationInterval = 60 * 2;   // 2 hours\nDWORD VLRenewalInterval = 60 * 24 * 7; // 7 days\nint_fast8_t DisconnectImmediately = FALSE;\nconst char *const cIPv4 = \"IPv4\";\nconst char *const cIPv6 = \"IPv6\";\n\n#ifdef IS_LIBRARY\nchar ErrorMessage[MESSAGE_BUFFER_SIZE];\n#endif // IS_LIBRARY\n\n#ifndef NO_STRICT_MODES\nuint32_t WhitelistingLevel = 0;\nint_fast8_t CheckClientTime = FALSE;\n#ifndef NO_CLIENT_LIST\nint_fast8_t MaintainClients = FALSE;\nint_fast8_t StartEmpty = FALSE;\n#endif // NO_CLIENT_LIST\n#endif // !NO_STRICT_MODES\n\n#ifndef USE_MSRPC\nint_fast8_t UseMultiplexedRpc = TRUE;\n#ifndef SIMPLE_RPC\nint_fast8_t UseServerRpcNDR64 = TRUE;\nint_fast8_t UseServerRpcBTFN = TRUE;\n#endif // !SIMPLE_RPC\nint_fast8_t UseClientRpcNDR64 = TRUE;\nint_fast8_t UseClientRpcBTFN = TRUE;\n#endif // USE_MSRPC\n\n#ifndef NO_SOCKETS\nchar *defaultport = (char*)\"1688\";\n#endif // NO_SOCKETS\n\n#if !defined(NO_PRIVATE_IP_DETECT)\nuint32_t PublicIPProtectionLevel = 0;\n#endif\n\n#if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\nKmsResponseParam_t* KmsResponseParameters;\n#endif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\n\n#if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\nint_fast8_t IsRestarted = FALSE;\n#endif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\n#if !defined(NO_TIMEOUT) && !__minix__\nDWORD ServerTimeout = 30;\n#endif // !defined(NO_TIMEOUT) && !__minix__\n\n#if !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\n#ifdef USE_MSRPC\nuint32_t MaxTasks = RPC_C_LISTEN_MAX_CALLS_DEFAULT;\n#else // !USE_MSRPC\nuint32_t MaxTasks = SEM_VALUE_MAX;\n#endif // !USE_MSRPC\n#endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\n\n#ifndef NO_LOG\nint_fast8_t LogDateAndTime = TRUE;\nchar *fn_log = NULL;\nint_fast8_t logstdout = 0;\n#ifndef NO_VERBOSE_LOG\nint_fast8_t logverbose = 0;\n#endif // NO_VERBOSE_LOG\n#endif // NO_LOG\n\n#ifndef NO_SOCKETS\nint_fast8_t ExitLevel = 0;\n\n#ifndef _WIN32\nint_fast8_t nodaemon = 0;\n#endif // _WIN32\nint_fast8_t InetdMode = 0;\n#else\n#ifndef _WIN32\nint_fast8_t nodaemon = 1;\n#endif // _WIN32\nint_fast8_t InetdMode = 1;\n#endif // NO_SOCKETS\n\nPVlmcsdHeader_t KmsData = NULL;\n#ifndef NO_EXTERNAL_DATA\n#ifndef DATA_FILE\nchar *fn_data = NULL;\n#else // DATA_FILE\nchar *fn_data = DATA_FILE;\n#endif // DATA_FILE\n#ifndef NO_INTERNAL_DATA\nint_fast8_t ExplicitDataLoad = FALSE;\n#endif // NO_INTERNAL_DATA\n#endif // NO_EXTERNAL_DATA\nconst char *fn_exe = NULL;\n\n#ifndef NO_RANDOM_EPID\nint_fast8_t RandomizationLevel = 1;\nuint16_t Lcid = 0;\nuint16_t HostBuild = 0;\n#endif\n\n#if !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\nuint8_t IsNDR64Defined = FALSE;\n#endif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\n\n\n#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n#ifdef SIMPLE_SOCKETS\nSOCKET s_server;\n#else\nSOCKET *SocketList;\nint numsockets = 0;\n#endif\n\n#if !defined(NO_LIMIT) && !__minix__\n#ifndef _WIN32 // Posix\nsem_t *MaxTaskSemaphore;\n#else // _WIN32\nHANDLE MaxTaskSemaphore;\n#endif // _WIN32\n\n#endif // !defined(NO_LIMIT) && !__minix__\n#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n#ifdef _NTSERVICE\nint_fast8_t IsNTService = TRUE;\nint_fast8_t ServiceShutdown = FALSE;\n#endif // _NTSERVICE\n\n#ifndef NO_LOG\n#ifdef USE_THREADS\n#if !defined(_WIN32) && !defined(__CYGWIN__)\npthread_mutex_t logmutex = PTHREAD_MUTEX_INITIALIZER;\n#else\nCRITICAL_SECTION logmutex;\n#endif // !defined(_WIN32) && !defined(__CYGWIN__)\n#endif // USE_THREADS\n#endif // NO_LOG\n\n#if HAVE_FREEBIND\nint_fast8_t freebind = FALSE;\n#endif // HAVE_FREEBIND\n\n\n\n\n\n"
  },
  {
    "path": "src/shared_globals.h",
    "content": "#ifndef INCLUDED_SHARED_GLOBALS_H\n#define INCLUDED_SHARED_GLOBALS_H\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#include <sys/types.h>\n\n#ifndef _WIN32\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n#include <netdb.h>\n#include <pwd.h>\n#include <grp.h>\n#include <syslog.h>\n#if !__minix__\n#include <pthread.h>\n#endif // !__minix__\n#include <fcntl.h>\n#include <sys/stat.h>\n#if !defined(NO_LIMIT) && !__minix__\n#include <semaphore.h>\n#endif // !defined(NO_LIMIT) && !__minix__\n#else\n//#ifndef USE_MSRPC\n#include <winsock2.h>\n#include <ws2tcpip.h>\n//#endif // USE_MSRPC\n#include <windows.h>\n#endif\n\n#include <signal.h>\n#if !_MSC_VER\n#include <unistd.h>\n#endif\n#include <time.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n#include <limits.h>\n#include <ctype.h>\n#include <stdarg.h>\n//#include <semaphore.h>\n#include \"types.h\"\n#include \"kms.h\"\n\n//#define MIN_CSVLK 6\ntypedef struct\n{\n\tconst char* Epid;\n\tconst BYTE* HwId;\n\t#ifndef NO_LOG\n\tconst char* EpidSource;\n\tuint8_t IsRandom;\n\t#endif // NO_LOG\n} KmsResponseParam_t, *PKmsResponseParam_t;\n\ntypedef struct\n{\n\tint8_t HasRpcDiag;\n\tint8_t HasBTFN;\n\tint8_t HasNDR64;\n} RpcDiag_t, *PRpcDiag_t;\n\n#if !defined(NO_LIMIT) && !__minix__\n#ifndef SEM_VALUE_MAX // Android does not define this\n#ifdef __ANDROID__\n#define SEM_VALUE_MAX 0x3fffffff\n#elif defined(_WIN32)\n#define SEM_VALUE_MAX 0x7fffffff\n#else\n#define SEM_VALUE_MAX 0x7fff // Be cautious if unknown\n#endif // __ANDROID__\n#endif // !defined(SEM_VALUE_MAX)\n#endif // !defined(NO_LIMIT) && !__minix__\n\nextern const char *const Version;\n\n//Fix for stupid eclipse parser\n#ifndef UINT_MAX\n#define UINT_MAX 4294967295\n#endif\n\n#define MESSAGE_BUFFER_SIZE 4096\n#ifdef IS_LIBRARY\nextern char ErrorMessage[MESSAGE_BUFFER_SIZE];\n#endif // IS_LIBRARY\n\nextern int global_argc, multi_argc;\nextern CARGV global_argv, multi_argv;\n#ifndef _WIN32\nextern int_fast8_t nodaemon;\n#endif // _WIN32\nextern DWORD VLActivationInterval;\nextern DWORD VLRenewalInterval;\nextern int_fast8_t DisconnectImmediately;\n#if !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\nextern KmsResponseParam_t* KmsResponseParameters;\n#endif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\nextern const char *const cIPv4;\nextern const char *const cIPv6;\nextern int_fast8_t InetdMode;\nextern PVlmcsdHeader_t KmsData;\n#ifndef NO_EXTERNAL_DATA\nextern char* fn_data;\n#ifndef NO_INTERNAL_DATA\nextern int_fast8_t ExplicitDataLoad;\n#endif // NO_INTERNAL_DATA\n#endif // NO_EXTERNAL_DATA\nextern const char* fn_exe;\n\n#ifndef NO_STRICT_MODES\nextern uint32_t WhitelistingLevel;\nextern int_fast8_t CheckClientTime;\n#ifndef NO_CLIENT_LIST\nextern int_fast8_t MaintainClients;\nextern int_fast8_t StartEmpty;\n#endif // NO_CLIENT_LIST\n#endif // !NO_STRICT_MODES\n\n\n#ifndef USE_MSRPC\nextern int_fast8_t UseMultiplexedRpc;\n#ifndef SIMPLE_RPC\nextern int_fast8_t UseServerRpcNDR64;\nextern int_fast8_t UseServerRpcBTFN;\n#endif // !SIMPLE_RPC\nextern int_fast8_t UseClientRpcNDR64;\nextern int_fast8_t UseClientRpcBTFN;\n#endif // USE_MSRPC\n\n#ifndef NO_SOCKETS\nextern int_fast8_t ExitLevel;\nextern char *defaultport;\n#endif // NO_SOCKETS\n\n#if !defined(NO_PRIVATE_IP_DETECT)\nextern uint32_t PublicIPProtectionLevel;\n#endif\n\n#if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\nextern int_fast8_t IsRestarted;\n#endif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\n#if !defined(NO_TIMEOUT) && !__minix__\nextern DWORD ServerTimeout;\n#endif // !defined(NO_TIMEOUT) && !__minix__\n\n#if !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\nextern uint32_t MaxTasks;\n#endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\n\n#ifndef NO_LOG\nextern int_fast8_t LogDateAndTime;\nextern char *fn_log;\nextern int_fast8_t logstdout;\n#ifndef NO_VERBOSE_LOG\nextern int_fast8_t logverbose;\n#endif\n#endif\n\n#if !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\nextern uint8_t IsNDR64Defined;\n#endif \n\n#ifndef NO_RANDOM_EPID\nextern int_fast8_t RandomizationLevel;\nextern uint16_t Lcid;\nextern uint16_t HostBuild;\n#endif\n\n#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n#if defined(SIMPLE_SOCKETS)\nextern SOCKET s_server;\n#else // !defined(SIMPLE_SOCKETS)\nextern SOCKET *SocketList;\nextern int numsockets;\n#endif // !defined(SIMPLE_SOCKETS)\n\n#if !defined(NO_LIMIT) && !__minix__\n\n#ifndef _WIN32\nextern sem_t *MaxTaskSemaphore;\n#else // _WIN32\nextern HANDLE MaxTaskSemaphore;\n#endif // _WIN32\n\n#endif // !defined(NO_LIMIT) && !__minix__\n\n#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n#ifdef _NTSERVICE\nextern int_fast8_t IsNTService;\nextern int_fast8_t ServiceShutdown;\n#endif\n\n#ifndef NO_LOG\n#ifdef USE_THREADS\n#if !defined(_WIN32) && !defined(__CYGWIN__)\nextern pthread_mutex_t logmutex;\n#else\nextern CRITICAL_SECTION logmutex;\n#endif // _WIN32\n#endif // USE_THREADS\n#endif // NO_LOG\n\n#if HAVE_FREEBIND\nextern int_fast8_t freebind;\n#endif // HAVE_FREEBIND\n\n\n#endif // INCLUDED_SHARED_GLOBALS_H\n"
  },
  {
    "path": "src/tap-windows.h",
    "content": "/*\n *  TAP-Windows -- A kernel driver to provide virtual tap\n *                 device functionality on Windows.\n *\n *  This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.\n *\n *  This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc.,\n *  and is released under the GPL version 2 (see below). This particular file\n *  (tap-windows.h) is also licensed using the MIT license (see COPYRIGHT.MIT).\n *\n *  This program is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License version 2\n *  as published by the Free Software Foundation.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program (see the file COPYING included with this\n *  distribution); if not, write to the Free Software Foundation, Inc.,\n *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n */\n#ifndef __TAP_WIN_H\n#define __TAP_WIN_H\n\n/*\n * =============\n * TAP IOCTLs\n * =============\n */\n\n#define TAP_WIN_CONTROL_CODE(request,method) \\\n  CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)\n\n/* Present in 8.1 */\n\n#define TAP_WIN_IOCTL_GET_MAC               TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_GET_VERSION           TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_GET_MTU               TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_GET_INFO              TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_SET_MEDIA_STATUS      TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ      TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_GET_LOG_LINE          TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED)\n#define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT   TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED)\n\n/* Added in 8.2 */\n\n/* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */\n#define TAP_WIN_IOCTL_CONFIG_TUN            TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED)\n\n/*\n * =================\n * Registry keys\n * =================\n */\n\n#define ADAPTER_KEY \"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Class\\\\{4D36E972-E325-11CE-BFC1-08002BE10318}\"\n\n#define NETWORK_CONNECTIONS_KEY \"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Network\\\\{4D36E972-E325-11CE-BFC1-08002BE10318}\"\n\n/*\n * ======================\n * Filesystem prefixes\n * ======================\n */\n\n#define USERMODEDEVICEDIR \"\\\\\\\\.\\\\Global\\\\\"\n#define SYSDEVICEDIR      \"\\\\Device\\\\\"\n#define USERDEVICEDIR     \"\\\\DosDevices\\\\Global\\\\\"\n#define TAP_WIN_SUFFIX    \".tap\"\n\n#endif // __TAP_WIN_H\n\n\n"
  },
  {
    "path": "src/types.h",
    "content": "#ifndef __types_h\n#define __types_h\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n\n#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if defined(NO_INTERNAL_DATA) && defined(NO_EXTERNAL_DATA)\n#error NO_INTERAL_DATA and NO_EXTERNAL_DATA cannot be used together\n#endif\n\n#if defined(_WIN32)\n\n//#ifndef USE_MSRPC\n#include <winsock2.h>\n//#include <ws2tcpip.h>\n//#endif // USE_MSRPC\n#endif // defined(_WIN32)\n\n#define ANDROID_API_LEVEL ANDROID_HELPER1(__ANDROID_API__)\n#define ANDROID_HELPER1(s) ANDROID_HELPER2(s)\n#define ANDROID_HELPER2(s) #s\n\n#if !_WIN32 && !__CYGWIN__\n\n#if !__minix__\n#include <pthread.h>\n#endif // !__minix__\n\n#define __declspec(x) __attribute__((__visibility__(\"default\")))\n#endif\n\n#if !defined(EXTERNAL)\n#define EXTERNAL dllimport\n#endif\n\n#ifdef __cplusplus\n#define EXTERNC extern \"C\"\n#else\n#define EXTERNC\n#endif\n\n#include <stdlib.h>\n//#include <limits.h>\n#include <stdint.h>\n\n#ifdef __ANDROID__\n#include <android/api-level.h>\n#endif // __ANDROID__\n\n#ifndef _WIN32\n#include <unistd.h>\n#include <netinet/in.h>\n#endif // _WIN32\n\n\n#if __linux__ // Some versions of uclibc do not define IP_FREEBIND in the correct header file\n#ifndef IP_FREEBIND\n#define IP_FREEBIND 15\n#endif // IP_FREEBIND\n#endif // __linux__\n\n#ifdef NO_EXTERNAL_DATA\n#ifndef UNSAFE_DATA_LOAD\n#define UNSAFE_DATA_LOAD\n#endif // UNSAFE_DATA_LOAD\n#endif // NO_EXTERNAL_DATA\n\n#if (IP_BINDANY || IP_FREEBIND || IPV6_BINDANY || IP_NONLOCALOK) && !defined(NO_FREEBIND) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n#define HAVE_FREEBIND 1\n#endif\n\n#if !defined(NO_GETIFADDRS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS) && !defined(NO_SOCKETS) && !defined(NO_PRIVATE_IP_DETECT) \n#define HAVE_GETIFADDR 1\n#endif\n\n//#if (__minix__ || defined(NO_SOCKETS)) && !defined(NO_STRICT_MODES)\n//#define NO_STRICT_MODES\n//#endif // __minix__ && !defined(NO_STRICT_MODES)\n\n#if (defined(NO_STRICT_MODES) || defined(NO_SOCKETS)) && !defined(NO_CLIENT_LIST)\n#define NO_CLIENT_LIST\n#endif // defined(NO_STRICT_MODES) || defined(NO_SOCKETS) && !defined(NO_CLIENT_LIST)\n\n#if !_WIN32 && !__CYGWIN__\n\n#if !defined(_POSIX_THREADS) || (!defined(_POSIX_THREAD_PROCESS_SHARED) && !defined(USE_THREADS) && !__ANDROID__)\n#ifndef NO_CLIENT_LIST\n#define NO_CLIENT_LIST\n#endif // !NO_CLIENT_LIST\n#endif // !defined(_POSIX_THREADS) || (!defined(_POSIX_THREAD_PROCESS_SHARED) && !defined(USE_THREADS))\n\n#if !defined(_POSIX_THREADS) && !defined(NO_LIMIT)\n#define NO_LIMIT\n#endif // !defined(POSIX_THREADS) && !defined(NO_LIMIT)\n\n#endif // !_WIN32 && !__CYGWIN__\n\n#ifndef alloca\n#ifdef __GNUC__\n#define alloca(x) __builtin_alloca(x)\n#endif // __GNUC__\n#endif // alloca\n\n\n#ifndef alloca\n#ifdef __has_builtin // clang feature test\n#if __has_builtin(__builtin_alloca)\n#define alloca(x) __builtin_alloca(x)\n#endif // __has_builtin(__builtin_alloca)\n#endif // __has_builtin\n#endif // alloca\n\n#ifndef alloca\n#if !_MSC_VER\n#include <alloca.h>\n#else\n#include <malloc.h>\n//#define alloca _malloca\n#endif\n//#define alloca _malloca\n//#endif // _MSC_VER\n#endif // alloca\n\n#ifndef __packed\n#if _MSC_VER\n#define __packed\n#else // !_MSC_VER\n#define __packed  __attribute__((packed))\n#endif // !_MSC_VER\n#endif\n\n#ifndef __pure\n#if _MSC_VER\n#define __pure\n#else\n#define __pure\t  __attribute__((pure))\n#endif\n#endif\n\n#ifndef __noreturn\n#if _MSC_VER\n#define __noreturn __declspec(noreturn)\n#else\n#define __noreturn\t__attribute__((noreturn))\n#endif\n#endif\n\n#define restrict\t__restrict\n\ntypedef struct __packed\n{\n\tuint16_t val[0];\n} PACKED16;\n\ntypedef struct __packed\n{\n\tuint32_t val[0];\n} PACKED32;\n\ntypedef struct __packed\n{\n\tuint64_t val[0];\n} PACKED64;\n\n// Deal with Mingw32-w64 C++ header which defines a _countof that is incompatible with vlmcsd\n#define vlmcsd_countof(x)\t( sizeof(x) / sizeof(x[0]) )\n\n// PATH_MAX is optional in Posix. We use a default of 260 here\n#ifndef PATH_MAX\n#ifdef _WIN32\n#define PATH_MAX MAX_PATH\n#else\n#define PATH_MAX 260\n#endif // _WIN32\n#endif // !PATH_MAX\n\n#if PATH_MAX > 260\n#define VLMCSD_PATH_MAX 260\n#else\n#define VLMCSD_PATH_MAX PATH_MAX\n#endif\n\n// Synchronization Objects\n\n// Mutexes\n#ifdef USE_THREADS\n#if !defined(_WIN32) && !defined(__CYGWIN__)\n#define lock_mutex(x) pthread_mutex_lock(x)\n#define unlock_mutex(x) pthread_mutex_unlock(x)\n#else\n#define lock_mutex(x) EnterCriticalSection(x)\n#define unlock_mutex(x) LeaveCriticalSection(x)\n#endif\n#else // !USE_THREADS\n//defines to nothing\n#define lock_mutex(x)\n#define unlock_mutex(x)\n#endif // !USE_THREADS\n\n// Semaphores\n#ifndef _WIN32\n#define semaphore_wait(x) sem_wait(x)\n#define semaphore_post(x) sem_post(x)\n#else // _WIN32\n#define semaphore_wait(x) WaitForSingleObject(x, INFINITE)\n#define semaphore_post(x) ReleaseSemaphore(x, 1, NULL)\n#endif // _WIN32\n\n// Stupid MingW just uses rand() from msvcrt.dll which uses RAND_MAX of 0x7fff\n#if RAND_MAX < 0x7fffffff\n#define rand32() ((uint32_t)((rand() << 17) | (rand() << 2) | (rand() & 3)))\n#elif RAND_MAX < 0xffffffff\n#define rand32(x) ((uint32_t)((rand(x) << 1) | (rand(x) & 1)))\n#else\n#define rand32(x) (uint32_t)rand(x)\n#endif\n\n#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(NO_SOCKETS)\n#define _NTSERVICE\n#else\n#ifndef NO_TAP\n#define NO_TAP\n#endif\n#endif\n\n#if (defined(__CYGWIN__) || defined(_WIN32) || defined(NO_SOCKETS)) && !defined(NO_SIGHUP)\n#define NO_SIGHUP\n#endif // (defined(__CYGWIN__) || defined(_WIN32) || defined(NO_SOCKETS)) && !defined(NO_SIGHUP)\n\n#ifdef _WIN32\n#ifndef USE_THREADS\n#define USE_THREADS\n#endif\n#endif\n\n#if defined(USE_THREADS)\n#define _TLS __thread\n#else\n#define _TLS\n#endif\n\n#define GUID_STRING_LENGTH 36\n\n#if defined(_WIN32)\n#include <windows.h>\n//#include <VersionHelpers.h>\n\ntypedef char* sockopt_t;\n/* Unknown Winsock error codes */\n#define WSAENODEV -1\n\n// Map VLMCSD error codes to WSAGetLastError() and GetLastError() codes\n// Add more if you need them\n#define SOCKET_EADDRINUSE WSAEADDRINUSE\n#define SOCKET_ENODEV WSAENODEV\n#define SOCKET_EADDRNOTAVAIL WSAEADDRNOTAVAIL\n#define SOCKET_EACCES WSAEACCES\n#define SOCKET_EINVAL WSAEINVAL\n#define SOCKET_ENOTSOCK WSAENOTSOCK\n#define SOCKET_EINTR WSAEINTR\n#define SOCKET_EINPROGRESS WSAEINPROGRESS\n#define SOCKET_ECONNABORTED WSAECONNABORTED\n#define SOCKET_EALREADY WSAEALREADY\n\n#define VLMCSD_EACCES ERROR_ACCESS_DENIED\n#define VLMCSD_EINVAL ERROR_INVALID_PARAMETER\n#define VLMCSD_ENOMEM ERROR_OUTOFMEMORY\n#define VLMCSD_EPERM ERROR_CAN_NOT_COMPLETE\n\n\n#define socket_errno WSAGetLastError()\n#define socketclose(x) (closesocket(x))\n#define vlmcsd_strerror(x) win_strerror(x)\n#define VLMCSD_SHUT_RD SD_RECEIVE\n#define VLMCSD_SHUT_WR SD_SEND\n#define VLMCSD_SHUT_RDWR SD_BOTH\n\n#elif defined(__CYGWIN__)\n#include <windows.h>\n\n\n// Resolve conflicts between OpenSSL and MS Crypto API\n#ifdef _CRYPTO_OPENSSL\n#undef OCSP_RESPONSE\n#undef X509_NAME\n#endif\n\n#else\ntypedef uint32_t\t\tDWORD;\ntypedef uint16_t\t\tWORD;\ntypedef uint8_t\t\t\tBYTE;\ntypedef uint16_t\t\tWCHAR;\ntypedef int32_t         BOOL;\ntypedef int32_t\t\t\tHRESULT;\n#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)\n#define FAILED(hr) (((HRESULT)(hr)) < 0)\n#define S_OK\t((HRESULT)0)\n\n\n#define FALSE  0\n#define TRUE   !0\n\ntypedef struct {\n\tDWORD  Data1;\n\tWORD   Data2;\n\tWORD   Data3;\n\tBYTE   Data4[8];\n} /*__packed*/ GUID;\n\ntypedef struct {\n\tDWORD  dwLowDateTime;\n\tDWORD  dwHighDateTime;\n} /*__packed*/ FILETIME;\n\n#endif // defined(__CYGWIN__)\n\n#ifndef _WIN32\n// Map VLMCSD error codes to POSIX codes\n// Add more if you need them\n#define SOCKET_EADDRINUSE EADDRINUSE\n#define SOCKET_ENODEV ENODEV\n#define SOCKET_EADDRNOTAVAIL EADDRNOTAVAIL\n#define SOCKET_EACCES EACCES\n#define SOCKET_EINVAL EINVAL\n#define SOCKET_ENOTSOCK ENOTSOCK\n#define SOCKET_EINTR EINTR\n#define SOCKET_EINPROGRESS EINPROGRESS\n#define SOCKET_ECONNABORTED ECONNABORTED\n#define SOCKET_EALREADY EALREADY\n\n#define VLMCSD_EACCES EACCES\n#define VLMCSD_EINVAL EINVAL\n#define VLMCSD_EINTR EINTR\n#define VLMCSD_ENOMEM ENOMEM\n#define VLMCSD_EPERM EPERM\n\ntypedef void* sockopt_t;\n#define _countof(x)        ( sizeof(x) / sizeof(x[0]) )\n#define SOCKET int\n#define INVALID_SOCKET -1\n#define socket_errno errno\n#define socketclose(x) (close(x))\n#define vlmcsd_strerror strerror\n#define VLMCSD_SHUT_RD SHUT_RD\n#define VLMCSD_SHUT_WR SHUT_WR\n#define VLMCSD_SHUT_RDWR SHUT_RDWR\n\n#endif // __MINGW__\n#define INVALID_UID ((uid_t)~0)\n#define INVALID_GID ((gid_t)~0)\n\n#undef IsEqualGUID\n#define IsEqualGUID(a, b)  ( !memcmp(a, b, sizeof(GUID)) )\n\n#if !defined(__stdcall) && !_MSC_VER\n#define __stdcall\n#endif\n\n#if !defined(__cdecl) && !_MSC_VER\n#define __cdecl\n#endif\n\ntypedef const char *const * CARGV;\n\ntypedef struct {\n\tSOCKET socket;\n\tDWORD RpcAssocGroup;\n} CLDATA, *const PCLDATA;\n\n\n#ifdef _MSC_VER\n#define strcasecmp _stricmp\n#define strncasecmp _strnicmp\n#define vlmcsd_snprintf _snprintf\n#define vlmcsd_vsnprintf _vsnprintf\n#define vlmcsd_unlink DeleteFile\n#define vlmcsd_strtoll _strtoi64\n#else // !_MSC_VER\n#define vlmcsd_snprintf snprintf\n#define vlmcsd_vsnprintf vsnprintf\n#define vlmcsd_strtoll strtoll\n#define vlmcsd_unlink unlink\n#endif  // !_MSC_VER\n\n#endif // __types_h\n"
  },
  {
    "path": "src/vlmcs.c",
    "content": "#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n\n#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#include \"vlmcs.h\"\n#if _MSC_VER\n#include <Shlwapi.h>\n#endif\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n#include <stdint.h>\n#if _MSC_VER\n#include \"wingetopt.h\"\n#else\n#include <getopt.h>\n#endif\n#include <sys/types.h>\n#include <sys/stat.h>\n#ifndef _MSC_VER\n#include <unistd.h>\n#endif\n#ifndef _WIN32\n#include <sys/ioctl.h>\n#include <termios.h>\n#else // _WIN32\n#endif // _WIN32\n#include \"endian.h\"\n#include \"shared_globals.h\"\n#include \"output.h\"\n#ifndef USE_MSRPC\n#include \"network.h\"\n#include \"rpc.h\"\n#else // USE_MSRPC\n#include \"msrpc-client.h\"\n#endif // USE_MSRPC\n#include \"kms.h\"\n#include \"helpers.h\"\n#include \"dns_srv.h\"\n\n\n#define VLMCS_OPTION_GRAB_INI 1\n#define VLMCS_OPTION_NO_GRAB_INI 2\n\n#ifndef IS_LIBRARY\n\n// Function Prototypes\nstatic void CreateRequestBase(REQUEST *Request);\n\n\n// KMS Parameters\n#ifndef NO_VERBOSE_LOG\nstatic int_fast8_t verbose = FALSE;\n#endif\n\nstatic int_fast8_t VMInfo = FALSE;\nstatic int_fast8_t dnsnames = TRUE;\nstatic int FixedRequests = 0;\nstatic DWORD LicenseStatus = 0x02;\nstatic const char *CMID = NULL;\nstatic const char *CMID_prev = NULL;\nstatic const char *WorkstationName = NULL;\nstatic int BindingExpiration = 43200; //30 days\nstatic const char *RemoteAddr;\nstatic int_fast8_t ReconnectForEachRequest = FALSE;\n#ifndef USE_MSRPC\nstatic int AddressFamily = AF_UNSPEC;\n#else\nstatic int AddressFamily = 0;\n#endif // USE_MSRPC\nstatic int_fast8_t incompatibleOptions = 0;\nstatic const char* fn_ini_client = NULL;\n//static int_fast16_t kmsVersionMinor = 0;\n//static const char* ePidGroup[] = { \"Windows\", \"Office2010\", \"Office2013\", \"Office2016\" };\nstatic int32_t ActiveProductIndex = 0;\nstatic int32_t NCountPolicy = 0;\nstatic GUID AppGuid, KmsGuid, SkuGuid;\nstatic uint16_t MinorVersion = 0;\nstatic uint16_t MajorVersion;\n\n#ifndef NO_DNS\nstatic int_fast8_t NoSrvRecordPriority = FALSE;\n#endif // NO_DNS\n\n\n//typedef char iniFileEpidLines[4][256];\n\ntypedef struct\n{\n\tconst char* first[16];\n\tconst char* second[16];\n\tconst char* tld[22];\n} DnsNames;\n\n\n// Some names for the DNS name random generator\nstatic DnsNames ClientDnsNames =\n{\n\t{ \"www\", \"ftp\", \"kms\", \"hack-me\", \"smtp\", \"ns1\", \"mx1\", \"ns1\", \"pop3\", \"imap\", \"mail\", \"dns\", \"headquarter\", \"we-love\", \"_vlmcs._tcp\", \"ceo-laptop\" },\n\t{ \".microsoft\", \".apple\", \".amazon\", \".samsung\", \".adobe\", \".google\", \".yahoo\", \".facebook\", \".ubuntu\", \".oracle\", \".borland\", \".htc\", \".acer\", \".windows\", \".linux\", \".sony\" },\n\t{ \".com\", \".net\", \".org\", \".cn\", \".co.uk\", \".de\", \".com.tw\", \".us\", \".fr\", \".it\", \".me\", \".info\", \".biz\", \".co.jp\", \".ua\", \".at\", \".es\", \".pro\", \".by\", \".ru\", \".pl\", \".kr\" }\n};\n\n// Request Count Control Variables\nstatic int RequestsToGo = 1;\nstatic BOOL firstRequestSent = FALSE;\n\n\nstatic void string2UuidOrExit(const char *const restrict input, GUID *const restrict guid)\n{\n\tif (strlen(input) != GUID_STRING_LENGTH || !string2UuidLE(input, guid))\n\t{\n\t\terrorout(\"Fatal: Command line contains an invalid GUID.\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n}\n\n\n#ifndef NO_HELP\n\n__noreturn static void clientUsage(const char* const programName)\n{\n\terrorout(\n\t\t\"vlmcs %s \\n\\n\"\n#\t\tifndef NO_DNS\n\t\t\"Usage: %s [options] [ <host>[:<port>] | .<domain> | - ] [options]\\n\\n\"\n#\t\telse // DNS\n\t\t\"Usage: %s [options] [<host>[:<port>]] [options]\\n\\n\"\n#\t\tendif // DNS\n\n\t\t\"Options:\\n\\n\"\n\n#\t\tifndef NO_VERBOSE_LOG\n\t\t\"  -v Be verbose\\n\"\n#\t\tendif\n\t\t\"  -l <app>\\n\"\n\t\t\"  -4 Force V4 protocol\\n\"\n\t\t\"  -5 Force V5 protocol\\n\"\n\t\t\"  -6 Force V6 protocol\\n\"\n#\t\tifndef USE_MSRPC\n\t\t\"  -i <IpVersion> Use IP protocol (4 or 6)\\n\"\n#\t\tendif // USE_MSRPC\n#\t\tifndef NO_EXTERNAL_DATA\n\t\t\"  -j <file> Load external KMS data file <file>\\n\"\n#\t\tendif // NO_EXTERNAL_DATA\n\t\t\"  -e Show some valid examples\\n\"\n\t\t\"  -x Show valid Apps\\n\"\n\t\t\"  -d no DNS names, use Netbios names (no effect if -w is used)\\n\"\n\t\t\"  -V show version information and exit\\n\\n\"\n\n\t\t\"Advanced options:\\n\\n\"\n\n\t\t\"  -a <AppGUID> Use custom Application GUID\\n\"\n\t\t\"  -s <ActGUID> Use custom Activation Configuration GUID\\n\"\n\t\t\"  -k <KmsGUID> Use custom KMS GUID\\n\"\n\t\t\"  -c <ClientGUID> Use custom Client GUID. Default: Use random\\n\"\n\t\t\"  -o <PreviousClientGUID> Use custom Prevoius Client GUID. Default: ZeroGUID\\n\"\n\t\t\"  -K <ProtocolVersion> Use a specific (possibly invalid) protocol version\\n\"\n\t\t\"  -w <Workstation> Use custom workstation name. Default: Use random\\n\"\n\t\t\"  -r <RequiredClientCount> Fake required clients\\n\"\n\t\t\"  -n <Requests> Fixed # of requests (Default: Enough to charge)\\n\"\n\t\t\"  -m Pretend to be a virtual machine\\n\"\n\t\t\"  -G <file> Get ePID/HwId data and write to <file>. Can't be used with -l, -4, -5, -6, -a, -s, -k, -r and -n\\n\"\n#\t\tifndef USE_MSRPC\n\t\t\"  -T Use a new TCP connection for each request.\\n\"\n\t\t\"  -N <0|1> disable or enable NDR64. Default: 1\\n\"\n\t\t\"  -B <0|1> disable or enable RPC bind time feature negotiation. Default: 1\\n\"\n#\t\tendif // USE_MSRPC\n\t\t\"  -t <LicenseStatus> Use specfic license status (0 <= T <= 6)\\n\"\n\t\t\"  -g <BindingExpiration> Use a specfic binding expiration time in minutes. Default 43200\\n\"\n#\t\tifndef NO_DNS\n\t\t\"  -P Ignore priority and weight in DNS SRV records\\n\"\n#\t\tendif // NO_DNS\n#\t\tifndef USE_MSRPC\n\t\t\"  -p Don't use multiplexed RPC bind\\n\"\n#\t\tendif // USE_MSRPC\n\t\t\"\\n\"\n\n\t\t\"<port>:\\t\\tTCP port name of the KMS to use. Default 1688.\\n\"\n\t\t\"<host>:\\t\\thost name of the KMS to use. Default 127.0.0.1\\n\"\n#\t\tifndef NO_DNS\n\t\t\".<domain>:\\tfind KMS server in <domain> via DNS\\n\"\n#\t\tendif // NO_DNS\n\t\t\"<app>:\\t\\t(Type %s -x to see a list of valid apps)\\n\\n\",\n\t\tVersion, programName, programName\n\t);\n\n\texit(VLMCSD_EINVAL);\n}\n\n__pure static int getLineWidth(void)\n{\n#ifdef TERMINAL_FIXED_WIDTH // For Toolchains that to not have winsize\n\treturn TERMINAL_FIXED_WIDTH;\n#else // Can determine width of terminal\n#ifndef _WIN32\n\n\tstruct winsize w;\n\n\tif (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w))\n\t{\n\t\treturn 80; // Return this if stdout is not a tty\n\t}\n\n\treturn w.ws_col;\n\n#else // _WIN32\n\n\tCONSOLE_SCREEN_BUFFER_INFO csbiInfo;\n\tHANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);\n\n\tif (!GetConsoleScreenBufferInfo(hStdout, &csbiInfo))\n\t{\n\t\treturn 80; // Return this if stdout is not a Console\n\t}\n\n\treturn csbiInfo.srWindow.Right - csbiInfo.srWindow.Left;\n\n#endif // WIN32\n\n#endif // Can determine width of terminal\n\n}\n\n__noreturn static void showProducts(PRINTFUNC p)\n{\n\tint cols = getLineWidth();\n\tint itemsPerLine;\n\tuint8_t i;\n\tint32_t index;\n\n\n\tuint_fast8_t longestString = 0;\n\tint32_t k, items = KmsData->SkuItemCount;\n\n\tp(\"You may use these product names or numbers:\\n\\n\");\n\n\tfor (index = 0; index < KmsData->SkuItemCount; index++)\n\t{\n\t\tuint_fast8_t len = (uint_fast8_t)strlen(KmsData->SkuItemList[index].Name);\n\t\tif (len > longestString) longestString = len;\n\t}\n\n\titemsPerLine = cols / (longestString + 10);\n\tif (!itemsPerLine) itemsPerLine = 1;\n\tuint8_t lines = items / itemsPerLine;\n\tif (items % itemsPerLine) lines++;\n\n\tfor (i = 0; i < lines; i++)\n\t{\n\t\tfor (k = 0; k < itemsPerLine; k++)\n\t\t{\n\t\t\tuint8_t j;\n\t\t\tindex = k * lines + i;\n\n\t\t\tif (index >= items) break;\n\n\t\t\tp(\"%3u = %s\", index + 1, KmsData->SkuItemList[index].Name);\n\n\t\t\tfor (j = 0; j < longestString + 4 - strlen(KmsData->SkuItemList[index].Name); j++)\n\t\t\t{\n\t\t\t\tp(\" \");\n\t\t\t}\n\t\t}\n\n\t\tp(\"\\n\");\n\t}\n\n\tp(\"\\n\");\n\n\texit(0);\n}\n\n__noreturn static void examples(const char* const programName)\n{\n\tprintf(\n\t\t\"\\nRequest activation for Office 2013 using V4 protocol from 192.168.1.5:1688\\n\"\n\t\t\"\\t%s -l \\\"Office 2013 Professional\\\" -4 192.168.1.5\\n\"\n\t\t\"\\t%s -l \\\"Office 2013 Professional\\\" -4 192.168.1.5:1688\\n\\n\"\n\n\t\t\"Request activation for Windows Server 2012 using V4 protocol from localhost:1688\\n\"\n\t\t\"\\t%s -4 -l \\\"Windows Server 2012\\\" -k 8665cb71-468c-4aa3-a337-cb9bc9d5eaac\\n\"\n\t\t\"\\t%s -4 -l \\\"Windows Server 2012\\\"\\n\"\n\t\t\"\\t%s -4 -l \\\"Windows Server 2012\\\" [::1]:1688\\n\"\n\t\t\"\\t%s -4 -l \\\"Windows Server 2012\\\" 127.0.0.2:1688\\n\\n\"\n\n\t\t\"Send 100,000 requests to localhost:1688\\n\"\n\t\t\"\\t%s -n 100000\\n\\n\"\n\n\t\t\"Request Activation for Windows 8 from 10.0.0.1:4711 and pretend to be Steve Ballmer\\n\"\n\t\t\"\\t%s -l \\\"Windows 8 Professional\\\" -w steveb1.redmond.microsoft.com 10.0.0.1:4711\\n\\n\",\n\t\tprogramName, programName, programName, programName, programName, programName, programName, programName\n\t);\n\n\texit(0);\n}\n\n#else // NO_HELP\n\n\n__noreturn static void clientUsage(const char* const programName)\n{\n\terrorout(\"Incorrect parameter specified.\\n\");\n\texit(VLMCSD_EINVAL);\n}\n\n\n#endif // NO_HELP\n\n\nstatic void parseProtocolVersion(void)\n{\n\tchar *endptr_major, *endptr_minor, *period = strchr(optarg, (int)'.');\n\n\tif (!period)\n\t{\n\t\terrorout(\"Fatal: Protocol version must be in the format #.#\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tlong major = strtol(optarg, &endptr_major, 10);\n\tlong minor = strtol(period + 1, &endptr_minor, 10);\n\n\tif ((*endptr_major && *endptr_major != '.') || *endptr_minor || *optarg == '.' || !period[1])\n\t{\n\t\terrorout(\"Fatal: Protocol version must be in the format #.#\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tif (major < 0 || major > 0xffff || minor < 0 || minor > 0xffff)\n\t{\n\t\terrorout(\"Fatal: Major and minor protocol version number must be between 0 and 65535\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tMajorVersion = (uint16_t)major;\n\tMinorVersion = (uint16_t)minor;\n}\n\n\nstatic int32_t findLicensePackByName(const char* const name)\n{\n\tint32_t i;\n\n\tfor (i = KmsData->SkuItemCount - 1; i >= 0; i--)\n\t{\n\t\tif (!strcasecmp(name, KmsData->SkuItemList[i].Name)) return i;\n\t}\n\n\treturn i;\n}\n\nstatic const char* const client_optstring = \"+N:B:i:j:l:a:s:k:c:w:r:n:t:g:G:o:K:pPTv456mexdV\";\n\n\n//We handle only \"-j\". Many other options do not run without a loaded database\nstatic void parseCommandLinePass0(const int argc, CARGV argv)\n{\n\tint o;\n\toptReset();\n\n\tfor (opterr = 0; (o = getopt(argc, (char* const*)argv, client_optstring)) > 0; ) switch (o)\n\t{\n#\tifndef NO_EXTERNAL_DATA\n\tcase 'j': // Set \"License Pack\" and protocol version (e.g. Windows8, Office2013v5, ...)\n\t\tfn_data = optarg;\n#\t\tifndef NO_INTERNAL_DATA\n\t\tExplicitDataLoad = TRUE;\n#\t\tendif // NO_INTERNAL_DATA\n\t\tbreak;\n#\tendif // NO_EXTERNAL_DATA\n\n\tdefault:\n\t\tbreak;\n\t}\n}\n\n//First pass. We handle only \"-l\". Since -a -k -s -4 -5 and -6 are exceptions to -l, we process -l first\nstatic void parseCommandLinePass1(const int argc, CARGV argv)\n{\n\tint o;\n\toptReset();\n\n\tfor (opterr = 0; (o = getopt(argc, (char* const*)argv, client_optstring)) > 0; ) switch (o)\n\t{\n\tcase 'l': // Set \"License Pack\" and protocol version (e.g. Windows8, Office2013v5, ...)\n\t\tif (stringToInt(optarg, 1, KmsData->SkuItemCount, (unsigned int*)&ActiveProductIndex))\n\t\t{\n\t\t\tActiveProductIndex--;\n\t\t\tbreak;\n\t\t}\n\n\t\tActiveProductIndex = findLicensePackByName(optarg);\n\t\tif (ActiveProductIndex < 0)\n\t\t{\n\t\t\terrorout(\"Invalid client application. \\\"%s\\\" is not valid for -l.\\n\\n\", optarg);\n#ifndef NO_HELP\n\t\t\tshowProducts(&errorout);\n#endif // !NO_HELP\n\t\t}\n\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\n\tint32_t kmsIndex = KmsData->SkuItemList[ActiveProductIndex].KmsIndex;\n\tint32_t appIndex = KmsData->SkuItemList[ActiveProductIndex].AppIndex;\n\n\tMajorVersion = (uint16_t)KmsData->SkuItemList[ActiveProductIndex].ProtocolVersion;\n\tNCountPolicy = (uint32_t)KmsData->SkuItemList[ActiveProductIndex].NCountPolicy;\n\tmemcpy(&SkuGuid, &KmsData->SkuItemList[ActiveProductIndex].Guid, sizeof(GUID));\n\tmemcpy(&KmsGuid, &KmsData->KmsItemList[kmsIndex].Guid, sizeof(GUID));\n\tmemcpy(&AppGuid, &KmsData->AppItemList[appIndex].Guid, sizeof(GUID));\n}\n\n\n// Second Pass. Handle all options except \"-l\"\nstatic void parseCommandLinePass2(const char *const programName, const int argc, CARGV argv)\n{\n\tint o;\n\toptReset();\n\n\tfor (opterr = 0; (o = getopt(argc, (char* const*)argv, client_optstring)) > 0; ) switch (o)\n\t{\n#ifndef NO_HELP\n\n\tcase 'j':\n\t\tbreak;\n\n\tcase 'e': // Show examples\n\n\t\texamples(programName);\n\n\tcase 'x': // Show Apps\n\n\t\tshowProducts(&printf);\n\n#endif // NO_HELP\n\n#\t\t\tifndef NO_DNS\n\n\tcase 'P':\n\n\t\tNoSrvRecordPriority = TRUE;\n\t\tbreak;\n\n#\t\t\tendif // NO_DNS\n\n\tcase 'G':\n\n\t\tincompatibleOptions |= VLMCS_OPTION_GRAB_INI;\n\t\tfn_ini_client = optarg;\n\t\tbreak;\n\n#\tifndef USE_MSRPC\n\n\tcase 'N':\n\t\tif (!getArgumentBool(&UseClientRpcNDR64, optarg)) clientUsage(programName);\n\t\tbreak;\n\n\tcase 'B':\n\t\tif (!getArgumentBool(&UseClientRpcBTFN, optarg)) clientUsage(programName);\n\t\tbreak;\n\n\tcase 'i':\n\n\t\tswitch (getOptionArgumentInt((char)o, 4, 6))\n\t\t{\n\t\tcase 4:\n\t\t\tAddressFamily = AF_INET;\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tAddressFamily = AF_INET6;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\terrorout(\"IPv5 does not exist.\\n\");\n\t\t\texit(VLMCSD_EINVAL);\n\t\t}\n\n\t\tbreak;\n\n\tcase 'p': // Multiplexed RPC\n\n\t\tUseMultiplexedRpc = FALSE;\n\t\tbreak;\n\n#\tendif // USE_MSRPC\n\n\tcase 'n': // Fixed number of Requests (regardless, whether they are required)\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tFixedRequests = getOptionArgumentInt((char)o, 1, INT_MAX);\n\t\tbreak;\n\n\tcase 'r': // Fake minimum required client count\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tNCountPolicy = getOptionArgumentInt((char)o, 0, INT_MAX);\n\t\tbreak;\n\n\tcase 'c': // use a specific client GUID\n\n\t\t// If using a constant Client ID, send only one request unless /N= explicitly specified\n\t\tif (!FixedRequests) FixedRequests = 1;\n\n\t\tCMID = optarg;\n\t\tbreak;\n\n\tcase 'o': // use a specific previous client GUID\n\n\t\tCMID_prev = optarg;\n\t\tbreak;\n\n\tcase 'a': // Set specific App Id\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tstring2UuidOrExit(optarg, &AppGuid);\n\t\tbreak;\n\n\tcase 'g': // Set custom \"grace\" time in minutes (default 30 days)\n\n\t\tBindingExpiration = getOptionArgumentInt((char)o, 0, INT_MAX);\n\t\tbreak;\n\n\tcase 's': // Set specfic SKU ID\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tstring2UuidOrExit(optarg, &SkuGuid);\n\t\tbreak;\n\n\tcase 'k': // Set specific KMS ID\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tstring2UuidOrExit(optarg, &KmsGuid);\n\t\tbreak;\n\n\tcase '4': // Force V4 protocol\n\tcase '5': // Force V5 protocol\n\tcase '6': // Force V5 protocol\n\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tMajorVersion = o - 0x30;\n\t\tMinorVersion = 0;\n\t\tbreak;\n\n\tcase 'K': // Use specific protocol (may be invalid)\n\n\t\tparseProtocolVersion();\n\t\tbreak;\n\n\tcase 'd': // Don't use DNS names\n\n\t\tdnsnames = FALSE;\n\t\tbreak;\n\n#\t\t\tifndef NO_VERBOSE_LOG\n\n\tcase 'v': // Be verbose\n\n\t\tverbose = TRUE;\n\t\tbreak;\n\n#\t\t\tendif // NO_VERBOSE_LOG\n\n\tcase 'm': // Pretend to be a virtual machine\n\n\t\tVMInfo = TRUE;\n\t\tbreak;\n\n\tcase 'w': // WorkstationName (max. 63 chars)\n\n\t\tWorkstationName = optarg;\n\n\t\tif (strlen(WorkstationName) > 63)\n\t\t{\n\t\t\terrorout(\"\\007WARNING! Truncating workstation name to 63 characters (%s).\\n\", WorkstationName);\n\t\t}\n\n\t\tbreak;\n\n\tcase 't':\n\n\t\tLicenseStatus = getOptionArgumentInt((char)o, 0, 0x7fffffff);\n\t\tif ((unsigned int)LicenseStatus > 6) errorout(\"Warning: Correct license status is 0 <= license status <= 6.\\n\");\n\t\tbreak;\n\n#\t\t\tifndef USE_MSRPC\n\n\tcase 'T':\n\n\t\tReconnectForEachRequest = TRUE;\n\t\tbreak;\n\n#\t\t\tendif // USE_MSRPC\n\n\tcase 'l':\n\t\tincompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;\n\t\tbreak;\n\n#\tifndef NO_VERSION_INFORMATION\n\n\tcase 'V':\n#\t\t\t\tif defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)\n\t\tprintf(\"vlmcs %s %i-bit\\n\", Version, sizeof(void*) == 4 ? 31 : (int)sizeof(void*) << 3);\n#\t\t\t\telse\n\t\tprintf(\"vlmcs %s %i-bit\\n\", Version, (int)sizeof(void*) << 3);\n#\t\t\t\tendif // defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)\n\t\tprintPlatform();\n\t\tprintCommonFlags();\n\t\tprintClientFlags();\n\t\texit(0);\n\n#\t\t\tendif // NO_VERSION_INFORMATION\n\n\tdefault:\n\t\tclientUsage(programName);\n\t}\n\tif ((incompatibleOptions & (VLMCS_OPTION_NO_GRAB_INI | VLMCS_OPTION_GRAB_INI)) == (VLMCS_OPTION_NO_GRAB_INI | VLMCS_OPTION_GRAB_INI))\n\t\tclientUsage(programName);\n}\n\n\n///*\n// * Compares 2 GUIDs where one is host-endian and the other is little-endian (network byte order)\n// */\n//int_fast8_t IsEqualGuidLEHE(const GUID* const guid1, const GUID* const guid2)\n//{\n//\tGUID tempGuid;\n//\tLEGUID(&tempGuid, guid2);\n//\treturn IsEqualGUID(guid1, &tempGuid);\n//}\n\n\n#ifndef USE_MSRPC\nstatic void checkRpcLevel(const REQUEST* request, RESPONSE* response)\n{\n\tif (!RpcFlags.HasNDR32)\n\t\terrorout(\"\\nWARNING: Server's RPC protocol does not support NDR32.\\n\");\n\n\tif (UseClientRpcBTFN && UseClientRpcNDR64 && RpcFlags.HasNDR64 && !RpcFlags.HasBTFN)\n\t\terrorout(\"\\nWARNING: Server's RPC protocol has NDR64 but no BTFN.\\n\");\n\n\t//#\tifndef NO_BASIC_PRODUCT_LIST\n\t//\tif (!IsEqualGuidLEHE(&request->KMSID, &ProductList[15].guid) && UseClientRpcBTFN && !RpcFlags.HasBTFN)\n\t//\t\terrorout(\"\\nWARNING: A server with pre-Vista RPC activated a product other than Office 2010.\\n\");\n\t//#\tendif // NO_BASIC_PRODUCT_LIST\n}\n#endif // USE_MSRPC\n\n\nstatic void displayResponse(const RESPONSE_RESULT result, const REQUEST* request, RESPONSE* response, BYTE *hwid)\n{\n\tfflush(stdout);\n\n\tif (!result.RpcOK)\t\t\t\terrorout(\"\\n\\007ERROR: Non-Zero RPC result code.\\n\");\n\tif (!result.DecryptSuccess)\t\terrorout(\"\\n\\007ERROR: Decryption of V5/V6 response failed.\\n\");\n\tif (!result.IVsOK)\t\t\t\terrorout(\"\\n\\007ERROR: AES CBC initialization vectors (IVs) of request and response do not match.\\n\");\n\tif (!result.PidLengthOK)\t\terrorout(\"\\n\\007ERROR: The length of the PID is not valid.\\n\");\n\tif (!result.HashOK)\t\t\t\terrorout(\"\\n\\007ERROR: Computed hash does not match hash in response.\\n\");\n\tif (!result.ClientMachineIDOK)\terrorout(\"\\n\\007ERROR: Client machine GUIDs of request and response do not match.\\n\");\n\tif (!result.TimeStampOK)\t\terrorout(\"\\n\\007ERROR: Time stamps of request and response do not match.\\n\");\n\tif (!result.VersionOK)\t\t\terrorout(\"\\n\\007ERROR: Protocol versions of request and response do not match.\\n\");\n\tif (!result.HmacSha256OK)\t\terrorout(\"\\n\\007ERROR: Keyed-Hash Message Authentication Code (HMAC) is incorrect.\\n\");\n\tif (!result.IVnotSuspicious)\terrorout(\"\\nWARNING: The KMS server is an emulator because the response uses an IV following KMSv5 rules in KMSv6 protocol.\\n\");\n\n\tif (result.effectiveResponseSize != result.correctResponseSize)\n\t{\n\t\terrorout(\"\\n\\007WARNING: Size of RPC payload (KMS Message) should be %u but is %u.\", result.correctResponseSize, result.effectiveResponseSize);\n\t}\n\n#\tifndef USE_MSRPC\n\tcheckRpcLevel(request, response);\n#\tendif // USE_MSRPC\n\n\tif (!result.DecryptSuccess) return; // Makes no sense to display anything\n\n\tchar ePID[3 * PID_BUFFER_SIZE];\n\tif (!ucs2_to_utf8(response->KmsPID, ePID, PID_BUFFER_SIZE, 3 * PID_BUFFER_SIZE))\n\t{\n\t\tmemset(ePID + 3 * PID_BUFFER_SIZE - 3, 0, 3);\n\t}\n\n\t// Read KMSPID from Response\n#\tifndef NO_VERBOSE_LOG\n\tif (!verbose)\n#\tendif // NO_VERBOSE_LOG\n\t{\n\t\tprintf(\" -> %s\", ePID);\n\n\t\tif (LE16(response->MajorVer) > 5)\n\t\t{\n#\t\t\tifndef _WIN32\n\t\t\tprintf(\" (%016llX)\", (unsigned long long)BE64(*(uint64_t*)hwid));\n#\t\t\telse // _WIN32\n\t\t\tprintf(\" (%016I64X)\", (unsigned long long)BE64(*(uint64_t*)hwid));\n#\t\t\tendif // _WIN32\n\t\t}\n\n\t\tprintf(\"\\n\");\n\t}\n#\tifndef NO_VERBOSE_LOG\n\telse\n\t{\n\t\tprintf(\n\t\t\t\"\\n\\nResponse from KMS server\\n========================\\n\\n\"\n\t\t\t\"Size of KMS Response            : %u (0x%x)\\n\", result.effectiveResponseSize, result.effectiveResponseSize\n\t\t);\n\n\t\tlogResponseVerbose(ePID, hwid, response, &printf);\n\t\tprintf(\"\\n\");\n\t}\n#\tendif // NO_VERBOSE_LOG\n}\n\n\nstatic void connectRpc(RpcCtx *s)\n{\n#\tifdef NO_DNS\n\n\tRpcDiag_t rpcDiag;\n\n\t*s = connectToAddress(RemoteAddr, AddressFamily, FALSE);\n\tif (*s == INVALID_RPCCTX)\n\t{\n\t\terrorout(\"Fatal: Could not connect to %s\\n\", RemoteAddr);\n\t\texit(SOCKET_ECONNABORTED);\n\t}\n\n\tif (verbose)\n\t\tprintf(\"\\nPerforming RPC bind ...\\n\");\n\n\tRpcStatus status;\n\tif ((status = rpcBindClient(*s, verbose, &rpcDiag)))\n\t{\n\t\terrorout(\"Fatal: Could not bind RPC\\n\");\n\t\texit(status);\n\t}\n\n\tif (verbose) printf(\"... successful\\n\");\n\n#\telse // DNS\n\n\tstatic kms_server_dns_ptr* serverlist = NULL;\n\tstatic int numServers = 0;\n\t//static int_fast8_t ServerListAlreadyPrinted = FALSE;\n\tint i;\n\n\tif (!strcmp(RemoteAddr, \"-\") || *RemoteAddr == '.') // Get KMS server via DNS SRV record\n\t{\n\t\tif (!serverlist)\n\t\t\tnumServers = getKmsServerList(&serverlist, RemoteAddr);\n\n\t\tif (numServers < 1)\n\t\t{\n\t\t\terrorout(\"Fatal: No KMS servers found\\n\");\n\t\t\texit(SOCKET_ECONNABORTED);\n\t\t}\n\n\t\tif (!NoSrvRecordPriority) sortSrvRecords(serverlist, numServers);\n\n#\t\tifndef NO_VERBOSE_LOG\n\t\tif (verbose /*&& !ServerListAlreadyPrinted*/)\n\t\t{\n\t\t\tfor (i = 0; i < numServers; i++)\n\t\t\t{\n\t\t\t\tprintf(\n\t\t\t\t\t\"Found %-40s (priority: %hu, weight: %hu, randomized weight: %i)\\n\",\n\t\t\t\t\tserverlist[i]->serverName,\n\t\t\t\t\tserverlist[i]->priority, serverlist[i]->weight,\n\t\t\t\t\tNoSrvRecordPriority ? 0 : serverlist[i]->random_weight\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tprintf(\"\\n\");\n\t\t\t//ServerListAlreadyPrinted = TRUE;\n\t\t}\n#\t\tendif // NO_VERBOSE_LOG\n\t}\n\telse // Just use the server supplied on the command line\n\t{\n\t\tif (!serverlist)\n\t\t{\n\t\t\tserverlist = (kms_server_dns_ptr*)vlmcsd_malloc(sizeof(kms_server_dns_ptr));\n\t\t\t*serverlist = (kms_server_dns_ptr)vlmcsd_malloc(sizeof(kms_server_dns_t));\n\n\t\t\tnumServers = 1;\n\t\t\tstrncpy((*serverlist)->serverName, RemoteAddr, sizeof((*serverlist)->serverName));\n\t\t}\n\t}\n\n\tfor (i = 0; i < numServers; i++)\n\t{\n\t\t*s = connectToAddress(serverlist[i]->serverName, AddressFamily, (*RemoteAddr == '.' || *RemoteAddr == '-'));\n\n\t\tif (*s == INVALID_RPCCTX) continue;\n\t\tRpcDiag_t rpcDiag;\n\n#\t\tifndef NO_VERBOSE_LOG\n\t\tif (verbose) printf(\"\\nPerforming RPC bind ...\\n\");\n\n\t\tif (rpcBindClient(*s, verbose, &rpcDiag))\n#\t\telse\n\t\tif (rpcBindClient(*s, FALSE, &rpcDiag))\n#\t\tendif\n\t\t{\n\t\t\terrorout(\"Warning: Could not bind RPC\\n\");\n\t\t\tcontinue;\n\t\t}\n\n#\t\tifndef NO_VERBOSE_LOG\n\t\tif (verbose) printf(\"... successful\\n\");\n#\t\tendif\n\n\t\treturn;\n\t}\n\n\terrorout(\"Fatal: Could not connect to any KMS server\\n\");\n\texit(SOCKET_ECONNABORTED);\n\n#\tendif // DNS\n}\n\n#endif // IS_LIBRARY\n\nint SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQUEST *baseRequest, RESPONSE_RESULT *result, BYTE *const hwid)\n{\n\tsize_t requestSize, responseSize;\n\tBYTE *request, *response;\n\tint status;\n\n\tresult->mask = 0;\n\n\tif (LE16(baseRequest->MajorVer) < 5)\n\t\trequest = CreateRequestV4(&requestSize, baseRequest);\n\telse\n\t\trequest = CreateRequestV6(&requestSize, baseRequest);\n\n\tif (!((status = rpcSendRequest(sock, request, requestSize, &response, &responseSize))))\n\t{\n\t\tif (LE16(((RESPONSE*)(response))->MajorVer) == 4)\n\t\t{\n\t\t\tRESPONSE_V4 response_v4;\n\t\t\t*result = DecryptResponseV4(&response_v4, (const int)responseSize, response, request);\n\t\t\tmemcpy(baseResponse, &response_v4.ResponseBase, sizeof(RESPONSE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tRESPONSE_V6 response_v6;\n\t\t\t*result = DecryptResponseV6(&response_v6, (int)responseSize, response, request, hwid);\n\t\t\tmemcpy(baseResponse, &response_v6.ResponseBase, sizeof(RESPONSE));\n\t\t}\n\n\t\tresult->RpcOK = TRUE;\n\t}\n\n\tif (response) free(response);\n\tfree(request);\n\treturn status;\n}\n\n#ifndef IS_LIBRARY\n\nstatic int sendRequest(RpcCtx *const s, REQUEST *const request, RESPONSE *const response, hwid_t hwid, RESPONSE_RESULT *const result)\n{\n\tCreateRequestBase(request);\n\n\tif (*s == INVALID_RPCCTX)\n\t\tconnectRpc(s);\n\telse\n\t{\n\t\t// Check for lame KMS emulators that close the socket after each request\n\t\tint_fast8_t disconnected = isDisconnected(*s);\n\n\t\tif (disconnected)\n\t\t\terrorout(\"\\nWarning: Server closed RPC connection (probably non-multitasked KMS emulator)\\n\");\n\n\t\tif (ReconnectForEachRequest || disconnected)\n\t\t{\n\t\t\tcloseRpc(*s);\n\t\t\tconnectRpc(s);\n\t\t}\n\t}\n\n\tprintf(\"Sending activation request (KMS V%u) \", MajorVersion);\n\tfflush(stdout);\n\n\treturn SendActivationRequest(*s, response, request, result, hwid);\n}\n\n\nstatic void displayRequestError(RpcCtx *const s, const int status, const int currentRequest, const int totalRequests)\n{\n\terrorout(\"\\nError 0x%08X while sending request %u of %u\\n\", status, currentRequest, RequestsToGo + totalRequests);\n\n\tswitch (status)\n\t{\n\tcase 0xC004F042: // not licensed\n\t\terrorout(\"The KMS server has declined to activate the requested product\\n\");\n\t\tbreak;\n\n\tcase 0x8007000D:  // e.g. v6 protocol on a v5 server\n\t\terrorout(\"The KMS host you are using is unable to handle your product. It only supports legacy versions\\n\");\n\t\tbreak;\n\n\tcase 0xC004F06C:\n\t\terrorout(\"The time stamp differs too much from the KMS server time\\n\");\n\t\tbreak;\n\n\tcase 0xC004D104:\n\t\terrorout(\"The security processor reported that invalid data was used\\n\");\n\t\tbreak;\n\n\tcase 1:\n\t\terrorout(\"An RPC protocol error has occured\\n\");\n\t\tcloseRpc(*s);\n\t\tconnectRpc(s);\n\t\tbreak;\n\n\tdefault:\n#\t\tif _WIN32\n\t\terrorout(\"%s\\n\", win_strerror(status));\n#\t\tendif // _WIN32\n\t\tbreak;\n\t}\n}\n\nstatic void newIniBackupFile(const char* const restrict fname)\n{\n\tFILE *restrict f = fopen(fname, \"wb\");\n\n\tif (!f)\n\t{\n\t\tint error = errno;\n\t\terrorout(\"Fatal: Cannot create %s: %s\\n\", fname, strerror(error));\n\t\texit(error);\n\t}\n\n\tif (fclose(f))\n\t{\n\t\tint error = errno;\n\t\terrorout(\"Fatal: Cannot write to %s: %s\\n\", fname, strerror(error));\n\t\tvlmcsd_unlink(fname);\n\t\texit(error);\n\t}\n}\n\n\nstatic void updateIniFile(char*** restrict lines)\n{\n\tint_fast8_t* lineWritten = (int_fast8_t*)malloc(KmsData->CsvlkCount * sizeof(int_fast8_t));\n#\tif !_MSC_VER\n\tstruct stat statbuf;\n#\tendif\n\tuint_fast8_t i;\n\tint_fast8_t iniFileExistedBefore = TRUE;\n\tunsigned int lineNumber;\n\n\tmemset(lineWritten, FALSE, KmsData->CsvlkCount * sizeof(int_fast8_t));\n\n\tchar* restrict fn_bak = (char*)vlmcsd_malloc(strlen(fn_ini_client) + 2);\n\n\tstrcpy(fn_bak, fn_ini_client);\n\tstrcat(fn_bak, \"~\");\n\n#\tif _MSC_VER\n\tif (!PathFileExists(fn_ini_client))\n\t{\n\t\tiniFileExistedBefore = FALSE;\n\t\tnewIniBackupFile(fn_bak);\n\t}\n#\telse\n\tif (stat(fn_ini_client, &statbuf))\n\t{\n\t\tif (errno != ENOENT)\n\t\t{\n\t\t\tint error = errno;\n\t\t\terrorout(\"Fatal: %s: %s\\n\", fn_ini_client, strerror(error));\n\t\t\texit(error);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tiniFileExistedBefore = FALSE;\n\t\t\tnewIniBackupFile(fn_bak);\n\t\t}\n\t}\n#\tendif\n\telse\n\t{\n\t\tvlmcsd_unlink(fn_bak); // Required for Windows. Most Unix systems don't need it.\n\t\tif (rename(fn_ini_client, fn_bak))\n\t\t{\n\t\t\tconst int error = errno;\n\t\t\terrorout(\"Fatal: Cannot create %s: %s\\n\", fn_bak, strerror(error));\n\t\t\texit(error);\n\t\t}\n\t}\n\n\tprintf(\"\\n%s file %s\\n\", iniFileExistedBefore ? \"Updating\" : \"Creating\", fn_ini_client);\n\n\tFILE *restrict in, *restrict out;\n\n\tin = fopen(fn_bak, \"rb\");\n\n\tif (!in)\n\t{\n\t\tconst int error = errno;\n\t\terrorout(\"Fatal: Cannot open %s: %s\\n\", fn_bak, strerror(error));\n\t\texit(error);\n\t}\n\n\tout = fopen(fn_ini_client, \"wb\");\n\n\tif (!out)\n\t{\n\t\tconst int error = errno;\n\t\terrorout(\"Fatal: Cannot create %s: %s\\n\", fn_ini_client, strerror(error));\n\t\texit(error);\n\t}\n\n\tchar sourceLine[256];\n\n\tfor (lineNumber = 1; fgets(sourceLine, sizeof(sourceLine), in); lineNumber++)\n\t{\n\t\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t\t{\n\t\t\tif (*(*lines)[i] && !strncasecmp(sourceLine, (*lines)[i], strlen(getNextString((KmsData->CsvlkData[i].EPid)))))\n\t\t\t{\n\t\t\t\tif (lineWritten[i]) break;\n\n\t\t\t\tfprintf(out, \"%s\", (*lines)[i]);\n\t\t\t\tprintf(\"line %2i: %s\", lineNumber, (*lines)[i]);\n\t\t\t\tlineWritten[i] = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (i >= KmsData->CsvlkCount)\n\t\t{\n\t\t\tfprintf(out, \"%s\", sourceLine);\n\t\t}\n\t}\n\n\tif (ferror(in))\n\t{\n\t\tint error = errno;\n\t\terrorout(\"Fatal: Cannot read from %s: %s\\n\", fn_bak, strerror(error));\n\t\texit(error);\n\t}\n\n\tfclose(in);\n\n\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t{\n\t\tif (!lineWritten[i] && *(*lines)[i])\n\t\t{\n\t\t\tfprintf(out, \"%s\", (*lines)[i]);\n\t\t\tprintf(\"line %2i: %s\", lineNumber + i, (*lines)[i]);\n\t\t}\n\t}\n\n\tif (fclose(out))\n\t{\n\t\tconst int error = errno;\n\t\terrorout(\"Fatal: Cannot write to %s: %s\\n\", fn_ini_client, strerror(error));\n\t\texit(error);\n\t}\n\n\tif (!iniFileExistedBefore) vlmcsd_unlink(fn_bak);\n\n\tfree(fn_bak);\n}\n\n\nstatic void grabServerData()\n{\n\tRpcCtx s = INVALID_RPCCTX;\n\tWORD MajorVer = 6;\n\tint32_t i;\n\tint32_t j;\n\n\tchar** lines = (char**)vlmcsd_malloc(KmsData->CsvlkCount * sizeof(char*));\n\tGUID* kmsGuids = (GUID*)vlmcsd_malloc(KmsData->CsvlkCount * sizeof(GUID));\n\n\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t{\n\t\tlines[i] = (char*)vlmcsd_malloc(256);\n\t\t*lines[i] = 0;\n\n\t\tfor (j = 0; j < KmsData->KmsItemCount; j++)\n\t\t{\n\t\t\tif (KmsData->KmsItemList[j].EPidIndex == i)\n\t\t\t{\n\t\t\t\tkmsGuids[i] = KmsData->KmsItemList[j].Guid;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tRESPONSE response;\n\tRESPONSE_RESULT result;\n\tREQUEST request;\n\thwid_t hwid;\n\tint status;\n\tsize_t len;\n\n\tfor (i = 0; i < KmsData->CsvlkCount && MajorVer > 3; i++)\n\t{\n\t\tconst int32_t kmsIndex = getProductIndex(&kmsGuids[i], KmsData->KmsItemList, KmsData->KmsItemCount, NULL, NULL);\n\n\t\tif (kmsIndex < 0)\n\t\t{\n\t\t\terrorout(\"Warning: KMS GUID not in database.\\n\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tActiveProductIndex = ~0;\n\n\t\tfor (j = KmsData->SkuItemCount - 1; j >= 0; j--)\n\t\t{\n\t\t\tif (KmsData->SkuItemList[j].KmsIndex == kmsIndex)\n\t\t\t{\n\t\t\t\tActiveProductIndex = j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (ActiveProductIndex == ~0)\n\t\t{\n\t\t\terrorout(\"Warning: KMS GUID not in database.\\n\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst int32_t appIndex = KmsData->SkuItemList[ActiveProductIndex].AppIndex;\n\n\t\tNCountPolicy = (uint32_t)KmsData->SkuItemList[ActiveProductIndex].NCountPolicy;\n\t\tmemcpy(&SkuGuid, &KmsData->SkuItemList[ActiveProductIndex].Guid, sizeof(GUID));\n\t\tmemcpy(&KmsGuid, &KmsData->KmsItemList[kmsIndex].Guid, sizeof(GUID));\n\t\tmemcpy(&AppGuid, &KmsData->AppItemList[appIndex].Guid, sizeof(GUID));\n\t\tMajorVersion = (uint16_t)MajorVer;\n\n\t\tstatus = sendRequest(&s, &request, &response, hwid, &result);\n\t\tprintf(\"%-11s\", getNextString(KmsData->CsvlkData[i].EPid));\n\n\t\tif (status)\n\t\t{\n\t\t\tdisplayRequestError(&s, status, i + 7 - MajorVer, 9 - MajorVer);\n\n\t\t\tif (status == 1) break;\n\n\t\t\tif ((status & 0xF0000000) == 0x80000000)\n\t\t\t{\n\t\t\t\tMajorVer--;\n\t\t\t\ti--;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tprintf(\"%i of %i\", (int)(i + 7 - MajorVer), (int)(KmsData->CsvlkCount + 6 - MajorVer));\n\t\tdisplayResponse(result, &request, &response, hwid);\n\n\t\tchar ePID[3 * PID_BUFFER_SIZE];\n\n\t\tif (!ucs2_to_utf8(response.KmsPID, ePID, PID_BUFFER_SIZE, 3 * PID_BUFFER_SIZE))\n\t\t{\n\t\t\tmemset(ePID + 3 * PID_BUFFER_SIZE - 3, 0, 3);\n\t\t}\n\n\t\tvlmcsd_snprintf(lines[i], 255 - strlen(lines[i]), \"%s = %s\", getNextString(KmsData->CsvlkData[i].EPid), ePID);\n\n\t\tif (response.MajorVer > 5)\n\t\t{\n\t\t\tlen = strlen(lines[i]);\n\t\t\tvlmcsd_snprintf(lines[i] + len, 255 - len, \" / %02X %02X %02X %02X %02X %02X %02X %02X\", hwid[0], hwid[1], hwid[2], hwid[3], hwid[4], hwid[5], hwid[6], hwid[7]);\n\t\t}\n\n\t\tlen = strlen(lines[i]);\n\t\tvlmcsd_snprintf(lines[i] + len, 255 - len, \"\\n\");\n\n\t}\n\n\tif (strcmp(fn_ini_client, \"-\"))\n\t{\n\t\tupdateIniFile(&lines);\n\t}\n\telse\n\t{\n\t\tprintf(\"\\n\");\n\t\tfor (i = 0; i < KmsData->CsvlkCount; i++) printf(\"%s\", lines[i]);\n\t}\n}\n\n\nint client_main(int argc, CARGV argv)\n{\n#if defined(_WIN32) && !defined(USE_MSRPC)\n\n\t// Windows Sockets must be initialized\n\n\tWSADATA wsaData;\n\tint error;\n\n\tif ((error = WSAStartup(0x0202, &wsaData)))\n\t{\n\t\terrorout(\"Fatal: Could not initialize Windows sockets (Error: %d).\\n\", error);\n\t\treturn error;\n\t}\n\n#endif // _WIN32\n\n#ifdef _NTSERVICE\n\n\t// We are not a service\n\tIsNTService = FALSE;\n\n#endif // _NTSERVICE\n\n\trandomNumberInit();\n\n\t//#\tifndef NO_EXTERNAL_DATA\n\t//\tExplicitDataLoad = TRUE;\n\t//#\tendif // NO_EXTERNAL_DATA\n\n\tparseCommandLinePass0(argc, argv);\n\n\tint_fast8_t useDefaultHost = FALSE;\n\n\tif (optind < argc)\n\t\tRemoteAddr = argv[optind];\n\telse\n\t\tuseDefaultHost = TRUE;\n\n\tconst int hostportarg = optind;\n\n\tif (optind < argc - 1)\n\t{\n\t\tparseCommandLinePass0(argc - hostportarg, argv + hostportarg);\n\n\t\tif (optind < argc - hostportarg)\n\t\t\tclientUsage(argv[0]);\n\t}\n\n\tloadKmsData();\n\n\tif (!KmsData->AppItemCount || !KmsData->SkuItemCount || !KmsData->KmsItemCount)\n\t{\n\t\terrorout(\"Fatal: Incomplete KMS data file\\n\");\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tparseCommandLinePass1(argc, argv);\n\n\tif (optind < argc - 1)\n\t{\n\t\tparseCommandLinePass1(argc - hostportarg, argv + hostportarg);\n\t}\n\n\tparseCommandLinePass2(argv[0], argc, argv);\n\n\tif (optind < argc - 1)\n\t\tparseCommandLinePass2(argv[0], argc - hostportarg, argv + hostportarg);\n\n\tif (useDefaultHost)\n\t{\n#\tifndef USE_MSRPC\n\t\tRemoteAddr = AddressFamily == AF_INET6 ? \"::1\" : \"127.0.0.1\";\n#\telse\n\t\tRemoteAddr = \"127.0.0.1\";\n#\tendif\n\t}\n\n\tif (fn_ini_client != NULL)\n\t\tgrabServerData();\n\telse\n\t{\n\t\tint requests;\n\t\tRpcCtx s = INVALID_RPCCTX;\n\n\t\tfor (requests = 0, RequestsToGo = NCountPolicy == 1 ? 1 : NCountPolicy - 1; RequestsToGo; requests++)\n\t\t{\n\t\t\tRESPONSE response;\n\t\t\tREQUEST request;\n\t\t\tRESPONSE_RESULT result;\n\t\t\thwid_t hwid;\n\n\t\t\tint status = sendRequest(&s, &request, &response, hwid, &result);\n\n\t\t\tif (FixedRequests) RequestsToGo = FixedRequests - requests - 1;\n\n\t\t\tif (status)\n\t\t\t{\n\t\t\t\tdisplayRequestError(&s, status, requests + 1, RequestsToGo + requests + 1);\n\t\t\t\tif (!FixedRequests)\tRequestsToGo = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!FixedRequests)\n\t\t\t\t{\n\t\t\t\t\tif (firstRequestSent && NCountPolicy - (int)response.Count >= RequestsToGo)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorout(\"\\nThe KMS server does not increment it's active clients. Aborting...\\n\");\n\t\t\t\t\t\tRequestsToGo = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tRequestsToGo = NCountPolicy - response.Count;\n\t\t\t\t\t\tif (RequestsToGo < 0) RequestsToGo = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfflush(stderr);\n\t\t\t\tprintf(\"%i of %i \", requests + 1, RequestsToGo + requests + 1);\n\t\t\t\tdisplayResponse(result, &request, &response, hwid);\n\t\t\t\tfirstRequestSent = TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n\n// Create Base KMS Client Request\nstatic void CreateRequestBase(REQUEST *Request)\n{\n\tRequest->MinorVer = LE16(MinorVersion);\n\tRequest->MajorVer = LE16(MajorVersion);\n\tRequest->VMInfo = LE32(VMInfo);\n\tRequest->LicenseStatus = LE32(LicenseStatus);\n\tRequest->BindingExpiration = LE32(BindingExpiration);\n\tRequest->N_Policy = LE32(NCountPolicy);\n\n\tmemcpy(&Request->ActID, &SkuGuid, sizeof(GUID));\n\tmemcpy(&Request->KMSID, &KmsGuid, sizeof(GUID));\n\tmemcpy(&Request->AppID, &AppGuid, sizeof(GUID));\n\n\tgetUnixTimeAsFileTime(&Request->ClientTime);\n\n\t{\n\t\tif (CMID)\n\t\t{\n\t\t\tstring2UuidOrExit(CMID, &Request->CMID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tget16RandomBytes(&Request->CMID);\n\n\t\t\t// Set reserved UUID bits\n\t\t\tRequest->CMID.Data4[0] &= 0x3F;\n\t\t\tRequest->CMID.Data4[0] |= 0x80;\n\n\t\t\t// Set UUID type 4 (random UUID)\n\t\t\tRequest->CMID.Data3 &= LE16(0xfff);\n\t\t\tRequest->CMID.Data3 |= LE16(0x4000);\n\t\t}\n\n\t\tif (CMID_prev)\n\t\t{\n\t\t\tstring2UuidOrExit(CMID_prev, &Request->CMID_prev);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmemset(&Request->CMID_prev, 0, sizeof(Request->CMID_prev));\n\t\t}\n\t}\n\n\tstatic const char alphanum[] = \"0123456789\" \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" /*\"abcdefghijklmnopqrstuvwxyz\" */;\n\n\tif (WorkstationName)\n\t{\n\t\tutf8_to_ucs2(Request->WorkstationName, WorkstationName, WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);\n\t}\n\telse if (dnsnames)\n\t{\n\t\tint len, len2;\n\t\tunsigned int index = rand() % vlmcsd_countof(ClientDnsNames.first);\n\t\tlen = (int)utf8_to_ucs2(Request->WorkstationName, ClientDnsNames.first[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);\n\n\t\tindex = rand() % vlmcsd_countof(ClientDnsNames.second);\n\t\tlen2 = (int)utf8_to_ucs2(Request->WorkstationName + len, ClientDnsNames.second[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);\n\n\t\tindex = rand() % vlmcsd_countof(ClientDnsNames.tld);\n\t\tutf8_to_ucs2(Request->WorkstationName + len + len2, ClientDnsNames.tld[index], WORKSTATION_NAME_BUFFER, WORKSTATION_NAME_BUFFER * 3);\n\t}\n\telse\n\t{\n\t\tunsigned int size = (rand() % 14) + 1;\n\t\tconst unsigned char *dummy;\n\t\tunsigned int i;\n\n\t\tfor (i = 0; i < size; i++)\n\t\t{\n\t\t\tRequest->WorkstationName[i] = utf8_to_ucs2_char((unsigned char*)alphanum + (rand() % (sizeof(alphanum) - 1)), &dummy);\n\t\t}\n\n\t\tRequest->WorkstationName[size] = 0;\n\t}\n\n#\tifndef NO_VERBOSE_LOG\n\tif (verbose)\n\t{\n\t\tprintf(\"\\nRequest Parameters\\n==================\\n\\n\");\n\t\tlogRequestVerbose(Request, &printf);\n\t\tprintf(\"\\n\");\n\t}\n#\tendif // NO_VERBOSE_LOG\n}\n\n#if _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY\nint __stdcall WinStartUp(void)\n{\n\tWCHAR **szArgList;\n\tint argc;\n\tszArgList = CommandLineToArgvW(GetCommandLineW(), &argc);\n\n\tint i;\n\tchar **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc);\n\n\tfor (i = 0; i < argc; i++)\n\t{\n\t\tint size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);\n\t\targv[i] = (char*)vlmcsd_malloc(size);\n\t\tWideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL);\n\t}\n\n\texit(client_main(argc, argv));\n}\n#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY\n\n\n#endif // IS_LIBRARY\n"
  },
  {
    "path": "src/vlmcs.h",
    "content": "#ifndef VLMCS_H_\n#define VLMCS_H_\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if !defined(USE_MSRPC) && defined(_WIN32)\n#include <winsock2.h>\n#endif // defined(USE_MSRPC) && defined(_WIN32)\n#include \"types.h\"\n#ifndef USE_MSRPC\n#include \"rpc.h\"\n#else // USE_MSRPC\n#include \"msrpc-client.h\"\n#endif // USE_MSRPC\n#include \"kms.h\"\n\n#if MULTI_CALL_BINARY < 1\n#define client_main main\n#else\nint client_main(int argc, CARGV argv);\n#endif\n\nint SendActivationRequest(const RpcCtx sock, RESPONSE *baseResponse, REQUEST *baseRequest, RESPONSE_RESULT *result, BYTE *const hwid);\n\n#endif /* VLMCS_H_ */\n\n"
  },
  {
    "path": "src/vlmcsd.c",
    "content": "#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if defined(USE_MSRPC) && !defined(_WIN32) && !defined(__CYGWIN__)\n#error Microsoft RPC is only available on Windows and Cygwin\n#endif\n\n#if defined(USE_MSRPC) && defined(SIMPLE_SOCKETS)\n#error You can only define either USE_MSRPC or SIMPLE_SOCKETS but not both\n#endif\n\n#if defined(NO_SOCKETS) && defined(USE_MSRPC)\n#error Cannot use inetd mode with Microsoft RPC\n#endif\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n#include <stdint.h>\n\n#if _MSC_VER\n#include \"wingetopt.h\"\n#endif\n\n#ifndef _WIN32\n#include <pwd.h>\n#include <grp.h>\n#include <sys/types.h>\n\n#if !defined(NO_LIMIT) && !__minix__\n#include <sys/ipc.h>\n#if !__ANDROID__\n#include <sys/shm.h>\n#endif // !__ANDROID__\n#endif // !defined(NO_LIMIT) && !__minix__\n\n#include <sys/wait.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <sys/stat.h>\n#ifndef NO_LIMIT\n#include <semaphore.h>\n#endif // NO_LIMIT\n#endif // !_WIN32\n\n#if __APPLE__\n#include <mach-o/dyld.h>\n#endif // __APPLE__\n\n#if __linux__ && defined(USE_AUXV)\n#include <sys/auxv.h>\n#endif\n\n#if __FreeBSD__\n#include <sys/sysctl.h>\n#endif\n\n#include \"vlmcsd.h\"\n// ReSharper disable CppUnusedIncludeDirective\n#include \"endian.h\"\n// ReSharper restore CppUnusedIncludeDirective\n#include \"shared_globals.h\"\n#include \"output.h\"\n#ifndef USE_MSRPC\n#include \"network.h\"\n#else // USE_MSRPC\n#include \"msrpc-server.h\"\n#endif // USE_MSRPC\n#include \"ntservice.h\"\n#include \"helpers.h\"\n\n#ifndef NO_TAP\n#include \"wintap.h\"\n#endif\n\nstatic 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\";\n\n#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\nstatic uint_fast8_t maxsockets = 0;\n\n#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\n#ifdef _NTSERVICE\nstatic int_fast8_t installService = 0;\nstatic const char* restrict ServiceUser = NULL;\nstatic const char* restrict ServicePassword = \"\";\n#endif\n\n#ifndef NO_PID_FILE\nstatic const char* fn_pid = NULL;\n#endif\n\n#if !defined(NO_INI_FILE) || !defined(NO_CL_PIDS)\n\n#ifndef NO_INI_FILE\n#ifdef INI_FILE\nstatic const char* fn_ini = INI_FILE;\n#else // !INI_FILE\nstatic const char* fn_ini = NULL;\n#endif // !INI_FILE\n#endif // NO_INI_FILE\n\n#ifndef NO_TAP\nchar* tapArgument = NULL;\n#endif // NO_TAP\n\nstatic const char* IniFileErrorMessage = \"\";\nchar* IniFileErrorBuffer = NULL;\n#define INIFILE_ERROR_BUFFERSIZE 256\n\nstatic IniFileParameter_t IniFileParameterList[] =\n{\n#\tifndef NO_SOCKETS\n\t\t{ \"ExitLevel\", INI_PARAM_EXIT_LEVEL },\n#\tendif // NO_SOCKETS\n#\tifndef NO_TAP\n\t\t{ \"VPN\", INI_PARAM_VPN },\n#   endif // NO_TAP\n#\tifndef NO_EXTERNAL_DATA\n\t\t{ \"KmsData\", INI_PARAM_DATA_FILE },\n#\tendif // NO_EXTERNAL_DATA\n#\tifndef NO_STRICT_MODES\n\t\t{ \"WhiteListingLevel\", INI_PARAM_WHITELISTING_LEVEL },\n\t\t{ \"CheckClientTime\", INI_PARAM_CHECK_CLIENT_TIME },\n#\t\tifndef NO_CLIENT_LIST\n\t\t{ \"StartEmpty\", INI_PARAM_START_EMPTY },\n\t\t{ \"MaintainClients\", INI_PARAM_MAINTAIN_CLIENTS },\n#\t\tendif // NO_CLIENT_LIST\n#\tendif // NO_STRICT_MODES\n#\tifndef NO_RANDOM_EPID\n\t\t{ \"RandomizationLevel\", INI_PARAM_RANDOMIZATION_LEVEL },\n\t\t{ \"LCID\", INI_PARAM_LCID },\n\t\t{ \"HostBuild\", INI_PARAM_HOST_BUILD },\n#\tendif // NO_RANDOM_EPID\n#\tif !defined(NO_SOCKETS) && (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS) || defined(HAVE_GETIFADDR))\n\t\t{ \"Port\", INI_PARAM_PORT },\n#\tendif // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)\n#\tif !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n#\tifndef SIMPLE_SOCKETS\n\t\t{ \"Listen\", INI_PARAM_LISTEN },\n#\tendif // SIMPLE_SOCKETS\n#\tif HAVE_FREEBIND\n\t\t{ \"FreeBind\", INI_PARAM_FREEBIND },\n#\tendif // HAVE_FREEBIND\n#\tif !defined(NO_LIMIT) && !__minix__\n\t\t{ \"MaxWorkers\", INI_PARAM_MAX_WORKERS },\n#\tendif // !defined(NO_LIMIT) && !__minix__\n#\tendif // !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n#\tif !defined(NO_TIMEOUT) && !__minix__ && !defined(USE_MSRPC) & !defined(USE_MSRPC)\n\t\t{ \"ConnectionTimeout\", INI_PARAM_CONNECTION_TIMEOUT },\n#\tendif // !defined(NO_TIMEOUT) && !__minix__ && !defined(USE_MSRPC) & !defined(USE_MSRPC)\n#\tifndef USE_MSRPC\n\t\t{ \"DisconnectClientsImmediately\", INI_PARAM_DISCONNECT_IMMEDIATELY },\n#\tifndef SIMPLE_RPC\n\t\t{ \"UseNDR64\", INI_PARAM_RPC_NDR64 },\n\t\t{ \"UseBTFN\", INI_PARAM_RPC_BTFN },\n#\tendif // !SIMPLE_RPC\n#\tendif // USE_MSRPC\n#\tifndef NO_PID_FILE\n\t\t{ \"PIDFile\", INI_PARAM_PID_FILE },\n#\tendif // NO_PID_FILE\n#\tifndef NO_LOG\n\t\t{ \"LogDateAndTime\", INI_PARAM_LOG_DATE_AND_TIME },\n\t\t{ \"LogFile\", INI_PARAM_LOG_FILE },\n#\tifndef NO_VERBOSE_LOG\n\t\t{ \"LogVerbose\", INI_PARAM_LOG_VERBOSE },\n#\tendif // NO_VERBOSE_LOG\n#\tendif // NO_LOG\n#\tifndef NO_CUSTOM_INTERVALS\n\t\t{\"ActivationInterval\", INI_PARAM_ACTIVATION_INTERVAL },\n\t\t{\"RenewalInterval\", INI_PARAM_RENEWAL_INTERVAL },\n#\tendif // NO_CUSTOM_INTERVALS\n#\tif !defined(NO_USER_SWITCH) && !defined(_WIN32)\n\t\t{ \"user\", INI_PARAM_UID },\n\t\t{ \"group\", INI_PARAM_GID},\n#\tendif // !defined(NO_USER_SWITCH) && !defined(_WIN32)\n#\tif !defined(NO_PRIVATE_IP_DETECT)\n\t\t{\"PublicIPProtectionLevel\", INI_PARAM_PUBLIC_IP_PROTECTION_LEVEL },\n#\tendif\n};\n\n#endif // NO_INI_FILE\n\n\n#if !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\n\n#if !defined(USE_THREADS) && !defined(CYGWIN) && !defined(USE_MSRPC)\nstatic int shmid = -1;\n#endif\n\n\n#endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__\n\n#ifndef NO_USER_SWITCH\n#ifndef _WIN32\n\nstatic const char* uname = NULL, * gname = NULL;\nstatic gid_t gid = INVALID_GID;\nstatic uid_t uid = INVALID_UID;\n\n// Get Numeric id of user/group\nstatic char GetNumericId(gid_t* restrict id, const char* const c)\n{\n\tchar* endptr;\n\tgid_t temp;\n\n\ttemp = (gid_t)strtoll(c, &endptr, 10);\n\tif (!*endptr) *id = temp;\n\tif (*endptr || temp == (gid_t)-1) errno = EINVAL;\n\n\treturn *endptr || *id == (gid_t)-1;\n}\n\n\n// Get group id from option argument\nstatic char GetGid()\n{\n\tstruct group* g;\n\n\tif ((g = getgrnam(optarg)))\n\t\tgid = g->gr_gid;\n\telse\n\t\treturn GetNumericId(&gid, optarg);\n\n\treturn 0;\n}\n\n\n// Get user id from option argument\nstatic char GetUid()\n{\n\tstruct passwd* u;\n\n\t////PORTABILITY: Assumes uid_t and gid_t are of same size (shouldn't be a problem)\n\tif ((u = getpwnam(optarg)))\n\t\tuid = u->pw_uid;\n\telse\n\t\treturn GetNumericId((gid_t*)&uid, optarg);\n\n\treturn 0;\n}\n#endif // _WIN32\n#endif //NO_USER_SWITCH\n\n#ifdef NO_HELP\nstatic __noreturn void usage()\n{\n\tprinterrorf(\"Incorrect parameters\\n\\n\");\n\texit(VLMCSD_EINVAL);\n}\n#else // HELP\n\n\nstatic __noreturn void usage()\n{\n\tprinterrorf(\"vlmcsd %s\\n\"\n\t\t\"\\nUsage:\\n\"\n\t\t\"   %s [ options ]\\n\\n\"\n\t\t\"Where:\\n\"\n#\t\tif !defined(_WIN32) && !defined(NO_USER_SWITCH)\n\t\t\"  -u <user>\\t\\tset uid to <user>\\n\"\n\t\t\"  -g <group>\\t\\tset gid to <group>\\n\"\n#\t\tendif // !defined(_WIN32) && !defined(NO_USER_SWITCH)\n#\t\tifndef NO_CL_PIDS\n\t\t\"  -a <csvlk>=<epid>\\tuse <epid> for <csvlk>\\n\"\n#\t\tendif // NO_CL_PIDS\n#\t\tifndef NO_RANDOM_EPID\n\t\t\"  -r 0|1|2\\t\\tset ePID randomization level (default 1)\\n\"\n\t\t\"  -C <LCID>\\t\\tuse fixed <LCID> in random ePIDs\\n\"\n\t\t\"  -H <build>\\t\\tuse fixed <build> number in random ePIDs\\n\"\n#\t\tendif // NO_RANDOM_EPID\n#\t\tif !defined(NO_PRIVATE_IP_DETECT)\n#\t\tif HAVE_GETIFADDR\n\t\t\"  -o 0|1|2|3\\t\\tset protection level against clients with public IP addresses (default 0)\\n\"\n#\t\telse // !HAVE_GETIFADDR\n#\t\tifndef USE_MSRPC\n\t\t\"  -o 0|2\\t\\tset protection level against clients with public IP addresses (default 0)\\n\"\n#\t\telse // USE_MSRPC\n\t\t\"  -o 0|2\\t\\tset protection level against clients with public IP addresses (default 0). Limited use with MS RPC\\n\"\n#\t\tendif // USE_MSRPC\n#\t\tendif // !HAVE_GETIFADDR\n#\t\tendif // !defined(NO_PRIVATE_IP_DETECT)\n#\t\tifndef NO_TAP\n\t\t\"  -O <v>[=<a>][/<c>]\\tuse VPN adapter <v> with IPv4 address <a> and CIDR <c>\\n\"\n#\t\tendif\n#\t\tifndef NO_SOCKETS\n\t\t\"  -x <level>\\t\\texit if warning <level> reached (default 0)\\n\"\n#\t\tif !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\t\t\"  -L <address>[:<port>]\\tlisten on IP address <address> with optional <port>\\n\"\n\t\t\"  -P <port>\\t\\tset TCP port <port> for subsequent -L statements (default 1688)\\n\"\n#\t\tif HAVE_FREEBIND\n\t\t\"  -F0, -F1\\t\\tdisable/enable binding to foreign IP addresses\\n\"\n#\t\tendif // HAVE_FREEBIND\n#\t\telse // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)\n\t\t\"  -P <port>\\t\\tuse TCP port <port> (default 1688)\\n\"\n#\t\tendif // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)\n#\t\tif !defined(NO_LIMIT) && !__minix__\n\t\t\"  -m <clients>\\t\\tHandle max. <clients> simultaneously (default no limit)\\n\"\n#\t\tendif // !defined(NO_LIMIT) && !__minix__\n#\t\tifdef _NTSERVICE\n\t\t\"  -s\\t\\t\\tinstall vlmcsd as an NT service. Ignores -e\"\n#\t\tifndef _WIN32\n\t\t\", -f and -D\"\n#\t\tendif // _WIN32\n\t\t\"\\n\"\n\t\t\"  -S\\t\\t\\tremove vlmcsd service. Ignores all other options\\n\"\n\t\t\"  -U <username>\\t\\trun NT service as <username>. Must be used with -s\\n\"\n\t\t\"  -W <password>\\t\\toptional <password> for -U. Must be used with -s\\n\"\n#\t\tendif // _NTSERVICE\n#\t\tifndef NO_LOG\n\t\t\"  -e\\t\\t\\tlog to stdout\\n\"\n#\t\tendif // NO_LOG\n#\t\tifndef _WIN32 //\n\t\t\"  -D\\t\\t\\trun in foreground\\n\"\n#\t\telse // _WIN32\n\t\t\"  -D\\t\\t\\tdoes nothing. Provided for compatibility with POSIX versions only\\n\"\n#\t\tendif // _WIN32\n#\t\tendif // NO_SOCKETS\n#\t\tifndef NO_STRICT_MODES\n\t\t\"  -K 0|1|2|3\\t\\tset white-listing level for KMS IDs (default -K0)\\n\"\n\t\t\"  -c0, -c1\\t\\tdisable/enable client time checking (default -c0)\\n\"\n#\t\tifndef NO_CLIENT_LIST\n\t\t\"  -M0, -M1\\t\\tdisable/enable maintaining clients (default -M0)\\n\"\n\t\t\"  -E0, -E1\\t\\tdisable/enable start with empty client list (default -E0, ignored if -M0)\\n\"\n#\t\tendif // !NO_CLIENT_LIST\n#\t\tendif // !NO_STRICT_MODES\n#\t\tifndef USE_MSRPC\n#\t\tif !defined(NO_TIMEOUT) && !__minix__\n\t\t\"  -t <seconds>\\t\\tdisconnect clients after <seconds> of inactivity (default 30)\\n\"\n#\t\tendif // !defined(NO_TIMEOUT) && !__minix__\n\t\t\"  -d\\t\\t\\tdisconnect clients after each request\\n\"\n\t\t\"  -k\\t\\t\\tdon't disconnect clients after each request (default)\\n\"\n#\t\tifndef SIMPLE_RPC\n\t\t\"  -N0, -N1\\t\\tdisable/enable NDR64\\n\"\n\t\t\"  -B0, -B1\\t\\tdisable/enable bind time feature negotiation\\n\"\n#\t\tendif // !SIMPLE_RPC\n#\t\tendif // USE_MSRPC\n#\t\tifndef NO_PID_FILE\n\t\t\"  -p <file>\\t\\twrite pid to <file>\\n\"\n#\t\tendif // NO_PID_FILE\n#\t\tifndef NO_INI_FILE\n\t\t\"  -i <file>\\t\\tuse config file <file>\\n\"\n#\t\tendif // NO_INI_FILE\n#\t\tifndef NO_EXTERNAL_DATA\n\t\t\"  -j <file>\\t\\tuse KMS data file <file>\\n\"\n#\t\tendif // !NO_EXTERNAL_DATA\n#\t\tifndef NO_CUSTOM_INTERVALS\n\t\t\"  -R <interval>\\t\\trenew activation every <interval> (default 1w)\\n\"\n\t\t\"  -A <interval>\\t\\tretry activation every <interval> (default 2h)\\n\"\n#\t\tendif // NO_CUSTOM_INTERVALS\n#\t\tifndef NO_LOG\n#\t\tifndef _WIN32\n\t\t\"  -l syslog\t\tlog to syslog\\n\"\n#\t\tendif // _WIN32\n\t\t\"  -l <file>\\t\\tlog to <file>\\n\"\n\t\t\"  -T0, -T1\\t\\tdisable/enable logging with time and date (default -T1)\\n\"\n#\t\tifndef NO_VERBOSE_LOG\n\t\t\"  -v\\t\\t\\tlog verbose\\n\"\n\t\t\"  -q\\t\\t\\tdon't log verbose (default)\\n\"\n#\t\tendif // NO_VERBOSE_LOG\n#\t\tendif // NO_LOG\n#\t\tifndef NO_VERSION_INFORMATION\n\t\t\"  -V\\t\\t\\tdisplay version information and exit\\n\"\n#\t\tendif // NO_VERSION_INFORMATION\n\t\t,\n\t\tVersion, global_argv[0]);\n\n\texit(VLMCSD_EINVAL);\n}\n#endif // HELP\n\n\n#ifndef NO_CUSTOM_INTERVALS\n#if !defined(NO_INI_FILE)\n\n__pure static BOOL getTimeSpanFromIniFile(DWORD* result, const char* const restrict argument)\n{\n\tconst DWORD val = timeSpanString2Minutes(argument);\n\n\tif (!val)\n\t{\n\t\tIniFileErrorMessage = \"Incorrect time span.\";\n\t\treturn FALSE;\n\t}\n\n\t*result = val;\n\treturn TRUE;\n}\n\n#endif // !defined(NO_INI_FILE)\n\n\n__pure static DWORD getTimeSpanFromCommandLine(const char* const restrict arg, const char optchar)\n{\n\tconst DWORD val = timeSpanString2Minutes(arg);\n\n\tif (!val)\n\t{\n\t\tprinterrorf(\"Fatal: No valid time span specified in option -%c.\\n\", optchar);\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\treturn val;\n}\n\n#endif // NO_CUSTOM_INTERVALS\n\n\n#if !defined(NO_INI_FILE) || !defined (NO_CL_PIDS)\nstatic __pure int isControlCharOrSlash(const char c)\n{\n\tif ((unsigned char)c < '!') return TRUE;\n\tif (c == '/') return TRUE;\n\treturn FALSE;\n}\n\n\nstatic void iniFileLineNextWord(const char** s)\n{\n\twhile (**s && isspace((int)**s)) (*s)++;\n}\n\n\nstatic BOOL setHwIdFromIniFileLine(const char** s, const uint32_t index, const uint8_t overwrite)\n{\n\tiniFileLineNextWord(s);\n\n\tif (**s == '/')\n\t{\n\t\tif (!overwrite && KmsResponseParameters[index].HwId) return TRUE;\n\n\t\tBYTE* HwId = (BYTE*)vlmcsd_malloc(sizeof(((RESPONSE_V6*)0)->HwId));\n\t\thex2bin(HwId, *s + 1, sizeof(((RESPONSE_V6*)0)->HwId));\n\t\tKmsResponseParameters[index].HwId = HwId;\n\t}\n\n\treturn TRUE;\n}\n\n\nstatic BOOL setEpidFromIniFileLine(const char** s, const uint32_t index, const char* ePidSource, const uint8_t overwrite)\n{\n\tiniFileLineNextWord(s);\n\tconst char* savedPosition = *s;\n\tuint_fast16_t i;\n\n\tfor (i = 0; !isControlCharOrSlash(**s); i++)\n\t{\n\t\tif (utf8_to_ucs2_char((const unsigned char*)*s, (const unsigned char**)s) == (WCHAR)~0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\tif (i < 1 || i >= PID_BUFFER_SIZE) return FALSE;\n\tif (!overwrite && KmsResponseParameters[index].Epid) return TRUE;\n\n\tconst size_t size = *s - savedPosition + 1;\n\n\tchar* epidbuffer = (char*)vlmcsd_malloc(size);\n\tmemcpy(epidbuffer, savedPosition, size - 1);\n\tepidbuffer[size - 1] = 0;\n\n\tKmsResponseParameters[index].Epid = epidbuffer;\n\n#ifndef NO_LOG\n\tKmsResponseParameters[index].EpidSource = ePidSource;\n#endif //NO_LOG\n\n\treturn TRUE;\n}\n\n#ifndef NO_INI_FILE\nstatic BOOL getIniFileArgumentBool(int_fast8_t* result, const char* const argument)\n{\n\tIniFileErrorMessage = \"Argument must be true/on/yes/1 or false/off/no/0\";\n\treturn getArgumentBool(result, argument);\n}\n\n\nstatic BOOL getIniFileArgumentInt(unsigned int* result, const char* const argument, const unsigned int min, const unsigned int max)\n{\n\tunsigned int tempResult;\n\n\tif (!stringToInt(argument, min, max, &tempResult))\n\t{\n\t\tvlmcsd_snprintf(IniFileErrorBuffer, INIFILE_ERROR_BUFFERSIZE, \"Must be integer between %u and %u\", min, max);\n\t\tIniFileErrorMessage = IniFileErrorBuffer;\n\t\treturn FALSE;\n\t}\n\n\t*result = tempResult;\n\treturn TRUE;\n}\n\n\nstatic BOOL setIniFileParameter(uint_fast8_t id, const char* const iniarg)\n{\n\tunsigned int result;\n\tBOOL success = TRUE;\n\tswitch (id)\n\t{\n#\tifndef NO_TAP\n\n\tcase INI_PARAM_VPN:\n\t\ttapArgument = (char*)vlmcsd_strdup(iniarg);\n\t\tbreak;\n\n#\tendif // NO_TAP\n\n#\tif !defined(NO_USER_SWITCH) && !_WIN32\n\n\tcase INI_PARAM_GID:\n\t{\n\t\tstruct group* g;\n\t\tIniFileErrorMessage = \"Invalid group id or name\";\n\t\tif (!(gname = vlmcsd_strdup(iniarg))) return FALSE;\n\n\t\tif ((g = getgrnam(iniarg)))\n\t\t\tgid = g->gr_gid;\n\t\telse\n\t\t\tsuccess = !GetNumericId(&gid, iniarg);\n\t\tbreak;\n\t}\n\n\tcase INI_PARAM_UID:\n\t{\n\t\tstruct passwd* p;\n\t\tIniFileErrorMessage = \"Invalid user id or name\";\n\t\tif (!(uname = vlmcsd_strdup(iniarg))) return FALSE;\n\n\t\tif ((p = getpwnam(iniarg)))\n\t\t\tuid = p->pw_uid;\n\t\telse\n\t\t\tsuccess = !GetNumericId(&uid, iniarg);\n\t\tbreak;\n\t}\n\n#\tendif // !defined(NO_USER_SWITCH) && !defined(_WIN32)\n\n#\tifndef NO_RANDOM_EPID\n\n\tcase INI_PARAM_LCID:\n\t\tsuccess = getIniFileArgumentInt(&result, iniarg, 0, 32767);\n\t\tif (success) Lcid = (uint16_t)result;\n\t\tbreak;\n\n\tcase INI_PARAM_RANDOMIZATION_LEVEL:\n\t\tsuccess = getIniFileArgumentInt(&result, iniarg, 0, 2);\n\t\tif (success) RandomizationLevel = (int_fast8_t)result;\n\t\tbreak;\n\n\tcase INI_PARAM_HOST_BUILD:\n\t\tsuccess = getIniFileArgumentInt(&result, iniarg, 0, 65535);\n\t\tif (success) HostBuild = (uint16_t)result;\n\t\tbreak;\n\n#\tendif // NO_RANDOM_EPID\n\n#\tif (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS) || defined(HAVE_GETIFADDR)) && !defined(NO_SOCKETS)\n\n\tcase INI_PARAM_PORT:\n\t\tdefaultport = vlmcsd_strdup(iniarg);\n\t\tbreak;\n\n#\tendif // (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS) || defined(HAVE_GETIFADDR)) && !defined(NO_SOCKETS)\n\n#\tif !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\n\tcase INI_PARAM_LISTEN:\n\t\tmaxsockets++;\n\t\treturn TRUE;\n\n#\tendif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n#\tif !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__\n\n\tcase INI_PARAM_MAX_WORKERS:\n#\t\tifdef USE_MSRPC\n\t\tsuccess = getIniFileArgumentInt(&MaxTasks, iniarg, 1, RPC_C_LISTEN_MAX_CALLS_DEFAULT);\n#\t\telse // !USE_MSRPC\n\t\tsuccess = getIniFileArgumentInt(&MaxTasks, iniarg, 1, SEM_VALUE_MAX);\n#\t\tendif // !USE_MSRPC\n\t\tbreak;\n\n#\tendif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__\n\n#\tifndef NO_PID_FILE\n\n\tcase INI_PARAM_PID_FILE:\n\t\tfn_pid = vlmcsd_strdup(iniarg);\n\t\tbreak;\n\n#\tendif // NO_PID_FILE\n\n#\tifndef NO_EXTERNAL_DATA\n\n\tcase INI_PARAM_DATA_FILE:\n\t\tfn_data = vlmcsd_strdup(iniarg);\n#\t\tifndef NO_INTERNAL_DATA\n\t\tExplicitDataLoad = TRUE;\n#\t\tendif // NO_INTERNAL_DATA\n\t\tbreak;\n\n#\tendif // NO_EXTERNAL_DATA\n\n#\tifndef NO_STRICT_MODES\n\n\tcase INI_PARAM_WHITELISTING_LEVEL:\n\t\tsuccess = getIniFileArgumentInt(&WhitelistingLevel, iniarg, 0, 3);\n\t\tbreak;\n\n\tcase INI_PARAM_CHECK_CLIENT_TIME:\n\t\tsuccess = getIniFileArgumentBool(&CheckClientTime, iniarg);\n\t\tbreak;\n\n#\tifndef NO_CLIENT_LIST\n\tcase INI_PARAM_MAINTAIN_CLIENTS:\n\t\tsuccess = getIniFileArgumentBool(&MaintainClients, iniarg);\n\t\tbreak;\n\n\tcase INI_PARAM_START_EMPTY:\n\t\tsuccess = getIniFileArgumentBool(&StartEmpty, iniarg);\n\t\tbreak;\n\n#\tendif // NO_CLIENT_LIST\n#\tendif // !NO_STRICT_MODES\n\n\n#\tifndef  NO_LOG\n\n\tcase INI_PARAM_LOG_FILE:\n\t\tfn_log = vlmcsd_strdup(iniarg);\n\t\tbreak;\n\n\tcase INI_PARAM_LOG_DATE_AND_TIME:\n\t\tsuccess = getIniFileArgumentBool(&LogDateAndTime, iniarg);\n\t\tbreak;\n\n#\tifndef NO_VERBOSE_LOG\n\tcase INI_PARAM_LOG_VERBOSE:\n\t\tsuccess = getIniFileArgumentBool(&logverbose, iniarg);\n\t\tbreak;\n\n#\tendif // NO_VERBOSE_LOG\n#\tendif // NO_LOG\n\n#\tifndef NO_CUSTOM_INTERVALS\n\n\tcase INI_PARAM_ACTIVATION_INTERVAL:\n\t\tsuccess = getTimeSpanFromIniFile(&VLActivationInterval, iniarg);\n\t\tbreak;\n\n\tcase INI_PARAM_RENEWAL_INTERVAL:\n\t\tsuccess = getTimeSpanFromIniFile(&VLRenewalInterval, iniarg);\n\t\tbreak;\n\n#\tendif // NO_CUSTOM_INTERVALS\n\n#\tifndef USE_MSRPC\n\n#\tif !defined(NO_TIMEOUT) && !__minix__\n\n\tcase INI_PARAM_CONNECTION_TIMEOUT:\n\t\tsuccess = getIniFileArgumentInt(&result, iniarg, 1, 600);\n\t\tif (success) ServerTimeout = (DWORD)result;\n\t\tbreak;\n\n#\tendif // !defined(NO_TIMEOUT) && !__minix__\n\n\tcase INI_PARAM_DISCONNECT_IMMEDIATELY:\n\t\tsuccess = getIniFileArgumentBool(&DisconnectImmediately, iniarg);\n\t\tbreak;\n\n\tcase INI_PARAM_RPC_NDR64:\n\t\tsuccess = getIniFileArgumentBool(&UseServerRpcNDR64, iniarg);\n\t\tif (success) IsNDR64Defined = TRUE;\n\t\tbreak;\n\n\tcase INI_PARAM_RPC_BTFN:\n\t\tsuccess = getIniFileArgumentBool(&UseServerRpcBTFN, iniarg);\n\t\tbreak;\n\n#\tendif // USE_MSRPC\n\n#\tifndef NO_SOCKETS\n\n\tcase INI_PARAM_EXIT_LEVEL:\n\t\tsuccess = getIniFileArgumentInt(&result, iniarg, 0, 1);\n\t\tif (success) ExitLevel = (int_fast8_t)result;\n\t\tbreak;\n\n#\tendif // NO_SOCKETS\n\n#\tif HAVE_FREEBIND\n\n\tcase INI_PARAM_FREEBIND:\n\t\tsuccess = getIniFileArgumentBool(&freebind, iniarg);\n\t\tbreak;\n\n#\tendif // HAVE_FREEBIND\n\n#\tif !defined(NO_PRIVATE_IP_DETECT)\n\n\tcase INI_PARAM_PUBLIC_IP_PROTECTION_LEVEL:\n\t\tsuccess = getIniFileArgumentInt(&PublicIPProtectionLevel, iniarg, 0, 3);\n\n#\t\tif !HAVE_GETIFADDR\n\t\tif (PublicIPProtectionLevel & 1)\n\t\t{\n\t\t\tIniFileErrorMessage = \"Must be 0 or 2\";\n\t\t\tsuccess = FALSE;\n\t\t}\n#\t\tendif // !HAVE_GETIFADDR\n\n\t\tbreak;\n\n#\tendif // !defined(NO_PRIVATE_IP_DETECT)\n\n\tdefault:\n\t\treturn FALSE;\n\t}\n\n\treturn success;\n}\n#endif // !NO_INI_FILE\n\n\n\nstatic BOOL getIniFileArgument(const char** s)\n{\n\twhile (!isspace((int)**s) && **s != '=' && **s) (*s)++;\n\tiniFileLineNextWord(s);\n\n\tif (*((*s)++) != '=')\n\t{\n\t\tIniFileErrorMessage = \"'=' required after keyword.\";\n\t\treturn FALSE;\n\t}\n\n\tiniFileLineNextWord(s);\n\n\tif (!**s)\n\t{\n\t\tIniFileErrorMessage = \"missing argument after '='.\";\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n\nstatic int8_t GetCsvlkIndexFromName(const char* s)\n{\n\tint8_t i;\n\n\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t{\n\t\tconst char* csvlkName = getNextString(KmsData->CsvlkData[i].EPid);\n\n\t\tif (!strncasecmp(csvlkName, s, strlen(csvlkName)))\n\t\t{\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nstatic BOOL handleIniFileEpidParameter(const char* s, uint8_t allowIniFileDirectives, const char* ePidSource)\n{\n\tint_fast16_t i;\n\n\tif (allowIniFileDirectives)\n\t{\n\t\tfor (i = 0; i < (int_fast16_t)vlmcsd_countof(IniFileParameterList); i++)\n\t\t{\n\t\t\tif (!strncasecmp(IniFileParameterList[i].Name, s, strlen(IniFileParameterList[i].Name)))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\ti = GetCsvlkIndexFromName(s);\n\n\tif (i >= 0)\n\t{\n\t\tif (!getIniFileArgument(&s)) return FALSE;\n\t\tif (!setEpidFromIniFileLine(&s, i, ePidSource, !allowIniFileDirectives)) return FALSE;\n\t\tif (!setHwIdFromIniFileLine(&s, i, !allowIniFileDirectives)) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tIniFileErrorMessage = \"Unknown keyword.\";\n\treturn FALSE;\n}\n\n#endif // !defined(NO_INI_FILE) || !defined (NO_CL_PIDS)\n\n#ifndef NO_INI_FILE\nstatic void ignoreIniFileParameter(uint_fast8_t iniFileParameterId)\n{\n\tuint_fast8_t i;\n\n\tfor (i = 0; i < vlmcsd_countof(IniFileParameterList); i++)\n\t{\n\t\tif (IniFileParameterList[i].Id != iniFileParameterId) continue;\n\t\tIniFileParameterList[i].Id = 0;\n\t\tbreak;\n\t}\n}\n#else // NO_INI_FILE\n#define ignoreIniFileParameter(x)\n#endif // NO_INI_FILE\n\n#ifndef NO_INI_FILE\nstatic BOOL handleIniFileParameter(const char* s)\n{\n\tuint_fast8_t i;\n\n\tfor (i = 0; i < vlmcsd_countof(IniFileParameterList); i++)\n\t{\n\t\tif (strncasecmp(IniFileParameterList[i].Name, s, strlen(IniFileParameterList[i].Name))) continue;\n\t\tif (!IniFileParameterList[i].Id) return TRUE;\n\t\tif (!getIniFileArgument(&s)) return FALSE;\n\n\t\treturn setIniFileParameter(IniFileParameterList[i].Id, s);\n\t}\n\n\tIniFileErrorMessage = NULL;\n\treturn TRUE;\n}\n\n\n#if !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)\nstatic BOOL setupListeningSocketsFromIniFile(const char* s)\n{\n\tif (!maxsockets) return TRUE;\n\tif (strncasecmp(\"Listen\", s, 6)) return TRUE;\n\tif (!getIniFileArgument(&s)) return TRUE;\n\n\tvlmcsd_snprintf(IniFileErrorBuffer, INIFILE_ERROR_BUFFERSIZE, \"Cannot listen on %s.\", s);\n\tIniFileErrorMessage = IniFileErrorBuffer;\n\treturn addListeningSocket(s);\n}\n#endif // !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)\n\n\nstatic BOOL readIniFile(const uint_fast8_t pass)\n{\n\tchar  line[256];\n\tconst char* s;\n\tunsigned int lineNumber;\n\tuint_fast8_t lineParseError;\n\n\tFILE* restrict f;\n\tBOOL result = TRUE;\n\n\tIniFileErrorBuffer = (char*)vlmcsd_malloc(INIFILE_ERROR_BUFFERSIZE);\n\n\tif (!((f = fopen(fn_ini, \"r\")))) return FALSE;\n\n\tfor (lineNumber = 1; (s = fgets(line, sizeof(line), f)); lineNumber++)\n\t{\n\t\tsize_t i;\n\n\t\tfor (i = strlen(line); i > 0; i--)\n\t\t{\n\t\t\tif (line[i - 1] != 0xd && line[i - 1] != 0xa)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tline[i] = 0;\n\t\t\n\t\tiniFileLineNextWord(&s);\n\t\tif (*s == ';' || *s == '#' || !*s) continue;\n\n\t\tif (pass == INI_FILE_PASS_1)\n\t\t{\n\t\t\tif (handleIniFileParameter(s)) continue;\n\t\t\tlineParseError = TRUE;\n\t\t}\n\t\telse if (pass == INI_FILE_PASS_2)\n\t\t{\n\t\t\tif (handleIniFileEpidParameter(s, TRUE, fn_ini)) continue;\n\t\t\tlineParseError = TRUE;\n\t\t}\n#\t\tif !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)\n\t\telse if (pass == INI_FILE_PASS_3)\n\t\t{\n\t\t\tlineParseError = !setupListeningSocketsFromIniFile(s);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n#\t\tendif // !defined(NO_SOCKETS) &&  && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)\n\n\t\tif (lineParseError)\n\t\t{\n\t\t\tprinterrorf(\"Warning: %s line %u: \\\"%s\\\". %s\\n\", fn_ini, lineNumber, line, IniFileErrorMessage);\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tif (ferror(f)) result = FALSE;\n\n\tfree(IniFileErrorBuffer);\n\tfclose(f);\n\n#\tif !defined(NO_SOCKETS) && !defined(NO_LOG)\n\n\tif (pass == INI_FILE_PASS_1 && !InetdMode && result)\n\t{\n#\t\tifdef _NTSERVICE\n\t\tif (!installService)\n#\t\tendif // _NTSERVICE\n\t\t\tlogger(\"Read ini file %s\\n\", fn_ini);\n\t}\n\n#\tendif // !defined(NO_SOCKETS) && !defined(NO_LOG)\n\n\treturn result;\n}\n#endif // NO_INI_FILE\n\n\n#if !defined(NO_SOCKETS)\n#if !defined(_WIN32)\n#if !defined(NO_SIGHUP)\nstatic void exec_self(char** argv)\n{\n\tgetExeName();\n\n\tif (fn_exe != NULL)\n\t{\n\t\texecv(fn_exe, argv);\n\t}\n\telse\n\t{\n\t\texecvp(argv[0], argv);\n\t}\n}\n\n\n__noreturn static void HangupHandler(const int signal_unused)\n{\n\tint i;\n\tint_fast8_t daemonize_protection = TRUE;\n\tCARGV argv_in = multi_argv == NULL ? global_argv : multi_argv;\n\tint argc_in = multi_argc == 0 ? global_argc : multi_argc;\n\tconst char** argv_out = (const char**)vlmcsd_malloc((argc_in + 2) * sizeof(char**));\n\n\tfor (i = 0; i < argc_in; i++)\n\t{\n\t\tif (!strcmp(argv_in[i], \"-Z\")) daemonize_protection = FALSE;\n\t\targv_out[i] = argv_in[i];\n\t}\n\n\targv_out[argc_in] = argv_out[argc_in + 1] = NULL;\n\tif (daemonize_protection) argv_out[argc_in] = (char*)\"-Z\";\n\n\texec_self((char**)argv_out);\n\tint error = errno;\n\n#\tifndef NO_LOG\n\tlogger(\"Fatal: Unable to restart on SIGHUP: %s\\n\", strerror(error));\n#\tendif\n\n#\tifndef NO_PID_FILE\n\tif (fn_pid) unlink(fn_pid);\n#\tendif // NO_PID_FILE\n\texit(error);\n}\n#endif // NO_SIGHUP\n\n\n__noreturn static void terminationHandler(const int signal_unused)\n{\n\tcleanup();\n\texit(0);\n}\n\n\n#if defined(CHILD_HANDLER) || __minix__\nstatic void childHandler(const int signal)\n{\n\twaitpid(-1, NULL, WNOHANG);\n}\n#endif // defined(CHILD_HANDLER) || __minix__\n\n\nstatic int daemonizeAndSetSignalAction()\n{\n\tstruct sigaction sa;\n\tsigemptyset(&sa.sa_mask);\n\n#\tifndef NO_LOG\n\tif (!nodaemon) if (daemon(!0, logstdout))\n#\telse // NO_LOG\n\tif (!nodaemon) if (daemon(!0, 0))\n#\tendif // NO_LOG\n\t{\n\t\tprinterrorf(\"Fatal: Could not daemonize to background.\\n\");\n\t\treturn(errno);\n\t}\n\n\tif (!InetdMode)\n\t{\n#\t\tifndef USE_THREADS\n\n#\t\tif defined(CHILD_HANDLER) || __minix__\n\t\tsa.sa_handler = childHandler;\n#\t\telse // !(defined(CHILD_HANDLER) || __minix__)\n\t\tsa.sa_handler = SIG_IGN;\n#\t\tendif // !(defined(CHILD_HANDLER) || __minix__)\n\t\tsa.sa_flags = SA_NOCLDWAIT;\n\n\t\tif (sigaction(SIGCHLD, &sa, NULL))\n\t\t\treturn(errno);\n\n#\t\tendif // !USE_THREADS\n\n\t\tsa.sa_handler = terminationHandler;\n\t\tsa.sa_flags = 0;\n\n\t\tsigaction(SIGINT, &sa, NULL);\n\t\tsigaction(SIGTERM, &sa, NULL);\n\n#\t\tifndef NO_SIGHUP\n\t\tsa.sa_handler = HangupHandler;\n\t\tsa.sa_flags = SA_NODEFER;\n\t\tsigaction(SIGHUP, &sa, NULL);\n#\t\tendif // NO_SIGHUP\n\t}\n\n\treturn 0;\n}\n\n\n#else // _WIN32\n\nstatic BOOL __stdcall  terminationHandler(const DWORD fdwCtrlType)\n{\n\t// What a lame substitute for Unix signal handling\n\tswitch (fdwCtrlType)\n\t{\n\tcase CTRL_C_EVENT:\n\tcase CTRL_CLOSE_EVENT:\n\tcase CTRL_BREAK_EVENT:\n\tcase CTRL_LOGOFF_EVENT:\n\tcase CTRL_SHUTDOWN_EVENT:\n\t\tcleanup();\n\t\texit(0);\n\tdefault:\n\t\treturn FALSE;\n\t}\n}\n\n\nstatic DWORD daemonizeAndSetSignalAction()\n{\n\tif (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)terminationHandler, TRUE))\n\t{\n#ifndef NO_LOG\n\t\tconst DWORD rc = GetLastError();\n\t\tlogger(\"Warning: Could not register Windows signal handler: Error %u\\n\", rc);\n#endif // NO_LOG\n\t}\n\n\treturn ERROR_SUCCESS;\n}\n#endif // _WIN32\n#endif // !defined(NO_SOCKETS)\n\n\n// Workaround for Cygwin fork problem (only affects cygwin processes that are Windows services)\n// Best is to compile for Cygwin with threads. fork() is slow and unreliable on Cygwin\n#if !defined(NO_INI_FILE) || !defined(NO_LOG) || !defined(NO_CL_PIDS) || !defined(NO_EXTERNAL_DATA)\n__pure static char* getCommandLineArg(char* const restrict arg)\n{\n#\tif !__CYGWIN__ || defined(USE_THREADS) || defined(NO_SOCKETS)\n\treturn arg;\n#\telse\n\tif (!IsNTService) return arg;\n\n\treturn vlmcsd_strdup(arg);\n#\tendif\n}\n#endif // !defined(NO_INI_FILE) || !defined(NO_LOG) || !defined(NO_CL_PIDS) || !defined(NO_EXTERNAL_DATA)\n\n\nstatic void parseGeneralArguments() {\n\tint o;\n\n\tfor (opterr = 0; (o = getopt(global_argc, (char* const*)global_argv, (const char*)optstring)) > 0; ) switch (o)\n\t{\n#\tif !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\tcase 'Z':\n\t\tIsRestarted = TRUE;\n\t\tnodaemon = TRUE;\n\t\tbreak;\n#\tendif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)\n\n#\tifndef NO_TAP\n\n\tcase 'O':\n\t\tignoreIniFileParameter(INI_PARAM_VPN);\n\t\ttapArgument = getCommandLineArg(optarg);\n\t\tbreak;\n\n#\tendif // NO_TAP\n\n#\tifndef NO_CL_PIDS\n\n\tcase 'a':\n\t\tbreak;\n\n#\tendif // NO_CL_PIDS\n\n#\tifndef NO_EXTERNAL_DATA\n\n\tcase 'j':\n\t\tignoreIniFileParameter(INI_PARAM_DATA_FILE);\n\t\tfn_data = getCommandLineArg(optarg);\n#\t\tifndef NO_INTERNAL_DATA\n\t\tExplicitDataLoad = TRUE;\n#\t\tendif // NO_INTERNAL_DATA\n\t\tbreak;\n\n#\tendif // NO_EXTERNAL_DATA\n\n#\tifndef NO_SOCKETS\n\n\tcase 'x':\n\t\tignoreIniFileParameter(INI_PARAM_EXIT_LEVEL);\n\t\tExitLevel = (int_fast8_t)getOptionArgumentInt((char)o, 0, 1);\n\t\tbreak;\n\n\tcase 'P':\n\t\tignoreIniFileParameter(INI_PARAM_PORT);\n#\t\tif !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)\n\t\tignoreIniFileParameter(INI_PARAM_LISTEN);\n#\t\telse\n\t\tdefaultport = optarg;\n#\t\tendif // !SIMPLE_SOCKETS\n\t\tbreak;\n\n#\tif !defined(NO_LIMIT) && !__minix__\n\n\tcase 'm':\n#\t\tifdef USE_MSRPC\n\t\tMaxTasks = getOptionArgumentInt(o, 1, RPC_C_LISTEN_MAX_CALLS_DEFAULT);\n#\t\telse // !USE_MSRPC\n\t\tMaxTasks = getOptionArgumentInt((char)o, 1, SEM_VALUE_MAX);\n#\t\tendif // !USE_MSRPC\n\t\tignoreIniFileParameter(INI_PARAM_MAX_WORKERS);\n\t\tbreak;\n\n#\t\tendif // !defined(NO_LIMIT) && !__minix__\n#\t\tendif // NO_SOCKETS\n\n#\tif !defined(NO_TIMEOUT) && !__minix__ && !defined(USE_MSRPC)\n\tcase 't':\n\t\tServerTimeout = getOptionArgumentInt((char)o, 1, 600);\n\t\tignoreIniFileParameter(INI_PARAM_CONNECTION_TIMEOUT);\n\t\tbreak;\n#\tendif // !defined(NO_TIMEOUT) && !__minix__ && !defined(USE_MSRPC)\n\n#\tifndef NO_PID_FILE\n\tcase 'p':\n\t\tfn_pid = getCommandLineArg(optarg);\n\t\tignoreIniFileParameter(INI_PARAM_PID_FILE);\n\t\tbreak;\n#\tendif\n\n#\tifndef NO_INI_FILE\n\tcase 'i':\n\t\tfn_ini = getCommandLineArg(optarg);\n\t\tif (!strcmp(fn_ini, \"-\")) fn_ini = NULL;\n\t\tbreak;\n#\tendif\n\n#\tifndef NO_LOG\n\n\tcase 'T':\n\t\tif (!getArgumentBool(&LogDateAndTime, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_LOG_DATE_AND_TIME);\n\t\tbreak;\n\n\tcase 'l':\n\t\tfn_log = getCommandLineArg(optarg);\n\t\tignoreIniFileParameter(INI_PARAM_LOG_FILE);\n\t\tbreak;\n\n#\tifndef NO_VERBOSE_LOG\n\tcase 'v':\n\tcase 'q':\n\t\tlogverbose = o == 'v';\n\t\tignoreIniFileParameter(INI_PARAM_LOG_VERBOSE);\n\t\tbreak;\n\n#\tendif // NO_VERBOSE_LOG\n#\tendif // NO_LOG\n\n#\tif !defined(NO_PRIVATE_IP_DETECT)\n\tcase 'o':\n\t\tignoreIniFileParameter(INI_PARAM_PUBLIC_IP_PROTECTION_LEVEL);\n\t\tPublicIPProtectionLevel = getOptionArgumentInt((char)o, 0, 3);\n\n#\t\tif !HAVE_GETIFADDR\n\t\tif (PublicIPProtectionLevel & 1) usage();\n#\t\tendif // !HAVE_GETIFADDR\n\n\t\tbreak;\n#\tendif // !defined(NO_PRIVATE_IP_DETECT)\n\n#\tifndef NO_SOCKETS\n#\tif !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\tcase 'L':\n\t\tmaxsockets++;\n\t\tignoreIniFileParameter(INI_PARAM_LISTEN);\n\t\tbreak;\n#\tif HAVE_FREEBIND\n\tcase 'F':\n\t\tif (!getArgumentBool(&freebind, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_FREEBIND);\n\t\tbreak;\n#\tendif // HAVE_FREEBIND\n#\tendif // !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\n#\tifdef _NTSERVICE\n\tcase 'U':\n\t\tServiceUser = optarg;\n\t\tbreak;\n\n\tcase 'W':\n\t\tServicePassword = optarg;\n\t\tbreak;\n\n\tcase 's':\n#\t\tifndef USE_MSRPC\n\t\tif (InetdMode) usage();\n#\t\tendif // USE_MSRPC\n\t\tif (!IsNTService) installService = 1; // Install\n\t\tbreak;\n\n\tcase 'S':\n\t\tif (!IsNTService) installService = 2; // Remove\n\t\tbreak;\n#\tendif // _NTSERVICE\n\n#\tifndef NO_STRICT_MODES\n\n\tcase 'K':\n\t\tWhitelistingLevel = (int_fast8_t)getOptionArgumentInt((char)o, 0, 3);\n\t\tignoreIniFileParameter(INI_PARAM_WHITELISTING_LEVEL);\n\t\tbreak;\n\n\tcase 'c':\n\t\tif (!getArgumentBool(&CheckClientTime, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_CHECK_CLIENT_TIME);\n\t\tbreak;\n\n#\tifndef NO_CLIENT_LIST\n\tcase 'E':\n\t\tif (!getArgumentBool(&StartEmpty, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_START_EMPTY);\n\t\tbreak;\n\n\tcase 'M':\n\t\tif (!getArgumentBool(&MaintainClients, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_MAINTAIN_CLIENTS);\n\t\tbreak;\n\n#\tendif // !NO_CLIENT_LIST\n#\tendif // !NO_STRICT_MODES\n\n\tcase 'D':\n#\t\tifndef _WIN32\n\t\tnodaemon = 1;\n#\t\telse // _WIN32\n#\t\tifdef _PEDANTIC\n\t\tprinterrorf(\"Warning: Option -D has no effect in the Windows version of vlmcsd.\\n\");\n#\t\tendif // _PEDANTIC\n#\t\tendif // _WIN32\n\t\tbreak;\n\n#\tifndef NO_LOG\n\n\tcase 'e':\n\t\tlogstdout = 1;\n\t\tbreak;\n\n#\tendif // NO_LOG\n#\tendif // NO_SOCKETS\n\n#\tifndef NO_RANDOM_EPID\n\tcase 'r':\n\t\tRandomizationLevel = (int_fast8_t)getOptionArgumentInt((char)o, 0, 2);\n\t\tignoreIniFileParameter(INI_PARAM_RANDOMIZATION_LEVEL);\n\t\tbreak;\n\n\tcase 'C':\n\t\tLcid = (uint16_t)getOptionArgumentInt((char)o, 0, 32767);\n\n\t\tignoreIniFileParameter(INI_PARAM_LCID);\n\n#\t\tifdef _PEDANTIC\n\t\tif (!IsValidLcid(Lcid))\n\t\t{\n\t\t\tprinterrorf(\"Warning: %s is not a valid LCID.\\n\", optarg);\n\t\t}\n#\t\tendif // _PEDANTIC\n\n\t\tbreak;\n\n\tcase 'H':\n\t\tHostBuild = (uint16_t)getOptionArgumentInt((char)o, 0, 0xffff);\n\t\tignoreIniFileParameter(INI_PARAM_HOST_BUILD);\n\t\tbreak;\n#\tendif // NO_RANDOM_PID\n\n#\tif !defined(NO_USER_SWITCH) && !defined(_WIN32)\n\tcase 'g':\n\t\tgname = optarg;\n\t\tignoreIniFileParameter(INI_PARAM_GID);\n#\t\tifndef NO_SIGHUP\n\t\tif (!IsRestarted)\n#\t\tendif // NO_SIGHUP\n\t\t\tif (GetGid())\n\t\t\t{\n\t\t\t\tprinterrorf(\"Fatal: %s for %s failed: %s\\n\", \"setgid\", gname, strerror(errno));\n\t\t\t\texit(errno);\n\t\t\t}\n\t\tbreak;\n\n\tcase 'u':\n\t\tuname = optarg;\n\t\tignoreIniFileParameter(INI_PARAM_UID);\n#\t\tifndef NO_SIGHUP\n\t\tif (!IsRestarted)\n#\t\tendif // NO_SIGHUP\n\t\t\tif (GetUid())\n\t\t\t{\n\t\t\t\tprinterrorf(\"Fatal: %s for %s failed: %s\\n\", \"setuid\", uname, strerror(errno));\n\t\t\t\texit(errno);\n\t\t\t}\n\t\tbreak;\n#\tendif // NO_USER_SWITCH && !_WIN32\n\n#\tifndef NO_CUSTOM_INTERVALS\n\tcase 'R':\n\t\tVLRenewalInterval = getTimeSpanFromCommandLine(optarg, (char)o);\n\t\tignoreIniFileParameter(INI_PARAM_RENEWAL_INTERVAL);\n\t\tbreak;\n\n\tcase 'A':\n\t\tVLActivationInterval = getTimeSpanFromCommandLine(optarg, (char)o);\n\t\tignoreIniFileParameter(INI_PARAM_ACTIVATION_INTERVAL);\n\t\tbreak;\n#\tendif // NO_CUSTOM_INTERVALS\n\n#\tifndef USE_MSRPC\n\tcase 'd':\n\tcase 'k':\n\t\tDisconnectImmediately = o == 'd';\n\t\tignoreIniFileParameter(INI_PARAM_DISCONNECT_IMMEDIATELY);\n\t\tbreak;\n\n#\tifndef SIMPLE_RPC\n\tcase 'N':\n\t\tif (!getArgumentBool(&UseServerRpcNDR64, optarg)) usage();\n\t\tIsNDR64Defined = TRUE;\n\t\tignoreIniFileParameter(INI_PARAM_RPC_NDR64);\n\t\tbreak;\n\n\tcase 'B':\n\t\tif (!getArgumentBool(&UseServerRpcBTFN, optarg)) usage();\n\t\tignoreIniFileParameter(INI_PARAM_RPC_BTFN);\n\t\tbreak;\n#\tendif // !SIMPLE_RPC\n#\tendif // !USE_MSRPC\n\n#\tifndef NO_VERSION_INFORMATION\n\tcase 'V':\n#\t\tifdef _NTSERVICE\n\t\tif (IsNTService) break;\n#\t\tendif\n#\t\tif defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)\n\t\tprintf(\"vlmcsd %s %i-bit\\n\", Version, sizeof(void*) == 4 ? 31 : (int)sizeof(void*) << 3);\n#\t\telse\n\t\tprintf(\"vlmcsd %s %i-bit\\n\", Version, (int)sizeof(void*) << 3);\n#\t\tendif // defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)\n\t\tprintPlatform();\n\t\tprintCommonFlags();\n\t\tprintServerFlags();\n\t\texit(0);\n#\tendif // NO_VERSION_INFORMATION\n\n\tdefault:\n\t\tusage();\n\t}\n\n\t// Do not allow non-option arguments\n\tif (optind != global_argc)\n\t\tusage();\n\n#\tifdef _NTSERVICE\n\t// -U and -W must be used with -s\n\tif ((ServiceUser || *ServicePassword) && installService != 1) usage();\n#\tendif // _NTSERVICE\n}\n\n\n#if !defined(NO_PID_FILE)\nstatic void writePidFile()\n{\n#\tifndef NO_SIGHUP\n\tif (IsRestarted) return;\n#\tendif // NO_SIGHUP\n\n\tif (fn_pid && !InetdMode)\n\t{\n\t\tFILE* file = fopen(fn_pid, \"w\");\n\n\t\tif (file)\n\t\t{\n#\t\t\tif _MSC_VER\n\t\t\tfprintf(file, \"%u\", (unsigned int)GetCurrentProcessId());\n#\t\t\telse\n\t\t\tfprintf(file, \"%u\", (unsigned int)getpid());\n#\t\t\tendif\n\t\t\tfclose(file);\n\t\t}\n\n#\t\tifndef NO_LOG\n\t\telse\n\t\t{\n\t\t\tlogger(\"Warning: Cannot write pid file '%s'. %s.\\n\", fn_pid, strerror(errno));\n\t\t}\n#\t\tendif // NO_LOG\n\t}\n}\n#else\n#define writePidFile()\n#endif // !defined(NO_PID_FILE)\n\n#if !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\nvoid cleanup()\n{\n\tif (!InetdMode)\n\t{\n#\t\tifndef NO_CLIENT_LIST\n\t\tif (MaintainClients) CleanUpClientLists();\n#\t\tendif // !NO_CLIENT_LIST\n\n#\t\tifndef NO_PID_FILE\n\t\tif (fn_pid) vlmcsd_unlink(fn_pid);\n#\t\tendif // NO_PID_FILE\n\t\tcloseAllListeningSockets();\n\n#\t\tif !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !defined(_WIN32) && !__minix__\n\t\tsem_unlink(\"/vlmcsd\");\n#\t\tif !defined(USE_THREADS) && !defined(CYGWIN)\n\t\tif (shmid >= 0)\n\t\t{\n\t\t\tif (MaxTaskSemaphore != (sem_t*)-1) shmdt(MaxTaskSemaphore);\n\t\t\tshmctl(shmid, IPC_RMID, NULL);\n\t\t}\n#\t\tendif // !defined(USE_THREADS) && !defined(CYGWIN)\n#\t\tendif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !defined(_WIN32) && !__minix__\n\n#\t\tifndef NO_LOG\n\t\tlogger(\"vlmcsd %s was shutdown\\n\", Version);\n#\t\tendif // NO_LOG\n\t}\n}\n\n#elif defined(USE_MSRPC)\n\nvoid cleanup()\n{\n#\tifndef NO_PID_FILE\n\tif (fn_pid) unlink(fn_pid);\n#\tendif // NO_PID_FILE\n\n#\tifndef NO_LOG\n\tlogger(\"vlmcsd %s was shutdown\\n\", Version);\n#\tendif // NO_LOG\n}\n\n#else // Neither Sockets nor RPC\n\n__pure void cleanup() {}\n\n#endif // Neither Sockets nor RPC\n\n\n#if !defined(USE_MSRPC) && !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__\n// Get a semaphore for limiting the maximum concurrent tasks\nstatic void allocateSemaphore(void)\n{\n#\tifdef USE_THREADS\n#\tdefine sharemode 0\n#\telse\n#\tdefine sharemode 1\n#\tendif\n\n#\tifndef _WIN32\n\tsem_unlink(\"/vlmcsd\");\n#\tendif\n\n\tif (MaxTasks < SEM_VALUE_MAX && !InetdMode)\n\t{\n#\t\tifndef _WIN32\n\n#\t\tif !defined(USE_THREADS) && !defined(CYGWIN)\n\n\t\tif ((MaxTaskSemaphore = sem_open(\"/vlmcsd\", O_CREAT /*| O_EXCL*/, 0700, MaxTasks)) == SEM_FAILED) // fails on many systems\n\t\t{\n\t\t\t// We didn't get a named Semaphore (/dev/shm on Linux) so let's try our own shared page\n\n\t\t\tif (\n\t\t\t\t(shmid = shmget(IPC_PRIVATE, sizeof(sem_t), IPC_CREAT | 0600)) < 0 ||\n\t\t\t\t(MaxTaskSemaphore = (sem_t*)shmat(shmid, NULL, 0)) == (sem_t*)-1 ||\n\t\t\t\tsem_init(MaxTaskSemaphore, 1, MaxTasks) < 0\n\t\t\t\t)\n\t\t\t{\n\t\t\t\tint errno_save = errno;\n\t\t\t\tif (MaxTaskSemaphore != (sem_t*)-1) shmdt(MaxTaskSemaphore);\n\t\t\t\tif (shmid >= 0) shmctl(shmid, IPC_RMID, NULL);\n\t\t\t\tprinterrorf(\"Warning: Could not create semaphore: %s\\n\", vlmcsd_strerror(errno_save));\n\t\t\t\tMaxTasks = SEM_VALUE_MAX;\n\t\t\t}\n\t\t}\n\n#\t\telse // THREADS or CYGWIN\n\n\t\tMaxTaskSemaphore = (sem_t*)vlmcsd_malloc(sizeof(sem_t));\n\n\t\tif (sem_init(MaxTaskSemaphore, sharemode, MaxTasks) < 0) // sem_init is not implemented on Darwin (returns ENOSYS)\n\t\t{\n\t\t\tfree(MaxTaskSemaphore);\n\n\t\t\tif ((MaxTaskSemaphore = sem_open(\"/vlmcsd\", O_CREAT /*| O_EXCL*/, 0700, MaxTasks)) == SEM_FAILED)\n\t\t\t{\n\t\t\t\tprinterrorf(\"Warning: Could not create semaphore: %s\\n\", vlmcsd_strerror(errno));\n\t\t\t\tMaxTasks = SEM_VALUE_MAX;\n\t\t\t}\n\t\t}\n\n#\t\tendif // THREADS or CYGWIN\n\n#\t\telse // _WIN32\n\n\t\tif (!((MaxTaskSemaphore = CreateSemaphoreA(NULL, MaxTasks, MaxTasks, NULL))))\n\t\t{\n\t\t\tprinterrorf(\"Warning: Could not create semaphore: %s\\n\", vlmcsd_strerror(GetLastError()));\n\t\t\tMaxTasks = SEM_VALUE_MAX;\n\t\t}\n\n#\t\tendif // _WIN32\n\t}\n}\n#endif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__\n\n\n#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\nint setupListeningSockets()\n{\n\tint o;\n#\tif HAVE_GETIFADDR\n\tchar** privateIPList = NULL;\n\tint numPrivateIPs = 0;\n\tif (PublicIPProtectionLevel & 1) getPrivateIPAddresses(&numPrivateIPs, &privateIPList);\n\tconst uint_fast8_t allocsockets = (uint_fast8_t)(maxsockets ? (maxsockets + numPrivateIPs) : ((PublicIPProtectionLevel & 1) ? numPrivateIPs : 2));\n#\telse // !HAVE_GETIFADDR\n\tuint_fast8_t allocsockets = maxsockets ? maxsockets : 2;\n#\tendif // !HAVE_GETIFADDR\n\n\tSocketList = (SOCKET*)vlmcsd_malloc((size_t)allocsockets * sizeof(SOCKET));\n\n\tconst int_fast8_t haveIPv4Stack = checkProtocolStack(AF_INET);\n\tconst int_fast8_t haveIPv6Stack = checkProtocolStack(AF_INET6);\n\n\t// Reset getopt since we've alread used it\n\toptReset();\n\n\tfor (opterr = 0; (o = getopt(global_argc, (char* const*)global_argv, (const char*)optstring)) > 0; ) switch (o)\n\t{\n\tcase 'P':\n\t\tdefaultport = optarg;\n\t\tbreak;\n\n\tcase 'L':\n\t\taddListeningSocket(optarg);\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\n\n#\tifndef NO_INI_FILE\n\tif (maxsockets && !numsockets)\n\t{\n\t\tif (fn_ini && !readIniFile(INI_FILE_PASS_3))\n\t\t{\n#\t\t\tifdef INI_FILE\n\t\t\tif (strcmp(fn_ini, INI_FILE))\n#\t\t\tendif // INI_FILE\n\t\t\t\tprinterrorf(\"Warning: Can't read %s: %s\\n\", fn_ini, strerror(errno));\n\t\t}\n\t}\n#\tendif\n\n#\tif HAVE_GETIFADDR\n\tif (PublicIPProtectionLevel & 1)\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < numPrivateIPs; i++)\n\t\t{\n\t\t\taddListeningSocket(privateIPList[i]);\n\t\t\tfree(privateIPList[i]);\n\t\t}\n\n\t\tfree(privateIPList);\n\t}\n#\tendif // HAVE_GETIFADDR\n\n\t// if -L hasn't been specified on the command line, use default sockets (all IP addresses)\n\t// maxsocket results from first pass parsing the arguments\n\tif (!maxsockets)\n\t{\n#\t\tif HAVE_GETIFADDR\n\t\tif (!(PublicIPProtectionLevel & 1) && haveIPv6Stack) addListeningSocket(\"::\");\n\t\tif (!(PublicIPProtectionLevel & 1) && haveIPv4Stack) addListeningSocket(\"0.0.0.0\");\n#\t\telse // !HAVE_GETIFADDR\n\t\tif (haveIPv6Stack) addListeningSocket(\"::\");\n\t\tif (haveIPv4Stack) addListeningSocket(\"0.0.0.0\");\n#\t\tendif // !HAVE_GETIFADDR\n\t}\n\n\tif (!numsockets)\n\t{\n\t\tprinterrorf(\"Fatal: Could not listen on any socket.\\n\");\n\t\treturn(!0);\n\t}\n\n\treturn 0;\n}\n#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)\n\n\nint server_main(int argc, CARGV argv)\n{\n\tglobal_argc = argc;\n\tglobal_argv = argv;\n\n#\tifdef _NTSERVICE\n\tDWORD lasterror = ERROR_SUCCESS;\n\n\tif (!StartServiceCtrlDispatcher(NTServiceDispatchTable) && (lasterror = GetLastError()) == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT)\n\t{\n\t\tIsNTService = FALSE;\n\t\treturn newmain();\n\t}\n\n\treturn lasterror;\n#\telse // !_NTSERVICE\n\treturn newmain();\n#\tendif // !_NTSERVICE\n}\n\n\nint newmain()\n{\n\t// Initialize thread synchronization objects for Windows and Cygwin\n#\tifdef USE_THREADS\n\n#\tifndef NO_LOG\n// Initialize the Critical Section for proper logging\n#\tif _WIN32 || __CYGWIN__\n\tInitializeCriticalSection(&logmutex);\n#\tendif // _WIN32 || __CYGWIN__\n#\tendif // NO_LOG\n\n#\tendif // USE_THREADS\n\n#\tifdef _WIN32\n\n#\tifndef USE_MSRPC\n\tWSADATA wsadata;\n\t{\n\t\t// Windows Sockets must be initialized\n\t\tint error;\n\t\tif ((error = WSAStartup(0x0202, &wsadata)))\n\t\t{\n\t\t\tprinterrorf(\"Fatal: Could not initialize Windows sockets (Error: %d).\\n\", error);\n\t\t\treturn error;\n\t\t}\n\t}\n#\tendif // USE_MSRPC\n\n\t// Windows can never daemonize\n\t//nodaemon = 1;\n\n#\telse // __CYGWIN__\n\n\t// Do not daemonize if we are a Windows service\n#\tifdef _NTSERVICE \n\tif (IsNTService) nodaemon = 1;\n#\tendif\n\n#\tendif // _WIN32 / __CYGWIN__\n\n\tparseGeneralArguments(); // Does not return if an error occurs\n\n#\tif !defined(_WIN32) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n\tstruct stat statbuf;\n\tfstat(STDIN_FILENO, &statbuf);\n\n\tif (S_ISSOCK(statbuf.st_mode))\n\t{\n\t\tInetdMode = 1;\n#\t\tifndef NO_CLIENT_LIST\n\t\tMaintainClients = FALSE;\n#\t\tendif // !NO_CLIENT_LIST\n\t\tnodaemon = 1;\n#\t\tifndef SIMPLE_SOCKETS\n\t\tmaxsockets = 0;\n#\t\tendif // !SIMPLE_SOCKETS\n#\t\tifndef NO_LOG\n\t\tlogstdout = 0;\n#\t\tendif // !NO_LOG\n\t}\n\n#\tendif // !defined(_WIN32) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n#\tifndef NO_INI_FILE\n\n\tif (fn_ini && !readIniFile(INI_FILE_PASS_1))\n\t{\n#\t\tifdef INI_FILE\n\t\tif (strcmp(fn_ini, INI_FILE))\n#\t\tendif // INI_FILE\n\t\t\tprinterrorf(\"Warning: Can't read %s: %s\\n\", fn_ini, strerror(errno));\n\t}\n\n#\tendif // NO_INI_FILE\n\n\tloadKmsData();\n\n#\tif !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\n\n\tif\n\t\t(\n\t\t\t!IsNDR64Defined\n\t\t\t)\n\t{\n\t\tUseServerRpcNDR64 = !!(KmsData->Flags & KMS_OPTIONS_USENDR64);\n#\t\tifndef NO_RANDOM_EPID\n\t\tif (HostBuild && RandomizationLevel)\n\t\t{\n\t\t\tUseServerRpcNDR64 = HostBuild > 7601;\n\t\t}\n#\t\tendif \n\t}\n#\tendif // !defined(USE_MSRPC) && !defined(SIMPLE_RPC)\n\n#\tif !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\n\tKmsResponseParameters = (KmsResponseParam_t*)vlmcsd_malloc(sizeof(KmsResponseParam_t) * KmsData->CsvlkCount);\n\tmemset(KmsResponseParameters, 0, sizeof(KmsResponseParam_t) * KmsData->CsvlkCount);\n#\tendif // !defined(NO_RANDOM_EPID) || !defined(NO_CL_PIDS) || !defined(NO_INI_FILE)\n\n#ifndef NO_CL_PIDS\n\toptReset();\n\tint o;\n\n\tfor (opterr = 0; (o = getopt(global_argc, (char* const*)global_argv, (const char*)optstring)) > 0; ) switch (o)\n\t{\n\tcase 'a':\n\t\tif (!handleIniFileEpidParameter(optarg, FALSE, \"command line\"))\n\t\t{\n\t\t\tusage();\n\t\t}\n\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\n#endif // NO_CL_PIDS\n\n#\tifndef NO_INI_FILE\n\n\tif (fn_ini && !readIniFile(INI_FILE_PASS_2))\n\t{\n#\t\tifdef INI_FILE\n\t\tif (strcmp(fn_ini, INI_FILE))\n#\t\tendif // INI_FILE\n\t\t\tprinterrorf(\"Warning: Can't read %s: %s\\n\", fn_ini, strerror(errno));\n\t}\n\n#\tendif // NO_INI_FILE\n\n#\tifndef NO_CLIENT_LIST\n\tif (MaintainClients) InitializeClientLists();\n#\tendif // !NO_CLIENT_LIST\n\n#\tif defined(USE_MSRPC) && !defined(NO_PRIVATE_IP_DETECT)\n\tif (PublicIPProtectionLevel)\n\t{\n\t\tprinterrorf(\"Warning: Public IP address protection using MS RPC is poor. See vlmcsd.8\\n\");\n\t}\n#\tendif // defined(USE_MSRPC) && !defined(NO_PRIVATE_IP_DETECT)\n\n#\tif !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__ && !defined(USE_MSRPC)\n\tallocateSemaphore();\n#\tendif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && __minix__\n\n#\tifdef _NTSERVICE\n\tif (installService)\n\t\treturn NtServiceInstallation(installService, ServiceUser, ServicePassword);\n#\tendif // _NTSERVICE\n\n#\tifndef NO_TAP\n\tif (tapArgument && !InetdMode) startTap(tapArgument);\n#\tendif // NO_TAP\n\n#\tif !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\tif (!InetdMode)\n\t{\n\t\tint error;\n#\t\tifdef SIMPLE_SOCKETS\n\t\tif ((error = listenOnAllAddresses())) return error;\n#\t\telse // !SIMPLE_SOCKETS\n\t\tif ((error = setupListeningSockets())) return error;\n#\t\tendif // !SIMPLE_SOCKETS\n\t}\n#\tendif // !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n\t// After sockets have been set up, we may switch to a lower privileged user\n#\tif !defined(_WIN32) && !defined(NO_USER_SWITCH)\n\n#\tifndef NO_SIGHUP\n\tif (!IsRestarted)\n\t{\n#\tendif // NO_SIGHUP\n\t\tif (gid != INVALID_GID)\n\t\t{\n\t\t\tif (setgid(gid))\n\t\t\t{\n\t\t\t\tprinterrorf(\"Fatal: %s for %s failed: %s\\n\", \"setgid\", gname, strerror(errno));\n\t\t\t\treturn errno;\n\t\t\t}\n\n\t\t\tif (setgroups(1, &gid))\n\t\t\t{\n\t\t\t\tprinterrorf(\"Fatal: %s for %s failed: %s\\n\", \"setgroups\", gname, strerror(errno));\n\t\t\t\treturn errno;\n\t\t\t}\n\t\t}\n\n\t\tif (uid != INVALID_UID && setuid(uid))\n\t\t{\n\t\t\tprinterrorf(\"Fatal: %s for %s failed: %s\\n\", \"setuid\", uname, strerror(errno));\n\t\t\treturn errno;\n\t\t}\n#\tifndef NO_SIGHUP\n\t}\n#\tendif // NO_SIGHUP\n\n#\tendif // !defined(_WIN32) && !defined(NO_USER_SWITCH)\n\n\trandomNumberInit();\n\n\t// Randomization Level 1 means generate ePIDs at startup and use them during\n\t// the lifetime of the process. So we generate them now\n#\tifndef NO_RANDOM_EPID\n\tif (RandomizationLevel == 1) randomPidInit();\n#   if !defined(NO_LOG) && !defined(NO_VERBOSE_LOG)\n\tif (logverbose)\n\t{\n\t\tint32_t i;\n\n\t\tfor (i = 0; i < KmsData->CsvlkCount; i++)\n\t\t{\n\t\t\tconst CsvlkData_t* const csvlk = KmsData->CsvlkData + i;\n\t\t\tconst char* csvlkIniName = getNextString(csvlk->EPid);\n\t\t\tconst char* csvlkFullName = getNextString(csvlkIniName);\n\t\t\tcsvlkFullName = *csvlkFullName ? csvlkFullName : \"unknown\";\n\t\t\tconst char* ePid = KmsResponseParameters[i].Epid ? KmsResponseParameters[i].Epid : RandomizationLevel == 2 ? \"\" : csvlk->EPid;\n\t\t\tlogger(\"Using CSVLK %s (%s) with %s ePID %s\\n\", csvlkIniName, csvlkFullName, (RandomizationLevel == 1 && KmsResponseParameters[i].IsRandom) || (RandomizationLevel == 2 && !KmsResponseParameters[i].Epid) ? \"random\" : \"fixed\", ePid);\n\t\t}\n\t}\n#   endif // !defined(NO_LOG) && !defined(NO_VERBOSE_LOG)\n#\tendif\n\n#\tif !defined(NO_SOCKETS)\n#\tifdef _WIN32\n\tif (!IsNTService)\n\t{\n#\tendif // _WIN32\n\t\tint error;\n\t\tif ((error = daemonizeAndSetSignalAction())) return error;\n#\tifdef _WIN32\n\t}\n#\tendif // _WIN32\n#\tendif // !defined(NO_SOCKETS)\n\n\twritePidFile();\n\n#\tif !defined(NO_LOG) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\tif (!InetdMode)\n\t\tlogger(\"vlmcsd %s started successfully\\n\", Version);\n#\tendif // !defined(NO_LOG) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)\n\n#\tif defined(_NTSERVICE) && !defined(USE_MSRPC)\n\tif (IsNTService) ReportServiceStatus(SERVICE_RUNNING, NO_ERROR, 200);\n#\tendif // defined(_NTSERVICE) && !defined(USE_MSRPC)\n\n\tint rc;\n\trc = runServer();\n\n\t// Clean up things and exit\n#\tifdef _NTSERVICE\n\tif (!ServiceShutdown)\n#\tendif\n\t\tcleanup();\n#\tifdef _NTSERVICE\n\telse\n\t\tReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);\n#\tendif\n\n\treturn rc;\n}\n\n\n#if _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY\nint __stdcall WinStartUp(void)\n{\n\tWCHAR** szArgList;\n\tint argc;\n\tszArgList = CommandLineToArgvW(GetCommandLineW(), &argc);\n\n\tint i;\n\tchar** argv = (char**)vlmcsd_malloc(sizeof(char*) * argc);\n\n\tfor (i = 0; i < argc; i++)\n\t{\n\t\tint size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);\n\t\targv[i] = (char*)vlmcsd_malloc(size);\n\t\tWideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL);\n\t}\n\n\texit(server_main(argc, argv));\n}\n#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY\n"
  },
  {
    "path": "src/vlmcsd.h",
    "content": "#ifndef __main_h\n#define __main_h\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#define __T(x)    #x\n#define  _T(x) __T(x)\n\nextern char *fn_log;\n\n#include \"types.h\"\n\n//int main(int argc, CARGV);\nextern void cleanup();\n\nint newmain();\n\n#if MULTI_CALL_BINARY < 1\n#define server_main main\n#else\nint server_main(int argc, CARGV argv);\n#endif\n\n#ifndef SA_NOCLDWAIT    // required for Cygwin\n#define SA_NOCLDWAIT 0\n#endif\n\n#if !defined(NO_INI_FILE) || !defined(NO_CL_PIDS)\n#define INI_PARAM_RANDOMIZATION_LEVEL 1\n#define INI_PARAM_LCID 2\n#define INI_PARAM_LISTEN 3\n#define INI_PARAM_MAX_WORKERS 4\n#define INI_PARAM_CONNECTION_TIMEOUT 5\n#define INI_PARAM_PID_FILE 6\n#define INI_PARAM_LOG_FILE 7\n#define INI_PARAM_LOG_VERBOSE 8\n#define INI_PARAM_ACTIVATION_INTERVAL 9\n#define INI_PARAM_RENEWAL_INTERVAL 10\n#define INI_PARAM_DISCONNECT_IMMEDIATELY 11\n#define INI_PARAM_UID 12\n#define INI_PARAM_GID 13\n#define INI_PARAM_PORT 14\n#define INI_PARAM_RPC_NDR64 15\n#define INI_PARAM_RPC_BTFN 16\n#define INI_PARAM_FREEBIND 17\n#define INI_PARAM_PUBLIC_IP_PROTECTION_LEVEL 18\n#define INI_PARAM_LOG_DATE_AND_TIME 19\n#define INI_PARAM_HOST_BUILD 20\n#define INI_PARAM_WHITELISTING_LEVEL 24\n#define INI_PARAM_CHECK_CLIENT_TIME 25\n#define INI_PARAM_MAINTAIN_CLIENTS 26\n#define INI_PARAM_START_EMPTY 27\n#define INI_PARAM_DATA_FILE 28\n#define INI_PARAM_VPN 29\n#define INI_PARAM_EXIT_LEVEL 30\n\n#define INI_FILE_PASS_1 1\n#define INI_FILE_PASS_2 2\n#define INI_FILE_PASS_3 3\n\ntypedef struct IniFileParameter\n{\n\tconst char* const Name;\n\tuint_fast8_t Id;\n} IniFileParameter_t, *PIniFileParameter_t;\n#endif // NO_INI_FILE\n\n#endif // __main_h\n"
  },
  {
    "path": "src/vlmcsdmulti.c",
    "content": "/* Multi-Call Binary for vlmcs and vlmcsd */\n\n#define _CRT_SECURE_NO_WARNINGS\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n\n#if MULTI_CALL_BINARY < 1\n#error \"Please define MULTI_CALL_BINARY=1 when compiling this file.\"\n#endif\n\n#include <stdio.h>\n\n#if !_MSC_VER\n#include <libgen.h>\n#else // _MSC_VER\n#include <stdlib.h>\n#include \"helpers.h\"\n#endif // _MSC_VER\n\n#include \"vlmcs.h\"\n#include \"vlmcsd.h\"\n#include \"types.h\"\n#include \"shared_globals.h\"\n#include \"output.h\"\n\n#if (defined(_WIN32) || defined(__CYGWIN__))\n#define compare strcasecmp // Best for case-preserving (but otherwise case-insensitive) filesystems\n#else // native Unix\n#define compare strcmp // for case-sensitive filesystems\n#endif // native Unix\n\n#if _MSC_VER\nstatic char* basename(const char* fullname)\n{\n\tsize_t len = strlen(fullname);\n\tchar* filename = (char*)vlmcsd_malloc(len + 1);\n\tchar* extension = (char*)vlmcsd_malloc(len + 1);\n\tstatic char result[64];\n\n\t_splitpath(fullname, NULL, NULL, filename, extension);\n\n\tif (strlen(filename) + strlen(extension) > 63)\n\t{\n\t\t*result = 0;\n\t\tgoto finally;\n\t}\n\n\tstrcpy(result, filename);\n\tstrcat(result, extension);\n\n\tfinally:\n\tfree(filename);\n\tfree(extension);\n\n\treturn result;\n}\n#endif // _MSC_VER\n\nint main(int argc, CARGV argv)\n{\n\tmulti_argv = argv;\n\tmulti_argc = argc;\n\n\tif (!compare(basename((char*)*argv), \"vlmcsd\"))\n\t\treturn server_main(argc, argv);\n\n\tif (!compare(basename((char*)*argv), \"vlmcs\"))\n\t\treturn client_main(argc, argv);\n\n#ifdef _WIN32\n\tif (!compare(basename((char*)*argv), \"vlmcsd.exe\"))\n\t\treturn server_main(argc, argv);\n\n\tif (!compare(basename((char*)*argv), \"vlmcs.exe\"))\n\t\treturn client_main(argc, argv);\n#endif // _WIN32\n\n\tif (argc > 1)\n\t{\n\t\tif (!strcmp((char*)argv[1], \"vlmcsd\"))\n\t\t\treturn server_main(argc - 1, argv + 1);\n\n\t\tif (!strcmp((char*)argv[1], \"vlmcs\"))\n\t\t\treturn client_main(argc - 1, argv + 1);\n\t}\n\n\terrorout(\n\t\t\"vlmcsdmulti %s\\n\\n\"\n\t\t\"Usage:\\n\"\n\t\t\"\\t%s vlmcsd [<vlmcsd command line>]\\n\"\n\t\t\"\\t%s vlmcs [<vlmcs command line>]\\n\\n\",\n\t\tVersion, *argv, *argv\n\t);\n\n\treturn VLMCSD_EINVAL;\n}\n\n\n#if _MSC_VER && !defined(_DEBUG)\nint __stdcall WinStartUp(void)\n{\n\tWCHAR **szArgList;\n\tint argc;\n\tszArgList = CommandLineToArgvW(GetCommandLineW(), &argc);\n\n\tint i;\n\tchar **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc);\n\n\tfor (i = 0; i < argc; i++)\n\t{\n\t\tint size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);\n\t\targv[i] = (char*)vlmcsd_malloc(size);\n\t\tWideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL);\n\t}\n\n\texit(main(argc, argv));\n}\n#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY\n"
  },
  {
    "path": "src/wingetopt.c",
    "content": "/*\nPOSIX getopt for Windows\n\nAT&T Public License\n\nCode given out at the 1985 UNIFORUM conference in Dallas.\nModified for vlmcsd by Hotbird64\n*/\n\n#ifdef _MSC_VER\n\n#include \"wingetopt.h\"\n//#include <stdio.h>\n#include <string.h>\n\n#define EOF\t(-1)\n#define ERR(s, c)\tif(opterr){\\\n\tchar errbuf[2];\\\n\terrbuf[0] = c; errbuf[1] = '\\n';\\\n\tfputs(argv[0], stderr);\\\n\tfputs(s, stderr);\\\n\tfputc(c, stderr);}\n//(void) write(2, argv[0], (unsigned)strlen(argv[0]));\\\n\t//(void) write(2, s, (unsigned)strlen(s));\\\n\t//(void) write(2, errbuf, 2);}\n\nint\topterr = 1;\nint\toptind = 1;\nint\toptopt;\nchar* optarg;\n\nint getopt(int argc, char * const argv[], const char *opts)\n{\n\tstatic int sp = 1;\n\tregister int c;\n\tregister char *cp;\n\n\tif (sp == 1)\n\t\tif (optind >= argc ||\n\t\t\targv[optind][0] != '-' || argv[optind][1] == '\\0')\n\t\t\treturn(EOF);\n\t\telse if (strcmp(argv[optind], \"--\") == 0) {\n\t\t\toptind++;\n\t\t\treturn(EOF);\n\t\t}\n\t\toptopt = c = argv[optind][sp];\n\t\tif (c == ':' || (cp = strchr(opts, c)) == NULL) {\n\t\t\t//ERR(\": illegal option -- \", (char)c);\n\t\t\tif (argv[optind][++sp] == '\\0') {\n\t\t\t\toptind++;\n\t\t\t\tsp = 1;\n\t\t\t}\n\t\t\treturn('?');\n\t\t}\n\t\tif (*++cp == ':') {\n\t\t\tif (argv[optind][sp + 1] != '\\0')\n\t\t\t\toptarg = (char*)&argv[optind++][sp + 1];\n\t\t\telse if (++optind >= argc) {\n\t\t\t\t//ERR(\": option requires an argument -- \", (char)c);\n\t\t\t\tsp = 1;\n\t\t\t\treturn('?');\n\t\t\t}\n\t\t\telse\n\t\t\t\toptarg = (char*)argv[optind++];\n\t\t\tsp = 1;\n\t\t}\n\t\telse {\n\t\t\tif (argv[optind][++sp] == '\\0') {\n\t\t\t\tsp = 1;\n\t\t\t\toptind++;\n\t\t\t}\n\t\t\toptarg = NULL;\n\t\t}\n\t\treturn(c);\n}\n\n#endif  // _MSC_VER\n\n"
  },
  {
    "path": "src/wingetopt.h",
    "content": "/*\r\nPOSIX getopt for Windows\r\n\r\nAT&T Public License\r\n\r\nCode given out at the 1985 UNIFORUM conference in Dallas.\r\nModified for vlmcsd by Hotbird64\r\n*/\r\n\r\n#ifndef _WINGETOPT_H_\r\n#define _WINGETOPT_H_\r\n\r\n#ifdef _MSC_VER\r\n\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n\textern int opterr;\r\n\textern int optind;\r\n\textern int optopt;\r\n\textern char *optarg;\r\n\textern int getopt(int argc, char * const argv[], const char *optstring);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif  // _MSC_VER\r\n#endif // __wingetopt_h\r\n"
  },
  {
    "path": "src/wintap.c",
    "content": "#ifndef _CRT_SECURE_NO_WARNINGS\n#define _CRT_SECURE_NO_WARNINGS\n#endif\n\n#ifndef CONFIG\n#define CONFIG \"config.h\"\n#endif // CONFIG\n#include CONFIG\n#include \"helpers.h\"\n#include \"wintap.h\"\n\n#ifndef NO_TAP\n\n#include \"types.h\"\n#include \"endian.h\"\n#include \"output.h\"\n#include \"tap-windows.h\"\n#include <iphlpapi.h>\n\n#if !_WIN32\n#include <arpa/inet.h>\n#endif // !_WIN32\n\nstatic char* szIpAddress = \"10.10.10.9\";\nstatic char* szMask = \"30\";\nstatic char* szTapName;\nstatic char *ActiveTapName, *AdapterClass;\nstatic char* szLeaseDuration = \"1d\";\nstatic uint32_t IpAddress, Mask, Network, Broadcast, DhcpServer; // These are host-endian (=little-endian) for easier calculations\nstatic uint32_t Mtu;\nstatic uint_fast8_t Cidr;\nstatic HANDLE TapHandle;\nstatic TapDriverVersion_t DriverVersion;\nstatic IpPacket_t* IpPacket;\nstatic uint32_t DhcpLeaseDuration;\n\n\nstatic BOOL isAddressAssigned()\n{\n\tPMIB_IPADDRTABLE pIPAddrTable;\n\tDWORD dwSize = 0;\n\tBOOL result = FALSE;\n\n\tpIPAddrTable = (PMIB_IPADDRTABLE)vlmcsd_malloc(sizeof(MIB_IPADDRTABLE));\n\tconst DWORD status = GetIpAddrTable(pIPAddrTable, &dwSize, 0);\n\tfree(pIPAddrTable);\n\n\tif (status != ERROR_INSUFFICIENT_BUFFER) return FALSE;\n\tpIPAddrTable = (MIB_IPADDRTABLE *)vlmcsd_malloc(dwSize);\n\n\tif (GetIpAddrTable(pIPAddrTable, &dwSize, 0))\n\t{\n\t\tfree(pIPAddrTable);\n\t\treturn FALSE;\n\t}\n\n\tPMIB_IPADDRROW row;\n\tfor (row = pIPAddrTable->table; row < pIPAddrTable->table + pIPAddrTable->dwNumEntries; row++)\n\t{\n\t\tif (\n\t\t\trow->dwAddr == BE32(IpAddress) &&\n\t\t\t!(row->wType & (MIB_IPADDR_DELETED | MIB_IPADDR_DISCONNECTED | MIB_IPADDR_TRANSIENT))\n\t\t\t)\n\t\t{\n\t\t\tresult = TRUE;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfree(pIPAddrTable);\n\treturn result;\n}\n\n\nstatic void parseTapArgument(char* argument)\n{\n\tchar* equalSignPosition = strchr(argument, (int)'=');\n\tchar* slashPosition = strchr(argument, (int)'/');\n\tchar* colonPosition = strchr(argument, (int)':');\n\n\tszTapName = argument;\n\n\tif (equalSignPosition)\n\t{\n\t\t*equalSignPosition = 0;\n\t\tszIpAddress = equalSignPosition + 1;\n\t}\n\n\tif (slashPosition)\n\t{\n\t\t*slashPosition = 0;\n\t\tszMask = slashPosition + 1;\n\t}\n\n\tif (colonPosition)\n\t{\n\t\t*colonPosition = 0;\n\t\tszLeaseDuration = colonPosition + 1;\n\t}\n\n\tIpAddress = BE32(inet_addr(szIpAddress));\n\n\tif (IpAddress == BE32(INADDR_NONE))\n\t{\n\t\tprinterrorf(\"Fatal: %s is not a valid IPv4 address\\n\", szIpAddress);\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tchar* next;\n\tCidr = (uint8_t)strtol(szMask, &next, 10);\n\n\tif (*next || Cidr < 8 || Cidr > 30)\n\t{\n\t\tprinterrorf(\"Fatal: /%s is not a valid CIDR mask between /8 and /30\\n\", szMask);\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tif (!((DhcpLeaseDuration = timeSpanString2Seconds(szLeaseDuration))))\n\t{\n\t\tprinterrorf(\"Fatal: No valid time span specified in option -%c.\\n\", 'O');\n\t\texit(VLMCSD_EINVAL);\n\t}\n\n\tMask = (uint32_t)~(0xffffffff >> Cidr);\n\tNetwork = IpAddress & Mask;\n\tBroadcast = IpAddress | ~Mask;\n\tDhcpServer = IpAddress + 1;\n\n\tif (IpAddress <= Network || IpAddress + 1 >= Broadcast)\n\t{\n\t\tuint32_t lowerIpBE = BE32(Network + 1);\n\t\tuint32_t upperIpBE = BE32(Broadcast - 2);\n\t\tconst char* szLower = vlmcsd_strdup(inet_ntoa(*(struct in_addr*)&lowerIpBE));\n\t\tconst char* szUpper = vlmcsd_strdup(inet_ntoa(*(struct in_addr*)&upperIpBE));\n\n\t\tprinterrorf(\"Fatal: For this subnet the IPv4 address must be \");\n\n\t\tif (lowerIpBE == upperIpBE)\n\t\t{\n\t\t\tprinterrorf(\"%s\\n\", szLower);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprinterrorf(\"between %s and %s\\n\", szLower, szUpper);\n\t\t}\n\n\t\texit(VLMCSD_EINVAL);\n\t}\n}\n\n\n__noreturn static void WinErrorExit(DWORD error)\n{\n\tprinterrorf(\"Registry read error: %s\\n\", win_strerror((int)error));\n\texit(error);\n}\n\n\nstatic HANDLE OpenTapHandle()\n{\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tHKEY regAdapterKey;\n\tDWORD regResult;\n\tif ((regResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ADAPTER_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &regAdapterKey)) != ERROR_SUCCESS)\n\t{\n\t\tWinErrorExit(regResult);\n\t}\n\n\tchar subKeyName[TAP_REGISTRY_DATA_SIZE];\n\tDWORD i, subKeySize = sizeof(subKeyName);\n\n\tfor (i = 0; (regResult = RegEnumKeyEx(regAdapterKey, i, subKeyName, &subKeySize, NULL, NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS; i++)\n\t{\n\t\tHKEY regSubKey;\n\t\tDWORD type, regDataSize;\n\t\tchar regData[TAP_REGISTRY_DATA_SIZE];\n\n\t\tif (regResult) WinErrorExit(regResult);\n\n\t\tif ((regResult = RegOpenKeyEx(regAdapterKey, subKeyName, 0, KEY_READ | KEY_WOW64_64KEY, &regSubKey)) == ERROR_SUCCESS)\n\t\t{\n\t\t\tregDataSize = sizeof(regData);\n\n\t\t\tif (RegQueryValueEx(regSubKey, \"ComponentId\", NULL, &type, (LPBYTE)regData, &regDataSize) == ERROR_SUCCESS)\n\t\t\t{\n\t\t\t\tif (\n\t\t\t\t\ttype == REG_SZ &&\n\t\t\t\t\t(\n\t\t\t\t\t\t!strncmp(regData, \"tap0801\", sizeof(regData)) ||\n\t\t\t\t\t\t!strncmp(regData, \"tap0901\", sizeof(regData)) ||\n\t\t\t\t\t\t!strncmp(regData, \"TEAMVIEWERVPN\", sizeof(regData))\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tAdapterClass = vlmcsd_strdup(regData);\n\t\t\t\t\tregDataSize = sizeof(regData);\n\n\t\t\t\t\tif (RegQueryValueEx(regSubKey, \"NetCfgInstanceId\", NULL, &type, (LPBYTE)regData, &regDataSize) == ERROR_SUCCESS && type == REG_SZ)\n\t\t\t\t\t{\n\t\t\t\t\t\tHKEY connectionKey;\n\t\t\t\t\t\tchar connectionKeyName[TAP_REGISTRY_DATA_SIZE];\n\n\t\t\t\t\t\tstrncpy(connectionKeyName, NETWORK_CONNECTIONS_KEY \"\\\\\", sizeof(connectionKeyName));\n\t\t\t\t\t\tstrncat(connectionKeyName, regData, sizeof(connectionKeyName) - strlen(connectionKeyName) - 1);\n\t\t\t\t\t\tstrncat(connectionKeyName, \"\\\\Connection\", sizeof(connectionKeyName) - strlen(connectionKeyName) - 1);\n\n\t\t\t\t\t\tif (RegOpenKeyEx(HKEY_LOCAL_MACHINE, connectionKeyName, 0, KEY_READ | KEY_WOW64_64KEY, &connectionKey) == ERROR_SUCCESS)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchar deviceName[TAP_REGISTRY_DATA_SIZE];\n\t\t\t\t\t\t\tregDataSize = sizeof(deviceName);\n\n\t\t\t\t\t\t\tif (RegQueryValueEx(connectionKey, \"Name\", NULL, &type, (LPBYTE)deviceName, &regDataSize) == ERROR_SUCCESS && type == REG_SZ)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!strcmp(szTapName, \".\") || !strncasecmp(szTapName, deviceName, sizeof(deviceName)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tActiveTapName = vlmcsd_strdup(deviceName);\n\t\t\t\t\t\t\t\t\tstrncpy(deviceName, USERMODEDEVICEDIR, sizeof(deviceName));\n\t\t\t\t\t\t\t\t\tstrncat(deviceName, regData, sizeof(deviceName) - strlen(deviceName) - 1);\n\t\t\t\t\t\t\t\t\tstrncat(deviceName, strcmp(AdapterClass, \"TEAMVIEWERVPN\") ? TAP_WIN_SUFFIX : \".dgt\", sizeof(deviceName) - strlen(deviceName) - 1);\n\t\t\t\t\t\t\t\t\thandle = CreateFile(deviceName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, NULL);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tRegCloseKey(connectionKey);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (handle == INVALID_HANDLE_VALUE) free(AdapterClass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tRegCloseKey(regSubKey);\n\t\tsubKeySize = sizeof(subKeyName);\n\t\tif (handle != INVALID_HANDLE_VALUE) break;\n\t}\n\n\tRegCloseKey(regAdapterKey);\n\n\tif (handle == INVALID_HANDLE_VALUE)\n\t{\n\t\tprinterrorf(\"Fatal: No compatible VPN adapter\");\n\n\t\tif (!strcmp(szTapName, \".\"))\n\t\t{\n\t\t\tprinterrorf(\"s\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprinterrorf(\" with name \\\"%s\\\"\", szTapName);\n\t\t}\n\n\t\tprinterrorf(\" available for use\\n\");\n\t\texit(ERROR_DEVICE_NOT_AVAILABLE);\n\t}\n\n\treturn handle;\n}\n\n\nstatic int DevCtl(DWORD code, void* data, DWORD len)\n{\n\tif (!DeviceIoControl(TapHandle, code, data, len, data, len, &len, NULL))\n\t{\n\t\tconst DWORD error = GetLastError();\n\t\tprinterrorf(\"Fatal: VPN adapter error: %s\\n\", win_strerror(error));\n\t\texit(error);\n\t}\n\n\treturn len;\n}\n\n\nstatic DWORD WINAPI TapMirror(LPVOID data_unused)\n{\n\twhile (TRUE)\n\t{\n\t\tDWORD bytesRead, bytesWritten;\n\t\tif (!ReadFile(TapHandle, IpPacket, Mtu, &bytesRead, NULL)) break;\n\n\t\tconst uint32_t temp = IpPacket->ip_src;\n\t\tIpPacket->ip_src = IpPacket->ip_dst;\n\t\tIpPacket->ip_dst = temp;\n\n\t\tif (!WriteFile(TapHandle, IpPacket, bytesRead, &bytesWritten, NULL)) break;\n\n#\t\tif !defined(NO_LOG) && defined(_PEDANTIC)\n\t\tif (bytesRead != bytesWritten) logger(\"Warning: VPN device \\\"%s\\\": %u bytes could not be written\\n\", ActiveTapName, bytesRead - bytesWritten);\n#\t\tendif // !defined(NO_LOG) && defined(_PEDANTIC)\n\t}\n\n\tconst DWORD error = GetLastError();\n\n#\tifndef NO_LOG\n\tlogger(\"Warning: VPN thread for device \\\"%s\\\" exiting: %s\\n\", ActiveTapName, win_strerror(error));\n#\tendif // NO_LOG\n\n\tfree(ActiveTapName);\n\tCloseHandle(TapHandle);\n\texitOnWarningLevel(1);\n\treturn error;\n}\n\n\nvoid startTap(char* const argument)\n{\n\tif (!strcmp(argument, \"-\")) return;\n\tparseTapArgument(argument);\n\n\tTapHandle = OpenTapHandle();\n\n\t// Get MTU and driver version\n\tDevCtl(TAP_WIN_IOCTL_GET_MTU, &Mtu, sizeof(Mtu));\n\tDevCtl(TAP_WIN_IOCTL_GET_VERSION, &DriverVersion, sizeof(DriverVersion));\n\n\t// Configure TUN mode\n\tTapConfigTun_t tapTunCfg;\n\ttapTunCfg.Address.s_addr = BE32(IpAddress);\n\ttapTunCfg.Network.s_addr = BE32(Network);\n\ttapTunCfg.Mask.s_addr = BE32(Mask);\n\tDevCtl(TAP_WIN_IOCTL_CONFIG_TUN, &tapTunCfg, sizeof(tapTunCfg));\n\n\t// Setup the drivers internal DHCP server\n\tTapConfigDhcp_t tapDhcpCfg;\n\ttapDhcpCfg.Address.s_addr = BE32(IpAddress);\n\ttapDhcpCfg.Mask.s_addr = BE32(Mask);\n\ttapDhcpCfg.DhcpServer.s_addr = BE32(IpAddress + 1);\n\ttapDhcpCfg.LeaseDuration = DhcpLeaseDuration;\n\tDevCtl(TAP_WIN_IOCTL_CONFIG_DHCP_MASQ, &tapDhcpCfg, sizeof(tapDhcpCfg));\n\n\t// Connect the virtual network cable\n\tBOOL isCableConnected = TRUE;\n\tDevCtl(TAP_WIN_IOCTL_SET_MEDIA_STATUS, &isCableConnected, sizeof(isCableConnected));\n\n\t// Allocate buffer and start mirror thread\n\tIpPacket = (IpPacket_t*)vlmcsd_malloc(Mtu);\n\tHANDLE threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TapMirror, NULL, 0, NULL);\n\n\tif (!threadHandle)\n\t{\n\t\tDWORD error = GetLastError();\n\t\tprinterrorf(\"Fatal: Unable to start VPN thread: %s\\n\", win_strerror(error));\n\t\texit(error);\n\t}\n\n\tCloseHandle(threadHandle);\n\n#\tifndef NO_LOG\n\tlogger(\"%s %u.%u.%u device \\\"%s\\\" started\\n\", AdapterClass, DriverVersion.Major, DriverVersion.Minor, DriverVersion.Build, ActiveTapName);\n#\tendif // NO_LOG\n\n\tDWORD i;\n\tBOOL isAssigned;\n\n\t// Wait up to 4 seconds until the IP address is up and running\n\t// so vlmcsd can actually bind to and listen on it\n\tfor (i = 0; !((isAssigned = isAddressAssigned())) && i < 20; i++) Sleep(200);\n\n\tif (!isAssigned)\n\t{\n\t\tprinterrorf(\"Warning: IPv4 address %s not assigned\\n\", szIpAddress);\n\t}\n\telse\n\t{\n#\t\tifndef NO_LOG\n\t\tlogger(\"IPv4 address %s assigned\\n\", szIpAddress);\n#\t\tendif // NO_LOG\n\t}\n}\n\n#endif // NO_TAP\n\n"
  },
  {
    "path": "src/wintap.h",
    "content": "#ifndef __WINTAP_H\n#define __WINTAP_H\n\n#define TAP_REGISTRY_DATA_SIZE 256\n\n// Network-Endian (= Big-Endian)\ntypedef struct TapConfigTun\n{\n\tstruct in_addr Address;\n\tstruct in_addr  Network;\n\tstruct in_addr  Mask;\n} TapConfigTun_t, *PTapConfigTun_t;\n\n// Network-Endian (= Big-Endian), except LeaseDuration\ntypedef struct TapConfigDhcp\n{\n\tstruct in_addr  Address;\n\tstruct in_addr  Mask;\n\tstruct in_addr  DhcpServer;\n\tuint32_t  LeaseDuration; // Host-Endian (=Little-Endian). Anything else is Big-Endian\n} TapConfigDhcp_t, *PTapConfigDhcp_t;\n\ntypedef struct TapDriverVersion\n{\n\tuint32_t Major;\n\tuint32_t Minor;\n\tuint32_t Build;\n\tuint32_t Revision;\n} TapDriverVersion_t, *PTapDriverVersion_t;\n\n// Network-Endian (= Big-Endian)\ntypedef struct IpPacket {\n\tuint8_t\t ip_hl : 4,\t\t/* header length */\n\t\t\t ip_v : 4;\t\t\t/* version */\n\tuint8_t\t ip_tos;\t\t\t/* type of service */\n\tint16_t\t ip_len;\t\t\t/* total length */\n\tuint16_t ip_id;\t\t\t/* identification */\n\tint16_t\t ip_off;\t\t\t/* fragment offset field */\n\tuint8_t\t ip_ttl;\t\t\t/* time to live */\n\tuint8_t\t ip_p;\t\t\t/* protocol */\n\tuint16_t ip_sum;\t\t\t/* checksum */\n\tuint32_t ip_src, ip_dst;\t/* source and dest address */\n\tuint8_t  payload[0];\n} IpPacket_t, *PIpPacket_t;\n\nvoid startTap(char* const argument);\n\n#endif //__WINTAP_H\n\n\n"
  }
]