printf not passing correct Hex Address to stack

Posted by kriss on Stack Overflow See other posts from Stack Overflow or by kriss
Published on 2012-09-08T08:56:40Z Indexed on 2012/09/08 9:38 UTC
Read the original article Hit count: 200

Filed under:

I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:-

printf "hello world!\x12\x23\x34" | ./input1

But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

© Stack Overflow or respective owner

Related posts about stackoverflow