[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.226.150.171: ~ $
U

ل=^4h�@sHddlZddlZddlZddlmZddlmZGdd�de�ZdZ	dS)�N�)�model��VerificationErrorc@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdZdd
�Z	dd�Z
d[dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZeZeZdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z d5d6�Z!d7d8�Z"d9d:�Z#d\d=d>�Z$d?d@�Z%eZ&d]dAdB�Z'dCdD�Z(dEdF�Z)dGdH�Z*dIdJ�Z+d^dLdM�Z,d_dNdO�Z-dPdQ�Z.dRdS�Z/eZ0dTdU�Z1dVdW�Z2eZ3dXdY�Z4d;S)`�VGenericEngine�gFcCs||_|j|_g|_i|_dS�N)�verifier�ffi�export_symbols�_struct_pending_verification)�selfr	�r�/vengine_gen.py�__init__szVGenericEngine.__init__cCs|�d|j�dS)Nr)�
setdefaultr)r
�kwdsrrr�patch_extension_kwdssz#VGenericEngine.patch_extension_kwdscCsT|D]J}||}|dkrtj}|D]*}tj�||�}tj�|�r"|Sq"qdSr)�sys�path�os�join�isfile)r
Zmodule_namerZso_suffixesZ	so_suffix�basename�dirname�filenamerrr�find_moduleszVGenericEngine.find_modulecCsdSrr�r
rrr�
collect_types%szVGenericEngine.collect_types�cCs|j�|d�dS)N�
)Z_f�write)r
Zwhatrrr�_prnt(szVGenericEngine._prntcCs`|j}|t�||jj�|�d�tjdkr\tjdkr>d}nd}|j��}|d||f�dS)NZdeclZwin32��ZPyInit_Zinitzvoid %s%s(void) { }
)	r"�cffimod_headerr	Zpreamble�	_generater�platform�version_infoZget_module_name)r
�prnt�prefix�modnamerrr�write_source_to_f+s



z VGenericEngine.write_source_to_frcsj�jj}tj�tj�jj�}|�||����	�d�G���fdd�dt
j���d�}�j	�d|d�|S)NZloadingcs&eZdZ�Z�jZgZ�fdd�ZdS)z/VGenericEngine.load_library.<locals>.FFILibrarycs�jSr)�	_cffi_dirr)�
FFILibraryrr�__dir__Tsz7VGenericEngine.load_library.<locals>.FFILibrary.__dir__N)�__name__�
__module__�__qualname__Z_cffi_generic_moduler
Z	_cffi_ffir-r/r�r.�moduler
rrr.Psr.rZloaded��library)r
�_backendrrr�curdirr	Zmodulefilename�load_library�_load�types�
ModuleType)r
�flags�backendrr6rr3rr9AszVGenericEngine.load_librarycCs$dd�|jjj��D�}|��|S)NcSsg|]\}\}}||f�qSrr)�.0�key�tpZqualrrr�
<listcomp>^s
z4VGenericEngine._get_declarations.<locals>.<listcomp>)r
Z_parserZ
_declarations�items�sort)r
Zlstrrr�_get_declarations]s
�z VGenericEngine._get_declarationscCs�|��D]�\}}|�dd�\}}zt|d||f�}Wn tk
rVtd|��YnXz|||�Wqtk
r�}zt�||��W5d}~XYqXqdS)N� rz_generate_gen_%s_%sznot implemented in verify(): %r)rE�split�getattr�AttributeErrorr�	Exceptionr�attach_exception_info)r
�	step_name�namerA�kind�realname�method�errrr&cs��
zVGenericEngine._generatec
Ks~|��D]p\}}|�dd�\}}t|d||f�}z||||f|�Wqtk
rv}	zt�|	|��W5d}	~	XYqXqdS)NrFrz
_%s_gen_%s)rErGrHrJrrK)
r
r4rLrrMrArNrOrPrQrrrr:rszVGenericEngine._loadcCsdSrr�r
rArMrrr�_generate_nothing|sz VGenericEngine._generate_nothingcKsdSrr�r
rArMr4rrrr�_loaded_noopszVGenericEngine._loaded_noopcst|jr|�d||�dS|j}t|j�}g}t|j�D].\}}d}t|tj�rRd}|�	d||f�q6d|��fdd�t
|j|�D�}	|j}
t|
tj�r�|	�d|
�
d	���tj}
d
�|	�p�d}	d|}|j�	|�|jr�|jd
}nd}d|||	f}
d|�||
�
|
���|d�t|jtj��r0d}nt|jtj��sFd}nd}|d||d
�|�f�|d�|�dS)NFr�*z%sx%dzargument of %scs g|]\}}|�d|���qS)z %s)�
get_c_name)r?�type�arg��contextrrrB�s�z>VGenericEngine._generate_gen_function_decl.<locals>.<listcomp>rz *rz, Zvoid�
_cffi_f_%srFz	 %s%s(%s)zresult of %s�{z*r = zreturn z  %s%s(%s);�})�ellipsis�_generate_gen_constr"�len�args�	enumerate�
isinstancer�
StructOrUnion�append�zip�result�insertrW�	void_typerr�abiZVoidType)r
rArMr)ZnumargsZargnames�irXZindirectionZarglistZtpresult�wrappernamerkZfuncdeclZresult_coderrZr�_generate_gen_function_decl�sJ


�z*VGenericEngine._generate_gen_function_declcCsX|jr|�d|||�}�ng}|}tdd�|jD��sDt|jtj�r�g}t|j�D]6\}	}
t|
tj�r~t�	|
�}
|�
|	|
f�|�
|
�qR|j}t|tj�r�|jdkr�td|�
�f��t�	|�}|�d|�|�dd|f�tj}t�t|�||j�}|j�|�}d|}
|�||
�}|D]\}	}
|�||	|
|�}�qt|||�t|�j�
|�dS)NFcss|]}t|tj�VqdSr)rdrre)r?�typrrr�	<genexpr>�sz6VGenericEngine._loaded_gen_function.<locals>.<genexpr>z*'%s' is used as result type, but is opaquerrhr\)r_�_load_constant�anyrbrdrhrrerc�PointerTyperfZfldtypes�	TypeError�_get_c_namerirjZFunctionPtrType�tupler
�_get_cached_btype�
load_function�_make_struct_wrapper�setattrrXr-)r
rArMr4r6ZnewfunctionZindirections�base_tpZ
indirect_argsrlroZindirect_result�BFuncrmrrr�_loaded_gen_function�sJ�

��

�
�z#VGenericEngine._loaded_gen_functioncsP|jj�|j�|���dkr4|j����fdd�}n����fdd�}||_|S)Nrhcs ����}�|f|��|dS�Nr)�new)rb�res)�BTyper
�oldfuncrr�newfunc�s
z4VGenericEngine._make_struct_wrapper.<locals>.newfunccs6|d�����|��f|�dd�}�|�S)Nr)Znewp)rb)r�r>rlr�rrr��s.)r
r7rwZ_cffi_base_type)r
r�rlrAr{r�r)r�r>r
rlr�rry�sz#VGenericEngine._make_struct_wrappercCs|�|d|�dS�N�struct��_generate_struct_or_union_declrRrrr�_generate_gen_struct_decl�sz(VGenericEngine._generate_gen_struct_declcCs|�|d||�dSr���_loading_struct_or_union�r
rArMr4rrr�_loading_gen_struct�sz"VGenericEngine._loading_gen_structcKs|�|�dSr��_loaded_struct_or_unionrTrrr�_loaded_gen_struct�sz!VGenericEngine._loaded_gen_structcCs|�|d|�dS�N�unionr�rRrrr�_generate_gen_union_decl�sz'VGenericEngine._generate_gen_union_declcCs|�|d||�dSr�r�r�rrr�_loading_gen_unionsz!VGenericEngine._loading_gen_unioncKs|�|�dSrr�rTrrr�_loaded_gen_unionsz VGenericEngine._loaded_gen_unionc
Cs|jdkrdSd||f}d||f}d||f��}|j}|d||f�|d�|d�|d�|��D]�\}}	}
}t|	tj�r�|	��s�|
dkr�|d	|�qlz$|d
|	jdd||d
�|f�Wqlt	k
r�}z|dt
|��W5d}~XYqlXql|d�|j�|�|d|f�|d�|d|�|d�|d|�|d�|��D]h\}}	}
}|
dk�rp�qV|d||f�t|	tj
��r�|	jdk�r�|d|	���n|d||f��qV|d�|d�|d�|d�|d|f�|d�|�dS)Nz_cffi_check_%s_%s�_cffi_layout_%s_%s�%s %szstatic void %s(%s *p)r]z8  /* only to generate compile-time warnings or errors */z
  (void)p;rz  (void)((p->%s) << 1);z  { %s = &p->%s; (void)tmp; }z*tmpzfield %r)Zqualsz
  /* %s */r^zintptr_t %s(intptr_t i)z,  struct _cffi_aligncheck { char x; %s y; };z  static intptr_t nums[] = {z    sizeof(%s),z)    offsetof(struct _cffi_aligncheck, y),z    offsetof(%s, %s),z    0,  /* %s */z    sizeof(((%s *)0)->%s),z    -1z  };z  return nums[i];z3  /* the next line is not executed, but compiled */z  %s(0);)�fldnames�stripr"�
enumfieldsrdr�
PrimitiveType�is_integer_typerWr�strrrf�	ArrayType�lengthru)
r
rAr*rMZ
checkfuncname�layoutfuncname�cnamer)�fname�ftype�fbitsize�fqualrQrrrr�s\
���$
z-VGenericEngine._generate_struct_or_union_declcCs�|jdkrdSd||f}|j�d�d}|�||�}g}d}	||	�}
|
dkrPqd|�|
�|	d7}	q>t|tj�r�|jr�|d}|d}|ddd�}
|ddd�}|�	�|
|||f|_
nd||f��}||f|j|<dS)Nr�zintptr_t(*)(intptr_t)rr�r$r�)
r�r
�_typeof_lockedrxrfrdrre�partialZ
force_flattenZfixedlayoutr�r)r
rAr*rMr4r�r|�function�layoutZnum�xZ	totalsizeZtotalalignmentZfieldofsZ	fieldsizer�rrrr�7s*


z'VGenericEngine._loading_struct_or_unionc
Cs|jdkrdS|j�|�||jkr�dd�}|j}|�|�}|j�|�\}}||d|�|�d�||d|�|�d�d}|��D]v\}}	}
}|
dkr�q�||||�||�d|f�||ddkr�|�|	�}|||d|�|�d	|f�|d7}q�dS)
NcSs||krtd|||f��dS)Nz'%s (we have %d, but C compiler says %d)r)Z	realvalueZ
expectedvalue�msgrrr�checkZs��z5VGenericEngine._loaded_struct_or_union.<locals>.checkrzwrong total sizerzwrong total alignmentr�zwrong offset for field %rzwrong size for field %r)	r�r
rwr�pop�sizeofZalignofr�Zoffsetof)
r
rAr�r
ZBStructr�r�rlr�r�r�r�ZBFieldrrrr�Ss0


�
�
z&VGenericEngine._loaded_struct_or_unioncCs.t|tj�r|�||d�n|�|d|�dS�Nr)rdr�EnumType�_generate_gen_enum_declr�rRrrr�_generate_gen_anonymous_declusz+VGenericEngine._generate_gen_anonymous_declcCs2t|tj�r|�|||d�n|�|d||�dSr�)rdrr��_loading_gen_enumr�r�rrr�_loading_gen_anonymous{sz%VGenericEngine._loading_gen_anonymouscKs.t|tj�r |j|||f|�n
|�|�dSr)rdrr��_loaded_gen_enumr�rTrrr�_loaded_gen_anonymous�sz$VGenericEngine._loaded_gen_anonymousN�constc
Cs
|j}d||f}|j�|�|dk	rX|d|�|d�|�||�|d�|d�n�|r�|d|�|d�|d|f�|d|f�|d�nj|d	kr�d
}nd}d}	|dkr�t|tj�r�d
}	d
}||�d|	|f|��|d�|d||f�|d�|�dS)Nz_cffi_%s_%s�int %s(char *out_error)r]�  return 0;r^zint %s(long long *out_value)z  *out_value = (long long)(%s);z  return (%s) <= 0;�var�&rr�zconst *z %s%s(void)z  return (%s%s);)r"rrf�_check_int_constant_valuerdrrerW)
r
�is_intrMrA�category�check_valuer)�funcnameZ	ampersandZextrarrrr`�s6

z"VGenericEngine._generate_gen_constcCs&t|tj�o|��}|�|||�dSr)rdrr�r�r`)r
rArMr�rrr�_generate_gen_constant_decl�sz*VGenericEngine._generate_gen_constant_declcCsd|}|dk	r"|�||�|}n�|r�|j�d�d}|j�d�d}	|�|	|�}
|j�|�}|
|�}t|d�}|dkr�|s�|j�d�d}
|dd|j�|
�>7}nVd}t|tj	�r�d	|}|j�|�
||��d}	|�|	|�}
|
�}t|tj	�r�|d}|S)
Nz_cffi_const_%sz
long long*rzint(*)(long long*)z	long longr�z	(*)(void)rV)�_load_known_int_constantr
r�rxr�intr�rdrrerW)r
r�rArMr4r�r��valuer�r|r��p�negativeZ	BLongLongZfntypeextrarrrrq�s.zVGenericEngine._load_constantcCsDt|tj�o|��}|�||||�}t|||�t|�j�|�dSr)	rdrr�r�rqrzrXr-rf)r
rArMr4r6r�r�rrr�_loaded_gen_constant�sz#VGenericEngine._loaded_gen_constantcCs�|j}|dkr"|d|||f�n|d|||f�|d�|d|�|d|�|d�|d|�|d	�|d
|dd�|f�|d�|d
�dS)Nrz&  if ((%s) > 0 || (long)(%s) != %dL) {z1  if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {z    char buf[64];z    if ((%s) <= 0)z)        sprintf(buf, "%%ld", (long)(%s));z    elsez2        sprintf(buf, "%%lu", (unsigned long)(%s));z:    sprintf(out_error, "%s has the real value %s, not %s",z            "%s", buf, "%d");�dz    return -1;z  })r")r
rMr�r)rrrr��s.�
��z(VGenericEngine._check_int_constant_valuecCsr|j�d�d}|j�d�d}|�||�}|j�|d�}||�dkrn|j�|�}tjdkrft|d�}t|��dS)Nzchar[]rz
int(*)(char*)�r#zutf-8)	r
r�rxr�stringrr(r�r)r
r4r�r�r|r�r��errorrrrr��s

z'VGenericEngine._load_known_int_constantcCs|�dd�}d||fS)N�$Z___D_z
_cffi_e_%s_%s)�replace)r
r*rMrrr�_enum_funcname�szVGenericEngine._enum_funcname�enumcCs�|jr"|jD]}|�d|�qdS|�||�}|j�|�|j}|d|�|d�t|j|j�D]\}}|�	||�qb|d�|d�|�dS)NTr�r]r�r^)
r��enumeratorsr`r�rrfr"rg�
enumvaluesr�)r
rArMr*�
enumeratorr�r)�	enumvaluerrrr��s
z&VGenericEngine._generate_gen_enum_declcsL�jr0���fdd��jD�}t|��_d�_n��||�}���|�dS)Ncsg|]}��d�|���qS)T)rq)r?r��r4r
rArrrBs�z4VGenericEngine._loading_gen_enum.<locals>.<listcomp>T)r�r�rvr�Zpartial_resolvedr�r�)r
rArMr4r*r�r�rr�rr�s�
z VGenericEngine._loading_gen_enumcCs8t|j|j�D]$\}}t|||�t|�j�|�qdSr)rgr�r�rzrXr-rf)r
rArMr4r6r�r�rrrr�szVGenericEngine._loaded_gen_enumcCs&|dkrd}n|}|jd||d�dS�N�...T)r�)r`)r
rArMr�rrr�_generate_gen_macro_decl sz'VGenericEngine._generate_gen_macro_declcCsF|dkrd}n|}|jd||||d�}t|||�t|�j�|�dSr�)rqrzrXr-rf)r
rArMr4r6r�r�rrr�_loaded_gen_macro)s�z VGenericEngine._loaded_gen_macrocCs�t|tj�rx|jdkr\|j}d|f}|j�|�|d|�|d�|d|f�|d�t�|j�}|�	d||�nt�|�}|j	d||dd	�dS)
Nr��_cffi_sizeof_%szsize_t %s(void)r]z  return sizeof(%s);r^Fr�)r�)
rdrr�r�r"rrfrs�itemr`)r
rArMr)r��tp_ptrrrr�_generate_gen_variable_decl6s


z*VGenericEngine._generate_gen_variable_declcs^t|tj�r�|jdkr�d|f}|j�d�d}|�||�}|�}|j�|j�}	t	||j�
|	��\}
}|dkr�td||jf��|�|
�}t�
|j�}|�d|||�}
|jdk	r�|j�|�}|j�||
�}
t|||
�t|�j�|�dSd|}|j�|�d|��d}|�||�}|���fd	d
�}�fdd�}tt|�|t||��t|�j�|�dS)
Nr�r�zsize_t(*)(void)rz/bad size: %r does not seem to be an array of %sFz_cffi_var_%sz
*(*)(void)cs�dSr~rr5�Zptrrr�gettergsz3VGenericEngine._loaded_gen_variable.<locals>.gettercs|�d<dSr~r)r6r�r�rr�setterisz3VGenericEngine._loaded_gen_variable.<locals>.setter)rdrr�r�r
r�rxrwr��divmodr�rZresolve_lengthrsrq�castrzrXr-rfrW�property)r
rArMr4r6r�r|r��sizeZ	BItemTyper��restr�r�ZBArrayr�r�rr�r�_loaded_gen_variableHs>

��

z#VGenericEngine._loaded_gen_variable)r)r)Nr�N)N)r�)r�)5r0r1r2Z
_class_keyZ_gen_python_modulerrrrr"r,r9rEr&r:rSrUZ_generate_gen_typedef_declZ_loading_gen_typedefZ_loaded_gen_typedefrnZ_loading_gen_functionr}ryr�r�r�r�r�r�r�r�r�r�r�r�r`r�Z_loading_gen_constantrqr�r�r�r�r�r�r�r�Z_loading_gen_macror�r�Z_loading_gen_variabler�rrrrrsh



-$1"	�
%
	



rad
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/types.h>   /* XXX for ssize_t on some platforms */

/* this block of #ifs should be kept exactly identical between
   c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
   and cffi/_cffi_include.h */
#if defined(_MSC_VER)
# include <malloc.h>   /* for alloca() */
# if _MSC_VER < 1600   /* MSVC < 2010 */
   typedef __int8 int8_t;
   typedef __int16 int16_t;
   typedef __int32 int32_t;
   typedef __int64 int64_t;
   typedef unsigned __int8 uint8_t;
   typedef unsigned __int16 uint16_t;
   typedef unsigned __int32 uint32_t;
   typedef unsigned __int64 uint64_t;
   typedef __int8 int_least8_t;
   typedef __int16 int_least16_t;
   typedef __int32 int_least32_t;
   typedef __int64 int_least64_t;
   typedef unsigned __int8 uint_least8_t;
   typedef unsigned __int16 uint_least16_t;
   typedef unsigned __int32 uint_least32_t;
   typedef unsigned __int64 uint_least64_t;
   typedef __int8 int_fast8_t;
   typedef __int16 int_fast16_t;
   typedef __int32 int_fast32_t;
   typedef __int64 int_fast64_t;
   typedef unsigned __int8 uint_fast8_t;
   typedef unsigned __int16 uint_fast16_t;
   typedef unsigned __int32 uint_fast32_t;
   typedef unsigned __int64 uint_fast64_t;
   typedef __int64 intmax_t;
   typedef unsigned __int64 uintmax_t;
# else
#  include <stdint.h>
# endif
# if _MSC_VER < 1800   /* MSVC < 2013 */
#  ifndef __cplusplus
    typedef unsigned char _Bool;
#  endif
# endif
#else
# include <stdint.h>
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
#  include <alloca.h>
# endif
#endif
)
rrr;rrr�r�objectrr%rrrr�<module>sg

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 452 B 0644
__init__.cpython-38.pyc File 452 B 0644
api.cpython-38.opt-1.pyc File 33.25 KB 0644
api.cpython-38.pyc File 33.3 KB 0644
backend_ctypes.cpython-38.opt-1.pyc File 38.74 KB 0644
backend_ctypes.cpython-38.pyc File 39.04 KB 0644
cffi_opcode.cpython-38.opt-1.pyc File 4.54 KB 0644
cffi_opcode.cpython-38.pyc File 4.59 KB 0644
commontypes.cpython-38.opt-1.pyc File 1.75 KB 0644
commontypes.cpython-38.pyc File 1.8 KB 0644
cparser.cpython-38.opt-1.pyc File 21.75 KB 0644
cparser.cpython-38.pyc File 21.88 KB 0644
error.cpython-38.opt-1.pyc File 1.41 KB 0644
error.cpython-38.pyc File 1.41 KB 0644
ffiplatform.cpython-38.opt-1.pyc File 3.38 KB 0644
ffiplatform.cpython-38.pyc File 3.38 KB 0644
lock.cpython-38.opt-1.pyc File 346 B 0644
lock.cpython-38.pyc File 346 B 0644
model.cpython-38.opt-1.pyc File 18.94 KB 0644
model.cpython-38.pyc File 19.11 KB 0644
pkgconfig.cpython-38.opt-1.pyc File 5 KB 0644
pkgconfig.cpython-38.pyc File 5 KB 0644
recompiler.cpython-38.opt-1.pyc File 44.86 KB 0644
recompiler.cpython-38.pyc File 45.34 KB 0644
setuptools_ext.cpython-38.opt-1.pyc File 6.94 KB 0644
setuptools_ext.cpython-38.pyc File 6.97 KB 0644
vengine_cpy.cpython-38.opt-1.pyc File 34.38 KB 0644
vengine_cpy.cpython-38.pyc File 34.63 KB 0644
vengine_gen.cpython-38.opt-1.pyc File 20.21 KB 0644
vengine_gen.cpython-38.pyc File 20.5 KB 0644
verifier.cpython-38.opt-1.pyc File 8.93 KB 0644
verifier.cpython-38.pyc File 8.96 KB 0644