memcpy

Have you tried a simple cast?

memcpy(buffer, (char *)cube, CUBE_BYTES);