2

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?

sherlock
  • 1,381
  • 3
  • 23
  • 40

1 Answers1

3

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:

https://www.technovelty.org/linux/debugging-__thead-variables-from-coredumps.html

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

Igor Skochinsky
  • 36,553
  • 7
  • 65
  • 115