コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        /////////////////////////////////////////////////////////////////////////////
        // 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);
        }
コード例 #7
0
 public void Dispose()
 {
     this.archiveWrapper = null;
     this.directory      = null;
 }
コード例 #8
0
 internal RageArchiveDirectoryWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveDirectory7 directory)
 {
     this.archiveWrapper = archiveWrapper;
     this.directory      = directory;
 }
コード例 #9
0
 internal RageArchiveBinaryFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveBinaryFile7 file)
 {
     this.archiveWrapper = archiveWrapper;
     this.file = file;
 }
コード例 #10
0
 public void Dispose()
 {
     this.archiveWrapper = null;
     this.directory = null;
 }
コード例 #11
0
 internal RageArchiveDirectoryWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveDirectory7 directory)
 {
     this.archiveWrapper = archiveWrapper;
     this.directory = directory;
 }
コード例 #12
0
        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;
            }
        }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
        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;
        }
コード例 #15
0
        /////////////////////////////////////////////////////////////////////////////
        // 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;
        }
コード例 #16
0
 internal RageArchiveBinaryFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveBinaryFile7 file)
 {
     this.archiveWrapper = archiveWrapper;
     this.file           = file;
 }
コード例 #17
0
 internal RageArchiveResourceFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveResourceFile7 file)
 {
     this.archiveWrapper = archiveWrapper;
     this.file           = file;
 }
コード例 #18
0
 internal RageArchiveResourceFileWrapper7(RageArchiveWrapper7 archiveWrapper, RageArchiveResourceFile7 file)
 {
     this.archiveWrapper = archiveWrapper;
     this.file = file;
 }