Closed sanex3339 closed 6 years ago
Just wrote transformer for object keys:
// input
(function(){
if (true) {
if (true) {
var foo = {
foo: 'abc',
bar: {
baz: 'def',
'bax': 'bitcoin'
},
bark: 'hawl',
'inner': {
'inner1': {
inner2: {
inner3: 'inner_value'
}
}
}
};
}
}
console.log(foo);
})();
// output
var _0xbff3 = [
'foo',
'abc',
'bar',
'bark',
'hawl',
'inner',
'inner1',
'inner2',
'inner3',
'inner_value',
'baz',
'def',
'bax',
'bitcoin',
'log'
];
var _0x56e7 = function (_0x134adc, _0x1eb28b) {
_0x134adc = _0x134adc - 0x0;
var _0x4608a8 = _0xbff3[_0x134adc];
return _0x4608a8;
};
(function () {
if (!![]) {
if (!![]) {
var _0x240e3f = {};
_0x240e3f[_0x56e7('0x0')] = _0x56e7('0x1');
_0x240e3f[_0x56e7('0x2')] = {};
_0x240e3f[_0x56e7('0x3')] = _0x56e7('0x4');
_0x240e3f[_0x56e7('0x5')] = {};
_0x240e3f[_0x56e7('0x5')][_0x56e7('0x6')] = {};
_0x240e3f[_0x56e7('0x5')][_0x56e7('0x6')][_0x56e7('0x7')] = {};
_0x240e3f[_0x56e7('0x5')][_0x56e7('0x6')][_0x56e7('0x7')][_0x56e7('0x8')] = _0x56e7('0x9');
_0x240e3f[_0x56e7('0x2')][_0x56e7('0xa')] = _0x56e7('0xb');
_0x240e3f[_0x56e7('0x2')][_0x56e7('0xc')] = _0x56e7('0xd');
}
}
console[_0x56e7('0xe')](_0x240e3f);
}());
I'll put this under transformObjectKeys
option that will disabled by default.
or transformObjects
? What better?
I'd go with the first option transformObjectKeys
. In my opinion it's clearer what it does.
This PR will cover object keys obfuscation: https://github.com/javascript-obfuscator/javascript-obfuscator/pull/165
Transformer: https://github.com/javascript-obfuscator/javascript-obfuscator/pull/165/files#diff-41e5b71765008f5cfe8987f0c3b1c577
Still need some work like tests and refactoring
I cutoff improved self defending
from this milestone, because PR with object keys obfuscation
is huge.
Added obfuscation of eval
expressions to this milestone.
https://github.com/javascript-obfuscator/javascript-obfuscator/issues/168
I had to add two additional transformation passes over AST-tree - separate converting
pass (before it was combined with obfuscation
pass) and finalizing
pass. So, obfuscation will about 25% slower than in 0.13.0
version (because of two additional AST-tree traverses), but this additional passes will allow to made some complex transformations like eval expressions transformation
.
javascript-obfuscator@0.14.0-beta.2
was published to npm. Please, test it in your projects.
I'll publish new beta version later today.
javascript-obfuscator@0.14.0-beta.3
was published to npm
Anybody tested new features? Everything is ok?
out in javascript-obfuscator@0.14.0
eval
expressionsidentifiersPrefix
optionimproved self defending