-
Notifications
You must be signed in to change notification settings - Fork 30
Development
Joachim Metz edited this page Sep 11, 2016
·
4 revisions
import pyvhdi
pyvhdi.get_version()
import pyvhdi
vhdi_file = pyvhdi.file()
vhdi_file.open("image.vhd")
vhdi_file.close()
The explicit call to vhdi_file.close() is not required.
import pyvhdi
file_object = open("image.vhd", "rb")
vhdi_file = pyvhdi.file()
vhdi_file.open_file_object(file_object)
vhdi_file.close()
The explicit call to vhdi_file.close() is not required.
import pyvhdi
import pytsk3
class vhdi_Img_Info(pytsk3.Img_Info):
def __init__(self, vhdi_file):
self._vhdi_file = vhdi_file
super(vhdi_Img_Info, self).__init__(
url="", type=pytsk3.TSK_IMG_TYPE_EXTERNAL)
def close(self):
self._vhdi_file.close()
def read(self, offset, size):
self._vhdi_file.seek(offset)
return self._vhdi_file.read(size)
def get_size(self):
return self._vhdi_file.get_media_size()
vhdi_file = pyvhdi.file()
vhdi_file.open("image.vhd")
img_info = vhdi_Img_Info(vhdi_file)
fs_info = pytsk3.FS_Info(img_info, offset=63 * 512)
import pyvhdi
help(pyvhdi)
help(pyvhdi.file)