地址和推送说明前的星号,该地址被推送到何处? [英] Asterisk before an address and push instructions, where is it being pushed to?

查看:92
本文介绍了地址和推送说明前的星号,该地址被推送到何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个作业,需要了解使用GDB编译的C程序.我正在尝试按照说明进行操作,但是在准确地理解jmp命令在跳转到以*开头的地址时正在执行的操作有困难.我看过地址所在的位置,但它介于两个单词之间.跳转之后,有一个十六进制值的push命令.我只是假设这基本上就像使用指针一样,并且push命令使用将十六进制值压入该字节值来覆盖该字节值.我不确定我离我有多远.这是我正在查看的部分代码.由于已编译,因此我一直在使用x/10i $pc命令(根据我所在的位置更改要显示的指令量)来查看下一行指令.

I am working on an assignment where I need to understand the compiled C Program using GDB. I'm trying to follow the instructions but am having difficulty understanding exactly what the jmp command is doing when it is jumping to an address preceded by *. I've looked where the address is located but it falls between two words. After the jump, there is a push command of a hex value. I'm only assuming that this is basically like using a pointer and the push command overwrites the byte value with hex value being pushed onto it. I'm not sure how far off I am. Here is a portion of the code I'm looking at. Since it is compiled, I've been using the x/10i $pc command (changing the amount of instructions to display depending on where I am) to view the next instructions in line.

=> 0x08048334 <+0>:     jmp    *0x8049798
   0x0804833a <+6>:     push   $0x10
   0x0804833f <+11>:    jmp    0x8048304

第二个jmp继续以开始一系列类似事件.这是jmp指向的地址位置.这是我唯一一次在已编译的C文件的字节转储中看到此地址:

The second jmp proceeds to begin a chain of similar events. This is the address location that the jmp is pointing to. This is the only time I see this address in the byte-dump of the compiled C file:

 8049795:   83 04 08 3a             addl   $0x3a,(%eax,%ecx,1)
 8049799:   83 04 08 4a             addl   $0x4a,(%eax,%ecx,1)

对于将值实际放置到内存位置8049798中,如果将其更改为什么,我会提供一些有益的见解.

I'd appreciate some helpful insight on if the value is actually be placed into memory location 8049798 and if so, what is it changing it to?

推荐答案

我正在尝试按照说明进行操作,但是很难准确了解jmp命令在做什么

I'm trying to follow the instructions but am having difficulty understanding exactly what the jmp command is doing

您似乎正在查看PLT跳转存根.您可以在此处(查找惰性绑定优化"),但这是一个非常高级主题,您可能试图理解该代码(至少不是)然而).

It appears that you are looking at the PLT jump stub. You can find detailed description here (look for "lazy binding optimization"), but this a very advanced topic, and you likely shouldn't be trying to understand that code (at least not yet).

此说明:

jmp    *0x8049798

表示:读取位置0x8049798处的值,然后跳到那里.

means: read value at location 0x8049798 and jump there.

这篇关于地址和推送说明前的星号,该地址被推送到何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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