开发者

Does anybody know what a zbook file is? Or how I can open it?

开发者 https://www.devze.com 2023-03-22 17:35 出处:网络
I heard that it is a sqlite table just zipped up, but I cannot find anyway to open it up and access it contents. The file I\'m needing to crack open is a book, an开发者_高级运维d it\'s filename is boo

I heard that it is a sqlite table just zipped up, but I cannot find anyway to open it up and access it contents. The file I'm needing to crack open is a book, an开发者_高级运维d it's filename is book.zbook...

If you have any ideas, let me know please!


I've never worked with zbook files before, but I do have a fair bit of experience with "just compressed" file formats and SQLite and you're in luck. They could've been using the commercial SQLite Compressed and Encrypted Read-Only Database (CEROD) extension, but they're not.

.zbook is an SQLite3 database packed by raw zlib compression. (Gzip without a header, basically)

Here's some minimal code to unpack it in Python:

import zlib

infile = open('AntiguoTestamento.zbook', 'rb')
outfile = open('AntiguoTestamento.sqlite3', 'wb')

outfile.write(zlib.decompress(infile.read()))

infile.close()
outfile.close()

I'm actually a bit surprised at that. "Just zipped up" usually means the base format of the file is XML or HTML or something custom like bytecode or binary blobs since SQLite isn't really designed to be loaded from an archive that way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号