一个基于 eBPF 实现的调试器服务端,旨在脱离 ptrace 系统调用以实现最小侵入特征,无视大部分调试限制。目前支持 Android 与 Linux 下的 Arm64 和 x86_64 架构。

特别感谢学长 ShinoLeah 的项目 eDBG。本项目的名字还有原理均出于此,如果本项目帮到你的话也请给 eDBG 一个星吧。
edbgserver [OPTIONS] --target <TARGET> --break <BREAK_POINT>
Options:
-t, --target <TARGET> Path to the target binary or library
-p, --package <PACKAGE> [Android only] The package name of target application
-b, --break <BREAK_POINT> The initial breakpoint address (virtual address). The server will set a UProbe at this location to intercept execution and wait for GDB. Supports hexadecimal (e.g., 0x400000) or decimal input
--port <PORT> The TCP port where the GDB server will listen for incoming connections [default: 3333]
-u, --uds [<UDS>] Use Unix Domain Socket instead of TCP. If the path starts with '@', it is treated as an Abstract Namespace Socket. If no value is provided, it defaults to the abstract socket "@edbg"
-P, --pid <PID> The Process ID (PID) of the target process to attach to. If omitted, the server will automatically attach to the first process that triggers the breakpoint in the specified binary
-m, --multi-thread Run the server in multi-threaded mode
--no-filter Disable filtering of memory maps when attaching to the target process. By default, the server filters out irrelevant memory maps to improve performance
--use-uprobe force using uprobe implementation for single-step (perf by default)
-h, --help Print help (see more with '--help')
-V, --version Print version
一些例子:
./edbgserver -u -p io.cyril.supervipplayer -t libsupervipplayer.so -b 0x1848
adb forward tcp:3333 localabstract:edbg
pwndbg
pwndbg> target remote :3333
pwndbg> breakrva 0x18A8 libsupervipplayer.so
在调试安卓的时候因为本机拿不到远程的库文件,所以需要每次都从远端拉下来,这会非常非常慢。这个时候可以用根目录下的 android_lib_pull.sh 脚本先把一些常用库还有目标apk下的库给打包一次性拉下来,然后gdb设置查找路径。设置完成后每次调试都能够秒开了
./android_lib_pull.sh io.cyril.supervipplayer
pwndbg
pwndbg> set sysroot android_sysroot/
pwndbg> set breakpoint auto-hw on
pwndbg> target remote :3333
建议配合 pwndbg 食用
在 release 里面下载对应架构的二进制文件运行即可,本程序基于 musl 静态构建,无需额外安装依赖。
编译环境安装:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shrustup toolchain install stablerustup toolchain install nightly --component rust-srcrustup target add ${ARCH}-unknown-linux-muslbrew install llvm 并添加到环境变量 PATHbash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"brew install filosottile/musl-cross/musl-crossaarch64-linux-musl-cross.tgz 或 x86_64-linux-musl-cross.tgz 到 PATHcargo install bpf-linker之后 cargo check, cargo build 应该能够正常使用了
cargo check --target x86_64-unknown-linux-musl
cargo run --release --target aarch64-unknown-linux-musl
cargo build --release --target aarch64-unknown-linux-musl
项目使用构建脚本自动编译 eBPF 代码并将其链接至程序中,具体原理参考 aya。交叉编译部分可参考 .cargo/config.toml 文件
除 eBPF 代码外,edbgserver 遵循 MIT 协议 或 Apache 协议 (2.0版本) 开源,您可以择其一使用。除非您另有明确说明,否则根据 Apache-2.0 协议定义,您有意提交并包含在本库中的任何贡献都将按照上述方式双重授权,且不附加任何额外条款或条件。
所有 eBPF 代码均遵循 GNU 通用公共许可协议第 2 版 (GPLv2) 或 MIT 协议 开源,您可以择其一使用。除非您另有明确说明,否则根据 GPL-2 协议定义,您有意提交并包含在本项目中的任何贡献都将按照上述方式双重授权,且不附加任何额外条款或条件。
$ claude mcp add edbgserver \
-- python -m otcore.mcp_server <graph>