commit 363a81bb996eab65eef2f0f143a4bca4bb53cc4b Author: Dnomd343 Date: Sat Jul 31 22:05:18 2021 +0800 feat: kms server diff --git a/fonts/RobotoMono-Regular.woff b/fonts/RobotoMono-Regular.woff new file mode 100644 index 0000000..8cb9e6f Binary files /dev/null and b/fonts/RobotoMono-Regular.woff differ diff --git a/fonts/lato-black.woff b/fonts/lato-black.woff new file mode 100644 index 0000000..a0ab25e Binary files /dev/null and b/fonts/lato-black.woff differ diff --git a/fonts/lato-normal.woff b/fonts/lato-normal.woff new file mode 100644 index 0000000..ae1307f Binary files /dev/null and b/fonts/lato-normal.woff differ diff --git a/kms-cli.php b/kms-cli.php new file mode 100644 index 0000000..6dfac4e --- /dev/null +++ b/kms-cli.php @@ -0,0 +1,43 @@ + $versionContent) { + echo PHP_EOL; + showVersion($versionName, $versionContent); // 逐个显示表格 + } +} + +function showWinKeys() { // 显示Windows的KMS密钥 + $kmsKeys = getKmsKeys('win'); + showKmsKeys($kmsKeys); +} + +function showWinServerKeys() { // 显示Windows Server的KMS密钥 + $kmsKeys = array_reverse(getKmsKeys('win-server')); + showKmsKeys($kmsKeys); +} + +?> \ No newline at end of file diff --git a/kms-help.php b/kms-help.php new file mode 100644 index 0000000..91283d5 --- /dev/null +++ b/kms-help.php @@ -0,0 +1,40 @@ + http://' . $webSite . '/win' . PHP_EOL; + echo ' -> http://' . $webSite . '/win-server' . PHP_EOL; + echo PHP_EOL; +} + +function webHelp() { + global $webSite; + echo ''; + echo ''; + echo 'Windows Activation'; + echo ''; + echo '

Windows KMS Activation

';
+    echo ' slmgr /upk' . PHP_EOL;
+    echo ' slmgr /ipk {KMS_KEY}' . PHP_EOL;
+    echo ' slmgr /skms ' . $webSite . PHP_EOL;
+    echo ' slmgr /ato' . PHP_EOL;
+    echo ' slmgr /dlv';
+    echo '

KMS_KEY (Windows)
KMS_KEY (Windows Server)

'; +} + +?> \ No newline at end of file diff --git a/kms-keys.db b/kms-keys.db new file mode 100644 index 0000000..e8c0af8 Binary files /dev/null and b/kms-keys.db differ diff --git a/kms-keys.php b/kms-keys.php new file mode 100644 index 0000000..fdac760 --- /dev/null +++ b/kms-keys.php @@ -0,0 +1,43 @@ +open('kms-keys.db'); // KMS密钥数据库 + } +} + +function getVersionName($type, $version_id) { // 获取对应版本的名称 + $db = new kmsDB; + $res = $db->query('SELECT * FROM `' . $type . '_version` WHERE version_id=' . $version_id . ';'); + return $res->fetchArray(SQLITE3_ASSOC)['version_name']; +} + +function getKmsKeys($type) { // 获取所有版本的KMS密钥 + $db = new kmsDB; + $res = $db->query('SELECT * FROM `' . $type . '`;'); + while ($row = $res->fetchArray(SQLITE3_ASSOC)) { + $index = $row['version']; + unset($row['version']); + $data[getVersionName($type, $index)][] = $row; + } + return $data; +} + +?> \ No newline at end of file diff --git a/kms-web.php b/kms-web.php new file mode 100644 index 0000000..310f42c --- /dev/null +++ b/kms-web.php @@ -0,0 +1,34 @@ +'; + echo ''; + echo $title; + echo '
'; + foreach ($kmsKeys as $versionName => $versionContent) { + echo '

' . $versionName . '

'; + echo ''; + foreach ($versionContent as $row) { + echo ''; + echo ''; + } + echo '
操作系统KMS密钥
' . $row['name'] . '' . $row['key'] . '
'; + } + echo '
'; +} + +function webWinKeys() { // 网页显示Windows的KMS密钥 + $kmsKeys = getKmsKeys('win'); + webKmsKeys($kmsKeys, 'Windows KMS Keys'); +} + +function webWinServerKeys() { // 网页显示Windows Server的KMS密钥 + $kmsKeys = array_reverse(getKmsKeys('win-server')); + webKmsKeys($kmsKeys, 'Windows Server KMS Keys'); +} + +?> \ No newline at end of file diff --git a/route.php b/route.php new file mode 100644 index 0000000..eaf7732 --- /dev/null +++ b/route.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..ebede66 --- /dev/null +++ b/style.css @@ -0,0 +1,108 @@ +@font-face { + font-family: Lato; + font-style: normal; + font-weight: 400; + src: url(./fonts/lato-normal.woff) format("woff") +} + +@font-face { + font-family: Lato; + font-style: normal; + font-weight: 600; + src: url(./fonts/lato-black.woff) format("woff") +} + +@font-face { + font-family: Roboto Mono; + font-style: normal; + font-weight: 400; + src: url(./fonts/RobotoMono-Regular.woff) format("woff"); +} + +body, +html { + margin: 0; + padding: 0; + color: rgba(0, 0, 0, .75); + font-size: 16px; + font-family: Lato, sans-serif; + font-variant-ligatures: common-ligatures; + line-height: 1.67; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale +} + +div { + margin-bottom: 180px; + margin-left: auto; + margin-right: auto; + padding-left: 30px; + padding-right: 30px; + max-width: 750px +} + +h2 { + margin: 1.8em 0; + line-height: 1.33 +} + +h2:after { + content: ""; + display: block; + position: relative; + top: .33em; + border-bottom: 1px solid hsla(0, 0%, 50%, .33) +} + +a { + color: #0c93e4; + text-decoration: underline; + text-decoration-skip: ink; + background-color: transparent; + -webkit-text-decoration-skip: objects; +} + +a:focus, +a:hover { + text-decoration: none +} + +code, +pre { + font-family: Roboto Mono, monospace; + font-size: .85em +} + +pre * { + font-size: inherit +} + +pre>code { + background-color: rgba(0, 0, 0, .05); + display: block; + padding: .5em; + -webkit-text-size-adjust: none; + overflow-x: auto; + white-space: pre +} + +table { + background-color: transparent; + border-collapse: collapse; + border-spacing: 0 +} + +td, +th { + border-right: 1px solid #dcdcdc; + padding: 8px 12px +} + +td { + border-top: 1px solid #dcdcdc +} + +td:last-child, +th:last-child { + border-right: 0 +} \ No newline at end of file