CasperSecurity

Current Path : /lib/python3/dist-packages/serial/urlhandler/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/serial/urlhandler/__pycache__/protocol_hwgrep.cpython-310.pyc

o

��^W�@stddlmZddlZddlZzeWneyeZYnwGdd�dej�Zedkr8ed�Z	de	_
ee	�dSdS)�)�absolute_importNc@s*eZdZdZejjjdd��Zdd�ZdS)�SerialzOJust inherit the native Serial port implementation and patch the port property.cCsBt|t�r|�d�rtjj�||�|��dStjj�||�dS)z%translate port name before storing it�	hwgrep://N)�
isinstance�
basestring�
startswith�serialr�port�__set__�from_url)�self�value�r�C/usr/lib/python3/dist-packages/serial/urlhandler/protocol_hwgrep.pyr	&szSerial.portc
	Cs|���d�r
|dd�}d}d}|�d�}|�d�}|D]6}d|vr,|�dd�\}}n|}d}|d	krFt|�d}|dkrEtd
�|���q|dkrMd}qtd
�|���ttj	j
�|��D]'\}	}
}|rzzt�|	�}Wn
tj
yuYq]w|��|r�|d8}q]|	St�
d�|���)z(extract host and port from an URL stringr�	NrF�&�=��nz9option "n" expects a positive integer larger than 1: {!r}�	skip_busyTzunknown option: {!r}z#no ports found matching regexp {!r})�lowerr�split�pop�int�
ValueError�format�sortedr�tools�
list_ports�grepr�SerialException�close)
r�urlr�	test_open�args�regexp�arg�optionr
r	�desc�hwid�srrrr.s@

��zSerial.from_urlN)	�__name__�
__module__�__qualname__�__doc__rrr	�setterrrrrrr"s

r�__main__zhwgrep://ttyS0)�
__future__rr�serial.tools.list_portsr�	NameError�strrr+r*r	�printrrrr�<module>s�6�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY