nandokujs
Advanced tools
Comparing version 0.0.28 to 0.0.29
20
index.js
@@ -5,4 +5,4 @@ #!/usr/bin/env node | ||
* nandokujs. | ||
* Copyright(c) 2019 maachang. | ||
* MIT Licensed | ||
* Copyright(c) 2021 maachang. | ||
* MIT Licensed. | ||
*/ | ||
@@ -40,3 +40,3 @@ | ||
var _version = function() { | ||
return "0.0.28"; | ||
return "0.0.29"; | ||
} | ||
@@ -48,3 +48,3 @@ | ||
console.log(); | ||
console.log("$ nandokujs -j [js file name] -m [execute eval] -t [tally code]") | ||
console.log("$ nandokujs -j [js file name] -m [execute eval] -t [tally code] -o [out file]") | ||
console.log(" -j (--js) [js file name] Set the js file name to be converted.") | ||
@@ -60,2 +60,3 @@ console.log(" -m (--mode) [execute eval] Set the expansion condition."); | ||
console.log(" If you do not use it, please do not set it."); | ||
console.log(" -o (--out) Set the output file name of nandokujs."); | ||
console.log(" -v (--version) Version information will be returned."); | ||
@@ -72,2 +73,3 @@ console.log(" -h (--help) Help information will be returned."); | ||
var tallyCode = _args("-t") || _args("--tally"); | ||
var outFile = _args("-o") || _args("--out"); | ||
var versionFlg = _args("-v", true) || _args("--version", true); | ||
@@ -128,3 +130,3 @@ var helpFLg = _args("-h", true) || _args("--help", true); | ||
// this['\\44\\104']= | ||
var base = "var $D=(function(){var _A=['','\\x66\\x72\\x6F\\x6D\\x43\\x68\\x61\\x72\\x43\\x6F\\x64\\x65','\\x6C\\x65\\x6E\\x67\\x74\\x68', '\\x53\\x74\\x72\\x69\\x6e\\x67','\\x30\\x78\\x31\\x65'];return function(){var _B=arguments,_C=_A[0],_D=0;while(_D< _B[_A[2]]){_C+=this[_A[3]][_A[1]](_B[_D++]+(_A[4]|0))};return _C};})();"; | ||
var base = "var $D=(function(){var _A=['','\\x66\\x72\\x6F\\x6D\\x43\\x68\\x61\\x72\\x43\\x6F\\x64\\x65','\\x6C\\x65\\x6E\\x67\\x74\\x68','\\x53\\x74\\x72\\x69\\x6e\\x67','\\x30\\x78\\x31\\x65'];return function(){var _B=arguments,_C=_A[0],_D=0;while(_D< _B[_A[2]]){_C+=this[_A[3]][_A[1]](_B[_D++]+(_A[4]|0))};return _C};})();"; | ||
var keys = ["_A", "_B", "_C", "_D"]; | ||
@@ -174,6 +176,12 @@ var randKeys = []; | ||
// 出力先ファイル名をセット. | ||
// 指定されてない場合は、変換ファイル名+.nan.jsをファイル名とする. | ||
if(!outFile || outFile == "") { | ||
outFile = name + ".nan.js"; | ||
} | ||
// jsコード出力. | ||
file.writeByString(name + ".nan.js", buf); | ||
file.writeByString(outFile, buf); | ||
return true; | ||
})(); |
@@ -1,2 +0,2 @@ | ||
Copyright (c) 2018 Maachang | ||
Copyright (c) 2021 Maachang | ||
https://github.com/maachang/msful | ||
@@ -3,0 +3,0 @@ |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"description": "nandokujs is an obfuscation tool for obfuscating javascript files to be published on the Web and making it difficult to analyze the contents.", | ||
@@ -9,0 +9,0 @@ "main": "index.js", |
@@ -40,3 +40,3 @@ # nandokujs とは | ||
``` | ||
$ nandokujs -j [js file name] -m [execute eval] -t [tally code] | ||
$ nandokujs -j [js file name] -m [execute eval] -t [tally code] -o [out file] | ||
-j (--js) [js file name] Set the js file name to be converted. | ||
@@ -52,2 +52,3 @@ -m (--mode) [execute eval] Set the expansion condition. | ||
If you do not use it, please do not set it. | ||
-o (--out) Set the output file name of nandokujs. | ||
-v (--version) Version information will be returned. | ||
@@ -83,3 +84,2 @@ -h (--help) Help information will be returned. | ||
```html | ||
<script> | ||
@@ -89,4 +89,4 @@ var _$tallyCode = "指定した割符コード"; | ||
<script src="[nandokujsで難読化されたjavascript].nan.js"></script> | ||
``` | ||
-o or --out nandokujsの出力ファイル名を設定します. | ||
@@ -114,3 +114,2 @@ -v or --version バージョンを表示します. | ||
```html | ||
<script> | ||
@@ -117,0 +116,0 @@ var _$tallyCode = "test"; |
@@ -40,3 +40,3 @@ # What is nandokujs | ||
``` | ||
$ nandokujs -j [js file name] -m [execute eval] -t [tally code] | ||
$ nandokujs -j [js file name] -m [execute eval] -t [tally code] -o [out file] | ||
-j (--js) [js file name] Set the js file name to be converted. | ||
@@ -52,2 +52,3 @@ -m (--mode) [execute eval] Set the expansion condition. | ||
If you do not use it, please do not set it. | ||
-o (--out) Set the output file name of nandokujs. | ||
-v (--version) Version information will be returned. | ||
@@ -57,3 +58,2 @@ -h (--help) Help information will be returned. | ||
Files obfuscated by nandokujs are output as [js file name].nan.js. | ||
``` | ||
@@ -63,2 +63,3 @@ -j or --js Set the javascript file you want to convert. | ||
-m or --mode Set expansion conditions. | ||
``` | ||
@@ -85,3 +86,2 @@ When [true] Expand obfuscated information with eval. | ||
```html | ||
<script> | ||
@@ -91,5 +91,6 @@ var _$tallyCode = "tally code"; | ||
<script src="[target javascript].nan.js"></script> | ||
``` | ||
-o or --out Set the output file name of nandokujs. | ||
-v or --version Display the version. | ||
@@ -108,5 +109,3 @@ | ||
```cmd | ||
$ nandokujs -j cbox-min.js -t test | ||
``` | ||
@@ -117,3 +116,2 @@ | ||
```html | ||
<script> | ||
@@ -123,3 +121,2 @@ var _$tallyCode = "test"; | ||
<script src="cbox-min.js.nan.js"></script> | ||
``` | ||
@@ -126,0 +123,0 @@ |
90408
2407
122