Adding an signed integer beyond 0xFFFFFFFF
#include <stdio.h>
void fun3(int a, int b, int c)
{
printf("%d \n", a+b+c );
}
void fun2 ( int x, int y)
{
fun3(0x33333333,0x30303030, 0x31313131);
printf("%d \n", x+y);
}
fun1 (int x)
{
fun2(0x22222222,0x20202020);
printf("%d \n", x);
}
main()
{
fun1(0x1111111);
}
I'm going through the above program for stack corruption. I am getting the
o/p for the above program with some undesired values. All I could
understand is if the added value is beyond 0xFFFFFFFF then the small
negative integer becomes the largest value say -1 becomes 0xFFFFFFFF. Any
insights on this
No comments:
Post a Comment