| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- #ifndef CONFIG_H_
- #define CONFIG_H_
- /* Don't change anything ABOVE this line */
- /*
- * As a best practice do not change the original config.h as distributed with vlmcsd.
- * Instead make a copy, e.g. myconfig.h, customize it and type 'make CONFIG=myconfig.h'
- * to build vlmcsd. This prevents your copy being overwritten when you upgrade to a
- * new version.
- */
- /*
- * ----------------------------------------------------------------------------------------
- * Useful customizations. These options are mandatory. You cannot comment them out.
- * Feel free to change them to fit your needs.
- * ----------------------------------------------------------------------------------------
- */
- #ifndef VERSION
- /*
- * Define your own version identifier here, e.g. '#define VERSION "my vlmcsd based on svn560"'
- */
- #define VERSION "private build"
- #endif // VERSION
- /*
- * Define default ePIDs and HWID here. Preferrably grab ePIDs and HWID
- * from a real KMS server.
- */
- #ifndef EPID_WINDOWS
- #define EPID_WINDOWS "06401-00206-271-398432-03-1033-9600.0000-1422016"
- #endif
- #ifndef EPID_OFFICE2010
- #define EPID_OFFICE2010 "06401-00096-199-198384-03-1033-9600.0000-1422016"
- #endif
- #ifndef EPID_OFFICE2013
- #define EPID_OFFICE2013 "06401-00206-234-384729-03-1033-9600.0000-1422016"
- #endif
- #ifndef HWID // HwId from the Ratiborus VM
- #define HWID 0x36, 0x4F, 0x46, 0x3A, 0x88, 0x63, 0xD3, 0x5F
- #endif
- /*
- * Anything below this line is optional. If you want to use any of these options
- * uncomment one or more lines starting with "//#define"
- */
- /*
- * -------------------------------
- * Defaults
- * -------------------------------
- */
- #ifndef INI_FILE
- /*
- * Uncomment and customize the following line if you want vlmcsd to look for an ini file
- * at a default location
- */
- //#define INI_FILE "/etc/vlmcsd.ini"
- #endif // INI_FILE
- /*
- * ----------------------------------------------------------------------------------------
- * Troubleshooting options. Please note that disabling features may also help troubleshooting.
- * If you have an old OS that does not support features like pthreads, shared memory or
- * semaphores, uncomment "#define NO_LIMIT" and "#define NO_SIGHUP" and leave "#define USE_THREADS"
- * commented out.
- * ----------------------------------------------------------------------------------------
- */
- #ifndef CHILD_HANDLER
- /*
- * Uncomment the following #define if you are compiling for a platform that does
- * not correctly handle the SA_NOCLDWAIT flag when ignoring SIGCHLD, i.e. forked
- * processes remain as "zombies" after dying. This option will add a SIGCHLD handler that
- * "waits" for a child that has terminated. This is only required for a few
- * unixoid OSses.
- */
- //#define CHILD_HANDLER
- #endif // CHILD_HANDLER
- #ifndef NO_TIMEOUT
- /*
- * Uncomment the following #define if you are compiling for a platform that does
- * not support custom socket send or receive timeouts.
- */
- //#define NO_TIMEOUT
- #endif // NO_TIMEOUT
- #ifndef NO_DNS
- /*
- * Uncomment the following #define if you have trouble with accessing routines
- * from libresolv. If enabled, vlmcs will be compiled without support for
- * detecting KMS servers via DNS.
- */
- //#define NO_DNS
- #endif // NO_DNS
- #ifndef TERMINAL_FIXED_WIDTH
- /*
- * Uncomment the following #define and optionally change its value if you are compiling for
- * a platform that cannot properly determine the width of a terminal/command prompt.
- * This affects the output of "vlmcsd -x" only. It should be rarely necessary to use this.
- */
- //#define TERMINAL_FIXED_WIDTH 80
- #endif // TERMINAL_FIXED_WIDTH
- #ifndef _PEDANTIC
- /*
- * Uncomment the following #define if you want to do vlmcs and vlmcsd more checks on the data
- * it receives over the network. They are normally not necessary but may provide useful if
- * you are testing any KMS server or client emulator that may send malformed KMS packets.
- */
- //#define _PEDANTIC
- #endif // _PEDANTIC
- #ifndef NO_PROCFS
- /*
- * Cygwin, Linux, Android, NetBSD, DragonflyBSD:
- * Do not rely on a properly mounted proc filesystem and use the less reliable
- * argv[0] to determine the program's executable name when restarting vlmcsd
- * by sending a SIGHUP signal. Use only if absolutely necessary (very old versions
- * of these OSses).
- *
- * FreeBSD:
- * Do not use sysctl and but the less reliable
- * argv[0] to determine the program's executable name when restarting vlmcsd
- * by sending a SIGHUP signal. Use only if absolutely necessary (very old FreeBSD).
- *
- * OpenBSD:
- * This option has no effect since OpenBSD always must use the less reliable argv[0].
- *
- * Mac OS X, Solaris:
- * This option is not neccessary (and has no effect) since these OSses provide
- * a reliable way to determine the executable name.
- *
- * Windows:
- * This option is not used because Windows doesn't support signals.
- */
- //#define NO_PROCFS
- #endif // NO_PROCFS
- #ifndef USE_AUXV
- /*
- * Linux only:
- * Use the process' ELF aux vector to determine the executable name when restarting
- * vlmcsd by sending a SIGHUP signal. This is actually the best method but is supported
- * only with
- * * the musl library
- * * the glbic library 2.16 or newer
- *
- * It does NOT work with uclibc (most routers and other small devices) and glibc < 2.16.
- * Use it only if your system supports it and you do not plan to use the binary on older systems.
- * It won't work on debian 7 or Red Hat 6.x.
- *
- * It it safe to try this by yourself. vlmcsd won't compile if your system doesn't support it.
- */
- //#define USE_AUXV
- #endif // USE_AUXV
- #ifndef _OPENSSL_NO_HMAC
- /*
- * If you configured vlmcsd to use OpenSSL (which you shouldn't) you may use this option
- * to calculate the KMSv6 HMAC with internal code instead of using OpenSSL.
- *
- * This may be necessary for some embedded devices that have OpenSSL without HMAC support.
- */
- //#define _OPENSSL_NO_HMAC
- #endif // _OPENSSL_NO_HMAC
- /*
- * ----------------------------------------------------------------------------------------
- * Modes of operation
- * ----------------------------------------------------------------------------------------
- */
- #ifndef USE_THREADS
- /*
- * Do not use fork() but threads to serve your clients.
- *
- * Unix-like operarting systems:
- * You may use this or not. Entirely your choice. Threads do not require explicitly allocating
- * a shared memory segment which might be a problem on some systems. Using fork() is more robust
- * although the threaded version of vlmcsd is rock solid too.
- *
- * Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP
- * and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.
- *
- * Cygwin:
- * It is recommended to use threads since fork() is extremely slow (no copy on write) and somewhat
- * unstable.
- *
- * Windows:
- * This option has no effect since fork() is not supported.
- */
- //#define USE_THREADS
- #endif // USE_THREADS
- #ifndef _CRYPTO_POLARSSL
- /*
- * Not available on native Windows. Can be used with Cygwin.
- *
- * Use PolarSSL for crypto routines if possible and if it is safe. There is not much benefit by using this
- * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because
- * KMSv6 uses a modified algorithm that PolarSSL does not support. KMSv4 CMAC is also unsupported since it uses
- * a Rijndael keysize (160 bits) that is not part of the AES standard.
- *
- * It is strongly recommended not to use an external crypto library.
- *
- * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL
- */
- //#define _CRYPTO_POLARSSL
- #endif // _CRYPTO_POLARSSL
- #ifndef _CRYPTO_OPENSSL
- /*
- * Not available on native Windows. Can be used with Cygwin.
- *
- * Use OpenSSL for crypto routines if possible and if it is safe. There is not much benefit by using this
- * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because
- * KMSv6 uses a modified algorithm that OpenSSL does not support. KMSv4 CMAC is also unsupported since it uses
- * a Rijndael keysize (160 bits) that is not part of the AES standard.
- *
- * It is strongly recommended not to use an external crypto library.
- *
- * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL
- */
- //#define _CRYPTO_OPENSSL
- #endif // _CRYPTO_OPENSSL
- #ifndef _USE_AES_FROM_OPENSSL
- /*
- * DANGEROUS: Tweak OpenSSL to perform KMSv4 CMAC and KMSv6 modified AES. This option creates the expanded
- * AES key by itself and then applies modifications to it. OpenSSL will then perfom modified AES operations.
- *
- * This options tampers with internal structures of OpenSSL that are subject to change or may have a platform
- * specific implementation. In this case your resulting binary can only perform KMSv5 operations.
- *
- * This option has no effect if _CRYPTO_OPENSSL is not defined.
- *
- * Don't use this except for your own research on the internals of OpenSSL.
- */
- //#define _USE_AES_FROM_OPENSSL
- #endif // _USE_AES_FROM_OPENSSL
- #ifndef _OPENSSL_SOFTWARE
- /*
- * Use this only if you have defined _CRYPTO_OPENSSL and _USE_AES_FROM_OPENSSL. It has no effect otherwise.
- *
- * This options assumes a different internal AES expanded key in OpenSSL which is used mostly if OpenSSL is
- * compiled without support for hardware accelerated AES. It's worth a try if _USE_AES_FROM_OPENSSL doesn't work.
- */
- //#define _OPENSSL_SOFTWARE
- #endif // _OPENSSL_SOFTWARE
- /*
- * ------------------------------------------------------------------------------------------
- * Extra features not compiled by default because they are rarely needed
- * ------------------------------------------------------------------------------------------
- */
- #ifndef INCLUDE_BETAS
- /*
- * Uncomment the following #define if you want obsolete beta/preview SKUs
- * to be included in the extended product list.
- */
- //#define INCLUDE_BETAS
- #endif
- /*
- * ----------------------------------------------------------------------------------------
- * Removal of features. Allows you to remove features of vlmcsd you do not need or want.
- * Use it to get smaller binaries. This is especially useful on very small embedded devices.
- * ----------------------------------------------------------------------------------------
- */
- #ifndef NO_FREEBIND
- /*
- * Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command
- * line option and you can bind only to (listen on) IP addresses that are currently up and running on
- * your system.
- */
- //#define NO_FREEBIND
- #endif // NO_FREEBIND
- #ifndef NO_EXTENDED_PRODUCT_LIST
- /*
- * Do not compile the extended product list. Removes the list of Activation GUIDs (aka
- * Client SKU Id, License Id) and their respective product names (e.g. Windows 8.1 Enterprise).
- *
- * This affects logging only and does not have an effect on activation itself. As long as you
- * do not also define NO_BASIC_PRODUCT_LIST more generic names like Windows 8.1 or Office 2013
- * will still be logged. Saves a lot of space without loosing much functionality.
- *
- */
- //#define NO_EXTENDED_PRODUCT_LIST
- #endif // NO_EXTENDED_PRODUCT_LIST
- #ifndef NO_BASIC_PRODUCT_LIST
- /*
- * Do not compile the basic product list. Removes the list KMS GUIDs (aka Server SKU Id) and their
- * respective product names. Only affects logging not activation. This has a negative impact only
- * if you activate a product that is not (yet) in the extended product list. On the other hand you
- * do not save much space by not compiling this list.
- */
- //#define NO_BASIC_PRODUCT_LIST
- #endif // NO_BASIC_PRODUCT_LIST
- #ifndef NO_VERSION_INFORMATION
- /*
- * Removes the -V option from vlmcsd and vlmcs that displays the version information
- */
- //#define NO_VERSION_INFORMATION
- #endif // NO_VERSION_INFORMATION
- #ifndef NO_VERBOSE_LOG
- /*
- * Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v
- * option in the vlmcs client. Disables ini file directive LogVerbose.
- */
- //#define NO_VERBOSE_LOG
- #endif // NO_VERBOSE_LOG
- #ifndef NO_LOG
- /*
- * Disables logging completely. You can neither log to a file nor to the console. -D and -f will
- * start vlmcsd in foreground. -e will not be available. Disables ini file directive LogFile.
- * Implies NO_VERBOSE_LOG, NO_EXTENDED_PRODUCT_LIST and NO_BASIC_PRODUCT_LIST.
- */
- //#define NO_LOG
- #endif // NO_LOG
- #ifndef NO_RANDOM_EPID
- /*
- * Disables the ability to generate random ePIDs. Useful if you managed to grab ePID/HWID from a
- * real KMS server and want to use these. Removes -r from the vlmcsd command line and the ini
- * file directive RandomizationLevel (The randomization level will be harcoded to 0).
- */
- //#define NO_RANDOM_EPID
- #endif // NO_RANDOM_EPID
- #ifndef NO_INI_FILE
- /*
- * Disables the ability to use a configuration file (aka ini file). Removes -i from the command line.
- */
- //#define NO_INI_FILE
- #endif // NO_INI_FILE
- #ifndef NO_PID_FILE
- /*
- * Disables the abilty to write a pid file containing the process id of vlmcsd. If your init system
- * does not need this feature, you can safely disables this but it won't save much space. Disables
- * the use of -p from the command line and PidFile from the ini file.
- */
- //#define NO_PID_FILE
- #endif // NO_PID_FILE
- #ifndef NO_USER_SWITCH
- /*
- * Disables switching to another uid and/or gid after starting the program and setting up the sockets.
- * You cannot use -u anf -g on the command line as well as User and Group in the ini file. If your init system
- * supports starting daemons as another uid/gid (user/group) you can disable this feature in vlmcsd as long as you
- * do not need to run vlmcsd on a privileged port ( < 1024 on most systems).
- *
- * This setting has no effect on native Windows since -u and -g is not available anyway. It may be used with
- * Cygwin.
- */
- //#define NO_USER_SWITCH
- #endif // NO_USER_SWITCH
- #ifndef NO_HELP
- /*
- * Disables display of help in both vlmcsd and vlmcs. Saves some bytes but only makes sense if you have
- * access to the man files vlmcsd.8 and vlmcs.1
- */
- //#define NO_HELP
- #endif // NO_HELP
- #ifndef NO_CUSTOM_INTERVALS
- /*
- * Disables the ability to specify custom interval for renewing and retrying activation. Newer versions of the Microsoft's
- * KMS activation client (as in Win 8.1) do not honor these parameters anyway. Disable them to save some bytes. Removes
- * -A and -R from the command line as well as ActivationInterval and RenewalInterval in the ini file.
- */
- //#define NO_CUSTOM_INTERVALS
- #endif // NO_CUSTOM_INTERVALS
- #ifndef NO_PRIVATE_IP_DETECT
- /*
- * Disables the ability to protect vlmcsd against KMS requests from public IP addresses.
- * Removes -o from the command line.
- */
- //#define NO_PRIVATE_IP_DETECT
- #endif // NO_PRIVATE_IP_DETECT
- #ifndef NO_SOCKETS
- /*
- * Disables standalone startup of vlmcsd. If you use this config directive, you must start vlmcsd from an internet
- * superserver like inetd, xinetd, systemd or launchd. Disables -m, -t, -4, -6, -e, -f, -P and -L in the vlmcsd
- * command line. Socket setup is the job of your superserver.
- */
- //#define NO_SOCKETS
- #endif // NO_SOCKETS
- #ifndef NO_CL_PIDS
- /*
- * Disables the ability to specify ePIDs and HWID at the command line. You still may use them in the ini file.
- * Removes -0, -3, -w and -H from the vlmcsd command line.
- */
- //#define NO_CL_PIDS
- #endif // NO_CL_PIDS
- #ifndef NO_LIMIT
- /*
- * Disables the ability to limit the number of worker threads or processes that vlmcsd uses. While you should set a
- * limit whenever possible, you may save some bytes by enabling that setting. If you do not use a limit, use vlmcsd
- * in a "friendly" environment only, i.e. do not run it without a reasonable limit on the internet.
- *
- * Removes the ability to use -m in the vlmcsd command line and MaxWorkers in the ini file.
- *
- * Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP
- * and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.
- */
- //#define NO_LIMIT
- #endif // NO_LIMIT
- #ifndef NO_SIGHUP
- /*
- * Disables the ability to signal hangup (SIGHUP) to vlmcsd to restart it (rereading the ini file). The SIGHUP
- * handler makes heavy use of OS specific code. It should not cause any trouble on Solaris, Mac OS X and iOS. On Linux
- * use "#define USE_AUXV" (see troubleshooting options) if this is supported by your C runtime library.
- *
- * You may save some bytes by enabling this option. Use it also if the SIGHUP handler causes any trouble on your
- * platform. Please note that with no SIGHUP handler at all. vlmcsd will simply terminate (uncleanly) if it receives
- * the SIGHUP signal. This is the same behavior as with most other signals.
- *
- * This option has no effect on native Windows since Posix signaling is not supported. It can be used with Cygwin.
- */
- //#define NO_SIGHUP
- #endif // NO_SIGHUP
- #ifndef SIMPLE_SOCKETS
- /*
- * Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.
- * It still supports IPv4 and IPv6.
- */
- //#define SIMPLE_SOCKETS
- #endif // SIMPLE_SOCKETS
- /* Don't change anything BELOW this line */
- #endif /* CONFIG_H_ */
|