mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
First draw of control flow change. Right now for binary expressions.
This commit is contained in:
Vendored
+4
-4
@@ -1564,12 +1564,12 @@ var Obfuscator = function () {
|
||||
NodeUtils_1.NodeUtils.parentize(node);
|
||||
var stackTraceData = new StackTraceAnalyzer_1.StackTraceAnalyzer(node.body).analyze();
|
||||
this.initializeCustomNodes(stackTraceData);
|
||||
this.beforeObfuscation(node);
|
||||
this.obfuscate(node);
|
||||
this.afterObfuscation(node);
|
||||
if (this.options.controlFlow) {
|
||||
this.changeControlFlow(node);
|
||||
}
|
||||
this.beforeObfuscation(node);
|
||||
this.obfuscate(node);
|
||||
this.afterObfuscation(node);
|
||||
return node;
|
||||
}
|
||||
}, {
|
||||
@@ -3151,7 +3151,7 @@ var AbstractControlFlowReplacer = function () {
|
||||
key: 'getStorageKey',
|
||||
value: function getStorageKey() {
|
||||
return Utils_1.Utils.getRandomGenerator().string({
|
||||
length: 4,
|
||||
length: 3,
|
||||
pool: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
});
|
||||
}
|
||||
|
||||
+4
-4
@@ -104,14 +104,14 @@ export class Obfuscator implements IObfuscator {
|
||||
|
||||
this.initializeCustomNodes(stackTraceData);
|
||||
|
||||
this.beforeObfuscation(node);
|
||||
this.obfuscate(node);
|
||||
this.afterObfuscation(node);
|
||||
|
||||
if (this.options.controlFlow) {
|
||||
this.changeControlFlow(node);
|
||||
}
|
||||
|
||||
this.beforeObfuscation(node);
|
||||
this.obfuscate(node);
|
||||
this.afterObfuscation(node);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export abstract class AbstractControlFlowReplacer implements IControlFlowReplace
|
||||
*/
|
||||
protected static getStorageKey (): string {
|
||||
return Utils.getRandomGenerator().string({
|
||||
length: 4,
|
||||
length: 3,
|
||||
pool: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
});
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
import { NO_CUSTOM_NODES_PRESET } from '../../src/preset-options/NoCustomNodesPreset';
|
||||
|
||||
if (!(<any>global)._babelPolyfill) {
|
||||
require('babel-polyfill');
|
||||
@@ -50,9 +49,12 @@ if (!(<any>global)._babelPolyfill) {
|
||||
console.log(n);
|
||||
})();
|
||||
`,
|
||||
Object.assign({}, NO_CUSTOM_NODES_PRESET, {
|
||||
controlFlow: true
|
||||
})
|
||||
{
|
||||
controlFlow: true,
|
||||
disableConsoleOutput: false,
|
||||
selfDefending: true,
|
||||
stringArrayEncoding: 'rc4'
|
||||
}
|
||||
).getObfuscatedCode();
|
||||
|
||||
console.log(obfuscatedCode);
|
||||
|
||||
Reference in New Issue
Block a user