forked from log2timeline/plaso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/docstring_check' into docstring_…
…check # Conflicts: # plaso/analysis/windows_services.py # plaso/cli/helpers/manager.py # plaso/engine/zeromq_queue.py # plaso/formatters/chrome.py # plaso/formatters/chrome_extension_activity.py # plaso/formatters/chrome_preferences.py # plaso/formatters/default.py # plaso/formatters/file_system.py # plaso/formatters/firefox.py # plaso/formatters/fseventsd.py # plaso/formatters/gdrive.py # plaso/formatters/hachoir.py # plaso/formatters/imessage.py # plaso/formatters/interface.py # plaso/formatters/kik_ios.py # plaso/formatters/msiecf.py # plaso/formatters/olecf.py # plaso/formatters/recycler.py # plaso/formatters/safari_cookies.py # plaso/formatters/shell_items.py # plaso/formatters/shutdown.py # plaso/formatters/symantec.py # plaso/formatters/trendmicroav.py # plaso/formatters/twitter_ios.py # plaso/formatters/utmp.py # plaso/formatters/utmpx.py # plaso/formatters/winjob.py # plaso/formatters/winlnk.py # plaso/formatters/winprefetch.py # plaso/formatters/winreg.py # plaso/formatters/winrestore.py # plaso/lib/lexer.py # plaso/lib/objectfilter.py # plaso/lib/timelib.py # plaso/output/null.py # plaso/parsers/bash_history.py # plaso/parsers/cups_ipp.py # plaso/parsers/docker.py # plaso/parsers/firefox_cache.py # plaso/parsers/iis.py # plaso/parsers/interface.py # plaso/parsers/java_idx.py # plaso/parsers/mac_keychain.py # plaso/parsers/mactime.py # plaso/parsers/mediator.py # plaso/parsers/plugins.py # plaso/parsers/sqlite.py # plaso/parsers/syslog.py # plaso/parsers/text_parser.py # plaso/parsers/winfirewall.py # plaso/parsers/winreg_plugins/mrulist.py # plaso/parsers/winreg_plugins/mrulistex.py # plaso/serializer/json_serializer.py # plaso/storage/fake/writer.py
- Loading branch information
Showing
54 changed files
with
800 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# -*- coding: utf-8 -*- | ||
"""The Google Hangouts messages database event formatter.""" | ||
|
||
from __future__ import unicode_literals | ||
|
||
from plaso.formatters import interface | ||
from plaso.formatters import manager | ||
from plaso.lib import errors | ||
|
||
|
||
_MESSAGE_TYPES = { | ||
1: 'SENT', | ||
2: 'RECEIVED'} | ||
|
||
_MESSAGE_STATUSES = { | ||
0: 'UNREAD', | ||
4: 'READ'} | ||
|
||
|
||
class HangoutsFormatter(interface.ConditionalEventFormatter): | ||
"""Formatter for an Hangouts message event.""" | ||
|
||
DATA_TYPE = 'android:messaging:hangouts' | ||
|
||
FORMAT_STRING_PIECES = [ | ||
'Sender: {sender}', | ||
'Body: {body}', | ||
'Status: {message_status}', | ||
'Type: {message_type}'] | ||
|
||
FORMAT_STRING_SHORT_PIECES = ['{body}'] | ||
|
||
SOURCE_LONG = 'Google Hangouts Message' | ||
SOURCE_SHORT = 'HANGOUTS' | ||
|
||
# VALUE_FORMATTERS contains formatting functions for event values that are | ||
# not ready for human consumption. | ||
# These functions replace the integer codes for scan types and scan results | ||
# (a.k.a. actions) with human-readable strings. | ||
VALUE_FORMATTERS = { | ||
'message_type': lambda message_type: _MESSAGE_TYPES[message_type], | ||
'message_status': | ||
lambda message_status: _MESSAGE_STATUSES[message_status]} | ||
|
||
def GetMessages(self, unused_formatter_mediator, event): | ||
"""Determines the formatted message strings for an event object. | ||
If any event values have a matching formatting function in VALUE_FORMATTERS, | ||
they are run through that function; then the dictionary is passed to the | ||
superclass's formatting method. | ||
Args: | ||
unused_formatter_mediator (FormatterMediator): not used. | ||
event (EventObject): event. | ||
Returns: | ||
tuple(str, str): formatted message string and short message string. | ||
Raises: | ||
WrongFormatter: if the event object cannot be formatted by the formatter. | ||
""" | ||
if self.DATA_TYPE != event.data_type: | ||
raise errors.WrongFormatter( | ||
'Unsupported data type: {0:s}.'.format(event.data_type)) | ||
|
||
event_values = event.CopyToDict() | ||
for formattable_value_name, formatter in self.VALUE_FORMATTERS.items(): | ||
if formattable_value_name in event_values: | ||
value = event_values[formattable_value_name] | ||
event_values[formattable_value_name] = formatter(value) | ||
|
||
return self._ConditionalFormatMessages(event_values) | ||
|
||
|
||
manager.FormattersManager.RegisterFormatter(HangoutsFormatter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
"""The Kodi MyVideos database event formatter.""" | ||
|
||
from __future__ import unicode_literals | ||
|
||
from plaso.formatters import interface | ||
from plaso.formatters import manager | ||
|
||
|
||
class KodiFormatter(interface.ConditionalEventFormatter): | ||
"""Formatter for an Kodi Video event.""" | ||
|
||
DATA_TYPE = 'kodi:videos:viewing' | ||
|
||
FORMAT_STRING_PIECES = [ | ||
'Video: {filename}', | ||
'Play Count: {play_count}'] | ||
|
||
FORMAT_STRING_SHORT_PIECES = ['{filename}'] | ||
|
||
SOURCE_LONG = 'Kodi Video Viewed' | ||
SOURCE_SHORT = 'KODI' | ||
|
||
|
||
manager.FormattersManager.RegisterFormatter(KodiFormatter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
# pylint: disable=missing-type-doc,missing-return-type-doc | ||
|
||
|
||
|
||
MONTH_DICT = { | ||
'jan': 1, | ||
'feb': 2, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.