c - Buffer Overflow -
i trying create buffer overflow. there 3 variables in function -- int, , 2 arrays. 2 arrays both length of 14 chars. int initialized 0 in function, trying change 1. run program terminal , put in input assign second array.
therefore, when run program, doing this:
./a.out 11111111111111111111111111111
this 29 1's. overflows 2 arrays making them both 1's, , want put 29th "1" int, reason gets converted decimal number "49." how able put "1" int using buffer overflow without converting?
i not able put decimal version of 1 because unprintable character in ascii.
the ascii value of character 1
0x31
, 49
in decimal. on right track.
what doing invokes undefined behavior anyway, expected behavior form of undefined behavior.
to try , change integer 1
, can run
./a.out 1111111111111111111111111111^a
where ^a
obtained pressing control , a keys, shell's line editor interpret command move cursor beginning of line... can try instead:
./a.out $(printf '1111111111111111111111111111\001')
Comments
Post a Comment