javascriptencodingdecodeautoencoderdecoder

Strange names in Javascript code - how do I decode it?


I have some JS code of 1000 lines, I found it on the internet, it is some audio player plugin. The problem is that it's not clear. Because all names of functions and variables have incomprehensible names.

Why? Does this mean the code is encoded and can it be decoded?

for example:

function _0xe65c19(_0x5996d3) {
var _0x4fb109 = _0x2e18ad;
_0x5996d3 *= 0x3e8;
var _0x1454f1 = Math[_0x4fb109(0x1cd)](_0x5996d3 / _0x57b6cf),
  _0x10c32b = Math[_0x4fb109(0x1cd)](_0x5996d3 % _0x57b6cf / _0x208cde),
  _0x19d861 = Math[_0x4fb109(0x1cd)](_0x5996d3 % _0x208cde / _0xc5606a),
  _0x5996d3 = Math[_0x4fb109(0x1cd)](_0x5996d3 % _0xc5606a / _0x36abb6),
  _0x10c32b = _0x4b3607(0x18 * _0x1454f1 + _0x10c32b, 0x2) + ':';
return _0x10c32b += _0x4b3607(_0x19d861, 0x2) + ':', _0x10c32b += _0x4b3607(_0x5996d3, 0x2);
}

function _0x4b3607(_0x509671, _0x2dd832) {
var _0xb5d61a = _0x2e18ad;
for (_0x509671 = _0x509671[_0xb5d61a(0x1ff)](); _0x509671[_0xb5d61a(0x238)] < _0x2dd832;) _0x509671 = '0' + _0x509671;
return _0x509671;
}
_0x5a3048 = _0xe65c19(_0x8cec82);

function _0x14b432(_0x2535d6) {
var _0x55e761 = _0x2e18ad,
  _0x388ffc = $(_0x2535d6)[_0x55e761(0x206)]()[0x0][_0x55e761(0x290)](),
  _0x2cc4cd = $(_0x2535d6)[0x0][_0x55e761(0x290)](),
  _0x1b6133 = {};
_0x1b6133['top'] = _0x2cc4cd[_0x55e761(0x1c7)] - _0x388ffc[_0x55e761(0x1c7)] + $(_0x2535d6)[_0x55e761(0x206)]()[0x0][_0x55e761(0x340)], $(_0x2535d6)['parent']()[_0x55e761(0x1c0)]({
  'scrollTop': _0x1b6133[_0x55e761(0x1c7)]
}, 0x1f4);
}

I've tried decoding the code using some online services, but it doesn't work.


Solution

  • The code has been run through an obfuscator (e.g. https://obfuscator.io/ which produces variable names similar to what is seen in the snippet) with the specific intent of making it as unreadable as possible. The motivations to do so are varied, such as ensuring the code is not re-used and modified without permission or proper license.

    The process of obfuscation is by design lossy, renaming all variables to random strings, restructuring functions and disguising the use of native JS functions. It cannot usually be decoded programmatically, and the only way to make it readable again is to manually reverse engineer the code.