User Tools

Site Tools


session:04-gdb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
session:04-gdb [2018/06/16 11:42]
Rareş-Mihail VISALOM (67101) [Basic stuff]
session:04-gdb [2020/07/19 12:49] (current)
Line 1: Line 1:
-====== 0x04b. Taming GDB ======+====== Refresher. Taming GDB ======
  
 Although it is a powerful tool, gdb is pretty cumbersome to use by itself. Even simple tasks such as execution tracing are made difficult by the lack of "friendliness". Although it is a powerful tool, gdb is pretty cumbersome to use by itself. Even simple tasks such as execution tracing are made difficult by the lack of "friendliness".
Line 28: Line 28:
 set history size 32768 set history size 32768
 set history expansion on set history expansion on
 +
 +# By default peda clears the screen after most commands, displaying a single
 +# context frame at a time and allowing you to access the previous/next frame
 +# using Shift+PageUp/Shift+PageDown. However, that might not work in your
 +# terminal, leaving you unable to access any older information. If that is the
 +# case, uncomment the following line:
 +#
 +#pset opt clearscr off
 </file> </file>
 ====== Basic stuff ====== ====== Basic stuff ======
Line 172: Line 180:
 Breakpoint 1, 0x080484fc in my_strcmp () Breakpoint 1, 0x080484fc in my_strcmp ()
 </code> </code>
-If you remember from the last session, the parameters passed to a function are on the stack. Because we have just arrived at this function using a ''call'' instruction, the return address is placed at the top of the stack (0x8048620). Immediately afterwards are the two parameters to the function: with "bla bla bla" being my input and "WXXHYIWE5yWic9vnmMGlA" the correct input.+If you remember from the last session, the parameters passed to a function are on the stack. Because we have just arrived at this function using a ''call'' instruction, the return address is placed at the top of the stack (0x8048620). Immediately afterwards are the two parameters to the function: with "bla bla bla" being my input and "WXXHYIWE5yWic9vnmMGlA" the correct input (obviously, the two should match, therefore your job now is to input the value that the program expects).
  
 Note that peda automatically //telescopes// addresses (dereferences and interprets the data) Note that peda automatically //telescopes// addresses (dereferences and interprets the data)
session/04-gdb.1529138577.txt.gz · Last modified: 2018/06/16 11:42 by Rareş-Mihail VISALOM (67101)