소스 검색

`unicodeArrayThreshold` fix

sanex3339 9 년 전
부모
커밋
1d7b7f8d3c
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      dist/src/node-obfuscators/NodeObfuscator.js
  2. 1 1
      src/node-obfuscators/NodeObfuscator.ts

+ 1 - 1
dist/src/node-obfuscators/NodeObfuscator.js

@@ -35,7 +35,7 @@ class NodeObfuscator {
         return `${prefix}${Utils_1.Utils.decToHex(nodeValue)}`;
     }
     replaceLiteralValueByUnicodeValue(nodeValue) {
-        let value = nodeValue, replaceByUnicodeArrayFlag = Math.random() > this.options['unicodeArrayThreshold'];
+        let value = nodeValue, replaceByUnicodeArrayFlag = Math.random() <= this.options['unicodeArrayThreshold'];
         if (this.options['encodeUnicodeLiterals'] && replaceByUnicodeArrayFlag) {
             value = new Buffer(encodeURI(value)).toString('base64');
         }

+ 1 - 1
src/node-obfuscators/NodeObfuscator.ts

@@ -98,7 +98,7 @@ export abstract class NodeObfuscator implements INodeObfuscator {
      */
     protected replaceLiteralValueByUnicodeValue (nodeValue: string): string {
         let value: string = nodeValue,
-            replaceByUnicodeArrayFlag: boolean = Math.random() > this.options['unicodeArrayThreshold'];
+            replaceByUnicodeArrayFlag: boolean = Math.random() <= this.options['unicodeArrayThreshold'];
 
         if (this.options['encodeUnicodeLiterals'] && replaceByUnicodeArrayFlag) {
             value = new Buffer(encodeURI(value)).toString('base64');