Vc76csddlZddlZddlZddlZejdkr dZdZdZnejdkrejdkr ddl m Z d Znej d rdd l mZnhejdkr]ddlZddlZd Zd ZejdkrdZndZej drdZdZnejdkrdZddZn dZdZdZdZedkr edSdS)Nntcsx d}tj|}|dkrdS|t|z}tj|ddd\}}t |dddz }|dkr|dz }t |dd d z }|dkrd }|dkr||zSdS) NzMSC v.z i iig$@r)sysversionZfindZlensplitint)ZprefixZiZsZrestZ majorVersionZ minorVersion $/usr/lib64/python3.11/ctypes/util.py_get_build_versionr s  K  V $ $ 7 1 F O+abb/''Q//41SbS6{{Q 2   A L1QqS6{{T) 1  L 1  /,. .tcs t}|dS|dkrd}n|dkr d|dzz}ndSddl}d|jjvr|dz }|d zS) Nrmsvcrtrzmsvcr%di rz_d.pydd.dll)r Zimportlib.machineryZ machineryZEXTENSION_SUFFIXES)rZclibnameZ importlib r find_msvcrtr"s3$&&  4 a< HH ]  GbL1HH4 #""" y*= =  OHr cs|dvrtStjdtjD]}tj||}tj|r|cS| drm|dz}tj|r|cSdS)N)cmZPATHr) rosenvironrZpathseppathjoinZisfileZlowerZendswith)nameZ directoryZfnamerr find_libraryr7s :  !== F+11"*==  IGLLD11Ew~~e$$  {{}}%%f-- FNEw~~e$$   tr posixdarwin) dyld_findcsrd|zd|z|d|g}|D]#} t|cS#t$rY wxYwdS)Nz lib%s.dylibz%s.dylibz .framework/) _dyld_find ValueError)rZpossible r rrHsv!D(%)-tt46  D !$'''''    ts ' 44aix)rcs d}t|d5}|d|kcdddS#1swxYwYdS)NsELFZbr)Zopenread)ZfilenameZ elf_headerZthefilerr _is_elfr$`s6 (D ! ! 1W<<??j0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1s :>>cstjdtj|z}t jd}|st jd}|sdSt j} |dd|jd|zg}ttj }d|d<d|d < tj |tj tj| }n7#t$r*Y |dS#t"$rYdSwxYwwxYw|5|j}dddn #1swxYwY |n:#t"$rYn.wxYw# |w#t"$rYwwxYwxYwtj||}|sdS|D]'} t+| stj| cSdS) N[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t-oz-lCLC_ALLLANGstdoutstderrenv)rfsencodereescapeshutilwhichtempfileZNamedTemporaryFilerdictr subprocessPopenPIPEZSTDOUTOSErrorZcloseZFileNotFoundErrorr+r#findallr$fsdecode) rexprZ c_compilerZtempargsr-procZtraceresfiles r _findLib_gccr@fsf {9BIdOOKLL\%((  ,d++J 4*,, $ 4$;GDrz""CCMCK !'/9/9/@,/111     $      + + ((** + + + + + + + + + + + + + + +  $      $    ju%% 4 % %D4== ;t$$ $ $ $  % %s,2E,C E DEC.. C<;C<?DED+ E+D//E2D/3E7E EEFE32F3 F=F?FFZsunos5csr|sdS tjdd|ftjtj}n#t$rYdSwxYw|5|j}dddn #1swxYwYtjd|}|sdStj | dS)Nz/usr/ccs/bin/dumpz-Lpvr+r,s\[.*\]\sSONAME\s+([^\s]+)r) r5r6r7DEVNULLr8r+r#r/searchrr:group)fr=datar>s r _get_sonamerGs t !')s r rGrGs/ tl9--G t !'$j!(L/9/9/ACCC   tt  * *{'')) * * * * * * * * * * * * * * *)3T::C t;syy||,, ,s#0A AA"BB B )ZfreebsdZopenbsdZ dragonflycs|d}g} |r7|dt||7n#t$rYnwxYw|p t jgS)Ns.r)rZinsertr Zpoprrmaxsize)ZlibnameZpartsZnumsrr _num_versionrKsMM$''ED 5KK3uyy{{#3#34445    (CK= (s9A A A cstj|}d|d|d}tj|} t jdtjtj}|5|j }dddn #1swxYwYn#t$rd}YnwxYwtj ||}|stt|S|ttj|dS) Nz:-lz\.\S+ => \S*/(libz\.\S+))/sbin/ldconfigz-rrAr )Zkeyr)r/r0rr.r5r6r7rBr+r#r8r9rGr@ZsortrKr:)rZenamer;r=rFr>r r rrsOIdOOEE8=uuuED;t$$D .!'(@/9/9/ACCC ..;++--D...............     *T4((C 7"<#5#5666 HHH & & &;s2w'' 's#+B BB  B  B! B!cstjdsdSttj}d|d<|rd}nd}d} t j|t jt j|}n#t$rYdSwxYw|5|j D]W}| }| dr,tj |d}X dddn #1swxYwY|sdS|d D]H}tj|d |z}tj|r|cSIdS) N /usr/bin/crler'r()rM-64)rMr*sDefault Library Path (ELF):r":zlib%s.so)rrZexistsr4rr5r6r7rBr8r+Zstrip startswithr:rr) ris64r-r<Zpathsr=ZlineZdirZlibfiles r _findLib_crlerRs7>>/22 trz""CCM */)E !'/9/9/A,/111   tt  = = K==D::<>7>>'**#"NNN#4s% ,A77 BB A C77C;>C;FcsZtt||pt|SN)rGrRr@)rrQr r rr s'}T488NLs r _findSoname_ldconfigrXs MMMs##q( 5(**,u4(**,u4+)+)( H ||GW55H1EK4((C CDDE %'7&>,6,>-7-?-7_58#*F*F HHH9LM)E18==??;;C9!{399Q<<8899999999 9 999999999999999999    s=!r?s r _findLib_ldrY,sM1BIdOOCD,Cjnn%677G * s++**AJJay)))) JJbj&4-8 9 9 9F $S,6O8<>>>Qjr{3'7'788--D#4==! ;t,,,,, -    MsBD)) D65D6cst|p7tt|ptt|SrS)rXrGr@rY)rs r rrGsE'--U|D1122U6A+dBSBS6T6T Ur csddlm}tjdkrRt |jt |dt tdtjdkrt tdt tdt tdtj d krt | d t | d t | d t | d dStj drddlm }tj dkrt d|dtjt d| dt tdt | dnKt d|dtjt d| dt dtdt d| tdt dtdt d| tddSt | dt | dt tddSdS)Nr)cdllrrrrrZbz2rz libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr!)CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz librpm.sozlibc.a(shr_64.o)z crypt :: Zcryptz crypto :: Zcryptozlibm.soz libcrypt.so)ZctypesrZrrZprintrZloadrrplatformZ LoadLibraryrPr[rJZ RTLD_MEMBER)rZr[r r testr]OsB w$& dk dii!!""" l8$$%%% w') l3    l3    l5!!""" <8 # ) $""<00 1 1 1 $""#455 6 6 6 $""#455 6 6 6 $""#<== > > > > > \ $ $U + + ) # # # # # #{U" [b44QSQ_;`;`bbcccV43C3CO3T3TVVWWWl5))***d&&{334444e44@RTVTb;c;ceefffY43C3CDV3W3WYYZZZ 6|G4466 7 7 7 Ht// W0E0EFFHH I I I 8 X 6 688 9 9 9 J 0 0h1G1G H HJJ K K K K K $""9-- . . . $""=11 2 2 2 ,w'' ( ( ( ( (?))r Z__main__)F)rr1r5rrr rrr\Zctypes.macholib.dyldrrrPZ ctypes._aixr/r3r$r@rGrKrRrXrYr]Z__name__)r r r^sQ  7d?CU2*    WDUCLH4DU<<<<<<     \U##wU)((((((WnU111 /%/%/%d |x'- - - - -" - - -, |BCCIU ) ) ) ( ( ( (*  !gU" " " H P P P P P    <   6 U U U&)&)&)P z DFFFFF  r