示例#1
0
        private List <ChapterListModel> GetChapterList(int chaptercount, int headlenth, byte[] buff, int key)
        {
            List <ChapterListModel> list          = new List <ChapterListModel>();
            ChapterListStruct       blockFileList = new ChapterListStruct();
            int num = 0;

            for (int i = 0; i < chaptercount; i++)
            {
                ChapterListModel model = new ChapterListModel();
                byte[]           buffs = new byte[0x18];
                Array.Copy(buff, num, buffs, 0, buffs.Length);
                byte[] data = new byte[4];
                Array.Copy(buffs, 12, data, 0, 4);
                Array.Copy(this.ebk3_data.pbk_sys_data_decode(data, key), 0, buffs, 12, 4);
                blockFileList                             = new ByteToStructEbk3().GetBlockFileList(buffs);
                model.chapter_index1                      = blockFileList.chapter_index1;
                model.chapter_level2                      = blockFileList.chapter_level2;
                model.chapter_data_type3                  = blockFileList.chapter_data_type3;
                model.chapter_data_block_offset4          = blockFileList.chapter_data_block_offset4;
                model.chapter_content_decompresss_offset5 = blockFileList.chapter_content_decompresss_offset5;
                model.chapter_content_decompress_length6  = blockFileList.chapter_content_decompress_length6;
                model.chapter_name_length7                = blockFileList.chapter_name_length7;
                byte[] buffer3 = new byte[model.chapter_name_length7];
                Array.Copy(buff, num + buffs.Length, buffer3, 0, buffer3.Length);
                model.chapter_name_data8 = Encoding.Unicode.GetString(this.ebk3_data.pbk_sys_data_decode(buffer3, key), 0, buffer3.Length);
                num += buffs.Length + buffer3.Length;
                list.Add(model);
            }
            return(list);
        }
示例#2
0
        public ChapterListStruct GetBlockFileList(byte[] buffs)
        {
            ChapterListStruct struct2 = new ChapterListStruct();
            int offset = 0;

            struct2.chapter_name_length7                = (uint)GetInt32(4, ref offset, buffs);
            struct2.chapter_index1                      = (uint)GetInt32(4, ref offset, buffs);
            struct2.chapter_level2                      = (ushort)GetInt16(2, ref offset, buffs);
            struct2.chapter_data_type3                  = (ushort)GetInt16(2, ref offset, buffs);
            struct2.chapter_data_block_offset4          = (uint)GetInt32(4, ref offset, buffs);
            struct2.chapter_content_decompresss_offset5 = (uint)GetInt32(4, ref offset, buffs);
            struct2.chapter_content_decompress_length6  = (uint)GetInt32(4, ref offset, buffs);
            return(struct2);
        }