In a program I am debugging, the canary value is read to eax from gs:0x14 memory location. I am attaching gdb to the process late enough to break on the mov reading the canary to eax. Therefore, reading eax is not an option to me. How can I read (x/w) the canary location (gs:0x14) in gdb?

  • very similar questions have been asked and answered here and here
    – julian
    May 14, 2017 at 20:55
  • @SYS_V I'm not sure either one was really "answered" (well, maybe if you count "you can't" as an answer)
    – Igor Skochinsky
    May 15, 2017 at 16:32

1 Answer 1


It seems it's not possible to do this using built-in GDB functionality but I found a blog post which explains how to get the gs base from a core dump:


You should be able to generate a core using generate-core-file command then inspect it outside of GDB.

  • Ah! I see. Every time I learn something new from you. Thanks. Will try that.
    – sherlock
    May 14, 2017 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.