Skip to content

Instantly share code, notes, and snippets.

@PkmX
Created September 16, 2014 19:58
Show Gist options
  • Select an option

  • Save PkmX/957ceaf9e5e5cdb34018 to your computer and use it in GitHub Desktop.

Select an option

Save PkmX/957ceaf9e5e5cdb34018 to your computer and use it in GitHub Desktop.
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from magic...(no debugging symbols found)...done.
(gdb) b *0x804869a
Breakpoint 1 at 0x804869a
(gdb) r < input
Starting program: /home/pkmx/work/magic < input
Got object file from memory but can't read symbols: File truncated.
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Welcome to Magic system!
Give me your name(a-z): Your name is ker.
Give me something that you want to MAGIC:
Breakpoint 1, 0x0804869a in magic ()
(gdb) x/30x $sp
0xffffcfa0: 0x08048836 0xffffcfb4 0xf7f96e80 0xf7e44f0d
0xffffcfb0: 0xf7f96e80 0x34333231 0x38373635 0x32313039
0xffffcfc0: 0x36353433 0x30393837 0x34333231 0x38373635
0xffffcfd0: 0x32313039 0x36353433 0x30393837 0x34333231
0xffffcfe0: 0x38373635 0x32313039 0x36353433 0x30393837
0xffffcff0: 0x34333231 0x38373635 0x00313039 0x08048613
0xffffd000: 0xf7f96e00 0xffffd011 0x00000001 0xf7e0731b
0xffffd010: 0x63626120 0xf7ffcf00
(gdb) b *0x80486b4
Breakpoint 2 at 0x80486b4
(gdb) c
Continuing.
Breakpoint 2, 0x080486b4 in magic ()
(gdb) x/30x $sp
0xffffcfa0: 0xffffcfb4 0x00000047 0xf7f96e80 0xf7e44f0d
0xffffcfb0: 0xf7f96e80 0xd82f31ac 0x5f4e2106 0xb8c4a1f1
0xffffcfc0: 0xf21c2a59 0x83d1a3d5 0x1628abb7 0xab56ff2c
0xffffcfd0: 0x44c7d4e1 0x2d5726d4 0xc2bbe31e 0xe34f455c
0xffffcfe0: 0x4fab93a0 0xf41bb479 0x01dc722d 0xd7f27238
0xffffcff0: 0x226ef31f 0xc40689e6 0x00df83a2 0x08048613
0xffffd000: 0xf7f96e00 0xffffd011 0x00000001 0xf7e0731b
0xffffd010: 0x63626120 0xf7ffcf00
(gdb) ni
0x080486b7 in magic ()
(gdb) ni
0x080486bb in magic ()
(gdb) ni
0x080486c2 in magic ()
(gdb) ni
0x080486c7 in magic ()
(gdb) ni
0x080486c8 in magic ()
(gdb) c
Continuing.
sh-4.3$ exit
Program received signal SIGSEGV, Segmentation fault.
0x0804861f in never_use ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment