Skip to content

Commit

Permalink
obfuscator: update stringArrayV2 to support rotate function before 2.…
Browse files Browse the repository at this point in the history
…10.0 (#61)

Signed-off-by: echo094 <[email protected]>
  • Loading branch information
echo094 authored Nov 19, 2023
1 parent 15db164 commit 70b6715
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plugin/obfuscator.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ function stringArrayV2(ast) {
return
}
const arr = callee.node.params[0].name
// const cmpV = callee.node.params[1].name
const fp = `(){try{if()break${arr}push(${arr}shift())}catch(){${arr}push(${arr}shift())}}`
const cmpV = callee.node.params[1].name
// >= 2.10.0
const fp1 = `(){try{if()break${arr}push(${arr}shift())}catch(){${arr}push(${arr}shift())}}`
// < 2.10.0
const fp2 = `const=function(){while(--){${arr}push(${arr}shift)}}${cmpV}`
const code = '' + callee.get('body')
if (!checkPattern(code, fp)) {
if (!checkPattern(code, fp1) && !checkPattern(code, fp2)) {
return
}
obj.stringArrayName = args[0].name
Expand Down

0 comments on commit 70b6715

Please sign in to comment.