# Buggy code
def _GetEventDataHexDump(self, event_object, before=0, maximum_number_of_lines=20):
    """Returns a hexadecimal representation of the event data.

     This function creates a hexadecimal string representation based on
     the event data described by the event object.

    Args:
      event_object: The event object (instance of EventObject).
      before: Optional number of bytes to include in the output before
              the event. The default is none.
      maximum_number_of_lines: Optional maximum number of lines to include
                               in the output. The default is 20.

    Returns:
      A string that contains the hexadecimal representation of the event data.
    """
    if not event_object:
        return "Missing event object."

    if not hasattr(event_object, "pathspec"):
        return "Event object has no path specification."

    try:
        file_entry = resolver.Resolver.OpenFileEntry(event_object.pathspec)
    except IOError as exception:
        return "Unable to open file with error: {0:s}".format(exception)

    offset = getattr(event_object, "offset", 0)
    if offset - before > 0:
        offset -= before

    file_object = file_entry.GetFileObject()
    file_object.seek(offset, os.SEEK_SET)
    data_size = maximum_number_of_lines * 16
    data = file_object.read(data_size)
    file_object.close()

    return hexdump.Hexdump.FormatData(data, data_offset=offset)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/usr/local/bin/preg.py", line 5, in <module>
pkg_resources.run_script('plaso==1.3.0-20150715', u'preg.py')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 492, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1350, in run_script
execfile(script_filename, namespace, namespace)
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 1711, in <module>
if not Main():
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 1700, in Main
tool.RunModeRegistryPlugin()
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 865, in RunModeRegistryPlugin
plugin_list = self.plugin_names.split(u',')
AttributeError: 'list' object has no attribute 'split'

# Fixed code
def _GetEventDataHexDump(self, event_object, before=0, maximum_number_of_lines=20):
    """Returns a hexadecimal representation of the event data.

     This function creates a hexadecimal string representation based on
     the event data described by the event object.

    Args:
      event_object: The event object (instance of EventObject).
      before: Optional number of bytes to include in the output before
              the event. The default is none.
      maximum_number_of_lines: Optional maximum number of lines to include
                               in the output. The default is 20.

    Returns:
      A string that contains the hexadecimal representation of the event data.
    """
    if not event_object:
        return "Missing event object."

    if not hasattr(event_object, "pathspec"):
        return "Event object has no path specification."

    try:
        file_entry = resolver.Resolver.OpenFileEntry(event_object.pathspec)
    except IOError as exception:
        return "Unable to open file with error: {0:s}".format(exception)

    offset = getattr(event_object, "offset", 0)
    if offset - before > 0:
        offset -= before

    file_object = file_entry.GetFileObject()
    file_object.seek(offset, os.SEEK_SET)
    data_size = maximum_number_of_lines * 16
    data = file_object.read(data_size)
    file_object.close()

    return hexdump.Hexdump.FormatData(data)