Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plaso/parsers/winreg_plugins/amcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ class AMCachePlugin(interface.WindowsRegistryPlugin):
'ProductVersion': 'file_version',
'ProgramId': 'program_identifier',
'Publisher': 'company_name',
'Size': 'file_size'}
'Size': 'file_size',
'FileId': 'sha1',
'Language': 'language_code',
'Version': 'file_version'}

_FILE_REFERENCE_KEY_VALUES = {
'0': 'product_name',
Expand Down Expand Up @@ -217,6 +220,10 @@ def _ParseApplicationSubKey(self, parser_mediator, application_sub_key):
value_data = self._GetValueDataAsObject(
parser_mediator, application_sub_key.path, value_name, value)

if attribute_name == 'sha1' and value_data.startswith('0000'):
# Strip off the 4 leading zero's from the sha1 hash.
value_data = value_data[4:]

setattr(event_data, attribute_name, value_data)

install_date_value = application_sub_key.GetValueByName('InstallDate')
Expand Down
11 changes: 10 additions & 1 deletion tests/parsers/winreg_plugins/amcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,16 @@ def testProcessWindows10(self):
'installation_time': None,
'last_written_time': None,
'link_time': '1997-01-10T22:26:24+00:00',
'msi_installation_time': None}
'msi_installation_time': None,
'sha1': '75c5a97f521f760e32a4a9639a653eed862e9c61',
'file_size': 53744,
'language_code': 1033,
'file_version': '10.0.18362.1 (winbuild.160101.0800)',
'company_name': 'microsoft corporation',
'file_description': None,
'file_reference': None,
'product_name': 'microsoft® windows® operating system',
'program_identifier': '0000f519feec486de87ed73cb92d3cac802400000000'}

event_data = storage_writer.GetAttributeContainerByIndex('event_data', 135)
self.CheckEventData(event_data, expected_event_values)
Expand Down