I'm working on a simple arc injection exploit, wherein this particular string gives me the desired address of the place where I'd like to jump: Á^F@^@
. This is the address 0x004006c1
(I'm using a 64 bit Intel processor, so x86-64 with little endian arrangement).
When I provide this string Á^F@^@
as input to a vulnerable gets()
routine in my function and inspect the addresses using gdb
, the address gets modified to 0x00400681
instead of 0x004006c1
. I'm not quite sure as to why this is happening. Furthermore, is there any way to easily provide hexadecimal values to a gets
routine at stdin
? I've tried doing something like: 121351...12312\xc1\x06\x40\x00
, but instead of picking up \xc1
as it is, it translates individual character to hex, so I get something like 5c78..
(hex for \ and x, followed by hex for c and 1).
Any help is appreciated, thanks!