# Path: dtformats/amcache.py
# class WindowsAMCacheFile(data_format.BinaryDataFile):
#   _APPLICATION_KEY_DESCRIPTIONS = {
#       'ProgramId': 'Program identifier',
#       'ProgramInstanceId': 'Program instance identifier'}
#   _APPLICATION_FILE_KEY_DESCRIPTIONS = {}
#   _FILE_REFERENCE_KEY_DESCRIPTIONS = {
#       '0': 'Product name',
#       '1': 'Company name',
#       '3': 'Language code',
#       '5': 'File version',
#       '6': 'File size',
#       '7': 'PE/COFF image size',
#       '9': 'PE/COFF checksum',
#       'c': 'File description',
#       'd': 'PE/COFF image version',
#       'f': 'PE/COFF compilation time',
#       '11': 'File modification time',
#       '12': 'File creation time',
#       '15': 'Path',
#       '100': 'Program identifier',
#       '101': 'SHA-1'}
#   _PROGRAM_KEY_DESCRIPTIONS = {
#       '0': 'Name',
#       '1': 'Version',
#       '2': 'Publisher',
#       '3': 'Language code',
#       '6': 'Installation method',
#       '7': 'Uninstallation key paths',
#       'a': 'Installation time',
#       'b': 'Uninstallation time',
#       'd': 'Installation directories',
#       'Files': 'File reference key identifiers'}
#   _ROOT_KEY_NAMES = frozenset([
#       '{11517b7c-e79d-4e20-961b-75a811715add}',
#       '{356c48f6-2fee-e7ef-2a64-39f59ec3be22}'])
#   def _GetValueDataAsObject(self, value):
#   def _ReadApplicationFileKey(self, application_file_key):
#   def _ReadApplicationKey(self, application_key):
#   def _ReadFileKey(self, file_key):
#   def _ReadFileReferenceKey(self, file_reference_key):
#   def _ReadInventoryApplicationFileKey(self, inventory_application_file_key):
#   def _ReadInventoryApplicationKey(self, inventory_application_key):
#   def _ReadProgramKey(self, program_key):
#   def _ReadProgramsKey(self, programs_key):
#   def ReadFileObject(self, file_object):
# 
# Path: dtformats/output_writers.py
# class OutputWriter(object):
# class StdoutWriter(OutputWriter):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):


import argparse
import logging
import sys
from dtformats import amcache
from dtformats import output_writers

  argument_parser.add_argument(
      '-d', '--debug', dest='debug', action='store_true', default=False,
      help='enable debug output.')

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='PATH',
      default=None, help='path of the Amcache.hve file.')

  options = argument_parser.parse_args()

  if not options.source:
    print('Source file missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = output_writers.StdoutWriter()

  try:
    output_writer.Open()
  except IOError as exception:
    print('Unable to open output writer with error: {0!s}'.format(exception))
    print('')
    return False


# Path: dtformats/amcache.py
# class WindowsAMCacheFile(data_format.BinaryDataFile):
#   _APPLICATION_KEY_DESCRIPTIONS = {
#       'ProgramId': 'Program identifier',
#       'ProgramInstanceId': 'Program instance identifier'}
#   _APPLICATION_FILE_KEY_DESCRIPTIONS = {}
#   _FILE_REFERENCE_KEY_DESCRIPTIONS = {
#       '0': 'Product name',
#       '1': 'Company name',
#       '3': 'Language code',
#       '5': 'File version',
#       '6': 'File size',
#       '7': 'PE/COFF image size',
#       '9': 'PE/COFF checksum',
#       'c': 'File description',
#       'd': 'PE/COFF image version',
#       'f': 'PE/COFF compilation time',
#       '11': 'File modification time',
#       '12': 'File creation time',
#       '15': 'Path',
#       '100': 'Program identifier',
#       '101': 'SHA-1'}
#   _PROGRAM_KEY_DESCRIPTIONS = {
#       '0': 'Name',
#       '1': 'Version',
#       '2': 'Publisher',
#       '3': 'Language code',
#       '6': 'Installation method',
#       '7': 'Uninstallation key paths',
#       'a': 'Installation time',
#       'b': 'Uninstallation time',
#       'd': 'Installation directories',
#       'Files': 'File reference key identifiers'}
#   _ROOT_KEY_NAMES = frozenset([
#       '{11517b7c-e79d-4e20-961b-75a811715add}',
#       '{356c48f6-2fee-e7ef-2a64-39f59ec3be22}'])
#   def _GetValueDataAsObject(self, value):
#   def _ReadApplicationFileKey(self, application_file_key):
#   def _ReadApplicationKey(self, application_key):
#   def _ReadFileKey(self, file_key):
#   def _ReadFileReferenceKey(self, file_reference_key):
#   def _ReadInventoryApplicationFileKey(self, inventory_application_file_key):
#   def _ReadInventoryApplicationKey(self, inventory_application_key):
#   def _ReadProgramKey(self, program_key):
#   def _ReadProgramsKey(self, programs_key):
#   def ReadFileObject(self, file_object):
# 
# Path: dtformats/output_writers.py
# class OutputWriter(object):
# class StdoutWriter(OutputWriter):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):


# Path: scripts/amcache.py
import argparse
import logging
import sys
from dtformats import amcache
from dtformats import output_writers


  argument_parser.add_argument(
      '-d', '--debug', dest='debug', action='store_true', default=False,
      help='enable debug output.')

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='PATH',
      default=None, help='path of the Amcache.hve file.')

  options = argument_parser.parse_args()

  if not options.source:
    print('Source file missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = output_writers.StdoutWriter()

  try:
    output_writer.Open()
  except IOError as exception:
    print('Unable to open output writer with error: {0!s}'.format(exception))
    print('')
    return False


  amcache_file = amcache.WindowsAMCacheFile(