Hi All
I am learning basics of buffer overflow with mainly shellcoder's handbook (+ google ofc).
Purpose of this excercise is to redirect flow of program.
According to the book, i should overwrite RET with address of other instruction, (in this case 0x0804844e). I can control where the input can be stored, however the book says to overwrite RET with address encoded in the way \x4e\x84\x04\x08.
But when i do so, I get SEGFAULT, and upon debugging it says that EIP was not overwritten with custom address, but with half of this code, encoded in hex. So what I get here is e.g. 0x5c783465 value of EIP which is ascii represenatation of \x4e (or similarly, I have tried various input lenghts but I never managed to encode any address in style \xYY)
Could anyone help me and tell me what i'm doing wrongly? How to store complete address to RET without having it encoded to ASCII?