level 2
The catcher()
function is what we want to call.
The main()
function returns the division of the second and third argument, first being the program name itself.
The program makes signal
syscall which sets a handler function for a signal. This handle function gets called when the signal is received.
In our case the signal is SIGFPE
and the handler function is catcher()
.
If we look at the man-page, it tells us when a SIGFPE
signal is generated.
So SIGFPE
is generated during divisions, and there is a division occurring in our program.
We cannot perform division by zero because our argv[2]
is the divisor and the program doesn't allow for it to be zero.
However, argv[2]
can be -1. Which means we just have to figure out what the most negative integer is and pass it as argv[1]
We can cat the password for the next level now.
Last updated