Curious about memory structure among gdb (code area or data area)

Asked 2 years ago, Updated 2 years ago, 120 views

Code with an if statement. I thought that 0xdeadbeef was a constant that shouldn't be changed, so I thought it would be in the data area.

But when I tried gdb,

The assembly code is in the code area, right?

If you look at the image above, is it right to say that 0xdeadbeef is stored in the code area?

I wonder if the value 0xdeadbeef is in the code area or the data area.

gdb data-structure

2022-09-20 19:22

1 Answers

The operand value of the command cmp is the 0xdeadbeef value.

Even at the binary level, it's liturgical.

https://www.felixcloutier.com/x86/cmp

If you go and see. CMP EAX, imm32 You can check the appropriate commands.

im is an abbreviation for the immediate value.

Yes, it is embedded in the code area as an operand value.


2022-09-20 19:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.