private void Init(Stream input) { using (var br = new BinaryReader(input)) { Header.Read(br); if (!Functions.CompareBytes(Header.Magic, new byte[] { 0, 0x50, 0x53, 0x46 })) { throw new Exception("Invalid PARAM.SFO Header Magic"); } var tables = new List <Index_table>(); for (var i = 0; i < Header.IndexTableEntries; i++) { var t = new Index_table(); t.Read(br); tables.Add(t); } var xtables = new List <Table>(); var count = 0; foreach (var t in tables) { var x = new Table { index = count, Indextable = t, Name = ReadName(br, t), Value = ReadValue(br, t) }; count++; xtables.Add(x); } Tables = xtables.ToArray(); br.Close(); } }