【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

相关推荐
abc_ABC123A2 小时前
flutter开发安卓APP所需搭建的环境
android
又熟了2 小时前
乌班图Ubuntu安装
linux·运维·ubuntu
peixiuhui2 小时前
RK3506 ubuntu22.04系统编译
ubuntu·开发板·核心板·工控机·ubuntu22.04·瑞芯微·rk3506
padane223 小时前
gmssl编译wasm
ubuntu·html·密码学·wasm·js
xq95273 小时前
Google 授权登录 V2 接入文档 王者归来
android
李少兄4 小时前
MySQL分页重复问题深度剖析
android·数据库·mysql
reikocao5 小时前
ubuntu系统源
linux·运维·ubuntu
Sisphusssss5 小时前
DiskGenius 备份 Ubuntu 系统
linux·ubuntu·diskgenius
_李小白6 小时前
【android opencv学习笔记】Day 24: 最大稳定极值区域
android·opencv·学习
城南观北6 小时前
Ubuntu 解决 apt 锁占用 + 安装 net-tools + 搭建 SSH 远程连接(保姆级实操)
linux·ubuntu·ssh