pwd_3的博客

YourButterfly

gdb-pwndbg encoding issue

问题描述

为了更好的调试程序,下载编译了debug版的glibc-2.23。在配置环境后,打开gdb出现了如下的warning
******
Your encoding (ANSI_X3.4-1968) is different than UTF-8. pwndbg might not work properly.
You might try launching gdb with:
    LC_ALL=en_US.UTF-8 PYTHONIOENCODING=UTF-8 gdb
Make sure that en_US.UTF-8 is activated in /etc/locale.gen and you called locale-gen
******
pwndbg: loaded 164 commands. Type pwndbg [filter---Type <return> to continue, or q <return> to quit---q
Traceback (most recent call last):
  File "/home/pwd/pwndbg/gdbinit.py", line 36, in <module>
    import pwndbg # isort:skip
  File "/home/pwd/pwndbg/pwndbg/__init__.py", line 71, in <module>
    import pwndbg.prompt
  File "/home/pwd/pwndbg/pwndbg/prompt.py", line 24, in <module>
    print(message.prompt('pwndbg: ') + message.system(line))
  File "/usr/share/gdb/python/gdb/__init__.py", line 48, in write
    write(s, stream=STDOUT)
KeyboardInterrupt: Quit
(gdb) q

原因

新编译安装的glibc没有设置语言

解决方法

设置语言,
1.在安装目录下lib里,首先创建文件夹locale
2.在安装目录下bin里,执行./localedef -i en_US -f UTF-8 en_US.UTF-8
pwd@pwd-vm:~/installed/bin$ mkdir ../lib/locale/ 
pwd@pwd-vm:~/installed/bin$ ./localedef -i en_US -f UTF-8 en_US.UTF-8
阅读更多
文章标签: gdb
上一篇pwnable之brainfuck
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭