r2frida connects radare2 to Frida for live process analysis.
- C plugin:
src/io_frida.cHandles devices, sessions, memory I/O, and JSON message dispatch. Commands that start with:go through the I/O callback. - Agent:
src/agent/Runs inside the target process. It implements commands for inspection, hooks, and tracing. - Message flow:
radare2 <-> io_frida.c <-> Frida runtime <-> agent
- Build first time:
./configure && make -j && make user-install - Rebuild agent:
make -C src/agent - Format:
make fmt - Test:
make -C test - Clean:
make cleanormake mrproper - Use
maketargets only. Do not run ad-hocgcc,node, ordenocommands.
Agent build path: TypeScript -> _agent.js -> _agent.h -> C plugin.
- Location:
test/db/extras/ - Runner:
make -C testorr2r -u db/extras - Format:
NAME=test description
FILE=frida://0
CMDS=<<EOF
:commands_here
EOF
EXPECT=<<EOF
expected_output
EOF
RUN- TypeScript: strict mode, ES2020, 8-space indent, use
.jsin imports - C: 4-space indent, format with
clang-format-radare2 - ESLint rules are relaxed where Frida APIs need it
- C plugin:
src/io_frida.c,src/io_frida.h - Agent build tools:
src/r2frida-compile.c - Tracing in C:
src/systrace.c - Agent entry:
src/agent/index.ts - Agent config:
src/agent/config.ts - Agent I/O:
src/agent/io.ts - Plugin API:
src/agent/plugin.ts - R2 bridge:
src/agent/r2pipe-frida.ts - Agent libraries:
src/agent/lib/debug/,src/agent/lib/info/,src/agent/lib/java/,src/agent/lib/darwin/ - Other agent helpers:
src/agent/lib/search.ts,src/agent/lib/trace.ts,src/agent/lib/fs.ts,src/agent/lib/sys.ts,src/agent/lib/utils.ts,src/agent/lib/anal.ts,src/agent/lib/disasm.ts