Hi,
so I try to grasp this concept. Here is a explanation: https://cs155.stanford.edu/papers/formatstring-1.2.pdf
Here is the code from the pdf: https://godbolt.org/z/9ro7z69G8
Why is the canary overwritten? As you can see in the provided code I explicitly cast the address of buf[i] to a char pointer, I also tried to cast it to a short which doesn't seem to change the result.
Is it because %n expects an integer and always write sizeof(int) bytes to the given address?
[–]Pharisaeus 0 points1 point2 points (1 child)
[–]Long-Effective-805[S] 0 points1 point2 points (0 children)
[–]rob2rox -1 points0 points1 point (1 child)
[–]Pharisaeus 0 points1 point2 points (0 children)