def from_obj(driver_obj): if not driver_obj: return None driver_ = WinDriver() driver_.driver_init = UnsignedLong.from_obj(driver_obj.get_Driver_Init()) driver_.driver_name = String.from_obj(driver_obj.get_Driver_Name()) driver_.driver_object_address = HexBinary.from_obj(driver_obj.get_Driver_Object_Address()) driver_.driver_start_io = HexBinary.from_obj(driver_obj.get_Driver_Start_IO()) return driver_
def from_obj(win_pipe_obj): if not win_pipe_obj: return None win_pipe_ = Pipe.from_obj(win_pipe_obj, WinPipe()) win_pipe_.default_time_out = NonNegativeInteger.from_obj(win_pipe_obj.get_Default_Time_Out()) win_pipe_.handle = WinHandle.from_obj(win_pipe_obj.get_Handle()) win_pipe_.in_buffer_Size = NonNegativeInteger.from_obj(win_pipe_obj.get_In_Buffer_Size()) win_pipe_.max_instances = NonNegativeInteger.from_obj(win_pipe_obj.get_Max_Instances()) win_pipe_.open_mode = HexBinary.from_obj(win_pipe_obj.get_Open_Mode()) win_pipe_.out_buffer_size = NonNegativeInteger.from_obj(win_pipe_obj.get_Out_Buffer_Size()) win_pipe_.pipe_mode = HexBinary.from_obj(win_pipe_obj.get_Pipe_Mode()) win_pipe_.security_attributes = String.from_obj(win_pipe_obj.get_Security_Attributes()) return win_pipe_
def from_obj(extracted_string_obj): if not extracted_string_obj: return None extracted_string_ = ExtractedString() extracted_string_.encoding = VocabString.from_obj(extracted_string_obj.get_Encoding()) extracted_string_.string_value = String.from_obj(extracted_string_obj.get_String_Value()) extracted_string_.byte_string_value = HexBinary.from_obj(extracted_string_obj.get_Byte_String_Value()) extracted_string_.hashes = HashList.from_obj(extracted_string_obj.get_Hashes()) extracted_string_.address = HexBinary.from_obj(extracted_string_obj.get_Address()) extracted_string_.length = PositiveInteger.from_obj(extracted_string_obj.get_Length()) extracted_string_.language = String.from_obj(extracted_string_obj.get_Language()) extracted_string_.english_translation = String.from_obj(extracted_string_obj.get_English_Translation()) return extracted_string_
def from_obj(file_obj, file_class=None): if not file_obj: return None if not file_class: file_ = File() else: file_ = file_class ObjectProperties.from_obj(file_obj, file_) file_.is_packed = file_obj.get_is_packed() file_.file_name = String.from_obj(file_obj.get_File_Name()) file_.file_path = FilePath.from_obj(file_obj.get_File_Path()) file_.device_path = String.from_obj(file_obj.get_Device_Path()) file_.full_path = String.from_obj(file_obj.get_Full_Path()) file_.file_extension = String.from_obj(file_obj.get_File_Extension()) file_.size_in_bytes = UnsignedLong.from_obj(file_obj.get_Size_In_Bytes()) file_.magic_number = HexBinary.from_obj(file_obj.get_Magic_Number()) file_.file_format = String.from_obj(file_obj.get_File_Format()) file_.hashes = HashList.from_obj(file_obj.get_Hashes()) file_.extracted_features = ExtractedFeatures.from_obj(file_obj.get_Extracted_Features()) #TODO: why are there two Strings and one DateTime here? file_.modified_time = String.from_obj(file_obj.get_Modified_Time()) file_.accessed_time = String.from_obj(file_obj.get_Accessed_Time()) file_.created_time = DateTime.from_obj(file_obj.get_Created_Time()) return file_
def from_obj(global_flag_obj): if not global_flag_obj: return None global_flag_ = GlobalFlag() global_flag_.abbreviation = String.from_obj(global_flag_obj.get_Abbreviation()) global_flag_.destination = String.from_obj(global_flag_obj.get_Destination()) global_flag_.hexadecimal_value = HexBinary.from_obj(global_flag_obj.get_Hexadecimal_Value()) global_flag_.symbolic_name = String.from_obj(global_flag_obj.get_Symbolic_Name()) return global_flag_
def from_obj(packer_obj): if not packer_obj: return None packer = Packer() packer.name = String.from_obj(packer_obj.get_Name()) packer.version = String.from_obj(packer_obj.get_Version()) packer.entry_point = HexBinary.from_obj(packer_obj.get_Entry_Point()) packer.signature = String.from_obj(packer_obj.get_Signature()) packer.type_ = String.from_obj(packer_obj.get_Type()) return packer
def from_obj(extracted_string_obj): if not extracted_string_obj: return None extracted_string_ = ExtractedString() extracted_string_.encoding = VocabString.from_obj( extracted_string_obj.get_Encoding()) extracted_string_.string_value = String.from_obj( extracted_string_obj.get_String_Value()) extracted_string_.byte_string_value = HexBinary.from_obj( extracted_string_obj.get_Byte_String_Value()) extracted_string_.hashes = HashList.from_obj( extracted_string_obj.get_Hashes()) extracted_string_.address = HexBinary.from_obj( extracted_string_obj.get_Address()) extracted_string_.length = PositiveInteger.from_obj( extracted_string_obj.get_Length()) extracted_string_.language = String.from_obj( extracted_string_obj.get_Language()) extracted_string_.english_translation = String.from_obj( extracted_string_obj.get_English_Translation()) return extracted_string_
def from_obj(memory_obj): if not memory_obj: return None memory_ = Memory() memory_.is_injected = memory_obj.get_is_injected() memory_.is_mapped = memory_obj.get_is_mapped() memory_.is_protected = memory_obj.get_is_protected() memory_.hashes = HashList.from_obj(memory_obj.get_Hashes()) memory_.name = String.from_obj(memory_obj.get_Name()) memory_.region_size = UnsignedLong.from_obj(memory_obj.get_Region_Size()) memory_.region_start_address = HexBinary.from_obj(memory_obj.get_Region_Start_Address()) memory_.extracted_features = None return memory_
def from_obj(dns_record_obj): if not dns_record_obj: return None dns_record_ = DNSRecord() dns_record_.description = StructuredText.from_obj(dns_record_obj.get_Description()) dns_record_.domain_name = URI.from_obj(dns_record_obj.get_Domain_Name()) dns_record_.ip_address = Address.from_obj(dns_record_obj.get_IP_Address()) dns_record_.address_class = String.from_obj(dns_record_obj.get_Address_Class()) dns_record_.entry_type = String.from_obj(dns_record_obj.get_Entry_Type()) dns_record_.record_name = String.from_obj(dns_record_obj.get_Record_Name()) dns_record_.record_type = String.from_obj(dns_record_obj.get_Record_Type()) dns_record_.ttl = Integer.from_obj(dns_record_obj.get_TTL()) dns_record_.flags = HexBinary.from_obj(dns_record_obj.get_Flags()) dns_record_.data_length = Integer.from_obj(dns_record_obj.get_Length()) dns_record_.record_data = dns_record_obj.get_Record_Data() return dns_record_
def from_obj(file_obj): if not file_obj: return None file_ = File() file_.is_packed = file_obj.get_is_packed() file_.file_name = String.from_obj(file_obj.get_File_Name()) file_.file_path = FilePath.from_obj(file_obj.get_File_Path()) file_.device_path = String.from_obj(file_obj.get_Device_Path()) file_.full_path = String.from_obj(file_obj.get_Full_Path()) file_.file_extension = String.from_obj(file_obj.get_File_Extension()) file_.size_in_bytes = UnsignedLong.from_obj(file_obj.get_Size_In_Bytes()) file_.magic_number = HexBinary.from_obj(file_obj.get_Magic_Number()) file_.file_format = String.from_obj(file_obj.get_File_Format()) file_.hashes = HashList.from_obj(file_obj.get_Hashes()) return file_