tiann / eadb Goto Github PK
View Code? Open in Web Editor NEWeBPF Android Debug Bridge
License: Apache License 2.0
eBPF Android Debug Bridge
License: Apache License 2.0
用ssh,必须先把压缩包放到/data/eadb/debian/data/eadb/deb.tar.gz
然后才能
eadb --ssh root@ip prepare -a path/to/archive(本地路径)
然后提示找不到device-*
Line 133 in 0832f6e
这是因为这些文件实际解压到
/data/eadb/debian/data/eadb/device-unpack
原因是
ssh的push这里把路径拼接为{EADB_ROOTFS_DIR}/{EADB_DIR}
,但是后面脚本的操作都是基于EADB_DIR
,最终导致chmod +x device-*
命令异常
✘ king@kingdeMacBook-Pro ~/apks/bpf/ebpf eadb --ssh [email protected] shell
chroot: exec /bin/bash: No such file or directory
Connection to 192.168.31.179 closed.
$ cargo build
Compiling eadb v0.1.5 (E:\eadb)
error[E0425]: cannot find function getuid
in crate libc
--> src\build_image.rs:68:30
|
68 | let uid = unsafe { libc::getuid() };
| ^^^^^^ help: a function with a similar name exists: getpid
|
::: C:\Users.cargo\registry\src\mirrors.ustc.edu.cn-12df342d903acd47\libc-0.2.126\src\windows\mod.rs:474:5
|
474 | pub fn getpid() -> ::c_int;
| --------------------------- similarly named function getpid
defined here
For more information about this error, try rustc --explain E0425
.
error: could not compile eadb
due to previous error
Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version.
chdir(/lib/modules/4.14.243-gff8eae656fe6-ab8007944/build): No such file or directory
Traceback (most recent call last):
File "/usr/share/bcc/tools/opensnoop", line 261, in
b = BPF(text='')
File "/usr/lib/python3/dist-packages/bcc/init.py", line 475, in init
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module
Pixel4 运行 opensnoop 提示运行错误
有时候受限于PC的网络环境,比如手机和PC在不同的子网下,这个时候在虚拟机中无法连通到手机的ssh(即使手机监听0.0.0.0)
如果这个时候仍然想使用ssh去操作,可以通过adb forward tcp:手机端口 tcp:PC端口
进行转发
然后PC可以通过ssh [email protected] -p port
的方式连接到手机的ssh
但是adb forward tcp:22 tcp:22
怎么都会提示无法绑定端口,但是如果是其他端口却可以成功...
另外补充一点,ssh连的时候,forward的手机端口和PC端口必须一致,不知道为何...
所以希望可以增加一个指定端口的选项,另外项目是用的scp传输文件,改的话也需要一并增加
现在正尝试使用python script配合adb commands进行实验流程的自动化,想请问eadb是否提供方法可以用command的方式,从adb shell去执行BCC Tools?
按照https://blog.seeflower.dev/archives/138/走到执行rootfs的解压脚本时出现此提示,环境为pixel6 Linux localhost 5.10.149-android13-4-g0dfc360712ea刷入kernelSu
环境为 AVD 启动的 Android 12.0 Pixel 2,使用 63e6e2e 的 Actions 构建版本。
在 eadb prepare
后执行 eadb shell
,产生如下报错后连接被关闭
WARNING: linker: Warning: failed to find generated linker configuration from "/linkerconfig/ld.config.txt"
CANNOT LINK EXECUTABLE "/system/bin/ndk_translation_program_runner_binfmt_misc_arm64": library "libicu.so" not found: needed by /system/lib64/libharfbuzz_ng.so in namespace (default)
Unpack of rootfs successful!
oriole:/ # /data/eadb/run /data/eadb/debian
WARNING: linker: Warning: failed to find generated linker configuration from "/linkerconfig/ld.config.txt"
/bin/bash[10]: syntax error: unexpected '('
1|oriole:/ #
环境:
pixel6,Android13,内核Linux version 5.10.149-android13-4-gebdbc9fbe2e2-dirty (build-user@build-host) (Android (8508608, based on r450784e) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6), LLD 14.0.7) #1 SMP PREEMPT Mon Feb 27 10:44:09 UTC 2023
维术带佬你好,我跟着教程在手机上用 eadb v0.1.3 + debianfs-full.tar.gz 搭起 linux 环境,想简单体验一下 bpftrace 的效果
apt install bpftrace 后,执行 readme 中的展示命令会报错,参考直播时提到过 bcc 源码中的 tracing 路径问题,猜测应该是 bpftrace 源码里也写死了 /sys/kernel/debug/tracing 导致的,所以 fork 并修改了 bpftrace 的源码并 clone 到回来,尝试在手机上源码编译
目前是在源码编译仅修改 tracing 路径后的 bpftrace 过程中,make -j8 时报错
检查了报错代码中,对应函数的调用如下, 传递了 3 个参数
init_disassemble_info(&info, stdout, fprintf_nop);
但是从手机 linux 环境的 /usr/include/dis-asm.h 文件中查看导出的 init_disassemble_info 函数有 4 个参数,所以报错了
/* Method to initialize a disassemble_info struct. This should be
called by all applications creating such a struct. */
extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
fprintf_ftype fprintf_func,
fprintf_styled_ftype fprintf_styled_func);
/* For compatibility with existing code. */
#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC, FPRINTF_STYLED_FUNC) \
init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC), \
(fprintf_styled_ftype) (FPRINTF_STYLED_FUNC))
对这个方向的知识储备比较少,现在不知道该从哪里入手才能正常编译出 bpftrace 了,请 带佬 帮忙解答,非常感谢
i run the script file, and the script is actually in the file, but here comes an unexpected error "no such file or directory"
the detail of the emulator is:
phone image is Tiramisu(Android 13.0X86_64)
Properties
avd.ini.displayname phone
avd.ini.encoding UTF-8
AvdId phone
disk.dataPartition.size 6442450944
fastboot.chosenSnapshotFile
fastboot.forceChosenSnapshotBoot no
fastboot.forceColdBoot no
fastboot.forceFastBoot yes
hw.accelerometer yes
hw.arc false
hw.audioInput yes
hw.battery yes
hw.camera.back virtualscene
hw.camera.front emulated
hw.cpu.ncore 4
hw.device.hash2 MD5:a8abfd3536f3d35e4ba2041a7b99f40e
hw.device.manufacturer Google
hw.device.name pixel_6_pro
hw.dPad no
hw.gps yes
hw.gpu.enabled yes
hw.gpu.mode auto
hw.initialOrientation Portrait
hw.keyboard yes
hw.lcd.density 560
hw.lcd.height 3120
hw.lcd.width 1440
hw.mainKeys no
hw.ramSize 2048
hw.sdCard yes
hw.sensors.orientation yes
hw.sensors.proximity yes
hw.trackBall no
image.androidVersion.api 33
image.sysdir.1 system-images\android-33\default\x86_64
PlayStore.enabled false
runtime.network.latency none
runtime.network.speed full
showDeviceFrame yes
skin.dynamic yes
tag.display Default Android System Image
tag.id default
vm.heapSize 384
首先感谢作者杰出的工作,很好的解决了我的开发需求
为了使用vscode更好地进行远程开发,遵循看雪论坛 不吃菠菜https://bbs.kanxue.com/thread-275176.htm 给出的ssh方案
在eadb的debian系统内部安装ssh并且启动服务,在不同的设备root支持下出现不同的反馈
猜测可能与su的实现方式不同有关,请问有没有好的解决方案,再次感谢
目前安装0.21.x之后的bpftrace版本遇到很多底层库版本对不上的问题:
root@localhost:/# dpkg -i bpftrace_0.21.2-1_arm64.deb
(Reading database ... 42363 files and directories currently installed.)
Preparing to unpack bpftrace_0.21.2-1_arm64.deb ...
Unpacking bpftrace (0.21.2-1) over (0.21.2-1) ...
dpkg: dependency problems prevent configuration of bpftrace:
bpftrace depends on libbpf1 (>= 1:0.7.0); however:
Package libbpf1 is not installed.
bpftrace depends on libbpfcc (>= 0.30.0+ds); however:
Version of libbpfcc on system is 0.18.0+ds-2.
bpftrace depends on libc6 (>= 2.38); however:
Version of libc6:arm64 on system is 2.31-13+deb11u10.
bpftrace depends on libclang1-17t64 (>= 1:9~svn359771-1~); however:
Package libclang1-17t64 is not installed.
bpftrace depends on libelf1t64 (>= 0.142); however:
Package libelf1t64 is not installed.
bpftrace depends on libllvm17t64; however:
Package libllvm17t64 is not installed.
bpftrace depends on libstdc++6 (>= 13.1); however:
Version of libstdc++6:arm64 on system is 10.2.1-6.
dpkg: error processing package bpftrace (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
bpftrace
当前应该是debian11:
root@localhost:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
When I try to execute the command "chroot debian/ ..." inside the run script, it always tells me "no closing quote", I tried inserting both single and double quotes, removing them but nothing works, I don't know how I can solve it
大佬你好,我用了eadbv0.1.4+debianfs-arm64-full.tar.gz 搭了一个环境,在执行eadb shell 的阶段发现网络不能用,使用adb shell可以使用网络。
手机 google pixel3 arm64 内核是4.9.210-gdee0d123b122-ab6570413
设置rootfs
./eadb --ssh [email protected] -p 22225 prepare -a debianfs-arm64-full.tar.gz
安装正常
登录上来
./eadb --ssh [email protected] -p 22225 shell
然后安装工具时网络就不能访问
apt update
Err:1 http://mirrors.ustc.edu.cn/debian bullseye InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Reading package lists... Done
Building dependency tree... Done
All packages are up to date.
W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/bullseye/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Some index files failed to download. They have been ignored, or old ones used instead.
使用ping
后
root@localhost:/# ping baidu.com
ping: baidu.com: Temporary failure in name resolution
当前使用adb shell 能正常使用手机网络。
blueline:/ # ping baidu.com
PING baidu.com (220.181.38.251) 56(84) bytes of data.
64 bytes from 220.181.38.251: icmp_seq=1 ttl=52 time=42.9 ms
64 bytes from 220.181.38.251: icmp_seq=2 ttl=52 time=59.0 ms
chroot: exec /bin/bash: No such file or directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.