read mgc from binary file