Hi Daniele,
your code assumes that plain 'char' is unsigned. However, plain char is 'signed', or at least this is what I believe you are using.
Check your compiler settings:

The correct way to write your calculation is
result = (((unsigned char)(*buff))<<24)|(((unsigned char)*(buff+1))<<16)|(((unsigned char)*(buff+2))<<8)|((unsigned char)*(buff+3));
Explanation:
*(buff+1)
is a char (signed char)
Then you even cast it to a (signed) char again (redundant from the compiler point of view)
((char)*(buff+1))
Then, before the shift (<<) operation, the compiler has to do integral promotion.
because this is a signed char (0x9b) and negative, it gets promoted to
0xff9b
and then ORed into your result.
So this is why you get 0xff9b.
Solution: take care of signed or unsigned char, and use unsigend char in that particular case.
I hope this helps,
Erich