Skip to content

Commit ec32f40

Browse files
committed
Updated to use new version of from_xml_instance
1 parent 2bacd93 commit ec32f40

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/run_comparator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import maec
88
from maec.bundle.bundle import Bundle
9+
910
USAGE_TEXT = """
1011
MAEC Run Comparator Script v0.11 BETA
1112
*Performs Object->Object comparison of 2 or more input MAEC documents
@@ -17,14 +18,14 @@
1718
# Process a set of MAEC binding objects and extract the Bundles as appropriate
1819
def process_maec_file(filename, bundle_list):
1920
parsed_objects = maec.parse_xml_instance(filename)
20-
if parsed_objects and parsed_objects[0]:
21-
package_obj = parsed_objects[0][1]
21+
if parsed_objects and 'package' in parsed_objects:
22+
package_obj = parsed_objects['package']['api']
2223
if package_obj.malware_subjects:
2324
for malware_subject in package_obj.malware_subjects:
2425
for bundle in malware_subject.get_all_bundles():
2526
bundle_list.append(bundle)
26-
elif parsed_objects and parsed_objects[1]:
27-
bundle_list.append(parsed_objects[1][1])
27+
elif parsed_objects and 'bundle' in parsed_objects:
28+
bundle_list.append(parsed_objects['bundle']['api'])
2829

2930
def main():
3031
infilenames = []

0 commit comments

Comments
 (0)