memread and memcpy now both work