restringer
Advanced tools
Comparing version 1.6.3 to 1.6.4
{ | ||
"name": "restringer", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Deobfuscate Javascript with emphasis on reconstructing strings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,3 +30,3 @@ /** | ||
const arg = declBody.body[0].argument; | ||
if (arg.type === 'Identifier' || (arg.type === 'CallExpression' && !arg.arguments.length)) { | ||
if (arg.type === 'Identifier' || (arg.type === 'CallExpression' && !arg.arguments?.length)) { | ||
arb.markNode(c, arg); | ||
@@ -33,0 +33,0 @@ } |
@@ -24,3 +24,3 @@ /** | ||
n.body.body[0].argument?.type === 'CallExpression' && | ||
n.body.body[0].argument.arguments.length === n.params.length && | ||
n.body.body[0].argument.arguments?.length === n.params?.length && | ||
n.body.body[0].argument.callee.type === 'Identifier' && | ||
@@ -27,0 +27,0 @@ candidateFilter(n)); |
@@ -19,6 +19,7 @@ /** | ||
for (const c of candidates) { | ||
const args = (c.callee.property?.name || c.callee.property?.value) === 'apply' ? c.arguments[1].elements : c.arguments.slice(1); | ||
arb.markNode(c, { | ||
type: 'CallExpression', | ||
callee: c.callee.object, | ||
arguments: (c.callee.property?.name || c.callee.property?.value) === 'apply' ? c.arguments[1].elements : c.arguments.slice(1), | ||
arguments: Array.isArray(args) ? args : (args ? [args] : []), | ||
}); | ||
@@ -25,0 +26,0 @@ } |
@@ -42,2 +42,4 @@ const evalInVm = require(__dirname + '/evalInVm'); | ||
if (callee?.declNode || callee?.object?.declNode) continue; | ||
if ((callee?.object?.type || callee.type ) === 'ThisExpression' || | ||
(callee?.property?.name || callee?.property?.value) === 'constructor') continue; | ||
const safeImplementation = safeImplementations[callee.name]; | ||
@@ -44,0 +46,0 @@ if (safeImplementation) { |
Sorry, the diff of this file is not supported yet
630427
11353