如何在GDB中解析segment:offset地址 [英] how to resolve segment:offset address in GDB

查看:141
本文介绍了如何在GDB中解析segment:offset地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 (gdb)信息寄存器ds 
ds 0x7b 123
(gdb)反汇编
函数printf @ plt的汇编代码转储:
0x0804831c< + 0>:jmp DWORD PTR ds:0x804a008
=> 0x08048322< + 6>:push 0x10
0x08048327< + 11> ;: jmp 0x80482ec
汇编器转储结束。

有人可以描述如何将ds:0x804a008地址映射到线性地址吗?我可以使用x / xw地址命令?如果不清楚,我想知道代码跳转中第一个jmp函数的位置。

解决方案

0x804a008 是进程线性地址空间中的地址 - 该内存位置中的DWORD是将被跳转到的地址(即, 0x804a008 是一个指针)。
`



所以

  x / xw 0x804a008 

会转储指针的内容,并且

  disasm * 0x804a008 

将反汇编跳转该指针将执行。


(gdb) info registers ds
   ds             0x7b  123
(gdb) disassemble
   Dump of assembler code for function printf@plt:
   0x0804831c <+0>: jmp    DWORD PTR ds:0x804a008
=> 0x08048322 <+6>: push   0x10
   0x08048327 <+11>:    jmp    0x80482ec
End of assembler dump.

Can someone describe me how to map ds:0x804a008 address into linear address? I can use "x/xw address" command? If it is not clear I'd like to know where to this first jmp function in code jumps.

解决方案

0x804a008 is an address in the processes linear address space - the DWORD in that memory location is the address that will be jumped to (ie., 0x804a008 is a pointer). `

So

x/xw 0x804a008

will dump the contents of the pointer, and

disasm *0x804a008

will disassemble the code that jumping through that pointer will execute.

这篇关于如何在GDB中解析segment:offset地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆