echo094 / decode-js

JS混淆代码的AST分析工具 AST analysis tool for obfuscated JS code
MIT License
717 stars 336 forks source link

obfuscator: An error occurred while handling BlockStatementControlFlowFlatteningNode #99

Closed peasshoter closed 5 months ago

peasshoter commented 5 months ago

index.txt 清理死代码... 扁平化还原: _0x4924e0[_0x3fb2a9]就报错 for (let i = 0; i < pre_path.node.declarations.length; ++i) { ^ TypeError: Cannot read properties of undefined (reading 'length')

echo094 commented 5 months ago

已修复。

Note:

在查找BlockStatementControlFlowFlatteningNode的variableDeclarationNode时使用了getAllPrevSiblings方法获取上面的节点。当获取到多余的节点时,由于未验证节点类型导致出现错误。