Stephen J.
Stephen J.

Reputation: 3127

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

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, and it's filename is book.zbook...

If you have any ideas, let me know please!

Upvotes: 10

Views: 730

Answers (1)

ssokolow
ssokolow

Reputation: 15345

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.

Upvotes: 13

Related Questions