public bool ReadUTF(EndianReader br) { var offset = br.BaseStream.Position; if (tools.ReadCString(br, 4) != "@UTF") { return(false); } table_size = br.ReadInt32(); rows_offset = br.ReadInt32(); strings_offset = br.ReadInt32(); data_offset = br.ReadInt32(); rows_offset += offset + 8; strings_offset += offset + 8; data_offset += offset + 8; table_name = br.ReadInt32(); num_columns = br.ReadInt16(); row_length = br.ReadInt16(); num_rows = br.ReadInt32(); columns = new List <COLUMN>(); COLUMN column; for (var i = 0; i < num_columns; i++) { column = new COLUMN { flags = br.ReadByte() }; if (column.flags == 0) { br.BaseStream.Seek(3, SeekOrigin.Current); column.flags = br.ReadByte(); } column.name = tools.ReadCString(br, -1, br.ReadInt32() + strings_offset); columns.Add(column); } rows = new List <ROWS>(); ROWS current_entry; ROW current_row; int storage_flag; for (var j = 0; j < num_rows; j++) { br.BaseStream.Seek(rows_offset + j * row_length, SeekOrigin.Begin); current_entry = new ROWS(); for (var i = 0; i < num_columns; i++) { current_row = new ROW(); storage_flag = columns[i].flags & (int)COLUMN_FLAGS.STORAGE_MASK; switch (storage_flag) { case (int)COLUMN_FLAGS.STORAGE_NONE: current_entry.rows.Add(current_row); continue; case (int)COLUMN_FLAGS.STORAGE_ZERO: current_entry.rows.Add(current_row); continue; case (int)COLUMN_FLAGS.STORAGE_CONSTANT: current_entry.rows.Add(current_row); continue; } current_row.type = columns[i].flags & (int)COLUMN_FLAGS.TYPE_MASK; current_row.position = br.BaseStream.Position; switch (current_row.type) { case 0: case 1: current_row.uint8 = br.ReadByte(); break; case 2: case 3: current_row.uint16 = br.ReadUInt16(); break; case 4: case 5: current_row.uint32 = br.ReadUInt32(); break; case 6: case 7: current_row.uint64 = br.ReadUInt64(); break; case 8: current_row.ufloat = br.ReadSingle(); break; case 0xA: current_row.str = tools.ReadCString(br, -1, br.ReadInt32() + strings_offset); break; case 0xB: var position = br.ReadInt32() + data_offset; current_row.position = position; current_row.data = tools.GetData(br, position, br.ReadInt32()); break; default: throw new NotImplementedException(); } current_entry.rows.Add(current_row); } rows.Add(current_entry); } return(true); }