if we compile some C code with gcc, we often see the following build result
0x08048494 <+0>: push ebp
0x08048495 <+1>: mov ebp,esp
0x08048497 <+3>: and esp,0xfffffff0
0x0804849a <+6>: sub esp,0x130
0x080484a0 <+12>: mov eax,DWORD PTR [ebp+0xc]
0x080484a3 <+15>: mov DWORD PTR [esp+0x1c],eax
0x080484a7 <+19>: mov eax,gs:0x14
This is the prologue of the function. from line +19, we can see that the stack protection value obtained from gs: 0x14. my question is: can I find out the actual virtual address gs: 0x14 with gdb? the gs segment selector value indicates an offset from the GDT however a user level process such as gdb cannot access the GDT information. How can I determine the base address of the gs segment using gdb or another debugger? it's impossible?
thank you in advance.
source
share