Beispiel #1
0
 def deserialize_sirep(self, command_buffer):
     """Described in parent class"""
     command_type, payload_length, return_error_flag, return_output_flag = utils.unpack_uints(
         command_buffer[:self.HEADER_SIZE])
     command_line_string, parameters_string, base_directory_path = utils.unpack_string_array(
         command_buffer[self.HEADER_SIZE:])
     raise NotImplementedError()
Beispiel #2
0
    def deserialize_sirep(self, command_buffer):
        """
        A factory for SirepCommand instances.

        Instances are built from the given binary command buffer.
        """
        command_type, payload_length = utils.unpack_uints(
            command_buffer[:2 * INT_SIZE])
        return SirepCommand(command_type)
 def _parse_payload_to_kv(result_payload):
     """Described in parent class"""
     kv = super(FileInformationResult,
                FileInformationResult)._parse_payload_to_kv(result_payload)
     HResult, \
     kv['dwFileAttributes'], \
     nFileSizeLow, \
     nFileSizeHigh, \
     dwLowDateTime_Created, \
     dwHighDateTime_Created, \
     dwLowDateTime_LastAccess, \
     dwHighDateTime_LastAccess, \
     dwLowDateTime_LastWrite, \
     dwHighDateTime_LastWrite = \
         utils.unpack_uints(result_payload[:FILE_INFORMATION_SIZE])
     if HResult == 0x0:
         kv['file_size'] = utils.windows_low_high_to_int(nFileSizeLow, nFileSizeHigh)
         kv['time_created'] = utils.windows_filetime_to_string(dwLowDateTime_Created, dwHighDateTime_Created)
         kv['time_last_access'] = utils.windows_filetime_to_string(dwLowDateTime_LastAccess,
                                                                   dwHighDateTime_LastAccess)
         kv['time_last_write'] = utils.windows_filetime_to_string(dwLowDateTime_LastWrite, dwHighDateTime_LastWrite)
     kv['HResult'] = hex(HResult)
     return kv
 def deserialize_sirep(self, command_buffer):
     command_type, payload_length = utils.unpack_uints(
         command_buffer[:2 * INT_SIZE])
     remote_path, data = utils.unpack_strings(command_buffer[2 * INT_SIZE:])
     return PutFileOnDeviceCommand(remote_path, data)