# Path: dtformats/usn_journal.py
# class USNRecords(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('usn_journal.yaml')
#   _DEBUG_INFO_RECORD_V2 = [
#       ('size', 'Size', '_FormatIntegerAsDecimal'),
#       ('major_version', 'Major version', '_FormatIntegerAsDecimal'),
#       ('minor_version', 'Manor version', '_FormatIntegerAsDecimal'),
#       ('file_reference', 'File reference', '_FormatIntegerAsHexadecimal8'),
#       ('parent_file_reference', 'Parent file reference',
#        '_FormatIntegerAsHexadecimal8'),
#       ('timestamp', 'Timestamp', '_FormatIntegerAsFiletime'),
#       ('update_reason_flags', 'Update reason flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('update_source_flags', 'Update source flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('security_descriptor_entry', 'Security descriptor entry',
#        '_FormatIntegerAsDecimal'),
#       ('file_attribute_flags', 'File attribute flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('name_size', 'Name size', '_FormatIntegerAsDecimal'),
#       ('name_offset', 'Name offset', '_FormatIntegerAsDecimal'),
#       ('name', 'Name', '_FormatString')]
#   _EMPTY_USN_RECORD_HEADER = bytes([0] * 60)
#   def _ReadRecordV2(self, file_object):
#   def ReadFileObject(self, file_object):
#   def ReadRecords(self):
# 
# 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 usn_journal
from dtformats import output_writers

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

  Returns:
    bool: True if successful or False if not.
  """
  argument_parser = argparse.ArgumentParser(description=(
      'Extracts information from USN change journal records.'))

  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 USN change journal records.')

  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')


# Path: dtformats/usn_journal.py
# class USNRecords(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('usn_journal.yaml')
#   _DEBUG_INFO_RECORD_V2 = [
#       ('size', 'Size', '_FormatIntegerAsDecimal'),
#       ('major_version', 'Major version', '_FormatIntegerAsDecimal'),
#       ('minor_version', 'Manor version', '_FormatIntegerAsDecimal'),
#       ('file_reference', 'File reference', '_FormatIntegerAsHexadecimal8'),
#       ('parent_file_reference', 'Parent file reference',
#        '_FormatIntegerAsHexadecimal8'),
#       ('timestamp', 'Timestamp', '_FormatIntegerAsFiletime'),
#       ('update_reason_flags', 'Update reason flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('update_source_flags', 'Update source flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('security_descriptor_entry', 'Security descriptor entry',
#        '_FormatIntegerAsDecimal'),
#       ('file_attribute_flags', 'File attribute flags',
#        '_FormatIntegerAsHexadecimal8'),
#       ('name_size', 'Name size', '_FormatIntegerAsDecimal'),
#       ('name_offset', 'Name offset', '_FormatIntegerAsDecimal'),
#       ('name', 'Name', '_FormatString')]
#   _EMPTY_USN_RECORD_HEADER = bytes([0] * 60)
#   def _ReadRecordV2(self, file_object):
#   def ReadFileObject(self, file_object):
#   def ReadRecords(self):
# 
# 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/usn_journal.py
import argparse
import logging
import sys
from dtformats import usn_journal
from dtformats import output_writers


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

  Returns:
    bool: True if successful or False if not.
  """
  argument_parser = argparse.ArgumentParser(description=(
      'Extracts information from USN change journal records.'))

  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 USN change journal records.')

  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()