commit 39061befc28ce5d9acabcb9c0379d35c3fac3af3
Author: qubiaobiao <3294694717@qq.com>
Date: Thu Feb 22 12:10:31 2024 +0800
加密批处理文件生成器
diff --git a/BDAuthorization.bat b/BDAuthorization.bat
new file mode 100644
index 0000000..43b504d
--- /dev/null
+++ b/BDAuthorization.bat
@@ -0,0 +1,9 @@
+@echo off
+
+If Not "%~1"=="H" (
+ mshta vbscript:""
+)
+
+reg add HKEY_CURRENT_USER\SOFTWARE\HwaSmart /v BDAuthorization /t REG_SZ /d 87a47565-be47-1470-1a8b-c2354cbaea36 /f
+
+exit
\ No newline at end of file
diff --git a/KeyWord.txt b/KeyWord.txt
new file mode 100644
index 0000000..b372c03
--- /dev/null
+++ b/KeyWord.txt
@@ -0,0 +1 @@
+BDQH
\ No newline at end of file
diff --git a/MachineGuid.txt b/MachineGuid.txt
new file mode 100644
index 0000000..e69de29
diff --git a/batcreater.exe b/batcreater.exe
new file mode 100644
index 0000000..05d8a79
Binary files /dev/null and b/batcreater.exe differ
diff --git a/batcreater.js b/batcreater.js
new file mode 100644
index 0000000..c413658
--- /dev/null
+++ b/batcreater.js
@@ -0,0 +1,55 @@
+const fs = require('fs');
+const crypto = require('crypto');
+
+const passPath = 'HKEY_CURRENT_USER\\SOFTWARE\\HwaSmart';
+const passValue = 'BDAuthorization';
+
+function cryptMD5(GUID) {
+ let md5 = crypto.createHash('md5');
+ let ciphertext = md5.update(GUID).digest('hex')
+ return ciphertext.slice(0,8)+'-'+ciphertext.slice(8,12)+'-'+ciphertext.slice(12,16)+'-'+ciphertext.slice(16,20)+'-'+ciphertext.slice(20,32);
+}
+
+fs.readFile('./MachineGuid.txt', 'utf-8', (err, data) => {
+ if (err) {
+ if (err.code === 'ENOENT') {
+ console.error('file not exist');
+ return;
+ }
+ console.error(err, 'open');
+ return;
+ }
+ fs.readFile('./KeyWord.txt', 'utf-8', (error, key) => {
+ if (error) {
+ if (error.code === 'ENOENT') {
+ console.error('file not exist');
+ return;
+ }
+ console.error(error, 'open');
+ return;
+ }
+ console.log(key)
+ fs.writeFile('./BDAuthorization.bat',
+ `@echo off
+
+If Not "%~1"=="H" (
+ mshta vbscript:""
+)
+
+reg add ${passPath} /v ${passValue} /t REG_SZ /d ${cryptMD5(data + key)} /f
+
+exit`,
+ (e) => {
+ if(e){
+ console.log(`创建失败:${e}`);
+ }
+ console.log(`创建成功!`);
+ });
+ fs.writeFile('./MachineGuid.txt', '', (ero) => {
+ if(ero){
+ console.log(`创建失败:${ero}`);
+ }
+ console.log(`创建成功!`);
+ });
+ });
+});
\ No newline at end of file
diff --git a/使用说明.txt b/使用说明.txt
new file mode 100644
index 0000000..880ee77
--- /dev/null
+++ b/使用说明.txt
@@ -0,0 +1,10 @@
+拿到客户的Guid后,将其粘贴到文件
+MachineGuid.txt 中
+再打开文件
+KeyWord.txt
+输入加密关键字
+然后点击运行文件
+batcreater.exe
+运行完成后将文件
+BDAuthorization.bat
+发送到客户的电脑上,在客户的电脑上点击运行
\ No newline at end of file