September 2017
Beginner to intermediate
290 pages
6h 58m
English
The next step would be patching calls to gets() and redirecting them to our shim. As we only have a single call to gets() (which is now a call to fgets() with an invalid number of parameters), we will patch the call itself. If we had multiple calls to fgets(), we would then patch the jmp fgets instruction rather than patching each and every call.
As we have already seen, the call is relative to EIP, so we have to calculate a new offset for the call so that it would call our shim code located at 0x414d98. The formula is rather simple:
Here, 0x4117EC is the address of the call instruction and 5 is its length in bytes. We need to use this length of the call instruction as, at the time it is ...
Read now
Unlock full access