The result of the expression
((string_0[0] | (string_0[1] << 8)) | (string_0[2] << 0x10)) | (string_0[3] << 0x18)
is an int
. You are putting it into a uint
. Just make num
an int
, or cast the expression to uint
.
What happens is, when you derefence a part of the string by using the []
operator, you fetch a char
. Because shift operators for char
do not exist, the value will be upgraded implicitly to int
(upgrading is no problem, because there is no risk of loss of accuracy). So this part (as the others as well):
(string_0[1] << 8)
returns an int
.