【Android安全】Ubuntu 16.04安装GDB和GEF

1. 安装GDB

sudo apt install gdb-multiarch

2. 安装GEF(GDB Enhanced Features)

官网地址:https://github.com/hugsy/gef

2.1 安装2021.10版本

但是在Ubuntu 16.04上,bash -c "$(curl -fsSL https://gef.blah.cat/sh)"等命令不好使,应该是因为Ubuntu版本太旧而无法与最新版GEF适配

需要旧的GEF

实测这个版本可以:https://github.com/hugsy/gef/releases/tag/2021.10

安装步骤:

c 复制代码
wget https://github.com/hugsy/gef/archive/refs/tags/2021.10.tar.gz
tar -xzvf 2021.10.tar.gz
mkdir ~/.gef
sudo cp -r gef-2021.10/gef.py ~/.gef/
echo "source ~/.gef/gef.py" >> ~/.gdbinit

输入 gdb-multiarch

  • 如果开头是gef说明GEF安装成功
  • 如果开头是(gdb)说明GEF安装失败

我这里显示(gdb),并且输入gef之后显示报错:

c 复制代码
Python Exception <class 'UnicodeEncodeError'> 'ascii' codec can't encode character '\u27a4' in position 12: ordinal not in range(128): 
(gdb) 

说明GEF安装失败了

2.2 解决 Python Exception <class 'UnicodeEncodeError'> 'ascii' codec

输入gef之后显示报错:

复制代码
Python Exception <class 'UnicodeEncodeError'> 'ascii' codec can't encode character '\u27a4' in position 12: ordinal not in range(128): 
(gdb) 

临时解决办法:

改用:LC_ALL=en_US.UTF-8 gdb

永久解决办法:

复制代码
echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc
source ~/.bashrc

这样之后,直接输入gdb就可以

3. 参考链接:

https://github.com/hugsy/gef/issues/195

https://www.uf4te.cn/posts/2b805828.html#安装-gef

相关推荐
唔6620 分钟前
原生 Android(Kotlin)仅串口「侵入式架构」完整案例三
android·架构·kotlin
唔6620 分钟前
原生 Android(Kotlin)仅串口「可插拔架构」完整案例一
android·架构·kotlin
Melrose26 分钟前
移动端安全攻防
android·前端·安全
葡萄城技术团队43 分钟前
Claude Code Buddy 小析:一个非核心功能,如何体现产品的细节完成度
android·java·microsoft
.豆鲨包1 小时前
【Android】OkHttp的使用及封装
android·java·okhttp
黄林晴1 小时前
重启不用输 PIN!Android 17 终于把 SIM 卡安全做明白了
android
2501_915921431 小时前
uni-app一键生成iOS安装包并上传TestFlight全流程
android·ios·小程序·https·uni-app·iphone·webview
DeepHacking1 小时前
Ubuntu 上安装 ComfyUI(NVIDIA GPU / Conda / CUDA 12.1)
linux·ubuntu·conda
YQ_011 小时前
Ubuntu 执行 `ubuntu-drivers autoinstall` 后,Wi‑Fi 消失、外接显示器无反应的排查与修复
linux·运维·ubuntu
studyForMokey1 小时前
【Android面试】四大组件专题 todo
android·面试·职场和发展