本文整理汇总了Python中cybox.common.HashList.dict_from_object方法的典型用法代码示例。如果您正苦于以下问题:Python HashList.dict_from_object方法的具体用法?Python HashList.dict_from_object怎么用?Python HashList.dict_from_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.common.HashList
的用法示例。
在下文中一共展示了HashList.dict_from_object方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dict_from_object
# 需要导入模块: from cybox.common import HashList [as 别名]
# 或者: from cybox.common.HashList import dict_from_object [as 别名]
def dict_from_object(cls, byterun_obj):
"""Parse and return a dictionary for a ByteRun object"""
byterun_dict = {}
if byterun_obj.get_Offset() is not None: byterun_dict['offset'] = Base_Object_Attribute.dict_from_object(byterun_obj.get_Offset())
if byterun_obj.get_File_System_Offset() is not None: byterun_dict['file_system_offset'] = Base_Object_Attribute.dict_from_object(byterun_obj.get_File_System_Offset())
if byterun_obj.get_Image_Offset() is not None: byterun_dict['image_offset'] = Base_Object_Attribute.dict_from_object(byterun_obj.get_Image_Offset())
if byterun_obj.get_Length() is not None: byterun_dict['length'] = Base_Object_Attribute.dict_from_object(byterun_obj.get_Length())
if byterun_obj.get_Hashes() is not None: byterun_dict['hashes'] = HashList.dict_from_object(byterun_obj.get_Hashes())
if byterun_obj.get_Byte_Run_Data() is not None: byterun_dict['byte_run_data'] = {'value' : byterun_obj.get_Byte_Run_Data()}
return byterun_dict
示例2: dict_from_object
# 需要导入模块: from cybox.common import HashList [as 别名]
# 或者: from cybox.common.HashList import dict_from_object [as 别名]
def dict_from_object(cls, defined_object):
"""Parse and return a dictionary for a Memory Object object"""
defined_object_dict = {}
if defined_object.get_is_injected() is not None: defined_object_dict['is_injected'] = {'value' : defined_object.get_is_injected()}
if defined_object.get_is_mapped() is not None: defined_object_dict['is_mapped'] = {'value' : defined_object.get_is_mapped()}
if defined_object.get_is_protected() is not None: defined_object_dict['is_protected'] = {'value' : defined_object.get_is_protected()}
if defined_object.get_Hashes() is not None: defined_object_dict['hashes'] = HashList.dict_from_object(defined_object.get_Hashes())
if defined_object.get_Name() is not None: defined_object_dict['name'] = Base_Object_Attribute.dict_from_object(defined_object.get_Name())
if defined_object.get_Region_Size() is not None: defined_object_dict['region_size'] = Base_Object_Attribute.dict_from_object(defined_object.get_Region_Size())
if defined_object.get_Region_Start_Address() is not None: defined_object_dict['region_start_address'] = Base_Object_Attribute.dict_from_object(defined_object.get_Region_Start_Address())
return defined_object_dict
示例3: dict_from_object
# 需要导入模块: from cybox.common import HashList [as 别名]
# 或者: from cybox.common.HashList import dict_from_object [as 别名]
def dict_from_object(cls, extracted_string_obj):
"""Parse and return a dictionary for an Extracted String object"""
extracted_string_dict = {}
if extracted_string_obj.get_encoding() is not None: extracted_string_dict['encoding'] = {'value' : element.get_encoding()}
if extracted_string_obj.get_String_Value() is not None: extracted_string_dict['string_value'] = Base_Object_Attribute.dict_from_object(defined_object.get_String_Value())
if extracted_string_obj.get_Hashes() is not None: extracted_string_dict['hashes'] = HashList.dict_from_object(element.get_Hashes())
if extracted_string_obj.get_Address() is not None: extracted_string_dict['address'] = Base_Object_Attribute.dict_from_object(defined_object.get_Address())
if extracted_string_obj.get_Length() is not None: extracted_string_dict['length'] = Base_Object_Attribute.dict_from_object(defined_object.get_Length())
if extracted_string_obj.get_Language() is not None: extracted_string_dict['language'] = Base_Object_Attribute.dict_from_object(defined_object.get_Language())
if extracted_string_obj.get_English_Translation() is not None: extracted_string_dict['english_translation'] = Base_Object_Attribute.dict_from_object(defined_object.get_English_Translation())
return extracted_string_dict