【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

相关推荐
C_心欲无痕1 天前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
HIT_Weston1 天前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
HIT_Weston1 天前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式1 天前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
贺biubiu1 天前
2025 年终总结|总有那么一个人,会让你千里奔赴...
android·程序员·年终总结
xuekai200809011 天前
mysql-组复制 -8.4.7 主从搭建
android·adb
nono牛1 天前
ps -A|grep gate
android
未知名Android用户1 天前
Android动态变化渐变背景
android
nono牛1 天前
Gatekeeper 的精确定义
android
老前端的功夫1 天前
TypeScript 类型魔术:模板字面量类型的深层解密与工程实践
前端·javascript·ubuntu·架构·typescript·前端框架