ME3LibWV.PCCPackage.ReadExportTable C# (CSharp) Method

ReadExportTable() private method

private ReadExportTable ( ) : void
return void
        private void ReadExportTable()
        {
            try
            {
                DebugLog.PrintLn("Reading Export Table...");
                Exports = new List<ExportEntry>();
                if (GeneralInfo.compressed)
                {
                    UncompressRange(Header._offsetCompFlagEnd + 0xC, Header.HeaderLength - (Header._offsetCompFlagEnd + 0xC));
                    Header.DeCompBuffer.Seek(Header.ExportOffset, 0);
                    for (int i = 0; i < Header.ExportCount; i++)
                    {
                        ExportEntry e = new ExportEntry();
                        e.idxClass = ReadInt(Header.DeCompBuffer);
                        e.idxParent = ReadInt(Header.DeCompBuffer);
                        e.idxLink = ReadInt(Header.DeCompBuffer);
                        e.idxName = ReadInt(Header.DeCompBuffer);
                        e.Index = ReadInt(Header.DeCompBuffer);
                        e.idxArchetype = ReadInt(Header.DeCompBuffer);
                        e.Unk1 = ReadInt(Header.DeCompBuffer);
                        e.ObjectFlags = ReadInt(Header.DeCompBuffer);
                        e.Datasize = ReadInt(Header.DeCompBuffer);
                        e.Dataoffset = ReadInt(Header.DeCompBuffer);
                        long pos = Header.DeCompBuffer.Position;
                        if (!GeneralInfo.loadfull)
                            e.DataLoaded = false;
                        else
                        {
                            e.Data = GetObjectData(e.Dataoffset, e.Datasize);
                            e.DataLoaded = true;
                        }
                        Header.DeCompBuffer.Seek(pos, 0);
                        e.Unk2 = ReadInt(Header.DeCompBuffer);
                        int count = ReadInt(Header.DeCompBuffer);
                        e.Unk3 = new int[count];
                        for (int j = 0; j < count; j++)
                            e.Unk3[j] = ReadInt(Header.DeCompBuffer);
                        e.Unk4 = ReadInt(Header.DeCompBuffer);
                        e.Unk5 = ReadInt(Header.DeCompBuffer);
                        e.Unk6 = ReadInt(Header.DeCompBuffer);
                        e.Unk7 = ReadInt(Header.DeCompBuffer);
                        e.Unk8 = ReadInt(Header.DeCompBuffer);
                        Exports.Add(e);
                    }
                }
                else
                {
                    Source.Seek(Header.ExportOffset, 0);
                    for (int i = 0; i < Header.ExportCount; i++)
                    {
                        ExportEntry e = new ExportEntry();
                        e.idxClass = ReadInt(Source);
                        e.idxParent = ReadInt(Source);
                        e.idxLink = ReadInt(Source);
                        e.idxName = ReadInt(Source);
                        e.Index = ReadInt(Source);
                        e.idxArchetype = ReadInt(Source);
                        e.Unk1 = ReadInt(Source);
                        e.ObjectFlags = ReadInt(Source);
                        e.Datasize = ReadInt(Source);
                        e.Dataoffset = ReadInt(Source);
                        long pos = Source.Position;
                        if (!GeneralInfo.loadfull)
                            e.DataLoaded = false;
                        else
                        {
                            e.Data = GetObjectData(e.Dataoffset, e.Datasize);
                            e.DataLoaded = true;
                        }
                        Source.Seek(pos, 0);
                        e.Unk2 = ReadInt(Source);
                        int count = ReadInt(Source);
                        e.Unk3 = new int[count];
                        for (int j = 0; j < count; j++)
                            e.Unk3[j] = ReadInt(Source);
                        e.Unk4 = ReadInt(Source);
                        e.Unk5 = ReadInt(Source);
                        e.Unk6 = ReadInt(Source);
                        e.Unk7 = ReadInt(Source);
                        e.Unk8 = ReadInt(Source);
                        Exports.Add(e);
                    }
                }
                DebugLog.PrintLn("Done.");
            }
            catch (Exception ex)
            {
                DebugLog.PrintLn("PCCPACKAGE::READEXPORTTABLE ERROR:\n" + ex.Message);
            }
        }