This write command is really bad. I can only write to up to 0x7fffffff on a 32 bit system. So I can't use it to write on the stack which is somewhere at 0xbfc31000. So strtoul() would be the right function here. Also only writing signed integer values and not being able to use the value in hex is quite limited.