#!/usr/bin/env sh

set -e

echo "creddump7 - Python tool to extract credentials and secrets from Windows registry hives"
cd /usr/share/creddump7
tree -L 1 --noreport /usr/share/creddump7

## Check to see if last location is where we want to end up
## If its not, spawn a new shell (sub shell), so to "move" with "cd"
## This isn't ideal, but best option for the time being (rather keep everything in parent shell)
if [ "${OLDPWD}" != "${location}" ]; then
  ## From kali-menu: exec-in-shell
  USER=${USER:-$(whoami)}
  SHELL=${SHELL:-$(getent passwd $USER|cut -d: -f7)}
  ${SHELL:-bash} -i
fi
