diff --git a/tsk/auto/auto_db.cpp b/tsk/auto/auto_db.cpp index 538395d40aea72868f9413fd0dd31a3bb20dd73b..cd38ebff5f58fc1d0ff97fb03b36b465a24c49c4 100644 --- a/tsk/auto/auto_db.cpp +++ b/tsk/auto/auto_db.cpp @@ -20,6 +20,9 @@ #if HAVE_LIBVMDK #include "tsk/img/vmdk.h" #endif +#if HAVE_LIBVHDI +#include "tsk/img/vhd.h" +#endif #include <string.h> #include <algorithm> diff --git a/tsk/img/img_open.c b/tsk/img/img_open.c index 2594bb72e5975d8e5bea21aebe23b84c74d328f2..090bf883a2919ff899872cfaee92acec6a30f482 100644 --- a/tsk/img/img_open.c +++ b/tsk/img/img_open.c @@ -31,6 +31,9 @@ typedef int bool; #include "vmdk.h" #endif +#if HAVE_LIBVHDI +#include "vhd.h" +#endif /** * \ingroup imglib @@ -117,7 +120,7 @@ tsk_img_open(int num_img, */ if (type == TSK_IMG_TYPE_DETECT) { TSK_IMG_INFO *img_set = NULL; -#if HAVE_LIBAFFLIB || HAVE_LIBEWF || HAVE_LIBVMDK +#if HAVE_LIBAFFLIB || HAVE_LIBEWF || HAVE_LIBVMDK || HAVE_LIBVHDI char *set = NULL; #endif @@ -186,6 +189,26 @@ tsk_img_open(int num_img, } #endif +#if HAVE_LIBVHDI + if ((img_info = vhdi_open(num_img, images, a_ssize)) != NULL) { + if (set == NULL) { + set = "VHD"; + img_set = img_info; + } + else { + img_set->close(img_set); + img_info->close(img_info); + tsk_error_reset(); + tsk_error_set_errno(TSK_ERR_IMG_UNKTYPE); + tsk_error_set_errstr("VHD or %s", set); + return NULL; + } + } + else { + tsk_error_reset(); + } +#endif + // if any of the non-raw formats were detected, then use it. if (img_set != NULL) return img_set;