javascript-deobfuscator
javascript-deobfuscator copied to clipboard
Function executor does not deal with array of literals and deletes code even if no replacement is found
The following snippet does not simplify
function _0x1661() {
"#execute";
return ["str1", "str2"];
}
const foo = _0x1661()[0];
FunctionExecutor.replaceFunctionCalls() tries to replace the call by a literal value and fails (since we have a table of literals), so nothing gets replaced in the foo assigment (and cannot be simplified further).
The output is also not sound since the function is removed and the code can no longer be executed. Output is:
const foo = _0x1661()[0];
I don't know much about javascript, so there might be good reasons for not handling this. What you think?