private void ExtractFile(byte[] key, string path, string name) { try { if (config.OnlineMode) { throw new Exception(); } var idxInfo = GetLocalIndexInfo(key); if (idxInfo == null) { throw new Exception("local index missing"); } var stream = GetDataStream(idxInfo.Index); stream.Position = idxInfo.Offset; stream.Position += 30; //byte[] unkHash = reader.ReadBytes(16); //int __size = reader.ReadInt32(); //byte[] unkData1 = reader.ReadBytes(2); //byte[] unkData2 = reader.ReadBytes(8); using (BLTEHandler blte = new BLTEHandler(stream, idxInfo.Size - 30)) { blte.ExtractToFile(path, name); } } catch { if (key.EqualsTo(config.EncodingKey)) { int len; using (Stream s = cdn.OpenDataFileDirect(key, out len)) using (BLTEHandler blte = new BLTEHandler(s, len)) { blte.ExtractToFile(path, name); } } else { var idxInfo = cdn.GetCDNIndexInfo(key); if (idxInfo == null) { throw new Exception("CDN index missing"); } using (Stream s = cdn.OpenDataFile(key)) using (BLTEHandler blte = new BLTEHandler(s, idxInfo.Size)) { blte.ExtractToFile(path, name); } } } }
private Stream OpenFileLocal(byte[] key) { Stream stream = GetLocalDataStream(key); using (BLTEHandler blte = new BLTEHandler(stream, key)) { return(blte.OpenFile(true)); } }
private void ExtractFileLocal(byte[] key, string path, string name) { Stream stream = GetLocalDataStream(key); using (BLTEHandler blte = new BLTEHandler(stream, key)) { blte.ExtractToFile(path, name); } }
private Stream OpenFile(byte[] key) { try { if (OnlineMode) { throw new Exception(); } var idxInfo = GetLocalIndexInfo(key); if (idxInfo == null) { throw new Exception("local index missing"); } var stream = GetDataStream(idxInfo.Index); stream.Position = idxInfo.Offset; stream.Position += 30; //byte[] unkHash = reader.ReadBytes(16); //int __size = reader.ReadInt32(); //byte[] unkData1 = reader.ReadBytes(2); //byte[] unkData2 = reader.ReadBytes(8); using (BLTEHandler blte = new BLTEHandler(stream, idxInfo.Size - 30)) return(blte.OpenFile()); } catch { if (key.EqualsTo(CASCConfig.EncodingKey)) { using (Stream s = CDNHandler.OpenDataFileDirect(key, out int len)) using (BLTEHandler blte = new BLTEHandler(s, len)) return(blte.OpenFile()); } else { var idxInfo = CDNHandler.GetCDNIndexInfo(key); if (idxInfo == null) { throw new Exception("CDN index missing"); } using (Stream s = CDNHandler.OpenDataFile(key)) using (BLTEHandler blte = new BLTEHandler(s, idxInfo.Size)) return(blte.OpenFile()); } } }
protected Stream OpenFileLocalInternal(IndexEntry idxInfo, MD5Hash key) { if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return(blte.OpenFile(true)); } } else { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return(blte.OpenFile(true)); } } }
protected void ExtractFileOnlineInternal(IndexEntry idxInfo, MD5Hash key, string path, string name) { if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } else { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } }
private Stream OpenFileOnline(byte[] key) { IndexEntry idxInfo = CDNIndex.GetIndexInfo(key); if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return(blte.OpenFile(true)); } } else { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return(blte.OpenFile(true)); } } }
private void ExtractFileOnline(byte[] key, string path, string name) { IndexEntry idxInfo = CDNIndex.GetIndexInfo(key); if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } else { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } }
private Stream OpenFileOnline(byte[] key) { IndexEntry idxInfo = CDNIndex.GetIndexInfo(key); if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return blte.OpenFile(true); } } else { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { return blte.OpenFile(true); } } }
private void ExtractFileLocal(byte[] key, string path, string name) { Stream stream = GetLocalIndexData(key); using (BLTEHandler blte = new BLTEHandler(stream, key)) { blte.ExtractToFile(path, name); } }
private void ExtractFileOnline(byte[] key, string path, string name) { IndexEntry idxInfo = CDNIndex.GetIndexInfo(key); if (idxInfo != null) { using (Stream s = CDNIndex.OpenDataFile(idxInfo)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } else { try { using (Stream s = CDNIndex.OpenDataFileDirect(key)) using (BLTEHandler blte = new BLTEHandler(s, key)) { blte.ExtractToFile(path, name); } } catch { throw new Exception("CDN index missing"); } } }
private Stream OpenFileLocal(byte[] key) { Stream stream = GetLocalIndexData(key); using (BLTEHandler blte = new BLTEHandler(stream, key)) { return blte.OpenFile(true); } }
private void ExtractFile(byte[] key, string path, string name) { try { if (config.OnlineMode) throw new Exception(); var idxInfo = GetLocalIndexInfo(key); if (idxInfo == null) throw new Exception("local index missing"); var stream = GetDataStream(idxInfo.Index); stream.Position = idxInfo.Offset; stream.Position += 30; //byte[] unkHash = reader.ReadBytes(16); //int __size = reader.ReadInt32(); //byte[] unkData1 = reader.ReadBytes(2); //byte[] unkData2 = reader.ReadBytes(8); using (BLTEHandler blte = new BLTEHandler(stream, idxInfo.Size - 30)) { blte.ExtractToFile(path, name); } } catch { if (key.EqualsTo(config.EncodingKey)) { int len; using (Stream s = cdn.OpenDataFileDirect(key, out len)) using (BLTEHandler blte = new BLTEHandler(s, len)) { blte.ExtractToFile(path, name); } } else { var idxInfo = cdn.GetCDNIndexInfo(key); if (idxInfo == null) throw new Exception("CDN index missing"); using (Stream s = cdn.OpenDataFile(key)) using (BLTEHandler blte = new BLTEHandler(s, idxInfo.Size)) { blte.ExtractToFile(path, name); } } } }
private Stream OpenFile(byte[] key) { try { if (OnlineMode) throw new Exception(); var idxInfo = GetLocalIndexInfo(key); if (idxInfo == null) throw new Exception("local index missing"); var stream = GetDataStream(idxInfo.Index); stream.Position = idxInfo.Offset; stream.Position += 30; //byte[] unkHash = reader.ReadBytes(16); //int __size = reader.ReadInt32(); //byte[] unkData1 = reader.ReadBytes(2); //byte[] unkData2 = reader.ReadBytes(8); using (BLTEHandler blte = new BLTEHandler(stream, idxInfo.Size - 30)) return blte.OpenFile(); } catch { if (key.EqualsTo(CASCConfig.EncodingKey)) { using (Stream s = CDNHandler.OpenDataFileDirect(key, out int len)) using (BLTEHandler blte = new BLTEHandler(s, len)) return blte.OpenFile(); } else { var idxInfo = CDNHandler.GetCDNIndexInfo(key); if (idxInfo == null) throw new Exception("CDN index missing"); using (Stream s = CDNHandler.OpenDataFile(key)) using (BLTEHandler blte = new BLTEHandler(s, idxInfo.Size)) return blte.OpenFile(); } } }