Maybe some student may be confused about .gdb script file. I will give something here to help you understand it.
From the sample code in pwn.colledge. Here the gdb script will trigger anytime the program run at main+42.
And at this location, it will define a variable called $local_variable and then store the value ($rbp-0x32) pointer to as long long value.
And then printf out it.
1 | start |
In the pwn.college Debugging Refresher Level5, you can use disass
command which will show you the assembly code of the program to help you understand the program logic.
And then you will find that this is similar with the Level4. It will set random value and ask you to input it.
So there is a sample .gdb script here.
1 | start |