1
.data
value: .long 0x69
.text
#...
2
.text
value: .long 0x69
#...
I'm a student learning x86 and I noticed that value
can't be modified if it's under .text
. I've been trying to read why, but I couldn't find it. Can someone lead me to where I can read about it or explain it briefly?
.text
section is the region of an executable where the actual executable instructions lie, and the .data
section is the region of an executable where the non-stack based variables and constants lie. The reason why you can't modify values in the .text
section is because of a security feature called W^X(aka PaX, Exec Shield, DEP, etc), which is enabled on most of the modern operating systems, where the OS disallows region of the memory unwritable while they are being executed. It's there to help alleviate arbitrary code injections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With