Skip to content

Extract contents of the proprietary Clearwell .BAK file format

License

Notifications You must be signed in to change notification settings

jankais3r/Clearwell-backup-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clearwell backup extractor

Extract contents of the proprietary Clearwell (Veritas) .BAK file format

exbak.py - Script to extract .BAK files

Demo

format.ksy - Kaitai Struct format definition

If you want to interactively inspect the file format structure using Kaitai Web IDE, you first need to inflate the .BAK files.

You can use the following code to do that:

import os
import zlib

folder_path = '\path\to\folder\with\BAK files'

for file in os.listdir(os.path.abspath(folder_path)):
	filename = os.path.basename(file)
	if filename.endswith('.bak'): 
		print('Processing ' + filename)
		with open(os.path.join(folder_path, filename), 'rb') as f:
			hexdata = f.read().hex()
		deflated_hex = hexdata[hexdata.find('2e62616b7801')+12:] # remove .BAK file header (everything up to '.bakx.' in hex)
		deflated_bytes = bytes.fromhex(deflated_hex)
		inflated_bytes = zlib.decompress(deflated_bytes, -15) # inflate the rest of the file in the 'no headers' mode
		with open(os.path.join(folder_path, filename)[:-4] + '.dat', 'wb') as f:
			f.write(inflated_bytes)

File format diagram

Format

About

Extract contents of the proprietary Clearwell .BAK file format

Topics

Resources

License

Stars

Watchers

Forks