Skip to content

Commit c200183

Browse files
committed
Improve README
1 parent 8a4178e commit c200183

File tree

2 files changed

+62
-62
lines changed

2 files changed

+62
-62
lines changed

README.md

+48-61
Original file line numberDiff line numberDiff line change
@@ -62,61 +62,48 @@ cat ./*.results/active_urls.json | sort | uniq
6262
## Flags
6363

6464
<!--START_FLAGS-->
65-
--help (Boolean): Show the help text and quit
66-
67-
--version (Boolean): Show the package version and quit
68-
69-
--license (Boolean): Show the license and quit
70-
71-
--debug (Boolean): Die when an emulation error occurs, even in "batch mode", and pass on the exit code.
72-
73-
--loglevel (String): Logging level (debug, verbose, info, warning, error - default "info")
74-
75-
--threads (Number): When running in batch mode, how many analyses to run at the same time (0 = unlimited, default: as many as the number of CPU cores)
76-
77-
--download (Boolean): Actually download the payloads
78-
79-
--encoding (String): Encoding of the input sample (will be automatically detected by default)
80-
81-
--timeout (Number): The script will timeout after this many seconds (default 10)
82-
83-
--output-dir (String): The location on disk to write the results files and folders to (defaults to the current directory)
84-
85-
--preprocess (Boolean): Preprocess the original source code (makes reverse engineering easier, but takes a few seconds)
86-
87-
--unsafe-preprocess (Boolean): More aggressive preprocessing. Often results in better code, but can break on some edge cases (eg. redefining prototypes)
88-
89-
--no-kill (Boolean): Do not kill the application when runtime errors occur
90-
91-
--no-echo (Boolean): When the script prints data, do not print it to the console
92-
93-
--no-rewrite (Boolean): Do not rewrite the source code at all, other than for `@cc_on` support
94-
95-
--no-catch-rewrite (Boolean): Do not rewrite try..catch clauses to make the exception global-scoped
96-
97-
--no-cc_on-rewrite (Boolean): Do not rewrite `/*@cc_on <...>@*/` to `<...>`
98-
99-
--no-eval-rewrite (Boolean): Do not rewrite `eval` so that its argument is rewritten
100-
101-
--no-file-exists (Boolean): Return `false` for Scripting.FileSystemObject.FileExists(x)
102-
103-
--no-folder-exists (Boolean): Return `false` for Scripting.FileSystemObject.FileExists(x)
104-
105-
--function-rewrite (Boolean): Rewrite function calls in order to catch eval calls
106-
107-
--no-rewrite-prototype (Boolean): Do not rewrite expressions like `function A.prototype.B()` as `A.prototype.B = function()`
108-
109-
--no-hoist-prototype (Boolean): Do not hoist expressions like `function A.prototype.B()` (implied by no-rewrite-prototype)
110-
111-
--no-shell-error (Boolean): Do not throw a fake error when executing `WScriptShell.Run` (it throws a fake error by default to pretend that the distribution sites are down, so that the script will attempt to poll every site)
112-
113-
--no-typeof-rewrite (Boolean): Do not rewrite `typeof` (e.g. `typeof ActiveXObject`, which must return 'unknown' in the JScript standard and not 'object')
114-
115-
--proxy (String): [experimental] Use the specified proxy for downloads. This is not relevant if the --download flag is not present.
116-
117-
--windows-xp (Boolean): Emulate Windows XP (influences the value of environment variables)
118-
119-
--dangerous-vm (Boolean): Use the `vm` module, rather than `vm2`. This sandbox can be broken, so **don't use this** unless you're 100% sure of what you're doing. Helps with debugging by giving correct stack traces.
65+
NAME DESCRIPTION
66+
-h, --help Show the help text and quit
67+
-v, --version Show the package version and quit
68+
--license Show the license and quit
69+
--debug Die when an emulation error occurs, even in "batch mode", and pass on the exit
70+
code.
71+
--loglevel Logging level (debug, verbose, info, warning, error - default "info")
72+
--threads When running in batch mode, how many analyses to run at the same time (0 =
73+
unlimited, default: as many as the number of CPU cores)
74+
--download Actually download the payloads
75+
--encoding Encoding of the input sample (will be automatically detected by default)
76+
--timeout The script will timeout after this many seconds (default 10)
77+
--output-dir The location on disk to write the results files and folders to (defaults to the
78+
current directory)
79+
--preprocess Preprocess the original source code (makes reverse engineering easier, but takes
80+
a few seconds)
81+
--unsafe-preprocess More aggressive preprocessing. Often results in better code, but can break on
82+
some edge cases (eg. redefining prototypes)
83+
--no-kill Do not kill the application when runtime errors occur
84+
--no-echo When the script prints data, do not print it to the console
85+
--no-rewrite Do not rewrite the source code at all, other than for `@cc_on` support
86+
--no-catch-rewrite Do not rewrite try..catch clauses to make the exception global-scoped
87+
--no-cc_on-rewrite Do not rewrite `/*@cc_on <...>@*/` to `<...>`
88+
--no-eval-rewrite Do not rewrite `eval` so that its argument is rewritten
89+
--no-file-exists Return `false` for Scripting.FileSystemObject.FileExists(x)
90+
--no-folder-exists Return `false` for Scripting.FileSystemObject.FileExists(x)
91+
--function-rewrite Rewrite function calls in order to catch eval calls
92+
--no-rewrite-prototype Do not rewrite expressions like `function A.prototype.B()` as `A.prototype.B =
93+
function()`
94+
--no-hoist-prototype Do not hoist expressions like `function A.prototype.B()` (implied by
95+
no-rewrite-prototype)
96+
--no-shell-error Do not throw a fake error when executing `WScriptShell.Run` (it throws a fake
97+
error by default to pretend that the distribution sites are down, so that the
98+
script will attempt to poll every site)
99+
--no-typeof-rewrite Do not rewrite `typeof` (e.g. `typeof ActiveXObject`, which must return
100+
'unknown' in the JScript standard and not 'object')
101+
--proxy [experimental] Use the specified proxy for downloads. This is not relevant if
102+
the --download flag is not present.
103+
--windows-xp Emulate Windows XP (influences the value of environment variables)
104+
--dangerous-vm Use the `vm` module, rather than `vm2`. This sandbox can be broken, so **don't
105+
use this** unless you're 100% sure of what you're doing. Helps with debugging by
106+
giving correct stack traces.
120107
<!--END_FLAGS-->
121108

122109
# Analyzing the output
@@ -267,29 +254,29 @@ and iterate until the code emulates without errors.
267254

268255
# Contributors
269256

270-
@CapacitorSet: Main developer
257+
[@CapacitorSet](https://github.com/CapacitorSet/): Main developer
271258

272-
@daviesjamie:
259+
[@daviesjamie](https://github.com/daviesjamie/):
273260

274261
* npm packaging
275262
* command-line help
276263
* `--output-directory`
277264
* bugfixes
278265

279-
@ALange:
266+
[@ALange](https://github.com/ALange/):
280267

281268
* support for non-UTF8 encodings
282269
* bug reporting
283270

284-
@alexlamsl, @kzc
271+
[@alexlamsl](https://github.com/alexlamsl/), [@kzc](https://github.com/kzc/)
285272

286273
* advice on integrating UglifyJS in box-js
287274
* improving the features of UglifyJS used in deobfuscation
288275

289-
@psrok:
276+
[@psrok](https://github.com/psrok/):
290277

291278
* bugfixes
292279

293-
@gaelmuller:
280+
[@gaelmuller](https://github.com/gaelmuller/):
294281

295282
* bugfixes

update-docs.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
const fs = require("fs");
2+
const columnify = require("columnify");
23
const flags = JSON.parse(fs.readFileSync("flags.json", "utf8"));
3-
const text = flags.run.map((item) => `--${item.name} (${item.type}): ${item.description}`).join("\n\n");
4+
const text = columnify(
5+
require("./argv.js").flags.run.map((flag) => ({
6+
name: (flag.alias ? `-${flag.alias}, ` : "") + `--${flag.name}`,
7+
description: flag.description,
8+
})),
9+
{
10+
config: {
11+
description: {
12+
maxWidth: 80,
13+
},
14+
},
15+
}
16+
).split("\n").map(line => " " + line).join("\n");
417
const README = fs.readFileSync("README.md", "utf8");
518
fs.writeFileSync(
619
"README.md",

0 commit comments

Comments
 (0)