[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GDB all VERSION
From: |
sfddfsd |
Subject: |
GDB all VERSION |
Date: |
Fri, 1 Feb 2013 22:04:48 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121123 Icedove/10.0.11 |
hi, I write for the tool gdb, this has a bug.
you should compile this code with gcc proof.c -o proof .
#include <stdio.h>
int main(int argc,char** argv)
{
if( argc == 2 )
{
printf("%s",argv[1]);
}
return 0;
}
the next step is run gdb -q proof and put a breakpoint in function printf.
the direction of prinf is
0x0804843e <+34>: call 0x8048300 <address@hidden>
and put break in 0x0804843e , then should run gdb -q proof.
view the stack with x/8x $esp .
0xbffff960: 0x080484e0 0xbffffbb1 0x0804846b 0xb7fc4ff4
0xbffff970: 0x08048460 0x00000000 0xbffff9f8 0xb7e96e16
and print the string with value proof 0xbffffbb1 .
(gdb)x/s 0xbffffbb1
0xbffffbb1: "proof"
print the newly the stack with x/8x $esp and the result is.
0xbffff960: 0xe0 0x84 0x04 0x08 0xb1 0xfb 0xff 0xbf
do you understand ??, this bug is in all version of gdb .
will wait for you answer,please.
regards.
- GDB all VERSION,
sfddfsd <=