【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

相关推荐
lbb 小魔仙2 小时前
【Java】Java 实战项目:手把手教你写一个电商订单系统
android·java·python
Android系统攻城狮5 小时前
Android tinyalsa深度解析之pcm_state调用流程与实战(一百一十七)
android·pcm·tinyalsa·音频进阶·音频性能实战
吴声子夜歌5 小时前
RxJava——调度器Scheduler
android·echarts·rxjava
若谷老师6 小时前
21.WSL中部署gnina分子对接程序ds
linux·人工智能·ubuntu·卷积神经网络·gnina·smina
冬奇Lab7 小时前
AMS核心机制:Activity生命周期与进程管理深度解析
android·源码阅读
西邮彭于晏7 小时前
安卓app发布
android
游戏开发爱好者88 小时前
完整教程:App上架苹果App Store全流程指南
android·ios·小程序·https·uni-app·iphone·webview
Norach9 小时前
ubuntu22.04安装ssh-server与realvnc-server
linux·服务器·经验分享·ubuntu·ssh·vnc
YIN_尹9 小时前
【MySQL】SQL里的“连连看”:从笛卡尔积到自连接
android·sql·mysql
bisal(Chen Liu)9 小时前
0.5 hour还是0.5 hours?
android