public void FixChannels(string BRSTMPath, int amount) { BinaryReader br = new BinaryReader(File.Open(BRSTMPath, FileMode.Open), Encoding.ASCII); const string Magic = "DATA"; int position = 0; for (int i = 0; i < br.BaseStream.Length; i += 4) { if (new String(br.ReadChars(4)) == Magic) //if we find the magic we can stop and we have our position { position = i + 4; br.Dispose(); br.Close(); break; } } BigEndianReader ber = new BigEndianReader(File.Open(BRSTMPath, FileMode.Open)); ber.BaseStream.Seek(position, SeekOrigin.Begin); uint value = ber.ReadUInt32() + 0x20; ber.Dispose(); ber.Close(); BigEndianWriter bw = new BigEndianWriter(File.Open(BRSTMPath, FileMode.Open)); bw.Seek(position, SeekOrigin.Begin); bw.Write(value); bw.Flush(); bw.Close(); BRSTMPath = '"' + BRSTMPath + '"'; //fix path DecodeBRSTM brstm = new DecodeBRSTM(); brstm.DecodeBRSTMDSP(BRSTMPath, amount); //pass value }