Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@ input.js
output.js
.vscode/
.idea/

# Qualification workspace: encoder checkouts fetched by scripts/qualify-jsconfuser-vm
sandbox-tests/
__pycache__/
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ readable source.

One target per run, selected with `-t`:

The result-aware `jsconfuser-vm` target is listed in the dedicated section below.

| `-t` | target |
|---|---|
| `common` | frequently-seen local obfuscation, not tied to any one tool — unreachable code, nested blocks, constant expressions, raw strings |
| `jjencode` | jjencode, in the variant emitted by sojson.com |
| `sojson` | sojson |
| `sojsonv7` | sojson v7 |
| `jsconfuser-vm` | JS-Confuser numeric VM containers via the standalone result-aware adapter |
| `obfuscator` | [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator) (obfuscator.io) |
| `obfuscatorx` | the same obfuscator, version-aware — see below for how it differs |
| `jsconfuser` | [JS-Confuser](https://github.com/MichaelXF/js-confuser) |
Expand Down Expand Up @@ -47,7 +50,17 @@ A sample whose range overlaps that gap is reported as unknown rather than treate
### `jsconfuser`

Covers JS-Confuser 2.x up to and including the `high` preset. Which transforms are
reversed, which are not, and why: [docs/jsconfuser.md](docs/jsconfuser.md).
reversed, which are not, and why are documented in the
[decode-nexus jsconfuser plugin reference](https://github.com/echo094/decode-nexus/blob/main/skills/decode-js/plugins/jsconfuser.md).

### `jsconfuser-vm`

Decodes accepted numeric VM containers without executing target code. Each attempt writes the
adapter's JavaScript output and a JSON result record containing `status`, `diagnostic`, and the
standalone schema/proof metadata. The result path defaults to `<output>.result.json`; pass
`--result path.json` to choose an explicit path. A declined input is written byte-for-byte to the
output, recorded with `status: "declined"`, and exits successfully. The `--result` option is
target-specific; legacy targets keep their string/null output contract and do not write sidecars.

## Usage

Expand All @@ -71,7 +84,7 @@ npm run decode -- -t type [-i input.js] [-o output.js] [-v]
```

`xxx` is one of the predefined commands, each a shorthand for one target — `deob`,
`dejsc`, `deso`, `desov7`. See the `scripts` field in [package.json](package.json).
`dejsc`, `dejsc-vm`, `deso`, `desov7`. See the `scripts` field in [package.json](package.json).

The default input file is `input.js`. The file cannot contain additional codes other
than obfuscated code (such as non-obfuscated code).
Expand All @@ -80,6 +93,12 @@ The default output file is `output.js`.

`-v` turns on per-pass progress tracing, which is off by default.

For the result-aware VM target, use `--result` when an explicit result path is preferred:

```shell
npm run decode -- -t jsconfuser-vm -i encoded.js -o decoded.js --result decoded.json
```

## Related Projects

* [cilame/v_jstools](https://github.com/cilame/v_jstools)
Expand Down
61 changes: 0 additions & 61 deletions docs/jsconfuser.md

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"deob": "node src/main.js -t obfuscator",
"deobx": "node src/main.js -t obfuscatorx",
"dejsc": "node src/main.js -t jsconfuser",
"dejsc-vm": "node src/main.js -t jsconfuser-vm",
"deso": "node src/main.js -t sojson",
"desov7": "node src/main.js -t sojsonv7",
"test": "vitest --config vitest.config.js",
"test:light": "vitest --config vitest.light.config.js",
"lint": "eslint --fix src"
},
"dependencies": {
Expand Down
Loading
Loading