ddlZddlZddlZddlZddlZejjZdZdZ dZ dZ Gdde Z GddZdS) NceZdZdS)ArchiveReadErrorN)__name__ __module__ __qualname__pyimod01_archive.pyrr#sDr rc<eZdZdZdZddZedZd dZdS) ZlibArchiveReaderz Reader for PyInstaller's PYZ (ZlibArchive) archive. The archive is used to store collected byte-compiled Python modules, as individually-compressed entries. sPYZNFc||_||_i|_|"||\|_|_t |jd5}||jt j|t|j }||j krtd|tt}|r|tkrtdtjd|d^}}||j|zt jtt!j||_ddddS#1swxYwYdS)NrbzPYZ magic pattern mismatch!zPython magic pattern mismatch!z!i) _filename _start_offsettoc_parse_offset_from_filenameopenseekosSEEK_SETreadlen_PYZ_MAGIC_PATTERNrPYTHON_MAGIC_NUMBERstructunpackdictmarshalload) selffilename start_offset check_pymagicfpmagicpymagic toc_offset_s r __init__zZlibArchiveReader.__init__.s!)  151Q1QRZ1[1[ .DND. $.$ ' ' .2 GGD& 4 4 4GGC 78899E///&'DEEEggc"56677G I,?!?!?&'GHHH$]4<>FFcd}|d}|dkr||fS t||dzd}|d|}n#t$rYnwxYw||fS)z\ Parse the numeric offset from filename, stored as: `/path/to/file?offset`. r?rN)rfindint ValueError)r%offsetidxs r rz-ZlibArchiveReader._parse_offset_from_filenameOs nnS!! "99V# # #'((+,,F~HH    D s$A AAc\|j|}|td|d|\}}}|tkrdS t |jd5}||j|z||}dddn #1swxYwYn&#t$rtd|jdwxYw tj |}|ttfvr|stj|}n&#t"$r} t%d|d| d} ~ wwxYw|S) z Extract data from entry with the given name. If the entry belongs to a module or a package, the data is loaded (unmarshaled) into code object. To retrieve raw data, set `raw` flag to True. NzNo entry named z found in the archive!rzERROR: z appears to have been moved or deleted since this application was launched. Continouation from this state is impossible. Exiting now.zFailed to unmarshal PYZ entry !)rgetKeyErrorPYZ_ITEM_NSPKGrrrrrFileNotFoundError SystemExitzlib decompressPYZ_ITEM_MODULE PYZ_ITEM_PKGr"loadsEOFError ImportError) r$namerawentrytypecode entry_offset entry_lengthr(objes r extractzZlibArchiveReader.extractcs T"" =KTKKKLL L/4,,  ~ % %4 dnd++ ,r*\9:::ggl++ , , , , , , , , , , , , , , ,!    L$.LLL   Q/#&&CO\:::3:mC(( Q Q QHtHHHIIq P Q sHB$3B B$BB$B B$$#C :D D)D$$D))NF)F) rr r __doc__rr- staticmethodrrLr r r rr'sj"....B  \ &))))))r r)rrr"r=_frozen_importlib_bootstrap_external MAGIC_NUMBERrr?r@ PYZ_ITEM_DATAr: RuntimeErrorrrr r r rTs"  ';H       |   eeeeeeeeeer