commit 49b7f3bec06802757517515d615c25c3a553d68c Author: qubiaobiao <3294694717@qq.com> Date: Thu Feb 22 12:01:08 2024 +0800 公司产品加密软件 diff --git a/KeyWord.txt b/KeyWord.txt new file mode 100644 index 0000000..ad5c276 --- /dev/null +++ b/KeyWord.txt @@ -0,0 +1 @@ +BD \ No newline at end of file diff --git a/encryption.exe b/encryption.exe new file mode 100644 index 0000000..0dd821d Binary files /dev/null and b/encryption.exe differ diff --git a/encryption.js b/encryption.js new file mode 100644 index 0000000..d646c90 --- /dev/null +++ b/encryption.js @@ -0,0 +1,33 @@ +const crypto = require('crypto'); +const fs = require('fs'); +const child_process = require('child_process'); + +const keyPath = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography'; +const keyValue = 'MachineGuid'; +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('./KeyWord.txt', 'utf-8', (err, key) => { + if (err) { + if (err.code === 'ENOENT') { + console.error('file not exist'); + return; + } + console.error(err, 'open'); + return; + } + child_process.exec(`REG QUERY ${keyPath} /v ${keyValue}`,function(error,stdout,stderr){ + console.log('stderr:'+stderr); + if(error != null){ + console.log('exec error:'+error); + return + } + child_process.exec(`reg add ${passPath} /v ${passValue} /t REG_SZ /d ${cryptMD5(stdout.slice(83,119) + key)} /f`); + }); +}); \ No newline at end of file diff --git a/使用说明.txt b/使用说明.txt new file mode 100644 index 0000000..fe2dc1e --- /dev/null +++ b/使用说明.txt @@ -0,0 +1,6 @@ +打开文件 +KeyWord.txt +输入加密关键字 +点击运行文件 +权限部署.bat +即可完成权限部署 \ No newline at end of file diff --git a/权限部署.bat b/权限部署.bat new file mode 100644 index 0000000..c8db0e0 --- /dev/null +++ b/权限部署.bat @@ -0,0 +1,9 @@ +@echo off + +If Not "%~1"=="H" ( + mshta vbscript:"" +) + +start "" "%~dp0\encryption.exe" + +exit