File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import os
77import maec
88from maec .bundle .bundle import Bundle
9+
910USAGE_TEXT = """
1011MAEC Run Comparator Script v0.11 BETA
1112 *Performs Object->Object comparison of 2 or more input MAEC documents
1718# Process a set of MAEC binding objects and extract the Bundles as appropriate
1819def 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
2930def main ():
3031 infilenames = []
You can’t perform that action at this time.
0 commit comments