public static RageArchiveWrapper7 Open(Stream stream, string fileName, bool leaveOpen = false) { var arch = new RageArchiveWrapper7(stream, fileName, leaveOpen); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var tmp1 = GTA5Hash.CalculateHash(arch.FileName); var tmp2 = (tmp1 + (uint)stream.Length + (101 - 40)) % 0x65; arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[tmp2]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return(arch); } catch { arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Open(Stream stream, string fileName, bool leaveOpen = false) { var arch = new RageArchiveWrapper7(stream, fileName, leaveOpen); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var indexKey = GTA5Crypto.GetKeyIndex(arch.FileName, (uint)stream.Length); arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[indexKey]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return(arch); } catch { arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Open(string fileName) { var finfo = new FileInfo(fileName); var fs = new FileStream(fileName, FileMode.Open); var arch = new RageArchiveWrapper7(fs, finfo.Name, false); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var tmp1 = GTA5Hash.CalculateHash(arch.FileName); var tmp2 = (tmp1 + (uint)finfo.Length + (101 - 40)) % 0x65; arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[tmp2]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return(arch); } catch { fs.Dispose(); arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Open(string fileName) { var finfo = new FileInfo(fileName); var fs = new FileStream(fileName, FileMode.Open); var arch = new RageArchiveWrapper7(fs, finfo.Name, false); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var indexKey = GTA5Crypto.GetKeyIndex(arch.FileName, (uint)finfo.Length); arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[indexKey]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return(arch); } catch { fs.Dispose(); arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Create(Stream stream, string fileName, bool leaveOpen = false) { var arch = new RageArchiveWrapper7(stream, fileName, leaveOpen); var rootD = new RageArchiveDirectory7(); rootD.Name = ""; arch.archive_.Root = rootD; // arch.archive_.WriteHeader(); // write... return(arch); }
///////////////////////////////////////////////////////////////////////////// // static functions ///////////////////////////////////////////////////////////////////////////// public static RageArchiveWrapper7 Create(string fileName) { var finfo = new FileInfo(fileName); var fs = new FileStream(fileName, FileMode.Create); var arch = new RageArchiveWrapper7(fs, finfo.Name, false); var rootD = new RageArchiveDirectory7(); rootD.Name = ""; arch.archive_.Root = rootD; // arch.archive_.WriteHeader(); // write... return(arch); }
public void Dispose() { this.archiveWrapper = null; this.directory = null; }
internal RageArchiveDirectoryWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveDirectory7 directory) { this.archiveWrapper = archiveWrapper; this.directory = directory; }
internal RageArchiveBinaryFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveBinaryFile7 file) { this.archiveWrapper = archiveWrapper; this.file = file; }
public static RageArchiveWrapper7 Open(Stream stream, string fileName, bool leaveOpen = false) { var arch = new RageArchiveWrapper7(stream, fileName, leaveOpen); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var tmp1 = GTA5Hash.CalculateHash(arch.FileName); var tmp2 = (tmp1 + (uint)stream.Length + (101 - 40)) % 0x65; arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[tmp2]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return arch; } catch { arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Open(string fileName) { var finfo = new FileInfo(fileName); var fs = new FileStream(fileName, FileMode.Open); var arch = new RageArchiveWrapper7(fs, finfo.Name, false); try { if (GTA5Constants.PC_LUT != null && GTA5Constants.PC_NG_KEYS != null) { // calculate key... var tmp1 = GTA5Hash.CalculateHash(arch.FileName); var tmp2 = (tmp1 + (uint)finfo.Length + (101 - 40)) % 0x65; arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, GTA5Constants.PC_NG_KEYS[tmp2]); // read... } else { arch.archive_.ReadHeader(GTA5Constants.PC_AES_KEY, null); // read... } return arch; } catch { fs.Dispose(); arch.Dispose(); throw; } }
public static RageArchiveWrapper7 Create(Stream stream, string fileName, bool leaveOpen = false) { var arch = new RageArchiveWrapper7(stream, fileName, leaveOpen); var rootD = new RageArchiveDirectory7(); rootD.Name = ""; arch.archive_.Root = rootD; // arch.archive_.WriteHeader(); // write... return arch; }
///////////////////////////////////////////////////////////////////////////// // static functions ///////////////////////////////////////////////////////////////////////////// public static RageArchiveWrapper7 Create(string fileName) { var finfo = new FileInfo(fileName); var fs = new FileStream(fileName, FileMode.Create); var arch = new RageArchiveWrapper7(fs, finfo.Name, false); var rootD = new RageArchiveDirectory7(); rootD.Name = ""; arch.archive_.Root = rootD; // arch.archive_.WriteHeader(); // write... return arch; }
internal RageArchiveResourceFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveResourceFile7 file) { this.archiveWrapper = archiveWrapper; this.file = file; }