-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathr2frida-compile.1
More file actions
108 lines (97 loc) · 3.46 KB
/
r2frida-compile.1
File metadata and controls
108 lines (97 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.TH R2FRIDA-COMPILE 1 "20 August 2025" "r2frida-compile" "R2FRIDA COMPILE MANPAGE"
.SH NAME
r2frida-compile \- compile Frida agent sources and manage Frida packages
.SH SYNOPSIS
.B r2frida-compile
.RI "[options]" "[file.{js,ts} | esmjs [dir] | package-specs...]"
.SH DESCRIPTION
r2frida-compile is a small utility used to build Frida agent JavaScript/TypeScript sources into distributable bundles, produce C-friendly headers, pack/unpack directories into esmjs bundles, and (since this release) perform basic package manager operations (search and install) against the Frida package registry.
It is used by the r2frida build system to produce the agent bundle, and can be invoked directly by users for compilation tasks or for interacting with the Frida package registry.
.SH OPTIONS
.TP
.B -B [esm|iife]
Desired bundle format. "esm" (default) or "iife".
.TP
.B -c
Enable compression (minification) of output JavaScript.
.TP
.B -h
Show this help message and exit.
.TP
.B -H [file]
Output compiled result as a C-friendly hexadecimal byte array into the given header file.
.TP
.B -o [file]
Dump compiled JavaScript to the specified output file instead of stdout.
.TP
.B -p [esmjs] [dir]
Pack the contents of the given directory into an esmjs bundle (output name is the first argument).
.TP
.B -u [esmjs] [dir]
Unpack the provided esmjs bundle into the given directory.
.TP
.B -q
Quiet mode. Reduce output verbosity.
.TP
.B -r [project-root]
Specify the project root directory. When used with -i (install), this selects where packages should be installed or which project metadata to update.
.TP
.B -S
Do not include source maps in the compiled output.
.TP
.B -T [full|none]
Type-checking mode for the Frida compiler (requires Frida >= 17). "full" or "none".
.TP
.B -j
Emit compiler diagnostics as raw JSON (useful in scripts).
.TP
.B -v
Display version information.
.TP
.B -s [query]
Search the Frida package registry for packages matching QUERY. This replaces the previous r2frida-pm search command and emits results to stdout (use -j to get raw JSON).
.TP
.B -i
Install package(s). When present, positional arguments are interpreted as package specs to install (for example: r2frida-compile -i frida-somepkg@1.2.3). This replaces the separate r2frida-pm install command.
.SH EXAMPLES
.TP
Compile a single TypeScript file to stdout:
.B r2frida-compile src/agent/index.ts
.TP
Compile and output to a file:
.B r2frida-compile -o dist/agent.js src/agent/index.ts
.TP
Produce a C header with the compiled bundle:
.B r2frida-compile -H src/_agent.h -o src/_agent.js src/agent/index.ts
.TP
Pack a directory into an esmjs bundle:
.B r2frida-compile -p bundle.esmjs path/to/dir
.TP
Unpack an esmjs bundle:
.B r2frida-compile -u bundle.esmjs outdir
.TP
Search packages (human readable):
.B r2frida-compile -s "frida"
.TP
Search packages (JSON):
.B r2frida-compile -j -s "network"
.TP
Install packages:
.B r2frida-compile -i frida-foo frida-bar@^1.0.0
.SH EXIT STATUS
The command exits with 0 on success, or a non-zero value on error. When acting as package manager (using -s or -i), exit codes reflect success/failure of the underlying Frida package manager operations.
.SH FILES
.TP
.B src/_agent.js
Generated agent bundle used by r2frida plugin.
.TP
.B src/_agent.h
Optional C header generated from the agent bundle (use -H to produce).
.SH ENVIRONMENT
.PP
.nf
R2FRIDA_PM_REGISTRY=[url] # Package registry URL (default: registry.npmjs.org)
.SH SEE ALSO
r2frida(1), frida-compile(1), r2pm(1)
.SH AUTHORS
pancake <pancake@nowsecure.com>