[PATCH v4 33/44] sandbox: Move reading the RAM buffer into a better place