سؤال

I'm trying to reverse some pointers that were read from a binary encoded file.

When I try to reverse the pointer 0xfffe0024540 stored in big endian format, I get 0xffffffffe0024540

The pointer is stored in the file in the format: 0000 ff0f 02e0 4045

هل كانت مفيدة؟

المحلول

The behaviour of right-shifting a negative signed integer is implementation dependent, as far as I remember. You should replace long by unsigned long or uint64_t.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top