/* get a big endian word (32bits) from a pointer 
Caller should ensure parameters are valid. */
uint32_t BytesGetBe32(const void *ptr)
/* get a big endian word (32bits) from a pointer 
Caller should ensure parameters are valid. */
uint32_t BytesGetBe32(const void *ptr)
{
    const uint8_t *p = (const uint8_t *)ptr;
    return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}