var a = {
a: '1',
b: 2,
currencySymbol: '$',
c: 3
};
Input
code after obfuscated
var _0xbe98 = ["\x63\x75\x72\x72\x65\x6e\x63\x79\x53\x79\x6d\x62\x6f\x6c", "\x24"];
var a = {};
a['\x61'] = '\x31';
a['\x62'] = 0x2;
a[_0xbe98[0]] = _0xbe98[1];
a['\x63'] = 0x3;
Expected Output
Expecting result as below after unpack
var a = {};
a['\x61'] = '\x31';
a['\x62'] = 0x2;
a['currencySymbol'] = '$';
a['\x63'] = 0x3;
Actual Output
var a = {};
a['\x61'] = '\x31';
a['\x62'] = 0x2;
a['currencySymbol'] = '; //missing $'
a['\x63'] = 0x3;;
a['\x63'] = 0x3; // where is this line come from?
Steps to Reproduce
JavascriptObfuscator.unpack(code)
Reason
The symbol $ is treated as a capture when replace string using RegExp, standalone $ sign should be escaped for this scenario.
Description
Orignal code:
Input
code after obfuscated
Expected Output
Expecting result as below after unpack
Actual Output
Steps to Reproduce
JavascriptObfuscator.unpack(code)
Reason
The symbol
$
is treated as a capture when replace string using RegExp, standalone$
sign should be escaped for this scenario.