javascript-deobfuscator
javascript-deobfuscator copied to clipboard
Cannot deobfuscate private fields
Hello! I try to deobfuscate a file that have private fields (hash char #): here docs on mozilla
..............node_modules\shift-parser\dist\tokenizer.js:1536
throw this.createILLEGAL();
^
Error: [1:6801]: Unexpected "#"
Console error:
index: 6800,
line: 1,
column: 6801,
parseErrorLine: 1,
parseErrorColumn: 6801,
description: 'Unexpected "#"'
I guess it's a problem related to shift-parser that not support those new spec.
Yeah it is, only option to fix that would be rewriting the repo using another parser lib which I don't have time to do currently sadly
I, too, was uninspired when choosing a parser for a more targeted deobfuscator. I went with esprima, which doesn't support a lot of newer language features as well. As a workaround I found that transpiling the code to a compatible version via babel before deobfuscation works well and removes the need of rewriting the project with another parser.