# Path: dtformats/prefetch.py
# def CalculatePrefetchHashXP(path):
# def CalculatePrefetchHashVista(path):
# def CalculatePrefetchHash2008(path):


import argparse
import sys
from dtformats import prefetch
def Main():
  """The main program function.

  Returns:
    bool: True if successful or False if not.
  """
  argument_parser = argparse.ArgumentParser(description=(
      'Calculate Windows Prefetch hashes'))

  argument_parser.add_argument(
      'path', nargs='?', action='store', metavar='PATH',
      default=None, help='path to calculate the Prefetch hash of.')

  options = argument_parser.parse_args()

  if not options.path:
    print('Path missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  print('Windows Prefetch hashes:')

  hash_value = prefetch.CalculatePrefetchHashXP(options.path)
  print('\tWindows XP\t: 0x{0:08x}'.format(hash_value))

  hash_value = prefetch.CalculatePrefetchHashVista(options.path)
  print('\tWindows Vista\t: 0x{0:08x}'.format(hash_value))


# Path: dtformats/prefetch.py
# def CalculatePrefetchHashXP(path):
# def CalculatePrefetchHashVista(path):
# def CalculatePrefetchHash2008(path):


# Path: scripts/prefetch_hash.py
import argparse
import sys
from dtformats import prefetch

def Main():
  """The main program function.

  Returns:
    bool: True if successful or False if not.
  """
  argument_parser = argparse.ArgumentParser(description=(
      'Calculate Windows Prefetch hashes'))

  argument_parser.add_argument(
      'path', nargs='?', action='store', metavar='PATH',
      default=None, help='path to calculate the Prefetch hash of.')

  options = argument_parser.parse_args()

  if not options.path:
    print('Path missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  print('Windows Prefetch hashes:')

  hash_value = prefetch.CalculatePrefetchHashXP(options.path)
  print('\tWindows XP\t: 0x{0:08x}'.format(hash_value))

  hash_value = prefetch.CalculatePrefetchHashVista(options.path)
  print('\tWindows Vista\t: 0x{0:08x}'.format(hash_value))


  hash_value = prefetch.CalculatePrefetchHash2008(options.path)