HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/shellingham/__pycache__/nt.cpython-37.pyc
B

��f��@s�ddlZddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZddl
mZed�jZdZdZdZdZejjZdd	d
�Zdd�ZGd
d�dej�Zegej_eej_eegej_eej_ee�ej_ee� e�gej!_eej!_ee�ej!_ee� e�gej"_eej"_ee�ej"_gej#_eej#_eeegej$_eej$_ee�ej$_eee	egej%_eej%_ee�ej%_ej&dd��Z'dd�Z(dd�Z)ddd�Z*dS)�N)	�BOOL�CHAR�DWORD�HANDLE�LONG�LPWSTR�MAX_PATH�PDWORD�ULONG)�SHELL_NAMES�����z�ics�fdd�}|S)Ncs|�krt���|S)N)�ctypes�WinError)�ret�func�args)�	error_val��?/opt/alt/python37/lib/python3.7/site-packages/shellingham/nt.py�checksz_check_handle.<locals>.checkr)rrr)rr�
_check_handlesrcs�fdd�}|S)Ncs*|rdSt��}|�krdSt�|��dS)NTF)rZGetLastErrorr)rrr�code)�expectedrrr(sz_check_expected.<locals>.checkr)rrr)rr�_check_expected'src@sVeZdZdefdefdefde�e�fdefdefdefdefd	efd
ee	ff
Z
dS)�ProcessEntry32�dwSizeZcntUsage�
th32ProcessIDZth32DefaultHeapIDZth32ModuleIDZ
cntThreads�th32ParentProcessIDZpcPriClassBaseZdwFlags�	szExeFileN)�__name__�
__module__�__qualname__rr�POINTERr
rrr�_fields_rrrrr3src	os&|||�}z
|VWdt�|�XdS)N)�kernel32�CloseHandle)�fr�kwargs�handlerrr�_handlegs

r,c	cs\tj}t|td��@}t�}t�|�|_t�||�}x|rL|Vt�	||�}q4WWdQRXdS)Nr)
r'�CreateToolhelp32Snapshotr,�TH32CS_SNAPPROCESSrr�sizeofr�Process32First�
Process32Next)r)Zsnap�entryrrrr�_iter_processespsr3cCsDtt�}x6t�d|j�}t�|d||�r.|jS|jd9_q
WdS)N�rr)rrr�create_unicode_buffer�valuer'�QueryFullProcessImageNameW)�proch�sizeZ	path_buffrrr�_get_full_path{sr:�
c	
Cs�dd�t�D�}|pt��}x�td|d�D]�}y||\}}Wntk
rVPYnXt|t�rn|�dd�}|�d�d�	�}|t
kr�|}q,t}tt
j|d|��}|t|�fSQRXq,WdS)NcSsi|]}|j|jf|j�qSr)r r!r)�.0�procrrr�
<dictcomp>�szget_shell.<locals>.<dictcomp>r��mbcs�replace�.)r3�os�getpid�range�KeyError�
isinstance�bytes�decode�
rpartition�lowerr�!PROCESS_QUERY_LIMITED_INFORMATIONr,r'�OpenProcessr:)	�pidZ	max_depthZproc_map�_Zppid�
executable�name�keyr8rrr�	get_shell�s$

rS)r)Nr;)+�
contextlibrrCZctypes.wintypesrrrrrrrr	r
Zshellingham._corerr6ZINVALID_HANDLE_VALUEZERROR_NO_MORE_FILESZERROR_INSUFFICIENT_BUFFERr.rL�windllr'rr�	Structurerr(�argtypes�restyper-�errcheckr%r0r1ZGetCurrentProcessIdrMr7�contextmanagerr,r3r:rSrrrr�<module>sR,