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+ from maec .package .package import Package
910
1011USAGE_TEXT = """
1112MAEC Run Deduplicator Script v0.10 BETA
1920def process_maec_file (filename ):
2021 new_filename = filename [:filename .find (".xml" )] + "_deduplicated.xml"
2122 parsed_objects = maec .parse_xml_instance (filename )
22- if parsed_objects and 'package' in parsed_objects :
23- parsed_objects ['package' ][ ' api' ].deduplicate_malware_subjects ()
24- parsed_objects ['package' ][ ' api' ].to_xml_file (new_filename )
25- elif parsed_objects and 'bundle' in parsed_objects :
26- parsed_objects ['bundle' ][ ' api' ].deduplicate ()
27- parsed_objects ['bundle' ][ ' api' ].to_xml_file (new_filename )
23+ if parsed_objects and isinstance ( parsed_objects [ 'api' ], Package ) :
24+ parsed_objects ['api' ].deduplicate_malware_subjects ()
25+ parsed_objects ['api' ].to_xml_file (new_filename )
26+ elif parsed_objects and isinstance ( parsed_objects [ 'api' ], Bundle ) :
27+ parsed_objects ['api' ].deduplicate ()
28+ parsed_objects ['api' ].to_xml_file (new_filename )
2829
2930def main ():
3031 sys .stdout .write ("Deduplicating." )
You can’t perform that action at this time.
0 commit comments