Feb 21
old business
Next week's homework is posted.
aside
Looking at the executable :
new business
Walk through arithmetic, conditionals, and procedure calls.
Simplest way is with text's slides, I think :
I'm looking today at the "control" and "procedures" notes.
playing around
What's coming is the bomb lab - trying to
figure out what an unknown compiled program will do
by looking at it with whatever tools you can find.
So ... and example is
in
gdb example folder ; small.c and notes.
Your mission : find the strings and system calls.
Here's a snip of a gdb session to talk about. (More details
in my notes in the folder.)
$ gdb small
(gdb) break print_string
(gdb) run
(gdb) info stack /* i s */
(gdb) info frame /* i f */
(gdb) info registers /* i r */
(gdb) x/s $eax /* "The first string. I think." */
(gdb) disass print_string
(gdb) x/s $0xd4+$ebx /* "string: '%s'\n" */