config.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. #ifndef CONFIG_H_
  2. #define CONFIG_H_
  3. /* Don't change anything ABOVE this line */
  4. /*
  5. * As a best practice do not change the original config.h as distributed with vlmcsd.
  6. * Instead make a copy, e.g. myconfig.h, customize it and type 'make CONFIG=myconfig.h'
  7. * to build vlmcsd. This prevents your copy being overwritten when you upgrade to a
  8. * new version.
  9. */
  10. /*
  11. * ----------------------------------------------------------------------------------------
  12. * Useful customizations. These options are mandatory. You cannot comment them out.
  13. * Feel free to change them to fit your needs.
  14. * ----------------------------------------------------------------------------------------
  15. */
  16. #ifndef VERSION
  17. /*
  18. * Define your own version identifier here, e.g. '#define VERSION "my vlmcsd based on svn560"'
  19. */
  20. #define VERSION "private build"
  21. #endif // VERSION
  22. /*
  23. * Define default ePIDs and HWID here. Preferrably grab ePIDs and HWID
  24. * from a real KMS server.
  25. */
  26. #ifndef EPID_WINDOWS
  27. #define EPID_WINDOWS "06401-00206-271-398432-03-1033-9600.0000-1422016"
  28. #endif
  29. #ifndef EPID_OFFICE2010
  30. #define EPID_OFFICE2010 "06401-00096-199-198384-03-1033-9600.0000-1422016"
  31. #endif
  32. #ifndef EPID_OFFICE2013
  33. #define EPID_OFFICE2013 "06401-00206-234-384729-03-1033-9600.0000-1422016"
  34. #endif
  35. #ifndef HWID // HwId from the Ratiborus VM
  36. #define HWID 0x36, 0x4F, 0x46, 0x3A, 0x88, 0x63, 0xD3, 0x5F
  37. #endif
  38. /*
  39. * Anything below this line is optional. If you want to use any of these options
  40. * uncomment one or more lines starting with "//#define"
  41. */
  42. /*
  43. * -------------------------------
  44. * Defaults
  45. * -------------------------------
  46. */
  47. #ifndef INI_FILE
  48. /*
  49. * Uncomment and customize the following line if you want vlmcsd to look for an ini file
  50. * at a default location
  51. */
  52. //#define INI_FILE "/etc/vlmcsd.ini"
  53. #endif // INI_FILE
  54. /*
  55. * -------------------------------
  56. * Backward compatibility
  57. * -------------------------------
  58. */
  59. #if !defined(ENABLE_DEPRECATED_OPTIONS)
  60. /*
  61. * comment out the following line if you want vlmcsd no to support command line options
  62. * that have been present in previous versions of vlmcsd and are now obsolete
  63. */
  64. //#define ENABLE_DEPRECATED_OPTIONS
  65. #endif // ENABLE_DEPRECATED_OPTIONS
  66. /*
  67. * ----------------------------------------------------------------------------------------
  68. * Troubleshooting options. Please note that disabling features may also help troubleshooting.
  69. * If you have an old OS that does not support features like pthreads, shared memory or
  70. * semaphores, uncomment "#define NO_LIMIT" and "#define NO_SIGHUP" and leave "#define USE_THREADS"
  71. * commented out.
  72. * ----------------------------------------------------------------------------------------
  73. */
  74. #ifndef CHILD_HANDLER
  75. /*
  76. * Uncomment the following #define if you are compiling for a platform that does
  77. * not correctly handle the SA_NOCLDWAIT flag when ignoring SIGCHLD, i.e. forked
  78. * processes remain as "zombies" after dying. This option will add a SIGCHLD handler that
  79. * "waits" for a child that has terminated. This is only required for a few
  80. * unixoid OSses.
  81. */
  82. //#define CHILD_HANDLER
  83. #endif // CHILD_HANDLER
  84. #ifndef NO_TIMEOUT
  85. /*
  86. * Uncomment the following #define if you are compiling for a platform that does
  87. * not support custom socket send or receive timeouts.
  88. */
  89. //#define NO_TIMEOUT
  90. #endif // NO_TIMEOUT
  91. #ifndef NO_DNS
  92. /*
  93. * Uncomment the following #define if you have trouble with accessing routines
  94. * from libresolv. If enabled, vlmcs will be compiled without support for
  95. * detecting KMS servers via DNS.
  96. */
  97. //#define NO_DNS
  98. #endif // NO_DNS
  99. #ifndef TERMINAL_FIXED_WIDTH
  100. /*
  101. * Uncomment the following #define and optionally change its value if you are compiling for
  102. * a platform that cannot properly determine the width of a terminal/command prompt.
  103. * This affects the output of "vlmcsd -x" only. It should be rarely necessary to use this.
  104. */
  105. //#define TERMINAL_FIXED_WIDTH 80
  106. #endif // TERMINAL_FIXED_WIDTH
  107. #ifndef _PEDANTIC
  108. /*
  109. * Uncomment the following #define if you want to do vlmcs and vlmcsd more checks on the data
  110. * it receives over the network. They are normally not necessary but may provide useful if
  111. * you are testing any KMS server or client emulator that may send malformed KMS packets.
  112. */
  113. //#define _PEDANTIC
  114. #endif // _PEDANTIC
  115. #ifndef NO_PROCFS
  116. /*
  117. * Cygwin, Linux, Android, NetBSD, DragonflyBSD:
  118. * Do not rely on a properly mounted proc filesystem and use the less reliable
  119. * argv[0] to determine the program's executable name when restarting vlmcsd
  120. * by sending a SIGHUP signal. Use only if absolutely necessary (very old versions
  121. * of these OSses).
  122. *
  123. * FreeBSD:
  124. * Do not use sysctl and but the less reliable
  125. * argv[0] to determine the program's executable name when restarting vlmcsd
  126. * by sending a SIGHUP signal. Use only if absolutely necessary (very old FreeBSD).
  127. *
  128. * OpenBSD:
  129. * This option has no effect since OpenBSD always must use the less reliable argv[0].
  130. *
  131. * Mac OS X, Solaris:
  132. * This option is not neccessary (and has no effect) since these OSses provide
  133. * a reliable way to determine the executable name.
  134. *
  135. * Windows:
  136. * This option is not used because Windows doesn't support signals.
  137. */
  138. //#define NO_PROCFS
  139. #endif // NO_PROCFS
  140. #ifndef USE_AUXV
  141. /*
  142. * Linux only:
  143. * Use the process' ELF aux vector to determine the executable name when restarting
  144. * vlmcsd by sending a SIGHUP signal. This is actually the best method but is supported
  145. * only with
  146. * * the musl library
  147. * * the glbic library 2.16 or newer
  148. *
  149. * It does NOT work with uclibc (most routers and other small devices) and glibc < 2.16.
  150. * Use it only if your system supports it and you do not plan to use the binary on older systems.
  151. * It won't work on debian 7 or Red Hat 6.x.
  152. *
  153. * It it safe to try this by yourself. vlmcsd won't compile if your system doesn't support it.
  154. */
  155. //#define USE_AUXV
  156. #endif // USE_AUXV
  157. #ifndef _OPENSSL_NO_HMAC
  158. /*
  159. * If you configured vlmcsd to use OpenSSL (which you shouldn't) you may use this option
  160. * to calculate the KMSv6 HMAC with internal code instead of using OpenSSL.
  161. *
  162. * This may be necessary for some embedded devices that have OpenSSL without HMAC support.
  163. */
  164. //#define _OPENSSL_NO_HMAC
  165. #endif // _OPENSSL_NO_HMAC
  166. /*
  167. * ----------------------------------------------------------------------------------------
  168. * Modes of operation
  169. * ----------------------------------------------------------------------------------------
  170. */
  171. #ifndef USE_THREADS
  172. /*
  173. * Do not use fork() but threads to serve your clients.
  174. *
  175. * Unix-like operarting systems:
  176. * You may use this or not. Entirely your choice. Threads do not require explicitly allocating
  177. * a shared memory segment which might be a problem on some systems. Using fork() is more robust
  178. * although the threaded version of vlmcsd is rock solid too.
  179. *
  180. * Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP
  181. * and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.
  182. *
  183. * Cygwin:
  184. * It is recommended to use threads since fork() is extremely slow (no copy on write) and somewhat
  185. * unstable.
  186. *
  187. * Windows:
  188. * This option has no effect since fork() is not supported.
  189. */
  190. //#define USE_THREADS
  191. #endif // USE_THREADS
  192. #ifndef _CRYPTO_POLARSSL
  193. /*
  194. * Not available on native Windows. Can be used with Cygwin.
  195. *
  196. * Use PolarSSL for crypto routines if possible and if it is safe. There is not much benefit by using this
  197. * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because
  198. * KMSv6 uses a modified algorithm that PolarSSL does not support. KMSv4 CMAC is also unsupported since it uses
  199. * a Rijndael keysize (160 bits) that is not part of the AES standard.
  200. *
  201. * It is strongly recommended not to use an external crypto library.
  202. *
  203. * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL
  204. */
  205. //#define _CRYPTO_POLARSSL
  206. #endif // _CRYPTO_POLARSSL
  207. #ifndef _CRYPTO_OPENSSL
  208. /*
  209. * Not available on native Windows. Can be used with Cygwin.
  210. *
  211. * Use OpenSSL for crypto routines if possible and if it is safe. There is not much benefit by using this
  212. * options since it can be used for SHA256 and HMAC_SHA256 only. It cannot be used for AES calculations because
  213. * KMSv6 uses a modified algorithm that OpenSSL does not support. KMSv4 CMAC is also unsupported since it uses
  214. * a Rijndael keysize (160 bits) that is not part of the AES standard.
  215. *
  216. * It is strongly recommended not to use an external crypto library.
  217. *
  218. * Do not define both _CRYPTO_OPENSSL and _CRYPTO_POLARSSL
  219. */
  220. //#define _CRYPTO_OPENSSL
  221. #endif // _CRYPTO_OPENSSL
  222. #ifndef _USE_AES_FROM_OPENSSL
  223. /*
  224. * DANGEROUS: Tweak OpenSSL to perform KMSv4 CMAC and KMSv6 modified AES. This option creates the expanded
  225. * AES key by itself and then applies modifications to it. OpenSSL will then perfom modified AES operations.
  226. *
  227. * This options tampers with internal structures of OpenSSL that are subject to change or may have a platform
  228. * specific implementation. In this case your resulting binary can only perform KMSv5 operations.
  229. *
  230. * This option has no effect if _CRYPTO_OPENSSL is not defined.
  231. *
  232. * Don't use this except for your own research on the internals of OpenSSL.
  233. */
  234. //#define _USE_AES_FROM_OPENSSL
  235. #endif // _USE_AES_FROM_OPENSSL
  236. #ifndef _OPENSSL_SOFTWARE
  237. /*
  238. * Use this only if you have defined _CRYPTO_OPENSSL and _USE_AES_FROM_OPENSSL. It has no effect otherwise.
  239. *
  240. * This options assumes a different internal AES expanded key in OpenSSL which is used mostly if OpenSSL is
  241. * compiled without support for hardware accelerated AES. It's worth a try if _USE_AES_FROM_OPENSSL doesn't work.
  242. */
  243. //#define _OPENSSL_SOFTWARE
  244. #endif // _OPENSSL_SOFTWARE
  245. /*
  246. * ------------------------------------------------------------------------------------------
  247. * Extra features not compiled by default because they are rarely needed
  248. * ------------------------------------------------------------------------------------------
  249. */
  250. #ifndef INCLUDE_BETAS
  251. /*
  252. * Uncomment the following #define if you want obsolete beta/preview SKUs
  253. * to be included in the extended product list.
  254. */
  255. //#define INCLUDE_BETAS
  256. #endif
  257. /*
  258. * ----------------------------------------------------------------------------------------
  259. * Removal of features. Allows you to remove features of vlmcsd you do not need or want.
  260. * Use it to get smaller binaries. This is especially useful on very small embedded devices.
  261. * ----------------------------------------------------------------------------------------
  262. */
  263. #ifndef NO_FREEBIND
  264. /*
  265. * Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command
  266. * line option and you can bind only to (listen on) IP addresses that are currently up and running on
  267. * your system.
  268. */
  269. //#define NO_FREEBIND
  270. #endif // NO_FREEBIND
  271. #ifndef NO_EXTENDED_PRODUCT_LIST
  272. /*
  273. * Do not compile the extended product list. Removes the list of Activation GUIDs (aka
  274. * Client SKU Id, License Id) and their respective product names (e.g. Windows 8.1 Enterprise).
  275. *
  276. * This affects logging only and does not have an effect on activation itself. As long as you
  277. * do not also define NO_BASIC_PRODUCT_LIST more generic names like Windows 8.1 or Office 2013
  278. * will still be logged. Saves a lot of space without loosing much functionality.
  279. *
  280. */
  281. //#define NO_EXTENDED_PRODUCT_LIST
  282. #endif // NO_EXTENDED_PRODUCT_LIST
  283. #ifndef NO_BASIC_PRODUCT_LIST
  284. /*
  285. * Do not compile the basic product list. Removes the list KMS GUIDs (aka Server SKU Id) and their
  286. * respective product names. Only affects logging not activation. This has a negative impact only
  287. * if you activate a product that is not (yet) in the extended product list. On the other hand you
  288. * do not save much space by not compiling this list.
  289. */
  290. //#define NO_BASIC_PRODUCT_LIST
  291. #endif // NO_BASIC_PRODUCT_LIST
  292. #ifndef NO_VERSION_INFORMATION
  293. /*
  294. * Removes the -V option from vlmcsd and vlmcs that displays the version information
  295. */
  296. //#define NO_VERSION_INFORMATION
  297. #endif // NO_VERSION_INFORMATION
  298. #ifndef NO_VERBOSE_LOG
  299. /*
  300. * Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v
  301. * option in the vlmcs client. Disables ini file directive LogVerbose.
  302. */
  303. //#define NO_VERBOSE_LOG
  304. #endif // NO_VERBOSE_LOG
  305. #ifndef NO_LOG
  306. /*
  307. * Disables logging completely. You can neither log to a file nor to the console. -D and -f will
  308. * start vlmcsd in foreground. -e will not be available. Disables ini file directive LogFile.
  309. * Implies NO_VERBOSE_LOG, NO_EXTENDED_PRODUCT_LIST and NO_BASIC_PRODUCT_LIST.
  310. */
  311. //#define NO_LOG
  312. #endif // NO_LOG
  313. #ifndef NO_RANDOM_EPID
  314. /*
  315. * Disables the ability to generate random ePIDs. Useful if you managed to grab ePID/HWID from a
  316. * real KMS server and want to use these. Removes -r from the vlmcsd command line and the ini
  317. * file directive RandomizationLevel (The randomization level will be harcoded to 0).
  318. */
  319. //#define NO_RANDOM_EPID
  320. #endif // NO_RANDOM_EPID
  321. #ifndef NO_INI_FILE
  322. /*
  323. * Disables the ability to use a configuration file (aka ini file). Removes -i from the command line.
  324. */
  325. //#define NO_INI_FILE
  326. #endif // NO_INI_FILE
  327. #ifndef NO_PID_FILE
  328. /*
  329. * Disables the abilty to write a pid file containing the process id of vlmcsd. If your init system
  330. * does not need this feature, you can safely disables this but it won't save much space. Disables
  331. * the use of -p from the command line and PidFile from the ini file.
  332. */
  333. //#define NO_PID_FILE
  334. #endif // NO_PID_FILE
  335. #ifndef NO_USER_SWITCH
  336. /*
  337. * Disables switching to another uid and/or gid after starting the program and setting up the sockets.
  338. * You cannot use -u anf -g on the command line as well as User and Group in the ini file. If your init system
  339. * supports starting daemons as another uid/gid (user/group) you can disable this feature in vlmcsd as long as you
  340. * do not need to run vlmcsd on a privileged port ( < 1024 on most systems).
  341. *
  342. * This setting has no effect on native Windows since -u and -g is not available anyway. It may be used with
  343. * Cygwin.
  344. */
  345. //#define NO_USER_SWITCH
  346. #endif // NO_USER_SWITCH
  347. #ifndef NO_HELP
  348. /*
  349. * Disables display of help in both vlmcsd and vlmcs. Saves some bytes but only makes sense if you have
  350. * access to the man files vlmcsd.8 and vlmcs.1
  351. */
  352. //#define NO_HELP
  353. #endif // NO_HELP
  354. #ifndef NO_CUSTOM_INTERVALS
  355. /*
  356. * Disables the ability to specify custom interval for renewing and retrying activation. Newer versions of the Microsoft's
  357. * KMS activation client (as in Win 8.1) do not honor these parameters anyway. Disable them to save some bytes. Removes
  358. * -A and -R from the command line as well as ActivationInterval and RenewalInterval in the ini file.
  359. */
  360. //#define NO_CUSTOM_INTERVALS
  361. #endif // NO_CUSTOM_INTERVALS
  362. #ifndef NO_SOCKETS
  363. /*
  364. * Disables standalone startup of vlmcsd. If you use this config directive, you must start vlmcsd from an internet
  365. * superserver like inetd, xinetd, systemd or launchd. Disables -m, -t, -4, -6, -e, -f, -P and -L in the vlmcsd
  366. * command line. Socket setup is the job of your superserver.
  367. */
  368. //#define NO_SOCKETS
  369. #endif // NO_SOCKETS
  370. #ifndef NO_CL_PIDS
  371. /*
  372. * Disables the ability to specify ePIDs and HWID at the command line. You still may use them in the ini file.
  373. * Removes -0, -3, -w and -H from the vlmcsd command line.
  374. */
  375. //#define NO_CL_PIDS
  376. #endif // NO_CL_PIDS
  377. #ifndef NO_LIMIT
  378. /*
  379. * Disables the ability to limit the number of worker threads or processes that vlmcsd uses. While you should set a
  380. * limit whenever possible, you may save some bytes by enabling that setting. If you do not use a limit, use vlmcsd
  381. * in a "friendly" environment only, i.e. do not run it without a reasonable limit on the internet.
  382. *
  383. * Removes the ability to use -m in the vlmcsd command line and MaxWorkers in the ini file.
  384. *
  385. * Some older unixoid OSses may not have pthreads. Do NOT use USE_THREADS and define NO_SIGHUP
  386. * and NO_LIMIT instead to disable use of the pthreads, shared memory and semaphores.
  387. */
  388. //#define NO_LIMIT
  389. #endif // NO_LIMIT
  390. #ifndef NO_SIGHUP
  391. /*
  392. * Disables the ability to signal hangup (SIGHUP) to vlmcsd to restart it (rereading the ini file). The SIGHUP
  393. * handler makes heavy use of OS specific code. It should not cause any trouble on Solaris, Mac OS X and iOS. On Linux
  394. * use "#define USE_AUXV" (see troubleshooting options) if this is supported by your C runtime library.
  395. *
  396. * You may save some bytes by enabling this option. Use it also if the SIGHUP handler causes any trouble on your
  397. * platform. Please note that with no SIGHUP handler at all. vlmcsd will simply terminate (uncleanly) if it receives
  398. * the SIGHUP signal. This is the same behavior as with most other signals.
  399. *
  400. * This option has no effect on native Windows since Posix signaling is not supported. It can be used with Cygwin.
  401. */
  402. //#define NO_SIGHUP
  403. #endif // NO_SIGHUP
  404. #ifndef SIMPLE_SOCKETS
  405. /*
  406. * Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.
  407. * It still supports IPv4 and IPv6.
  408. */
  409. //#define SIMPLE_SOCKETS
  410. #endif // SIMPLE_SOCKETS
  411. /* Don't change anything BELOW this line */
  412. #endif /* CONFIG_H_ */