Skip to content

Commit

Permalink
Update README.md to Align with Latest Module Exports (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanvent authored Sep 4, 2023
1 parent 8902317 commit 8dcd9d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ Unsafe modules run code through `eval` (using [isolated-vm](https://www.npmjs.co
```javascript
const {
safe: {normalizeComputed},
unsafe: {resolveDefiniteBinaryExpressions, resolveLocalCalls}
} = require('restringer').modules;
unsafe: {resolveDefiniteBinaryExpressions, resolveLocalCalls},
utils: {runLoop}
} = require('restringer').deobModules;
let script = 'obfuscated JS here';
const deobModules = [
resolveDefiniteBinaryExpressions,
Expand All @@ -101,7 +102,10 @@ console.log(script); // Deobfuscated script

With the additional `candidateFilter` function argument, it's possible to narrow down the targeted nodes:
```javascript
const {unsafe: {resolveLocalCalls}} = require('restringer').modules;
const {
unsafe: {resolveLocalCalls},
utils: {runLoop}
} = require('restringer').deobModules;
let script = 'obfuscated JS here';

// It's better to define a function with a name that can show up in the log (otherwise you'll get 'undefined')
Expand Down

0 comments on commit 8dcd9d8

Please sign in to comment.