-
-
[原创]逆向iReader解读ebk2电子书格式
-
发表于:
2012-11-10 22:50
28794
-
===========================================================
+-------+---+-----------------------------+
|0 - 3 |4 | book_id |
+-------+---+-----------------------------+
|4 - 5 |2 | head_data_size |
+-------+---+-----------------------------+
|6 - 7 |2 | ebk_version |
+-------+---+-----------------------------+
|8 -11 |4 | ebk_size |
+-------+---+-----------------------------+
|12-75 |64 | book_name |
+-------+---+-----------------------------+
|76-79 |4 | file_size |
+-------+---+-----------------------------+
|80-83 |4 | head_compress_size |
+-------+---+-----------------------------+
|84-87 |4 | first_compress_block_size |
+-------+---+-----------------------------+
|88-89 |2 | chapter_count |
+-------+---+-----------------------------+
|90-91 |2 | compress_block_count |
+-------+---+-----------------------------+
|92-95 |4 | media_count |
+-------+---+-----------------------------+
|96-99 |4 | media_data_length |
+-------+---+-----------------------------+
|100-103|4 | txt_compress_size |
+-------+---+-----------------------------+
└─[$] <> xxd -l104 《白鹿原》.ebk2
0000000: 0000 0000 6800 0200 6636 0900 0a30 7d76 ....h...f6...0}v
0000010: 7f9e 9f53 0b30 0000 0000 0000 0000 0000 ...S.0..........
0000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000040: 0000 0000 0000 0000 0000 0000 f036 0e00 .............6..
0000050: 9502 0000 0bab 0000 3000 0f00 0000 0000 ........0.......
0000060: 0000 0000 6933 0900 ....i3..
└─[$] <> ll 《白鹿原》.ebk2
-rwxrwxrwx 2 root root 603750 Oct 25 08:39 《白鹿原》.ebk2*
0a30 7d76 ....h...f6...0}v
0000010: 7f9e 9f53 0b30 0000 0000 0000 0000 0000 ...S.0..........
0000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000040: 0000 0000 0000 0000 0000 0000
└─[$] <> ll 《白鹿原》.ebk2.txt
-rwxrwxrwx 1 root root 931570 Nov 3 16:57 《白鹿原》.ebk2.txt*
+-------+---+-----------------------------+----------------------------------------+
|0 - 3 |4 | book_id |一般为全0 |
+-------+---+-----------------------------+----------------------------------------+
|4 - 5 |2 | head_data_size |ebk2文件的head大小,一般为104字节 |
+-------+---+-----------------------------+----------------------------------------+
|6 - 7 |2 | ebk_version |ebk文件的版本 |
+-------+---+-----------------------------+----------------------------------------+
|8 -11 |4 | ebk_size |ebk2文件大小 |
+-------+---+-----------------------------+----------------------------------------+
|12-75 |64 | book_name |书名 |
+-------+---+-----------------------------+----------------------------------------+
|76-79 |4 | file_size |解压后txt文件的大小(包括章节名和内容) |
+-------+---+-----------------------------+----------------------------------------+
|80-83 |4 | head_compress_size |章节信息索引表的大小(压缩后的) |
+-------+---+-----------------------------+----------------------------------------+
|84-87 |4 | first_compress_block_size |第一个压缩块的大小 |
+-------+---+-----------------------------+----------------------------------------+
|88-89 |2 | chapter_count |章节数 |
+-------+---+-----------------------------+----------------------------------------+
|90-91 |2 | compress_block_count |小说内容压缩段的数量 |
+-------+---+-----------------------------+----------------------------------------+
|92-95 |4 | media_count |媒体数量 |
+-------+---+-----------------------------+----------------------------------------+
|96-99 |4 | media_data_length |媒体数据长度 |
+-------+---+-----------------------------+----------------------------------------+
|100-103|4 | txt_compress_size |压缩后的小说正文内容大小 |
+-------+---+-----------------------------+----------------------------------------+
struct ebk_chapter_info_tag
{
unsinged char chapter_name[大小未知];
unsigned int length;
unsigned int offset;
};
struct ebk_compress_block_data_tag
{
unsigned int length;
unsigned int offset;
};
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!