fix: Fixed variable names

pull/322/head
chrisr3d 2019-07-24 12:21:58 +02:00
parent 27f5c9ceeb
commit 42b95c4210
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 5 additions and 3 deletions

View File

@ -212,11 +212,12 @@ class JoeParser():
file_object.add_attribute(object_relation, **{'type': attribute_type, 'value': fileinfo[field]}) file_object.add_attribute(object_relation, **{'type': attribute_type, 'value': fileinfo[field]})
try: try:
to_call = arch_type_mapping[self.data['generalinfo']['arch']] to_call = arch_type_mapping[self.data['generalinfo']['arch']]
getattr(self, to_call)(fileinfo[to_call.split('_')[-1]], file_object) getattr(self, to_call)(fileinfo, file_object)
except KeyError: except KeyError:
self.misp_event.add_object(**file_object) self.misp_event.add_object(**file_object)
def parse_apk(self, apkinfo, fileobject): def parse_apk(self, fileinfo, file_object):
apkinfo = fileinfo['apk']
self.misp_event.add_object(**file_object) self.misp_event.add_object(**file_object)
permission_lists = defaultdict(list) permission_lists = defaultdict(list)
for permission in apkinfo['requiredpermissions']['permission']: for permission in apkinfo['requiredpermissions']['permission']:
@ -232,7 +233,8 @@ class JoeParser():
self.references[file_object.uuid].append(dict(referenced_uuid=permission_object.uuid, self.references[file_object.uuid].append(dict(referenced_uuid=permission_object.uuid,
relationship_type='grants')) relationship_type='grants'))
def parse_pe(self, peinfo, file_object): def parse_pe(self, fileinfo, file_object):
peinfo = fileinfo['pe']
pe_object = MISPObject('pe') pe_object = MISPObject('pe')
file_object.add_reference(pe_object.uuid, 'included-in') file_object.add_reference(pe_object.uuid, 'included-in')
self.misp_event.add_object(**file_object) self.misp_event.add_object(**file_object)