Repository URL to install this package:
Version:
1.0.7~rc2 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
scapy
/
__pycache__
/
main.cpython-37.pyc
|
---|
B ÂÐýÆH£sã @ sä d Z ddlmZ ddlmZ ddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlmZ ddlmZmZmZ ddlm mZ ddlmZmZmZ ddlmZ dd lmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% e&ej'j(j)a*d diZ+dd ddddddgZ,dd Z-e. e/ dfddZ0dd Z1e-dZ2e-dZ3dd Z4d<dd Z5d=d!d"Z6d>d#d$Z7d?d%d&Z8d@d(d)Z9d*d+ Z:dAd.d/Z;dBd0d1Z<dCd2d3Z=dDd4d5Z>dEd7d8Z?dddej@fd9d:ZAeBd;kràeA dS )Fz& Main module for interactive startup. é )Úabsolute_import)Úprint_functionN)Úchoice)Úlog_interactiveÚlog_loadingÚScapy_Exception)ÚDefaultThemeÚ BlackAndWhiteÚapply_ipython_style)ÚWINDOWS)ÚcastÚAnyÚDictÚListÚOptionalÚTupleÚUnionZtlsztls.all)z0Craft packets like it is your last day on earth.zLao-Tze)z#Craft packets like I craft my beer.zJean De Clerck)z$Craft packets before they craft you.ZSocrate)zCraft me if you can.z IPv6 layer)z`To craft a packet, you have to be a packet, and learn how to swim in the wires and in the waves.zJean-Claude Van Damme)z,We are in France, we say Skappee. OK? Merci.zSebastien Chabal)z'Wanna support scapy? Star us on GitHub!zSatoshi Nakamoto)zWhat is dead may never die!zPython 2c C sB t j t j d¡| ¡}yt |¡ W n tk r8 d S X |S d S )Nú~)ÚosÚpathÚjoinÚ expanduserÚstatÚOSError)ÚcfZcf_path© r ú/build/wlanpi-profiler-CSvHZ8/wlanpi-profiler-1.0.7~rc2/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/scapy/main.pyÚ_probe_config_fileB s r Tc C s t d| ¡ y0t| }tt| ¡ | d|| W dQ R X W nZ tk rr } z|rT t d| |¡ W dd}~X Y n& tk r |r t d| ¡ Y nX dS )a® Read a config file: execute a python file while loading scapy, that may contain some pre-configured values. If _globals or _locals are specified, they will be updated with the loaded vars. This allows an external program to use the function. Otherwise, vars are only available from inside the scapy console. params: - _globals: the globals() vars - _locals: the locals() vars - interactive: specified whether or not errors should be printed using the scapy console or raised. ex, content of a config.py file: 'conf.verb = 42 ' Manual loading: >>> _read_config_file("./config.py")) >>> conf.verb 2 zLoading config file [%s]ÚexecNz!Cannot read config file [%s] [%s]z+Error during evaluation of config file [%s]) r ÚdebugÚopenr ÚcompileÚreadÚIOErrorÚwarningÚ ExceptionÚ exception)r Z_globalsZ_localsÚinteractiveZcfgfÚer r r Ú_read_config_fileM s r) c C s | d dko| t kS )zªReturns whether or not a variable should be imported. Will return False for any default modules (sys), or if they are detected as private vars (starting with a _)r Ú_)ÚIGNORED)Úxr r r Ú_validate_localx s r- z.scapy_prestart.pyz.scapy_startup.pyc C s t d t d¡ d S )NzºUsage: scapy.py [-s sessionfile] [-c new_startup_file] [-p new_prestart_file] [-C] [-P] [-H] Args: -H: header-less start -C: do not read startup file -P: do not read pre-startup file r )ÚprintÚsysÚexitr r r r Ú_usage s r1 c C sÆ |dkrt jjj}yt | ¡}d|jkr^xp|jd D ]$}|dk rJ| |¡ |j| ||<