T1
VLMCSD / VLMCSD (amd64, cicd.bookworm, bookworm trixie noble, main, x86_64-linux-gnu-gcc-12) (push) Successful in 26s
VLMCSD / VLMCSD (arm64, cicd.bookworm, bookworm trixie noble, main, aarch64-linux-gnu-gcc-12) (push) Successful in 16s

This commit is contained in:
Cantibra
2026-05-05 19:53:32 +02:00
parent 50e015dc96
commit 7055dc7e96
14 changed files with 208 additions and 260 deletions
+3
View File
@@ -135,3 +135,6 @@
# Disable or enable the privacy mode (default is false)
# Command line:
;PrivacyMode = false
# Disable or enable the ability to count the request (default is false)
;CountingReq = false
+2 -2
View File
@@ -652,10 +652,10 @@ endif
$(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^
clean:
rm -f $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME) $(REAL_DLL_NAME) $(REAL_CLIENT_NAME) $(OBJ_NAME) $(REAL_A_NAME) ../bin/* ../build/* *.d
rm -rf $(REAL_PROGRAM_NAME) $(REAL_MULTI_NAME) $(REAL_DLL_NAME) $(REAL_CLIENT_NAME) $(OBJ_NAME) $(REAL_A_NAME) ../bin/* ../build/* *.d
dnsclean:
rm -f ../build/dns_srv.o
rm -rf ../build/dns_srv.o
help:
@echo "Help is available by typing 'make help' in directory $(shell realpath `pwd`/..). Use 'cd ..' to get there."
+6 -126
View File
@@ -10,8 +10,6 @@
* new version.
*/
/*
* ----------------------------------------------------------------------------------------
* Useful customizations. These options are mandatory. You cannot comment them out.
@@ -37,30 +35,22 @@
* 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"
#define INI_FILE "/etc/vlmcsd.ini"
#endif // INI_FILE
#ifndef DATA_FILE
/*
* Uncomment and customize the following line if you want vlmcsd to look for a KMS data file
@@ -71,7 +61,6 @@
#endif // DATA_FILE
/*
* ----------------------------------------------------------------------------------------
* Troubleshooting options. Please note that disabling features may also help troubleshooting.
@@ -81,7 +70,6 @@
* ----------------------------------------------------------------------------------------
*/
#ifndef CHILD_HANDLER
/*
* Uncomment the following #define if you are compiling for a platform that does
@@ -95,7 +83,6 @@
#endif // CHILD_HANDLER
#ifndef NO_TIMEOUT
/*
* Uncomment the following #define if you are compiling for a platform that does
@@ -106,7 +93,6 @@
#endif // NO_TIMEOUT
#ifndef NO_DNS
/*
* Uncomment the following #define if you have trouble with accessing routines
@@ -118,7 +104,6 @@
#endif // NO_DNS
#ifndef TERMINAL_FIXED_WIDTH
/*
* Uncomment the following #define and optionally change its value if you are compiling for
@@ -130,9 +115,6 @@
#endif // TERMINAL_FIXED_WIDTH
#ifndef _PEDANTIC
/*
* Uncomment the following #define if you want to do vlmcs and vlmcsd more checks on the data
@@ -144,9 +126,6 @@
#endif // _PEDANTIC
#ifndef NO_PROCFS
/*
* Cygwin, Linux, Android, NetBSD, DragonflyBSD:
@@ -167,9 +146,6 @@
#endif // NO_PROCFS
#ifndef USE_AUXV
/*
* Linux only:
@@ -186,13 +162,10 @@
* It is safe to try this by yourself. vlmcsd won't compile if your system doesn't support it.
*/
//#define USE_AUXV
#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
@@ -205,16 +178,12 @@
#endif // _OPENSSL_NO_HMAC
/*
* ----------------------------------------------------------------------------------------
* Modes of operation
* ----------------------------------------------------------------------------------------
*/
#ifndef USE_THREADS
/*
* Do not use fork() but threads to serve your clients.
@@ -239,9 +208,6 @@
#endif // USE_THREADS
#ifndef _CRYPTO_POLARSSL
/*
* Not available on native Windows. Can be used with Cygwin.
@@ -260,9 +226,6 @@
#endif // _CRYPTO_POLARSSL
#ifndef _CRYPTO_OPENSSL
/*
* Not available on native Windows. Can be used with Cygwin.
@@ -281,9 +244,6 @@
#endif // _CRYPTO_OPENSSL
#ifndef _USE_AES_FROM_OPENSSL
/*
* DANGEROUS: Tweak OpenSSL to perform KMSv4 CMAC and KMSv6 modified AES. This option creates the expanded
@@ -301,10 +261,6 @@
#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.
@@ -317,20 +273,15 @@
#endif // _OPENSSL_SOFTWARE
#ifndef FULL_INTERNAL_DATA
/*
* Includes the full database in vlmcsd.
*/
//#define FULL_INTERNAL_DATA
#define FULL_INTERNAL_DATA
#endif // FULL_INTERNAL_DATA
/*
* ----------------------------------------------------------------------------------------
* Removal of features. Allows you to remove features of vlmcsd you do not need or want.
@@ -338,7 +289,6 @@
* ----------------------------------------------------------------------------------------
*/
#ifndef NO_FREEBIND
/*
* Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command
@@ -350,21 +300,15 @@
#endif // NO_FREEBIND
#ifndef NO_TAP
/*
* Do not compile support for using a VPN adapter under Windows. Disables -O command line option.
*/
//#define NO_TAP
#define NO_TAP
#endif // NO_TAP
#ifndef NO_VERSION_INFORMATION
/*
* Removes the -V option from vlmcsd and vlmcs that displays the version information
@@ -374,9 +318,6 @@
#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
@@ -387,9 +328,6 @@
#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
@@ -401,9 +339,6 @@
#endif // NO_LOG
#ifndef NO_STRICT_MODES
/*
* Disables emulator detection protection. Removes -M0, -M1, -E0, -E1, -K0, -K1, -K2 and -K3 from
@@ -415,10 +350,6 @@
#endif // NO_STRICT_MODES
#ifndef NO_CLIENT_LIST
/*
* Disables the ability to maintain a list of Client Machine IDs (CMIDs). Removes -M0, -M1, -E0 and -E1
@@ -429,8 +360,6 @@
#endif // !NO_CLIENT_LIST
#ifndef NO_RANDOM_EPID
/*
* Disables the ability to generate random ePIDs. Useful if you managed to grab ePID/HWID from a
@@ -442,9 +371,6 @@
#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.
@@ -454,9 +380,6 @@
#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
@@ -468,9 +391,6 @@
#endif // NO_PID_FILE
#ifndef NO_EXTERNAL_DATA
/*
* Disables the abilty to load external KMS data from a file. Disables command line options -j
@@ -481,9 +401,6 @@
#endif // NO_EXTERNAL_DATA
#ifndef NO_INTERNAL_DATA
/*
* Compiles vlmcsd and vlmcs without an internal database. If no database is found at
@@ -495,9 +412,6 @@
#endif // NO_INTERNAL_DATA
#ifndef UNSAFE_DATA_LOAD
/*
* Does not check an external KMS data file for integrity.
@@ -508,9 +422,6 @@
#endif // UNSAFE_DATA_LOAD
#ifndef NO_USER_SWITCH
/*
* Disables switching to another uid and/or gid after starting the program and setting up the sockets.
@@ -526,9 +437,6 @@
#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
@@ -539,9 +447,6 @@
#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
@@ -553,9 +458,6 @@
#endif // NO_CUSTOM_INTERVALS
#ifndef NO_PRIVATE_IP_DETECT
/*
* Disables the ability to protect vlmcsd against KMS requests from public IP addresses.
@@ -566,9 +468,6 @@
#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
@@ -580,9 +479,6 @@
#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.
@@ -593,9 +489,6 @@
#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
@@ -612,9 +505,6 @@
#endif // NO_LIMIT
#ifndef NO_SIGHUP
/*
* Disables the ability to signal hangup (SIGHUP) to vlmcsd to restart it (rereading the ini file). The SIGHUP
@@ -632,9 +522,6 @@
#endif // NO_SIGHUP
#ifndef SIMPLE_RPC
/*
* Uses a simple version of the RPC protocol which does not support NDR64 and BTFN.
@@ -645,9 +532,6 @@
// #define SIMPLE_RPC
#endif // !SIMPLE_RPC
#ifndef SIMPLE_SOCKETS
/*
* Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.
@@ -658,9 +542,6 @@
#endif // SIMPLE_SOCKETS
#ifndef PRIVACY_ON
/*
* This flag enables the ability to hide the incoming request information and outcoming request
@@ -669,9 +550,8 @@
// #define PRIVACY_ON
#endif // PRIVACY_ON
#endif
/* Don't change anything BELOW this line */
#endif /* CONFIG_H_ */
+26
View File
@@ -51,6 +51,10 @@ typedef ssize_t(*sendrecv_t)(int, void*, size_t, int);
typedef int (WINAPI *sendrecv_t)(SOCKET, void*, int, int);
#endif
#ifndef NO_LOG
#include "output.h"
#include <time.h>
#endif // NO_LOG
// Send or receive a fixed number of bytes regardless if received in one or more chunks
int_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send)
@@ -1045,6 +1049,10 @@ int runServer()
serveClient(STDIN_FILENO, RpcAssocGroup);
return 0;
}
#ifndef NO_LOG
static uint32_t CountKMSReq = 0;
time_t startClock = time(NULL);
#endif // NO_LOG
for (;;)
{
@@ -1085,6 +1093,24 @@ int runServer()
# else // NO_LOG || !_PEDANTIC
serveClientAsync(s_client, RpcAssocGroup);
# endif // NO_LOG || !_PEDANTIC
#ifndef NO_LOG
if (isCounting == TRUE) {
CountKMSReq++;
time_t checkPointClock = time(NULL);
double uptimeReq = (double)(checkPointClock - startClock);
double reqRate = CountKMSReq / uptimeReq;
logger(
"Total %d %s in %.2lf seconds (%.4lf reqs/sec)\n",
CountKMSReq,
(CountKMSReq == 1) ? "request" : "requests",
uptimeReq,
reqRate
);
}
#endif // NO_LOG
}
# endif // NO_SOCKETS
}
+3 -1
View File
@@ -78,7 +78,9 @@ int_fast8_t logverbose = 0;
int_fast8_t isPrivacyOn = FALSE;
#else
int_fast8_t isPrivacyOn = TRUE;
#endif
#endif // PRIVACY_ON
int_fast8_t isCounting = FALSE;
#ifndef NO_SOCKETS
int_fast8_t ExitLevel = 0;
+3
View File
@@ -26,6 +26,7 @@
#endif // !defined(NO_LIMIT) && !__minix__
#else
//#ifndef USE_MSRPC
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
//#endif // USE_MSRPC
@@ -220,4 +221,6 @@ extern int_fast8_t freebind;
extern int_fast8_t isPrivacyOn;
#endif
extern int_fast8_t isCounting;
#endif // INCLUDED_SHARED_GLOBALS_H
+4
View File
@@ -31,6 +31,10 @@
* =============
*/
#ifdef _WIN32
#include <winioctl.h>
#endif // _WIN32
#define TAP_WIN_CONTROL_CODE(request,method) \
CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
+1
View File
@@ -21,6 +21,7 @@
#if defined(_WIN32)
//#ifndef USE_MSRPC
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
//#include <ws2tcpip.h>
//#endif // USE_MSRPC
+6 -3
View File
@@ -696,8 +696,9 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
"\n\nResponse from KMS server\n========================\n\n"
"Size of KMS Response : %u (0x%x)\n", result.effectiveResponseSize, result.effectiveResponseSize
);
#ifndef NO_LOG
logResponseVerbose(ePID, hwid, response, &printf);
#endif // NO_LOG
printf("\n");
}
# endif // NO_VERBOSE_LOG
@@ -1387,7 +1388,9 @@ static void CreateRequestBase(REQUEST *Request)
if (verbose)
{
printf("\nRequest Parameters\n==================\n\n");
#ifndef NO_LOG
logRequestVerbose(Request, &printf);
#endif // NO_LOG
printf("\n");
}
# endif // NO_VERBOSE_LOG
@@ -1398,12 +1401,12 @@ int __stdcall WinStartUp(void)
{
WCHAR **szArgList;
int argc;
szArgList = CommandLineToArgvW(GetCommandLineW(), &argc);
int i;
char **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc);
for (i = 0; i < argc; i++)
for (int i = 0; i < argc; i++)
{
int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);
argv[i] = (char*)vlmcsd_malloc(size);
+6
View File
@@ -7,6 +7,7 @@
#include CONFIG
#if !defined(USE_MSRPC) && defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#endif // defined(USE_MSRPC) && defined(_WIN32)
#include "types.h"
@@ -17,6 +18,11 @@
#endif // USE_MSRPC
#include "kms.h"
#if _MSC_VER
#include <windows.h>
#include <shellapi.h>
#endif
#if MULTI_CALL_BINARY < 1
#define client_main main
#else
+36 -22
View File
@@ -88,7 +88,7 @@ Volume License Management Service DAEMON (vlmcsd)
#include "wintap.h"
#endif
static const char *const optstring = "a:N:B:m:t:A:R:u:g:L:p:i:H:P:l:r:U:W:C:c:F:O:o:x:T:K:E:M:j:SseDdVvqkZX";
static const char *const optstring = "a:N:B:m:t:A:R:u:g:L:p:i:H:P:l:r:U:W:C:c:F:O:o:x:T:K:E:M:j:SseDdVvqkZXw";
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
static uint_fast8_t maxsockets = 0;
@@ -178,6 +178,7 @@ static IniFileParameter_t IniFileParameterList[] =
{"LogDateAndTime", INI_PARAM_LOG_DATE_AND_TIME},
{"LogFile", INI_PARAM_LOG_FILE},
{"PrivacyMode", INI_PARAM_PRIVACY_MODE},
{"CountingReq", INT_PARAM_COUNTING_REQ},
#ifndef NO_VERBOSE_LOG
{"LogVerbose", INI_PARAM_LOG_VERBOSE},
#endif // NO_VERBOSE_LOG
@@ -296,7 +297,7 @@ static __noreturn void usage()
/////////////////////////////////////////////////////////////////////
//// ePID randomization level is used
#ifndef NO_RANDOM_EPID
" -r (0|1|2)\t\tSet randomization level of the ePIDs (default is \"0\")\n\t\t\t\t\"0\" stands for no randomization, which also means VLMCSD will use the default ePID that is built-in. It is useful for emulating/replicating real KMS servers\n\t\t\t\t\"1\" stands for randomization of each KMS request, but it also poses a risk of being detected non-genuine KMS Server, causing clients to fail to be activated\n\t\t\t\t\"2\" is as same as the \"1\" option, but only for debugging\n"
" -r (0|1|2)\t\tSet randomization level of the ePIDs (default is \"0\")\n\t\t\t\t\"0\" stands for no randomization, which also means VLMCSD will use the default ePID that is built-in\n\t\t\t\t\"1\" stands for randomization of each KMS request, but it also poses a risk of being detected non-genuine KMS Server\n\t\t\t\t\"2\" is as same as the \"1\" option, but only for debugging\n"
" -C <LCID>\t\tUse fixed Windows Language Code Identifier in random ePIDs\n\t\t\t\tSee https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c for correct LCIDs\n"
" -H <build>\t\tUse fixed Windows build number for activation\n\t\t\t\tUseful when the client requires a proper KMS Server\n\t\t\t\tSee all build numbers here: https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions\n"
#endif // NO_RANDOM_EPID
@@ -362,8 +363,8 @@ static __noreturn void usage()
" -K (0|1|2|3)\t\tSet white-listing level which product VLMCSD accepts or refuses (default 0)\n\t\t\t\t\"0\" Activate all products with an unknown, retail or beta/preview KMS IDs\n\t\t\t\t\"1\" Activate products with a retail or beta/preview KMS ID but refuse to activate products with an unknown KMS ID\n\t\t\t\t\"2\" Activate products with an unknown KMS ID but refuse products with a retail or beta/preview KMS ID\n\t\t\t\t\"3\" Activate only products with a known volume license RTM KMS ID and refuse all others\n"
" -c (0|1)\t\tDisable (0)/Enable (1) client time checking\n\t\t\t\tIf the client time is different than 4 hours compare to the KMS Host, the host will deny the activation (default 0)\n\t\t\t\tNote: It is recommended that the VLMCSD has a reliable time service (e.g. sync the time with time.windows.com)\n"
#ifndef NO_CLIENT_LIST
" -M (0|1)\t\tDisable (0)/Enable (1) maintaining clients (default 0)\n\t\t\t\tNote: Enabling this service is not recommended, except you have to do so to prevent the activation failling\n\t\t\t\tIt is because the VLMCSD can only keep maximum of 16777215 clients. If that number exceed, VLMCSD will no longer accept any new connect, nor activation requests\n"
" -E (0|1)\t\tDisable (0)/Enable (1) starting VLMCSD with empty client list (Default 0)\n\t\t\t\tNote: It is recommended to keep the default, because Office will not activate unless your KMS Host has at least 5 active clients.\n\t\t\t\tSee more: https://learn.microsoft.com/en-us/office/troubleshoot/administration/0xc004f038-computer-not-activate\n"
" -M (0|1)\t\tDisable (default, 0)/Enable (1) maintaining clients\n\t\t\t\tNote: Enabling this service is not recommended, except you have to do so to prevent the activation failling\n\t\t\t\tIt is because the VLMCSD can only keep maximum of 16777215 clients. If that number exceed, VLMCSD will no longer accept any new connect, nor activation requests\n"
" -E (0|1)\t\tDisable (default, 0)/Enable (1) starting VLMCSD with empty client list\n\t\t\t\tNote: It is recommended to keep the default, because Office will not activate unless your KMS Host has at least 5 active clients.\n\t\t\t\tSee more: https://learn.microsoft.com/en-us/office/troubleshoot/administration/0xc004f038-computer-not-activate\n"
#endif // !NO_CLIENT_LIST
#endif // !NO_STRICT_MODES
/////////////////////////////////////////////////////////////////////
@@ -374,42 +375,42 @@ static __noreturn void usage()
#if !defined(NO_TIMEOUT) && !__minix__
" -t <seconds>\t\tDisconnect client after an amount of time of inactivity (default 30)\n"
#endif // !defined(NO_TIMEOUT) && !__minix__
" -d\t\t\tDisconnect each client after processing one activation request.\n"
" -k\t\t\tDo not disconnect clients after processing an activation request (default if \"-d\" defined in external VLMCSD configuration file).\n"
" -d\t\t\tDisconnect each client after processing one activation request\n"
" -k\t\t\tDo not disconnect clients after processing an activation request (default if \"-d\" defined in external VLMCSD configuration file)\n"
#ifndef SIMPLE_RPC
" -N (0|1)\t\tDisable (0)/Enable (default, 1) NDR64. Only useful when on Windows Vista/7 32-bit, where enabling NDR64 will make VLMCSD by running higher Windows build number.\n"
" -B (0|1)\t\tDisable (0)/Enable (1) bind time feature negotiation in RPC protocol.\n"
" -N (0|1)\t\tDisable (0)/Enable (default, 1) NDR64. Only useful when on Windows Vista/7 32-bit, where enabling NDR64 will make VLMCSD by running higher Windows build number\n"
" -B (0|1)\t\tDisable (0)/Enable (1) bind time feature negotiation in RPC protocol\n"
#endif // !SIMPLE_RPC
#endif // USE_MSRPC
#ifndef NO_PID_FILE
" -p <file>\t\tCreate pid file filename. This is used by standard init scripts (typically found in \"/etc/init.d\").\n"
" -p <file>\t\tCreate pid file filename. This is used by standard init scripts (typically found in \"/etc/init.d\")\n"
#endif // NO_PID_FILE
#ifndef NO_INI_FILE
" -i <file>\t\tUse external VLMCSD configuration file. Default name of that file is \"vlmcsd.ini\".\n"
" -i <file>\t\tUse external VLMCSD configuration file. Default name of that file is \"vlmcsd.ini\"\n"
#endif // NO_INI_FILE
#ifndef NO_EXTERNAL_DATA
" -j <file>\t\tUse external VLMCSD ePID database. Default name of that file is \"vlmcsd.kmd\".\n"
" -j <file>\t\tUse external VLMCSD ePID database. Default name of that file is \"vlmcsd.kmd\"\n"
#endif // !NO_EXTERNAL_DATA
#ifndef NO_CUSTOM_INTERVALS
" -R <interval>\t\tRenew activation every <interval> (default 1w).\n"
" -A <interval>\t\tRetry activation every <interval>, if the previous activation/reactivation is failed (default 2h).\n"
" -R <interval>\t\tRenew activation every <interval> (default 1w)\n"
" -A <interval>\t\tRetry activation every <interval>, if the previous activation/reactivation is failed (default 2h)\n"
#endif // NO_CUSTOM_INTERVALS
#ifndef NO_LOG
" -l <file>\t\tWrites VLMCSD log into a file. Note: Make sure you have read+write access to that file.\n"
" -T0, -T1\t\tDisable (0)/Enable logging client connection with time and date (default 1).\n"
" -l <file>\t\tWrites VLMCSD log into a file. Note: Make sure you have rw access to that file\n"
" -T0, -T1\t\tDisable (0)/Enable (default, 1) logging client connection with time and date\n"
#ifndef PRIVACY_ON
" -X\t\t\tAllow running in Privacy Mode (experiment).\n"
" -X\t\t\tAllow running in Privacy Mode (hide detail of incoming and response requests)\n"
#endif // PRIVACY_ON
" -w\t\t\tDisplay total KMS requests\n"
#ifndef NO_VERBOSE_LOG
" -v\t\t\tAllow logging verbose.\n"
" -q\t\t\tDon't allow log verbose (default).\n"
" -v\t\t\tAllow logging verbose\n"
" -q\t\t\tDon't allow log verbose (default)\n"
#endif // NO_VERBOSE_LOG
#endif // NO_LOG
#ifndef NO_VERSION_INFORMATION
" -V\t\t\tDisplay version information and exit\n"
#endif // NO_VERSION_INFORMATION
,
Version, global_argv[0]);
,Version, global_argv[0]);
exit(VLMCSD_EINVAL);
}
#endif // HELP
@@ -681,6 +682,10 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
break;
#endif // PRIVACY_ON
case INT_PARAM_COUNTING_REQ:
isCounting = getIniFileArgumentBool(&isCounting, iniarg);
break;
case INI_PARAM_LOG_FILE:
fn_log = vlmcsd_strdup(iniarg);
break;
@@ -1293,6 +1298,11 @@ static void parseGeneralArguments()
break;
#endif // PRIVACY_ON
case 'w':
isCounting = TRUE;
ignoreIniFileParameter(INT_PARAM_COUNTING_REQ);
break;
#ifndef NO_SOCKETS
#if !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
case 'L':
@@ -2027,6 +2037,10 @@ int newmain()
logger("Privacy mode is turned on\n");
#endif //PRIVACY_ON
if (isCounting == TRUE) {
logger("Counting request is turned on\n");
}
#endif // !defined(NO_LOG) && !defined(NO_SOCKETS) && !defined(USE_MSRPC)
#if defined(_NTSERVICE) && !defined(USE_MSRPC)
@@ -2055,12 +2069,12 @@ int __stdcall WinStartUp(void)
{
WCHAR** szArgList;
int argc;
szArgList = CommandLineToArgvW(GetCommandLineW(), &argc);
int i;
char** argv = (char**)vlmcsd_malloc(sizeof(char*) * argc);
for (i = 0; i < argc; i++)
for (int i = 0; i < argc; i++)
{
int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);
argv[i] = (char*)vlmcsd_malloc(size);
+6
View File
@@ -13,6 +13,11 @@ extern char *fn_log;
#include "types.h"
#if _MSC_VER
#include <windows.h>
#include <shellapi.h>
#endif
//int main(int argc, CARGV);
extern void cleanup();
@@ -57,6 +62,7 @@ int server_main(int argc, CARGV argv);
#define INI_PARAM_VPN 29
#define INI_PARAM_EXIT_LEVEL 30
#define INI_PARAM_PRIVACY_MODE 31
#define INT_PARAM_COUNTING_REQ 32
#define INI_FILE_PASS_1 1
#define INI_FILE_PASS_2 2
+2 -2
View File
@@ -108,12 +108,12 @@ int __stdcall WinStartUp(void)
{
WCHAR** szArgList;
int argc;
szArgList = CommandLineToArgvW(GetCommandLineW(), &argc);
int i;
char** argv = (char**)vlmcsd_malloc(sizeof(char*) * argc);
for (i = 0; i < argc; i++)
for (int i = 0; i < argc; i++)
{
int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL);
argv[i] = (char*)vlmcsd_malloc(size);