本文共 1986 字,大约阅读时间需要 6 分钟。
python脚本中pwntools gdb.attach遇到错误:Failed to read a valid object file image from memory.
******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 gdbMake sure that en_US.UTF-8 is activated in /etc/locale.gen and you called locale-gen******pwndbg: loaded 173 commands. Type pwndbg [filter] for a list.pwndbg: created $rebase, $ida gdb functions (can be used with print/break)Reading symbols from ./RNote4...(no debugging symbols found)...done.Attaching to program: /root/Pwn/RNote4/RNote4, process 1105Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.23.so...done.done.Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.23.so...done.done.Cannot access memory at address 0x7ffff7ffe148warning: Unable to find dynamic linker breakpoint function.GDB will be unable to debug shared library initializersand track explicitly loaded dynamic code.Failed to read a valid object file image from memory.0x00007ffff7b04260 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:8484 ../sysdeps/unix/syscall-template.S: No such file or directory.ERROR: Could not find ELF base!ERROR: Could not find ELF base!ERROR: Could not find ELF base!ERROR: Could not find ELF base!ERROR: Could not find ELF base!ERROR: Could not find ELF base!ERROR: Could not find ELF base!Couldn't get registers: No such process./tmp/pwnS5x0nn.gdb:2: Error in sourced command file:Couldn't get registers: No such process.Exception occured: Error: Couldn't get registers: No such process. ()For more info invoke `set exception-verbose on` and rerun the commandor debug it by yourself with `set exception-debugger on`Python Exception Couldn't get registers: No such process.:
一阵搜索之后没搞定。后来问了同学发现问题是python脚本里面忘加interactive了, 导致程序退出了。所以gdb attach不上。
转载地址:http://irmli.baihongyu.com/