├── Makefile ├── README.md └── files ├── vlmcsd.ini └── vlmcsd.init /Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=vlmcsd 4 | PKG_VERSION=svn1112 5 | PKG_RELEASE:=1 6 | 7 | PKG_MAINTAINER:=fuyumi <280604399@qq.com> 8 | PKG_LICENSE:=MIT 9 | PKG_LICENSE_FILES:=LICENSE 10 | 11 | PKG_SOURCE_PROTO:=git 12 | PKG_SOURCE_URL:=https://github.com/mchome/vlmcsd.git 13 | PKG_SOURCE_VERSION:=ae16d0381ddc9fc02d949ed1a9d034ab6b1e7cbb 14 | 15 | PKG_SOURCE_SUBDIR:=$(PKG_NAME) 16 | PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz 17 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) 18 | PKG_BUILD_PARALLEL:=1 19 | 20 | include $(INCLUDE_DIR)/package.mk 21 | 22 | define Package/vlmcsd 23 | SECTION:=net 24 | CATEGORY:=Network 25 | TITLE:=vlmcsd for OpenWRT 26 | URL:=http://forums.mydigitallife.info/threads/50234 27 | DEPENDS:=+libpthread 28 | endef 29 | 30 | define Package/vlmcsd/description 31 | vlmcsd is a KMS Emulator in C. 32 | endef 33 | 34 | MAKE_FLAGS += \ 35 | -C $(PKG_BUILD_DIR) 36 | 37 | define Package/vlmcsd/install 38 | $(INSTALL_DIR) $(1)/usr/bin 39 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcsd $(1)/usr/bin/vlmcsd 40 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcs $(1)/usr/bin/vlmcs 41 | $(INSTALL_DIR) $(1)/etc 42 | $(INSTALL_BIN) ./files/vlmcsd.ini $(1)/etc/vlmcsd.ini 43 | $(INSTALL_DIR) $(1)/etc/init.d 44 | $(INSTALL_BIN) ./files/vlmcsd.init $(1)/etc/init.d/vlmcsd 45 | endef 46 | 47 | $(eval $(call BuildPackage,vlmcsd)) 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # openwrt-vlmcsd 2 | a package for vlmcsd 3 | 4 | ``` 5 | PS: 6 | 1. srv-host=_vlmcs._tcp.lan,openwrt.lan,1688,0,100 添加到 /etc/dnsmasq.conf . 7 | 2. /etc/init.d/vlmcsd enable && /etc/init.d/vlmcsd start && /etc/init.d/dnsmasq restart 8 | 3. OK, 你的路由器下应该可以自动激活Windows或者Office了 :) 9 | ``` 10 | 11 | 配套luci: [luci-app-vlmcsd](https://github.com/mchome/luci-app-vlmcsd "") 12 | -------------------------------------------------------------------------------- /files/vlmcsd.ini: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Sample vlmcsd.ini 4 | # 5 | # An ini file for vlmcsd is normally not required. It is for advanced users only. 6 | # vlmcsd uses an ini file only if specified using the -i option in the command line parameters. 7 | # There is no default ini file because vlmcsd is designed to run on many platforms. 8 | # 9 | # Every line starting with a number sign (#) or semicolon (;) is treated as a comment. 10 | # If a key word is used more than once, the last occurrence is used. The only exception 11 | # to this is Listen. You can use Listen=[:port] more than once. 12 | # 13 | 14 | # Set ePID/HwId for Windows explicitly 15 | ;Windows = 06401-00206-471-111111-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 16 | 17 | # Set ePID for Office 2010 (including Visio and Project) explicitly 18 | ;Office2010 = 06401-00096-199-222222-03-1033-17763.0000-2822018 19 | 20 | # Set ePID/HwId for Office 2013 (including Visio and Project) explicitly 21 | ;Office2013 = 06401-00206-234-333333-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 22 | 23 | # Set ePID/HwId for Office 2016 (including Visio and Project) explicitly 24 | ;Office2016 = 06401-00206-437-444444-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 25 | 26 | # Set ePID/HwId for Office 2019 (including Visio and Project) explicitly 27 | ;Office2019 = 06401-00206-666-666666-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 28 | 29 | # Set ePID/HwId for Windows China Government (Enterprise G/GN) explicitly 30 | ;WinChinaGov = 06401-03858-000-555555-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08 31 | 32 | # Use a compatible VPN device to create a hidden local IPv4 address 33 | # Command line: -O 34 | # VPN = [=][/][:] 35 | # 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. 36 | ;VPN = KMS Mirror=192.168.123.100/24:1d 37 | 38 | # Use custom TCP port 39 | # Command line: -P 40 | # ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets 41 | # ***Use Listen otherwise 42 | ;Port = 1234 43 | 44 | # Listen on all IPv4 addresses (default port 1688) 45 | # Command line: -L 46 | # Does not work with MS RPC or simple sockets, use Port= 47 | ;Listen = 0.0.0.0:1688 48 | 49 | # Listen on all IPv6 addresses (default port 1688) 50 | # Command line: -L 51 | ;Listen = [::]:1688 52 | 53 | # Listen on all private IP addresses and reject incoming requests from public IP addresses 54 | # Command line: -o 55 | # PublicIPProtectionLevel = 3 56 | 57 | # Allow binding to foreign IP addresses 58 | # Command line: -F0 and -F1 59 | ;FreeBind = true 60 | 61 | # Randomize ePIDs at program start up (only those that are not explicitly specified) 62 | # Command line: -r 63 | ;RandomizationLevel = 1 64 | 65 | # Use a specific host build in ePIDs even if the ePID is randomized 66 | # Command line: -H 67 | ;HostBuild = 17763 68 | 69 | # Use a specific culture (1033 = English US) in ePIDs even if the ePID is randomized 70 | # Command line: -C 71 | ;LCID = 1033 72 | 73 | # Set a maximum of 4 workers (forked processes or threads) 74 | # Command line: -m 75 | ;MaxWorkers = 4 76 | 77 | # Disconnect users after 30 seconds of inactivity 78 | # Command line: -t 79 | ;ConnectionTimeout = 30 80 | 81 | # Disconnect clients immediately after each request 82 | # Command line: -d and -k 83 | ;DisconnectClientsImmediately = yes 84 | 85 | # Write a pid file (a file containing the process id of vlmcsd) 86 | # Command line: -p 87 | ;PidFile = /var/run/vlmcsd.pid 88 | 89 | # Load a KMS data file 90 | # Command line: -j 91 | ;KmsData = /etc/vlmcsd.kmd 92 | 93 | # Write log to /var/log/vlmcsd.log 94 | # Command line: -l (-e and -f also override this directive) 95 | ;LogFile = /var/log/vlmcsd.log 96 | 97 | # Don't include date and time in logs (default is true) 98 | # Command line: -T0 and -T1 99 | ;LogDateAndTime = false 100 | 101 | # Create a verbose log 102 | # Command line: -v and -q 103 | ;LogVerbose = true 104 | 105 | # Whitelist known products 106 | # Command line: -K0, -K1, -K2, -K3 107 | ;WhiteListingLevel = 0 108 | 109 | # Check that the client time is within +/- 4 hours of the system time 110 | # Command line: -c0, -c1 111 | ;CheckClientTime = false 112 | 113 | # Maintain a list of CMIDs 114 | # Command line: -M0, -M1 115 | ;MaintainClients = false 116 | 117 | # Start with empty CMID list (Requires MaintainClients = true) 118 | # Command line: -E0, -E1 119 | ;StartEmpty = false 120 | 121 | # Set activation interval to 2 hours 122 | # Command line: -A 123 | ;ActivationInterval = 2h 124 | 125 | # Set renewal interval to 7 days 126 | # Command line: -R 127 | ;RenewalInterval = 7d 128 | 129 | # Exit vlmcsd if warning of certain level has been reached 130 | # Command line: -x 131 | # 0 = Never 132 | # 1 = Exit, if any listening socket could not be established or TAP error occurs 133 | ;ExitLevel = 0 134 | 135 | # Run program as user vlmcsduser 136 | # Command line: -u 137 | ;user = vlmcsduser 138 | 139 | # Run program as group vlmcsdgroup 140 | # Command line: -g 141 | ;group = vlmcsdgroup 142 | 143 | # Disable or enable the NDR64 transfer syntax in RPC (default enabled) 144 | # Command line: -N0 and -N1 145 | ;UseNDR64 = true 146 | 147 | # Disable or enable bind time feature negotiation in RPC (default enabled) 148 | # Command line: -B0 and -B1 149 | ;UseBTFN = true 150 | -------------------------------------------------------------------------------- /files/vlmcsd.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (c) 2011-2016 OpenWrt.org 3 | 4 | START=90 5 | 6 | start(){ 7 | if [ ! -f "/tmp/vlmcsd.pid" ]; then 8 | /usr/bin/vlmcsd -i /etc/vlmcsd.ini -p /tmp/vlmcsd.pid -l syslog -L 0.0.0.0:1688 9 | echo "KMS Server has started." 10 | else 11 | echo "KMS Server has already started." 12 | fi 13 | } 14 | 15 | stop(){ 16 | if [ ! -f "/tmp/vlmcsd.pid" ]; then 17 | echo "KMS Server is not running." 18 | else 19 | pid=`cat /tmp/vlmcsd.pid` 20 | kill $pid 21 | rm -f /tmp/vlmcsd.pid 22 | echo "KMS Server has stopped." 23 | fi 24 | } 25 | 26 | restart(){ 27 | stop 28 | sleep 1 29 | start 30 | echo "KMS Server has restarted." 31 | } 32 | --------------------------------------------------------------------------------