【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

相关推荐
未来之窗软件服务1 小时前
服务器运维(十五)自建WEB服务C#PHP——东方仙盟炼气期
android·服务器运维·东方仙盟·东方仙盟sdk·自建web服务
Zender Han6 小时前
Flutter 新版 Google Sign-In 插件完整解析(含示例讲解)
android·flutter·ios·web
Warren988 小时前
Python自动化测试全栈面试
服务器·网络·数据库·mysql·ubuntu·面试·职场和发展
HIT_Weston8 小时前
39、【Ubuntu】【远程开发】拉出内网 Web 服务:构建静态网页(二)
linux·前端·ubuntu
来来走走9 小时前
Android开发(Kotlin) LiveData的基本了解
android·开发语言·kotlin
。puppy10 小时前
MySQL 远程登录实验:通过 IP 地址跨机器连接实战指南
android·adb
dongdeaiziji11 小时前
深入理解 Kotlin 中的构造方法
android·kotlin
风起云涌~11 小时前
【Android】浅谈Navigation
android
游戏开发爱好者811 小时前
iOS 商店上架全流程解析 从工程准备到审核通过的系统化实践指南
android·macos·ios·小程序·uni-app·cocoa·iphone
QuantumLeap丶13 小时前
《Flutter全栈开发实战指南:从零到高级》- 18 -自定义绘制与画布
android·flutter·ios