Projects STRLCPY aardwolf Commits ed5acdf0
🤬
  • multiple build scripts, many channel improvements

  • Loading...
  • SkelSec committed 1 year ago
    ed5acdf0
    1 parent ea897c31
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    .gitignore
    skipped 151 lines
    152 152  #.idea/
    153 153  *.tsv
    154 154  *.png
     155 + 
     156 +*.whl
  • ■ ■ ■ ■ ■
    Makefile
    skipped 5 lines
    6 6   find . -name '*.pyo' -exec rm -f {} +
    7 7   find . -name '*~' -exec rm -f {} +
    8 8   
    9  -publish: clean
    10  - python3 setup.py sdist bdist_wheel
     9 +publish: clean package
    11 10   python3 -m twine upload dist/*
     11 + 
     12 +package: clean
     13 + python3 setup.py sdist
     14 + docker pull quay.io/pypa/manylinux2014_x86_64
     15 + docker run --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/builder/manylinux/build.sh
    12 16   
    13 17  rebuild: clean
    14 18   python3 setup.py install
    skipped 4 lines
  • ■ ■ ■ ■ ■ ■
    aardwolf/connection.py
    skipped 1153 lines
    1154 1154   traceback.print_exc()
    1155 1155   return None, e
    1156 1156  
     1157 + async def get_current_clipboard_text(self):
     1158 + if 'cliprdr' not in self.__joined_channels:
     1159 + return None
     1160 + return await self.__joined_channels['cliprdr'].get_current_clipboard_text()
     1161 + 
     1162 + async def set_current_clipboard_text(self, text:str):
     1163 + if 'cliprdr' not in self.__joined_channels:
     1164 + return None
     1165 + return await self.__joined_channels['cliprdr'].set_current_clipboard_text(text)
     1166 +
     1167 + async def add_vchannel(self, channelname, handler):
     1168 + if 'drdynvc' not in self.__joined_channels:
     1169 + raise Exception('Dynamic Virtual Channels are not enabled on this connection!')
     1170 + if channelname in self.__joined_channels['drdynvc'].defined_channels:
     1171 + raise Exception('Channel already defined!')
     1172 + self.__joined_channels['drdynvc'].defined_channels[channelname] = handler
     1173 +
     1174 + def get_vchannels(self):
     1175 + if 'drdynvc' not in self.__joined_channels:
     1176 + raise Exception('Dynamic Virtual Channels are not enabled on this connection!')
     1177 + return self.__joined_channels['drdynvc'].defined_channels
     1178 +
    1157 1179   async def __external_reader(self):
    1158 1180   # This coroutine handles keyboard/mouse etc input from the user
    1159 1181   # It wraps the data in it's appropriate format then dispatches it to the server
    skipped 124 lines
  • ■ ■ ■ ■ ■ ■
    aardwolf/extensions/RDPECLIP/channel.py
    skipped 149 lines
    150 150   msg.data = fmtdata.dataobj
    151 151   msg.datatype = self.__requested_format
    152 152   await self.send_user_data(msg)
     153 + self.__current_clipboard_data = msg
    153 154  
    154 155   except Exception as e:
    155 156   raise e
    skipped 103 lines
    259 260   traceback.print_exc()
    260 261   return None,e
    261 262  
     263 + async def get_current_clipboard_text(self):
     264 + if self.__current_clipboard_data is None:
     265 + return ''
     266 + return str(self.__current_clipboard_data.data)
     267 + 
     268 + async def set_current_clipboard_text(self, text:str):
     269 + data = RDP_CLIPBOARD_DATA_TXT()
     270 + data.datatype = CLIPBRD_FORMAT.CF_UNICODETEXT
     271 + data.data = text
     272 + await self.set_clipboard_data(data)
     273 +
     274 + 
     275 + async def set_clipboard_data(self, data, force_refresh = True):
     276 + if data == self.__current_clipboard_data and force_refresh is False:
     277 + return
     278 + 
     279 + fmtl = CLIPRDR_FORMAT_LIST()
     280 + for fmtid in [CLIPBRD_FORMAT.CF_UNICODETEXT]: #CLIPBRD_FORMAT.CF_TEXT, CLIPBRD_FORMAT.CF_OEMTEXT
     281 + if CB_GENERAL_FALGS.USE_LONG_FORMAT_NAMES not in self.server_general_caps.generalFlags:
     282 + name = CLIPRDR_LONG_FORMAT_NAME()
     283 + name.formatId = data.datatype
     284 + else:
     285 + name = CLIPRDR_SHORT_FORMAT_NAME()
     286 + name.formatId = data.datatype
     287 + fmtl.templist.append(name)
     288 + msg = CLIPRDR_HEADER.serialize_packet(CB_TYPE.CB_FORMAT_LIST, 0, fmtl)
     289 + await self.fragment_and_send(msg)
     290 + 
     291 + self.__current_clipboard_data = data
    262 292   
    263 293   async def process_user_data(self, data):
    264 294   #print('clipboard out! %s' % data)
    265 295   if data.type == RDPDATATYPE.CLIPBOARD_DATA_TXT:
    266  - # data in, informing the server that our clipboard has changed
    267  - if data == self.__current_clipboard_data:
    268  - return
    269  -
    270  - fmtl = CLIPRDR_FORMAT_LIST()
    271  - for fmtid in [CLIPBRD_FORMAT.CF_UNICODETEXT]: #CLIPBRD_FORMAT.CF_TEXT, CLIPBRD_FORMAT.CF_OEMTEXT
    272  - if CB_GENERAL_FALGS.USE_LONG_FORMAT_NAMES not in self.server_general_caps.generalFlags:
    273  - name = CLIPRDR_LONG_FORMAT_NAME()
    274  - name.formatId = data.datatype
    275  - else:
    276  - name = CLIPRDR_SHORT_FORMAT_NAME()
    277  - name.formatId = data.datatype
    278  - fmtl.templist.append(name)
    279  - msg = CLIPRDR_HEADER.serialize_packet(CB_TYPE.CB_FORMAT_LIST, 0, fmtl)
    280  - await self.fragment_and_send(msg)
    281  - 
    282  - self.__current_clipboard_data = data
     296 + await self.set_clipboard_data(data, False)
    283 297  
    284 298   else:
    285 299   logger.debug('Unhandled data type in! %s' % data.type)
  • ■ ■ ■ ■ ■ ■
    builder/manylinux/build.sh
     1 +#!/bin/bash
     2 +set -e -x
     3 + 
     4 +PYBINS=("/opt/python/cp37-cp37m/bin" "/opt/python/cp38-cp38/bin" "/opt/python/cp39-cp39/bin" "/opt/python/cp310-cp310/bin" "/opt/python/cp311-cp311/bin")
     5 +RUST_CHANNEL=stable
     6 + 
     7 +ls -la /opt/python/
     8 + 
     9 +function install_rust {
     10 + curl https://sh.rustup.rs -sSf | sh -s -- -y
     11 + source "$HOME/.cargo/env"
     12 +}
     13 + 
     14 +function clean_project {
     15 + # Remove compiled files that might cause conflicts
     16 + pushd /io/
     17 + rm -rf .cache .eggs rust_fst/_ffi.py build *.egg-info
     18 + find ./ -name "__pycache__" -type d -print0 |xargs -0 rm -rf
     19 + find ./ -name "*.pyc" -type f -print0 |xargs -0 rm -rf
     20 + find ./ -name "*.so" -type f -print0 |xargs -0 rm -rf
     21 + popd
     22 +}
     23 + 
     24 +clean_project
     25 +install_rust $RUST_CHANNEL
     26 +rustc
     27 +rm -rf /io/builder/manylinux/wheelhouse/* || echo "No old wheels to delete"
     28 +mkdir -p /io/builder/manylinux/wheelhouse
     29 +mkdir -p /io/dist
     30 + 
     31 +for PYBIN in ${PYBINS[@]}; do
     32 + ${PYBIN}/python -m pip wheel /io -w /io/builder/manylinux/wheelhouse_tmp/
     33 + for whl in /io/builder/manylinux/wheelhouse_tmp/aardwolf*.whl; do
     34 + auditwheel repair $whl -w /io/dist/
     35 + done
     36 + clean_project
     37 +done
     38 + 
  • ■ ■ ■ ■ ■ ■
    builder/windows/build.bat
     1 + 
     2 +cd ..\..\
     3 +pip wheel . -w dist --no-deps
  • ■ ■ ■ ■ ■ ■
    pyproject.toml
    1 1  [build-system]
    2 2  requires = ["setuptools>=62.4", "setuptools-rust>=1.5.2"]
    3 3   
    4  - 
    5  - 
  • ■ ■ ■ ■ ■ ■
    setup.py
    skipped 44 lines
    45 45   
    46 46   install_requires=[
    47 47   'unicrypto>=0.0.9',
    48  - 'asyauth>=0.0.5',
    49  - 'asysocks>=0.2.2',
    50  - 'minikerberos>=0.3.3',
     48 + 'asyauth>=0.0.11',
     49 + 'asysocks>=0.2.5',
     50 + 'minikerberos>=0.3.5',
    51 51   'tqdm',
    52 52   'colorama',
    53 53   'asn1crypto',
    skipped 17 lines
Please wait...
Page is in error, reload to recover