Skip to content

Commit

Permalink
chore: improve deobfuscator exec order
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 17, 2023
1 parent 310b74a commit d0ccaa1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions play/jsonv6/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ class MyDeOb extends Deob { }
await deob.record(fileName, 3)

// 最后通用处理
// deob.calcBinary()
// deob.calcBoolean()
// deob.replaceConstant()
// await deob.record(fileName, 4)

// deob.removeUnusedBlock()
// deob.removeUnusedVariables()
// deob.selfCallFnReplace()

// // 优化
// // deob.changeObjectAccessMode()
// deob.deleteExtra()
// deob.addComments()
deob.calcBinary()
deob.calcBoolean()
deob.replaceConstant()
await deob.record(fileName, 4)

deob.removeUnusedBlock()
deob.removeUnusedVariables()
deob.selfCallFnReplace()

// 优化
// deob.changeObjectAccessMode()
deob.deleteExtra()
deob.addComments()

const code = deob.getCode()
await fs.writeFile(`${__dirname}/output.js`, code)
Expand Down
10 changes: 5 additions & 5 deletions website/utils/deobfuscator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ self.addEventListener(

const deob = new Deob(code)

deob.findDecryptFnByCallCount(800, true)
deob.findDecryptFnByCallCount(200, true)

// deob.saveAllObject()
// deob.objectMemberReplace()
// await deob.record(fileName, 2)
deob.saveAllObject()
deob.objectMemberReplace()

deob.switchFlat()
deob.switchFlat()
deob.reParse()

// 最后通用处理
deob.calcBinary()
Expand All @@ -29,6 +27,8 @@ self.addEventListener(
deob.removeUnusedVariables()
deob.selfCallFnReplace()

// 优化
// deob.changeObjectAccessMode()
deob.deleteExtra()
deob.addComments()

Expand Down

0 comments on commit d0ccaa1

Please sign in to comment.