【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

相关推荐
不羁的木木2 小时前
HarmonyOS APP实战-基于Image Kit的图像处理APP - 第9篇:批量处理与编辑历史
图像处理·ubuntu·harmonyos
春卷同学3 小时前
HarmonyOS掌上记账APP开发实践第15篇:ArkTS 类型系统深度解析 — 从接口到联合类型的灵活运用
ubuntu·华为·harmonyos
安卓修改大师3 小时前
安卓修改大师 vs MT管理器:反编译工具终极对决与全景解析
android·人工智能·机器翻译
程序员小八7774 小时前
从 0 学习 MySQL 索引——7 大核心精讲
android·学习·mysql
蓝速科技6 小时前
蓝速科技鸿蒙广告机替代安卓实测:信创系统下的性能与边界评估
android·科技·harmonyos
雅客李6 小时前
2026云手机高负载压力测评 安卓云手机多开实测数据
android·智能手机·php
千里马学框架7 小时前
google官方Perfetto 中使用 AI相关skill
android·人工智能·ai·framework·perfetto·性能·skill
zhangphil9 小时前
Android RecyclerView图像类ViewHolder离屏缓存数量直接增加Java/View对象内存,间接增加Graphics/GL内存
android
春卷同学9 小时前
HarmonyOS掌上记账APP开发实践第18篇:编译时优化与 ArkTS 语法限制 — 提升应用性能的编码规范
linux·运维·ubuntu
爸爸6199 小时前
鸿蒙应用开发实战【08】— AppStorage 全局状态与跨页面通信
ubuntu·华为·harmonyos·鸿蒙系统