添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm just looking at the .text section of a simple exe I wrote in C, and I'm just trying to work out how some x86 opcodes are structured.

From what I've been reading, it seems that 0xe9 is a single byte opcode for a relative jump (JMP), however I'm unsure how the rest of the bytes actually form the jump address.

I'm using the super online disassembler ODA to disassemble my program, and this is what is displayed:

.text:0x00411005    e936210000  jmp    0x00413140

So 0xe9 is the JMP instruction, and as this is a 32-bit executable, I'm assuming the next four bytes are going to be the address for the jump, however I'm a little unsure as to how they are actually structured.

If anyone could help shine some light on his, I'd appreciate it.

Thanks

Isn't this an almost verbatim copy-paste of the question you just deleted? The same advice (read the manual) applies to this question. – Kerrek SB Sep 12, 2013 at 12:39

This is a relative jump, meaning that the destination is given as relative to the next instruction.

This instruction is at address 0x411005 and takes 5 bytes, so the next instruction is at address 0x41100a. The relative amount to jump (encoded as little-endian, i.e. the bytes are stored from least significant to most significant) is 0x2136. So the destination of the jump is 0x41100a + 0x2136 = 0x413140.

Where could I find the part you said about little endian? (I believe and confirmed it myself right after having read this, but I needed to know about JNZ, which I found and I'm following the little endian again, but I'd like to know where you read that so I could know about the other instructions) – Edw590 May 18, 2020 at 22:27 @DADi590 All instructions and their encodings are described in the Intel architecture manual volume 2. – interjay May 19, 2020 at 10:35

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.