コード例 #1
0
 def from_obj(malware_subject_obj):
     if not malware_subject_obj:
         return None
     malware_subject_ = MalwareSubject(None)
     malware_subject_.id = malware_subject_obj.get_id()
     malware_subject_.malware_instance_object_attributes = Object.from_obj(malware_subject_obj.get_Malware_Instance_Object_Attributes())
     malware_subject_.minor_variants = MinorVariants.from_obj(malware_subject_obj.get_Minor_Variants())
     malware_subject_.field_data = None #TODO: add support
     malware_subject_.analyses = Analyses.from_obj(malware_subject_obj.get_Analyses())
     malware_subject_.findings_bundles = FindingsBundleList.from_obj(malware_subject_obj.get_Findings_Bundles())
     malware_subject_.relationships = MalwareSubjectRelationshipList.from_obj(malware_subject_obj.get_Relationships())
     return malware_subject_
コード例 #2
0
ファイル: bundle.py プロジェクト: akreffett/python-maec
 def from_obj(bundle_obj):
     if not bundle_obj:
         return None
     bundle_ = Bundle(None, None)
     bundle_.id = bundle_obj.get_id()
     bundle_.schema_version = bundle_obj.get_schema_version()
     bundle_.defined_subject = bundle_obj.get_defined_subject()
     bundle_.content_type = bundle_obj.get_content_type()
     bundle_.timestamp = bundle_obj.get_timestamp()
     bundle_.malware_instance_object_attributes = Object.from_obj(bundle_obj.get_Malware_Instance_Object_Attributes())
     if bundle_obj.get_AV_Classifications() is not None: bundle_.av_classifications = AVClassifications.from_obj(bundle_obj.get_AV_Classifications())
     bundle_.process_tree = ProcessTree.from_obj(bundle_obj.get_Process_Tree())
     if bundle_obj.get_Behaviors() is not None : bundle_.behaviors = BehaviorList.from_obj(bundle_obj.get_Behaviors())
     if bundle_obj.get_Actions() is not None : bundle_.actions = ActionList.from_obj(bundle_obj.get_Actions())
     if bundle_obj.get_Candidate_Indicators() is not None : bundle_.candidate_indicators = CandidateIndicatorList.from_obj(bundle_obj.get_Candidate_Indicators())
     bundle_.collections = Collections.from_obj(bundle_obj.get_Collections())
     return bundle_
コード例 #3
0
ファイル: stateful_measure.py プロジェクト: 2xyo/python-cybox
 def from_obj(statefulmeasure_obj):
     sm = StatefulMeasure()
     sm.object_ = Object.from_obj(statefulmeasure_obj.get_Object())
     return sm
コード例 #4
0
 def from_obj(object_obj):
     if not object_obj:
         return None
     obj = Object.from_obj(object_obj, AssociatedObject())
     obj.association_type_ = VocabString.from_obj(object_obj.get_Association_Type())
     return obj