Casting unsigned char * pointers to uint32_t * may cause wrong results if the pointers are not correctly aligned. Instead, build up the big-endian values from each byte with multiple dereferences of the original pointer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>