403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.158
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/analyze_dxp.cpython-36.opt-1.pyc
3

x2_W�@s�dZddlZddlZddlZddlZddlZeed�s>ed��ej�Z	ej
�add�Zdd�Z
d	d
�Zdd�Zd
d�Zdd�Zddd�ZdS)a
Some helper functions to analyze the output of sys.getdxp() (which is
only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE).
These will tell you which opcodes have been executed most frequently
in the current process, and, if Python was also built with -DDXPAIRS,
will tell you which instruction _pairs_ were executed most frequently,
which may help in choosing new instructions.

If Python was built without -DDYNAMIC_EXECUTION_PROFILE, importing
this module will raise a RuntimeError.

If you're running a script you want to profile, a simple way to get
the common pairs is:

$ PYTHONPATH=$PYTHONPATH:<python_srcdir>/Tools/scripts ./python -i -O the_script.py --args
...
> from analyze_dxp import *
> s = render_common_pairs()
> open('/tmp/some_file', 'w').write(s)
�N�getdxpzKCan't import analyze_dxp: Python built without -DDYNAMIC_EXECUTION_PROFILE.cCst|�dkot|dt�S)z[Returns True if the Python that produced the argument profile
    was built with -DDXPAIRS.r)�len�
isinstance�list)�profile�r�>/opt/alt/python36/lib64/python3.6/Tools/scripts/analyze_dxp.py�	has_pairs'sr	c	Cs$t�tj�tj�aWdQRXdS)z<Forgets any execution profile that has been gathered so far.N)�
_profile_lock�sysr�_cumulative_profilerrrr�
reset_profile.sr
cCs�t��tj�}t|�rdxvttt��D]:}x4ttt|��D] }t|||||7<q:Wq$Wn*x(ttt��D]}t|||7<qrWWdQRXdS)z�Reads sys.getdxp() and merges it into this module's cached copy.

    We need this because sys.getdxp() 0s itself every time it's called.N)r
rrr	�rangerr)Znew_profileZ
first_instZsecond_instZinstrrr�
merge_profile6src	Cs t�t�tjt�SQRXdS)z9Returns the cumulative execution profile until this call.N)r
r�copy�deepcopyrrrrr�snapshot_profileGsrcCsDt|�r|r|d}n|}dd�t|�D�}|jtjd�dd�|S)z�Returns the most common opcodes in order of descending frequency.

    The result is a list of tuples of the form
      (opcode, opname, # of occurrences)

    �cSs(g|] \}}|dkr|tj||f�qS)r)�opcode�opname)�.0�op�countrrr�
<listcomp>Ysz'common_instructions.<locals>.<listcomp>�T)�key�reverse���)r	�	enumerate�sort�operator�
itemgetter)rZ	inst_list�resultrrr�common_instructionsNs
r#cCs>t|�sgSdd�t|dd��D�}|jtjd�dd�|S)	z�Returns the most common opcode pairs in order of descending frequency.

    The result is a list of tuples of the form
      ((1st opcode, 2nd opcode),
       (1st opname, 2nd opname),
       # of occurrences of the pair)

    cSsHg|]@\}}t|�D].\}}|dkr||ftj|tj|f|f�qqS)r)rrr)rZop1Z
op1profileZop2rrrrrksz common_pairs.<locals>.<listcomp>NrrT)rrr)r	rrr r!)rr"rrr�common_pairs`s	r$cs&�dkrt���fdd�}dj|��S)z�Renders the most common opcode pairs to a string in order of
    descending frequency.

    The result is a series of lines of the form:
      # of occurrences: ('1st opname', '2nd opname')

    Nc3s*x$t��D]\}}}d||fVq
WdS)Nz%s: %s
)r$)�_Zopsr)rrr�seq~sz render_common_pairs.<locals>.seq�)r�join)rr&r)rr�render_common_pairstsr))N)�__doc__rrr rZ	threading�hasattr�RuntimeError�RLockr
rrr	r
rrr#r$r)rrrr�<module>s 


Youez - 2016 - github.com/yon3zu
LinuXploit