I'm attempting to do a buffer overflow with gets(). I've figured out how to write over the return address and I'm able to do so, however, I cannot write in the address I need because the 0x7F at the beginning of the address is being parsed weird. For example, overflowing with b"\x7f" * 150
shows in the stack as as all 00. Further, it seems that values after these 0x7F bytes overwrite where the 00s are.
In the picture below you can see a test where I overflowed with bytes from 0x00 up to 0xFF. As you can see, 0x7F is non-existant because it has been written over by the values after it for some strange reason.
I'm fairly confident this has something to do with gets() treating the 0x7F weird but I'm not sure how to work around this. Any help much appreciated!
Edit: Okay, so I just realized that 0x7F corresponds to the del (delete) ascii character which would explain the odd behavior. So I guess my question is still how to work around this?