312-50V9 · Question #595
You are programming a buffer overflow exploit and you want to create a NOP sled of 200 bytes in the program exploit.c What is the hexadecimal value of NOP instruction?
The correct answer is D. 0x90. The x86 NOP instruction has the opcode 0x90, and a NOP sled is a sequence of these bytes used to increase buffer overflow exploit reliability.
Question
You are programming a buffer overflow exploit and you want to create a NOP sled of 200 bytes in the program exploit.c What is the hexadecimal value of NOP instruction?
Options
- A0x60
- B0x80
- C0x70
- D0x90
How the community answered
(37 responses)- A5% (2)
- B5% (2)
- C3% (1)
- D86% (32)
Why each option
The x86 NOP instruction has the opcode 0x90, and a NOP sled is a sequence of these bytes used to increase buffer overflow exploit reliability.
0x60 is the opcode for the PUSHA instruction on x86, which pushes all general-purpose registers onto the stack and is unrelated to NOP.
0x80 is a prefix byte for immediate arithmetic and logical operations on x86 operands, not the NOP opcode.
0x70 is the opcode for JO (Jump if Overflow), a conditional branch instruction, not a no-operation instruction.
On x86 and x86-64 processors, 0x90 is the single-byte opcode for the NOP (No Operation) instruction. A NOP sled of 200 bytes means writing 0x90 repeated 200 times before the shellcode, so that a jump landing anywhere in the sled slides execution forward into the payload without crashing.
Concept tested: x86 NOP opcode used in buffer overflow NOP sleds
Topics
Community Discussion
No community discussion yet for this question.