소스 검색

refactoring

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

+ 3 - 2
dist/src/node-obfuscators/NodeObfuscator.js

@@ -30,10 +30,11 @@ class NodeObfuscator {
         return `${prefix}${Utils_1.Utils.decToHex(nodeValue)}`;
     }
     replaceLiteralStringByUnicodeArrayCall(nodeValue) {
-        let value = Utils_1.Utils.stringToUnicode(nodeValue), unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
+        let value = Utils_1.Utils.stringToUnicode(nodeValue);
+        let unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
         if (sameIndex < 0) {
             index = unicodeArray.length;
-            unicodeArray.push(Utils_1.Utils.stringToUnicode(nodeValue));
+            unicodeArray.push(value);
         }
         else {
             index = sameIndex;

+ 4 - 3
src/node-obfuscators/NodeObfuscator.ts

@@ -86,15 +86,16 @@ export abstract class NodeObfuscator implements INodeObfuscator {
      * @returns {string}
      */
     protected replaceLiteralStringByUnicodeArrayCall (nodeValue: string): string {
-        let value: string = Utils.stringToUnicode(nodeValue),
-            unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
+        let value: string = Utils.stringToUnicode(nodeValue);
+
+        let unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
             sameIndex: number = unicodeArray.indexOf(value),
             index: number,
             hexadecimalIndex: string;
 
         if (sameIndex < 0) {
             index = unicodeArray.length;
-            unicodeArray.push(Utils.stringToUnicode(nodeValue));
+            unicodeArray.push(value);
         } else {
             index = sameIndex;
         }