五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網 會員登陸 & 注冊

javascript-obfuscator 混淆代碼

2023-03-03 02:28 作者:灼_眼の夏_娜  | 我要投稿

// index.json

{

? ? "compact": false,

? ? "controlFlowFlattening": true,

? ? "controlFlowFlatteningThreshold": 1,

? ? "numbersToExpressions": true,

? ? "simplify": true,

? ? "shuffleStringArray": true,

? ? "splitStrings": true,

? ? "stringArrayThreshold": 1

}

// index.js

// 檢索的相對文件夾

const relativePath = './js'

// 不需要混淆的js或文件夾

const exitFile = ['jquery-3.6.1.min.js']

?

?

var fs = require('fs')

var process = require('child_process');

var readDir = fs.readdirSync(relativePath);

?

?

// 需要存在的js

const czFile = []

?

var filePath = relativePath

var arr = new Array()

readFile(readDir, filePath)

// 讀取相對路徑下的所有文件

function readFile(readDir, filePath) {

? ? if (readDir.length > 0) {

? ? ? ? for (var i = 0; i < readDir.length; i++) {

? ? ? ? ? ? scannerFile(readDir[i], filePath)

? ? ? ? }

? ? }

}

// 掃描文件進行檢索出js文件進行混淆

function scannerFile(file, filePath) {

? ? console.log("file-----" + file);

? ? var readdirpath = ""

? ? if (filePath == './') {

? ? ? ? readdirpath = filePath + file

? ? } else {

? ? ? ? readdirpath = filePath + "/" + file

? ? }

? ? if (exitFile.indexOf(file) < 0) {

? ? ? ? console.log('-->Start entering FS');

? ? ? ? fs.stat(readdirpath, (err, data) => {

? ? ? ? ? ? if (err) {

? ? ? ? ? ? ? ? console.log(err);

? ? ? ? ? ? } else {

? ? ? ? ? ? ? ? if (data.isDirectory()) {

? ? ? ? ? ? ? ? ? ? console.log('-->isDirectory:' + file);

? ? ? ? ? ? ? ? ? ? var readChildDir = fs.readdirSync(readdirpath);

? ? ? ? ? ? ? ? ? ? console.log(readChildDir);

? ? ? ? ? ? ? ? ? ? readFile(readChildDir, readdirpath)

? ? ? ? ? ? ? ? } else {

? ? ? ? ? ? ? ? ? ? console.log('-->isNotDirectory:' + file);

? ? ? ? ? ? ? ? ? ? if (file.indexOf('.js') >= 0 && file.indexOf('.json') < 0) {

? ? ? ? ? ? ? ? ? ? ? ? // 開始混淆代碼

? ? ? ? ? ? ? ? ? ? ? ? console.log('-->Start confusing code:' + file);

? ? ? ? ? ? ? ? ? ? ? ? var cmd = ' javascript-obfuscator ' + readdirpath + ' --config index.json --output ' + readdirpath;

? ? ? ? ? ? ? ? ? ? ? ? process.exec(cmd, function(error, stdout, stderr) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? console.log("error:" + error);

? ? ? ? ? ? ? ? ? ? ? ? ? ? console.log("stdout:" + stdout);

? ? ? ? ? ? ? ? ? ? ? ? ? ? console.log("stderr:" + stderr);

? ? ? ? ? ? ? ? ? ? ? ? });

? ? ? ? ? ? ? ? ? ? ? ? arr.push(readdirpath)

? ? ? ? ? ? ? ? ? ? } else {

? ? ? ? ? ? ? ? ? ? ? ? console.log('Non-folder - Non-js code :' + file);

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? })

?

? ? } else {

? ? ? ? console.log('-->skip------------');

? ? }

}

使用方式:


javascript-obfuscator 混淆代碼的評論 (共 條)

分享到微博請遵守國家法律
渝北区| 舞阳县| 清水河县| 绥芬河市| 将乐县| 宜春市| 民和| 鄄城县| 白朗县| 涞水县| 诸暨市| 阳曲县| 滁州市| 积石山| 湖州市| 民和| 视频| 杭锦后旗| 赤峰市| 肇东市| 扶风县| 喜德县| 潮安县| 益阳市| 濮阳市| 阜阳市| 米脂县| 宾阳县| 鄯善县| 若羌县| 仁寿县| 大田县| 蒙城县| 普安县| 建始县| 林西县| 门源| 萨迦县| 芜湖县| 广宁县| 定兴县|