ó
    ¯iÉ  ã                   ó„   • S r SSKJr  SSKJrJr  \R                  " \5      r	Sr
SrSrSrSrS	rSS
 jrSS jrSS jrS rg)z2
Read and write resources from/to Win32 PE files.
é    N)Ú
pywintypesÚwin32apié   éÁ   i  i  i  i  c           	      óÈ  • Ub  [        U5      OS1nUb  [        U5      OS1nUb  [        U5      OS1n0 n[        [        [        [        1n[
        R                  " U S[        5      n [
        R                  " U5      nSU;  a  U V	s/ s H  o™U;   d  M
  U	PM     nn	U H¼  n	 [
        R                  " Xi5      n
SU;  a  U
 Vs/ s H  o»U;   d  M
  UPM     n
nU
 H}  n [
        R                  " XiU5      nSU;  a  U Vs/ s H  oÝU;   d  M
  UPM     nnU H=  n [
        R                  " XiX½5      nX”;  a  0 XI'   X´U	   ;  a  0 XI   U'   XäU	   U   U'   M?     M     M¾     [
        R                  " U5        U$ ! [        R                   a!  nUR                  S   U;  a  e / n SnAGN)SnAff = fs  sn	f ! [        R                   a   nUR                  S   U;  a  e  SnAGMD  SnAff = fs  snf ! [        R                   a   nUR                  S   U;  a  e  SnAGME  SnAff = fs  snf ! [        R                   a   nUR                  S   U;  a  e  SnAGME  SnAff = f)aÂ  
Retrieve resources from the given PE file.

filename: path to the PE file.
types: a list of resource types (integers or strings) to search for (None = all).
names: a list of resource names (integers or strings) to search for (None = all).
languages: a list of resource languages (integers) to search for (None = all).

Returns a dictionary of the form {type: {name: {language: data}}}, which might also be empty if no matching
resources were found.
NÚ*r   )ÚsetÚERROR_RESOURCE_DATA_NOT_FOUNDÚERROR_RESOURCE_TYPE_NOT_FOUNDÚERROR_RESOURCE_NAME_NOT_FOUNDÚERROR_RESOURCE_LANG_NOT_FOUNDr   ÚLoadLibraryExÚLOAD_LIBRARY_AS_DATAFILEÚEnumResourceTypesr   ÚerrorÚargsÚEnumResourceNamesÚEnumResourceLanguagesÚLoadResourceÚFreeLibrary)ÚfilenameÚtypesÚnamesÚ	languagesÚoutputÚ_IGNORE_EXCEPTIONSÚmodule_handleÚavailable_typesÚeÚres_typeÚavailable_namesÚres_nameÚavailable_languagesÚres_langÚdatas                  ÚPC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller\utils\win32\winresource.pyÚget_resourcesr'      sq  € ð  Ñ+ŒC�ŒJ°#°€EØÑ+ŒC�ŒJ°#°€EØ"+Ñ"7”�I”¸c¸U€Ià€Fô 	&Ü%Ü%Ü%ð	Ðô ×*Ò*¨8°QÔ8PÓQ€MðÜ"×4Ò4°]ÓCˆð �%ÓÙ4CÓY²O¨ÐSXÑGXŸ8±OˆÐYã#ˆð	Ü&×8Ò8¸ÓQˆOð �eÓÙ8GÓ]º¨HÐW\ÑK\Ÿx¹ˆOÐ]ã'ˆHðÜ&.×&DÒ&DÀ]Ð^fÓ&gÐ#ð ˜)Ó#Ù@SÓ&mÒ@S°HÐclÑWl§xÑ@SÐ#Ð&mã/�ðÜ#×0Ò0°È(Ó]�Dð Ó)Ø')�FÑ$Ø¨(Ñ#3Ó3Ø13�FÑ$ XÑ.Ø7;�xÑ  Ñ*¨8Ó4ó 0ó (ñ $ôP ×Ò˜Ô'à€Møôe ×Ñó Ø�6‰6�!‰9Ð.Ó.ØØŽûðüò Zøô ×Ñó 	Ø�v‰v�a‰yÐ 2Ó2ØÞûð	üò ^øô ×#Ñ#ó Ø—6‘6˜!‘9Ð$6Ó6ØÞûðüò 'nøô "×'Ñ'ó Ø—v‘v˜a‘yÐ(:Ó:ØÞûðús„   Á)E8 Â		F0ÂF0Â$F5Ã	G,ÃG,ÃG1Ä 	H(ÄH(ÄH-Å8F-ÆF(Æ(F-Æ5G)Ç	G$Ç$G)Ç1H%ÈH È H%È-I!	ÉI	ÉI!	c           	      ó  • US:X  a  [        S5      eUb  [        U5      OS1nUb  [        U5      OS1n[        X/X45      nUR                  U0 5      nU H6  nUS:X  a  M  Xe;  a  0 XV'   U H  nUS:X  a  M  XuU   ;  d  M  SXV   U'   M     M8     [        R
                  " U S5      nUR                  5        H4  nXV   R                  5        H  n[        R                  " X‚XaU5        M     M6     [        R                  " US5        g)al  
Update or add a single resource in the PE file with the given binary data.

filename: path to the PE file.
data: binary data to write to the resource.
res_type: resource type to add/update (integer or string).
names: a list of resource names (integers or strings) to update (None = all).
languages: a list of resource languages (integers) to update (None = all).
r   z"res_type cannot be a wildcard (*)!Nr   )	Ú
ValueErrorr	   r'   Úgetr   ÚBeginUpdateResourceÚkeysÚUpdateResourceÚEndUpdateResource)	r   r%   r    r   r   Ú	resourcesr"   r$   r   s	            r&   Úadd_or_update_resourcer0   q   s
  € ð �3ƒÜÐ=Ó>Ð>àÑ+ŒC�ŒJ°#°€EØ"+Ñ"7”�I”¸c¸U€Iô ˜h¨
°EÓE€Ið —‘˜h¨Ó+€IãˆØ�s‹?ÙØÓ$Ø"$ˆIÑã!ˆHØ˜3‹ÙØ¨Ñ2Õ2Ø04�	Ñ# HÓ-ó	 "ñ ô ×0Ò0°¸1Ó=€MØ—N‘NÖ$ˆØ!Ñ+×0Ñ0Ö2ˆHÜ×#Ò# M¸XÈXÖVó 3ñ %ô ×Ò˜}¨aÕ0ó    c           
      ó„  • Ub  [        U5      OS1nUb  [        U5      OS1nUb  [        U5      OS1n[        XX45      nUR                  5        Hm  u  pgSU;  a  Xb;  a  M  UR                  5        HG  u  p‰SU;  a  Xƒ;  a  M  U	R                  5        H!  u  p«SU;  a  X¤;  a  M  [        XXh/U
/5        M#     MI     Mo     g)aÂ  
Update or add resources in the given PE file by copying them over from the specified source PE file.

filename: path to the PE file.
src_filename: path to the source PE file.
types: a list of resource types (integers or strings) to add/update via copy for (None = all).
names: a list of resource names (integers or strings) to add/update via copy (None = all).
languages: a list of resource languages (integers) to add/update via copy (None = all).
Nr   )r	   r'   Úitemsr0   )r   Úsrc_filenamer   r   r   r/   r    Úresources_for_typer"   Úresources_for_type_namer$   r%   s               r&   Úcopy_resources_from_pe_filer7   ›   sÉ   € ð  Ñ+ŒC�ŒJ°#°€EØÑ+ŒC�ŒJ°#°€EØ"+Ñ"7”�I”¸c¸U€Iô ˜l°5ÓD€Ià(1¯©Ö(9Ñ$ˆØ�eÓ Ó 5ÙØ1C×1IÑ1IÖ1KÑ-ˆHØ˜%Ó HÓ$9ÙØ"9×"?Ñ"?Ö"A‘�Ø˜iÓ'¨HÓ,EÙÜ& x°xÀÈhÈZÖXó #Bó 2Lò ):r1   c                 ó`   • [         R                  " U S5      n[         R                  " US5        g)z.
Remove all resources from the given PE file:
TFN)r   r+   r.   )r   r   s     r&   Úremove_all_resourcesr9   ¸   s&   € ô ×0Ò0°¸4Ó@€MÜ×Ò˜}¨eÕ4r1   )NNN)NN)Ú__doc__ÚPyInstaller.logÚlogÚloggingÚPyInstaller.compatr   r   Ú	getLoggerÚ__name__Úloggerr   ÚERROR_BAD_EXE_FORMATr
   r   r   r   r'   r0   r7   r9   © r1   r&   Ú<module>rD      s^   ðñõ "ß 3à	×	Ò	˜8Ó	$€àÐ ØÐ Ø $Ð Ø $Ð Ø $Ð Ø $Ð ôRôj'1ôTYó:5r1   