403Webshell
Server IP : 146.190.157.162  /  Your IP : 216.73.216.78
Web Server : Apache
System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User : businessweek ( 639)
PHP Version : 8.2.10-2ubuntu2.2
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/PIL/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/PIL/__pycache__/BlpImagePlugin.cpython-311.pyc
�

D#�dl<��p�dZddlZddlZddlmZddlmZddlmZm	Z	Gd�de��Z
Gd	�d
e��ZGd�de��Zd
�Z
d$d�Zd�Zd�ZGd�de��Zd�ZGd�de	j	��ZGd�de	j��ZGd�de��ZGd�de��ZGd�de	j��Zd$d�Zejejee��ejejd ��ejd!e��ejd"e��ej eje��ej!d#e��dS)%a�
Blizzard Mipmap Format (.blp)
Jerome Leclanche <jerome@leclan.ch>

The contents of this file are hereby released in the public domain (CC0)
Full text of the CC0 license:
  https://creativecommons.org/publicdomain/zero/1.0/

BLP1 files, used mostly in Warcraft III, are not fully supported.
All types of BLP2 files used in World of Warcraft are supported.

The BLP file structure consists of a header, up to 16 mipmaps of the
texture

Texture sizes must be powers of two, though the two dimensions do
not have to be equal; 512x256 is valid, but 512x200 is not.
The first mipmap (mipmap #0) is the full size image; each subsequent
mipmap halves both dimensions. The final mipmap should be 1x1.

BLP files come in many different flavours:
* JPEG-compressed (type == 0) - only supported for BLP1.
* RAW images (type == 1, encoding == 1). Each mipmap is stored as an
  array of 8-bit values, one per pixel, left to right, top to bottom.
  Each value is an index to the palette.
* DXT-compressed (type == 1, encoding == 2):
- DXT1 compression is used if alpha_encoding == 0.
  - An additional alpha bit is used if alpha_depth == 1.
  - DXT3 compression is used if alpha_encoding == 1.
  - DXT5 compression is used if alpha_encoding == 7.
�N)�IntEnum)�BytesIO�)�Image�	ImageFilec��eZdZdZdS)�FormatrN)�__name__�
__module__�__qualname__�JPEG���4/usr/lib/python3/dist-packages/PIL/BlpImagePlugin.pyr	r	(s�������D�D�Drr	c��eZdZdZdZdZdS)�Encodingr��N)r
rr�UNCOMPRESSED�DXT�UNCOMPRESSED_RAW_BGRArrrrr,s �������L�
�C����rrc��eZdZdZdZdZdS)�
AlphaEncodingrr�N)r
rr�DXT1�DXT3�DXT5rrrrr2s�������D��D��D�D�Drrc�<�|dz	dzdz|dz	dzdz|dzdzfS)N��r��?rr)�is r�
unpack_565r$8s2��
�"�W����"�a�1�f��_��$:�Q��X�!�O�K�KrFc	�T�t|��dz}t��t��t��t��f}t|��D�]N}|dz}tjd||��\}}}t|��\}	}
}t|��\}}
}td��D]�}td��D]�}|dz}|dz	}d}|dkr|	|
|}}}n�|dkr||
|}}}n||dkrA||kr"d|	z|zdz}d|
z|
zdz}d|z|zdz}nN|	|zdz}|
|
zdz}||zdz}n5|dkr/||kr"d|z|	zdz}d|
z|
zdz}d|z|zdz}nd	\}}}}|r ||�||||g����||�|||g������P|S)
�E
    input: one "row" of data (i.e. will produce 4*width pixels)
    �z<HHI�rr�rr)rrrr��len�	bytearray�range�struct�unpack_fromr$�extend)�data�alpha�blocks�ret�block�idx�color0�color1�bits�r0�g0�b0�r1�g1�b1�jr#�control�a�r�g�bs                      r�decode_dxt1rF<s)��
��Y�Y�!�^�F��;�;�	���Y�[�[�)�+�+�
>�C��v���*-�*-���a�i��%�1�&�$��D�D�������'�'�
��B����'�'�
��B���q��� 	-� 	-�A��1�X�X�
-�
-����(���q�y�����a�<�<� �"�b�!�q�A�A���\�\� �"�b�!�q�A�A���\�\�������V�b�[�Q�.����V�b�[�Q�.����V�b�[�Q�.����"�W��N���"�W��N���"�W��N�����\�\�������V�b�[�Q�.����V�b�[�Q�.����V�b�[�Q�.���%/�
��1�a���-���F�M�M�1�a��A�,�/�/�/�/���F�M�M�1�a��)�,�,�,�,�?
-� 	-�D�Jrc	��t|��dz}t��t��t��t��f}t|��D�]i}|dz}|||dz�}tjd|��}tjd|d��\}}tjd|d��\}t|��\}	}
}t|��\}}
}td��D]�}d}td��D]�}d|z|zd	z}||}|rd}|dz}nd
}|dz}|dz}|d	d|z|zzz	d
z}|dkr|	|
|}}}n\|dkr||
|}}}nO|d	kr"d	|	z|zd
z}d	|
z|
zd
z}d	|z|zd
z}n'|d
kr!d	|z|	zd
z}d	|
z|
zd
z}d	|z|zd
z}||�||||g���Ōِ�k|S)r&�z<8B�<HHr'�<I�r(FrT��rrrr*)r1r3r4r5r6r9r7r8�coder:r;r<r=r>r?r@�highr#�alphacode_indexrB�
color_coderCrDrEs                        r�decode_dxt3rRss>��
��Y�Y�"�_�F��;�;�	���Y�[�[�)�+�+�
>�C��v���(,�(,���b�j���S�3��8�^�$���!�%��/�/���+�E�5�!�<�<�����$�T�5�"�5�5�����'�'�
��B����'�'�
��B���q���	,�	,�A��D��1�X�X�
,�
,��#$�q�5�1�9��"2����)���� �D��!�G�A�A��D���H�A��R���"�a�1�q�5�1�9�o�5��=�
���?�?� �"�b�!�q�A�A��1�_�_� �"�b�!�q�A�A��1�_�_��R��"���*�A��R��"���*�A��R��"���*�A�A��1�_�_��R��"���*�A��R��"���*�A��R��"���*�A��A��
�
�q�!�Q��l�+�+�+�+�5
,�	,�<�Jrc	��t|��dz}t��t��t��t��f}t|��D�](}|dz}|||dz�}tjd|��\}}tjd|d��}|d|ddzz|ddzz|dd	zz}|d
|ddzz}	tjd|d��\}
}tjd
|d��\}t|
��\}
}}t|��\}}}td��D�]=}td��D�])}dd|z|zz}|dkr	|	|z	dz}n |dkr|	dz	|dzdzz}n||dz
z	dz}|d
kr|}nJ|dkr|}nA||krd|z
|z|dz
|zzdz}n&|dkrd
}n|dkrd}nd|z
|z|dz
|zzdz}|dd|z|zzz	dz}|d
kr|
||}}}n\|dkr|||}}}nO|dkr"d|
z|zdz}d|z|zdz}d|z|zdz}n'|dkr!d|z|
zdz}d|z|zdz}d|z|zdz}||�||||g����+��?��*|S)zG
    input: one "row" of data (i.e. will produce 4 * width pixels)
    rHz<BBz<6Brrr'r(r!�rrrIrJrKrrL�r)r*)r1r3r4r5r6�a0�a1r9�
alphacode1�
alphacode2r7r8rNr:r;r<r=r>r?r@r#rP�	alphacoderBrQrCrDrEs                            r�decode_dxt5r[�sA��
��Y�Y�"�_�F��;�;�	���Y�[�[�)�+�+�
>�C��v���9,�9,���b�j���S�3��8�^�$���#�E�5�1�1���B��!�%���2�2���!�W��Q��1��-��a��B��?�4��7�b�=�Q�
��!�W��Q��1��-�
��+�E�5�!�<�<�����$�T�5�"�5�5�����'�'�
��B����'�'�
��B���q���(	,�(	,�A��1�X�X�'
,�'
,��"#�q�1�u�q�y�/��"�b�(�(�!+��!>�$� F�I�I�$��*�*�!+�r�!1�z�Q��$�6N� O�I�I�!+��"�0D�!E�� M�I���>�>��A�A��!�^�^��A�A��"�W�W��i�-�2�-��Q��"�0D�D��J�A�A��!�^�^��A�A��!�^�^��A�A��i�-�2�-��Q��"�0D�D��J�A�"�a�1�q�5�1�9�o�5��=�
���?�?� �"�b�!�q�A�A��1�_�_� �"�b�!�q�A�A��1�_�_��R��"���*�A��R��"���*�A��R��"���*�A�A��1�_�_��R��"���*�A��R��"���*�A��R��"���*�A��A��
�
�q�!�Q��l�+�+�+�+�O'
,�(	,�T�Jrc��eZdZdS)�BLPFormatErrorN)r
rrrrrr]r]�s�������Drr]c��|dd�dvS)Nr(��BLP1�BLP2r)�prefixs r�_acceptrc�s���"�1�"�:�+�+�+rc� �eZdZdZdZdZd�ZdS)�BlpImageFilez 
    Blizzard Mipmap Format
    �BLPzBlizzard Mipmap Formatc��|j�d��|_|j�dtj��t
jd|j�d����\|_|j�dtj��t
jd|j�d����|_	|jdvr|j�
��}n&d	t|j����}t|���|jrd
nd|_
|d|jzd
|j
d
dffg|_dS)Nr(r!�<brr�<IIr'r_zBad BLP magic �RGBA�RGB�rrr)�fp�read�magic�seek�os�SEEK_CURr.�unpack�_blp_alpha_depth�_size�decode�reprr]�mode�size�tile)�self�decoder�msgs   r�_openzBlpImageFile._open�s	���W�\�\�!�_�_��
�����Q���$�$�$�#)�=��t�w�|�|�A���#G�#G� ��	�����Q���$�$�$��]�5�$�'�,�,�q�/�/�:�:��
��:�+�+�+��j�'�'�)�)�G�G�5�4��
�#3�#3�5�5�C� ��%�%�%�"�3�>�F�F���	��v��	�1�1�t�y�!�Q�6G�H�I��	�	�	rN)r
rr�__doc__�format�format_descriptionr~rrrrere�s?���������F�1��J�J�J�J�Jrrec�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)�_BLPBaseDecoderTc��	|���|���n)#tj$r}d}t	|��|�d}~wwxYwdS)NzTruncated BLP file)���r)�_read_blp_header�_loadr.�error�OSError)r{�buffer�er}s    rrvz_BLPBaseDecoder.decodesc��	&��!�!�#�#�#��J�J�L�L�L�L���|�	&�	&�	&�&�C��#�,�,�A�%�����	&�����us�(+�A�A�Ac���|j�d��tjd|�d����\|_tjd|�d����\|_tjd|�d����\|_tjd|�d����\|_|j�dtj
��tjd|�d����|_t|t��rTtjd|�d����\|_|j�dtj
��tjd|�d����|_tjd|�d����|_dS)	Nr(�<irhrrir'�<16I�@)�fdrpr.rs�
_safe_read�_blp_compression�
_blp_encodingrt�_blp_alpha_encodingrqrrry�
isinstance�BLP1Decoder�_blp_offsets�_blp_lengths)r{s rr�z _BLPBaseDecoder._read_blp_headersi������Q����#)�=��t���q�7I�7I�#J�#J� ��	� &�
�d�D�O�O�A�4F�4F� G� G���	�#)�=��t���q�7I�7I�#J�#J� ��	�&,�m�D�$�/�/�!�:L�:L�&M�&M�#��	!�����Q���$�$�$��M�%�����);�);�<�<��	��d�K�(�(�	)�$*�M�$�����8J�8J�$K�$K�!�T�
��G�L�L��B�K�(�(�(�"�M�&�$�/�/�&�2I�2I�J�J���"�M�&�$�/�/�&�2I�2I�J�J����rc�6�tj|j|��S)N)rr�r�)r{�lengths  rr�z_BLPBaseDecoder._safe_read0s���#�D�G�V�4�4�4rc���g}td��D]`}	tjd|�d����\}}}}n#tj$rYnwxYw|�||||f���a|S)N��<4Br()r-r.rsr�r��append)r{r4r#rErDrCrBs       r�
_read_palettez_BLPBaseDecoder._read_palette3s������s���	%�	%�A�
�#�]�5�$�/�/�!�2D�2D�E�E�
��1�a�����<�
�
�
����
�����J�J��1�a��|�$�$�$�$��
s�-A�A�Ac�j�t��}t|�|jd����}		t	jd|�d����\}n#tj$rYn9wxYw||\}}}}|||f}	|jr|	|fz
}	|�	|	���v|S)NrT�<Br)
r,rr�r�r.rsrnr�rtr0)
r{�paletter1�_data�offsetrErDrCrB�ds
          r�
_read_bgraz_BLPBaseDecoder._read_bgra=s����{�{�������(9�!�(<�=�=�>�>��		�
�"�M�$��
�
�1�
�
�>�>�	�����<�
�
�
���
���� ���J�A�q�!�Q��A�q�	�A��$�
��a�T�	���K�K��N�N�N�		��s�*A)�)A;�:A;N)	r
rr�	_pulls_fdrvr�r�r�r�rrrr�r�sg�������I����K�K�K�&5�5�5����
�
�
�
�
rr�c��eZdZd�Zd�ZdS)r�c��|jtjkr|���dS|jdkr||jdvrM|���}|�|��}|�t|����dSdt|j����}t|���dt|j����}t|���)Nr)r(r!zUnsupported BLP encoding zUnsupported BLP compression )r�r	r
�_decode_jpeg_streamr�r�r��
set_as_raw�bytesrwr])r{r�r1r}s    rr�zBLP1Decoder._loadNs���� �F�K�/�/��$�$�&�&�&�&�&�
�
"�a�
'�
'��!�V�+�+��,�,�.�.�����w�/�/������d���,�,�,�,�,�L�$�t�7I�2J�2J�L�L��$�S�)�)�)�K��d�6H�1I�1I�K�K�C� ��%�%�%rc���ddlm}tjd|�d����\}|�|��}|�|jd|j���z
��|�|jd��}||z}t|��}||��}tj|j��|j
dkr&|jd\}}}}	||||	ddffg|_|�d�����\}
}}tjd|||
f��}|�|�����dS)Nr)�
JpegImageFilerJr(r�CMYKrk)�JpegImagePluginr�r.rsr�r�r��tellr�rr�_decompression_bomb_checkryrxrz�convert�split�merger��tobytes)
r{r��jpeg_header_size�jpeg_headerr1�image�decoder_name�extentsr��argsrCrDrEs
             rr�zBLP1Decoder._decode_jpeg_stream^sW��2�2�2�2�2�2�$�m�D�$�/�/�!�2D�2D�E�E��	��o�o�&6�7�7������)�!�,�t�w�|�|�~�~�=�>�>�>����t�0��3�4�4���T�!���t�}�}���
�d�#�#��
�'��
�3�3�3��:����27�*�Q�-�/�L�'�6�4�'��&�4��7�F�:K�L�M�E�J��-�-��&�&�,�,�.�.���1�a���E�A�q�!�9�-�-������
�
���(�(�(�(�(rN)r
rrr�r�rrrr�r�Ms2������&�&�&� )�)�)�)�)rr�c��eZdZd�ZdS)�BLP2Decoderc�X�|���}|j�|jd��|jdk�r|jtjkr|�|��}�n|jtj	k�r�t��}|jtj
kry|jddzdzdz}t|jddzdz��D]@}t!|�|��t%|j�����D]}||z
}��A�nd|jtjkrd|jddzdzdz}t|jddzdz��D],}t+|�|����D]}||z
}��-n�|jtjkrd|jddzdzdz}t|jddzdz��D],}t/|�|����D]}||z
}��-nrdt1|j����}t3|���d	t1|j����}t3|���d
t1|j����}t3|���|�t7|����dS)Nrrrr(r')r2rHzUnsupported alpha encoding zUnknown BLP encoding zUnknown BLP compression )r�r�rpr�r�r�rrr�rr,r�rrryr-rFr��boolrtrrRrr[rwr]r�r�)r{r�r1�linesize�ybr�r}s       rr�zBLP2Decoder._loadrs����$�$�&�&������T�&�q�)�*�*�*�� �A�%�%��!�X�%:�:�:����w�/�/����#�x�|�3�3� �{�{���+�}�/A�A�A� $�	�!��q� 0�Q�6��:�H�#�T�Y�q�\�A�%5�!�$;�<�<�&�&��!,� �O�O�H�5�5�T�$�BW�=X�=X�"�"�"�&�&�A�!�A�I�D�D�&�&��-��1C�C�C� $�	�!��q� 0�Q�6��;�H�#�T�Y�q�\�A�%5�!�$;�<�<�&�&��!,�T�_�_�X�-F�-F�!G�!G�&�&�A� �A�I�D�D�&�&��-��1C�C�C� $�	�!��q� 0�Q�6��;�H�#�T�Y�q�\�A�%5�!�$;�<�<�&�&��!,�T�_�_�X�-F�-F�!G�!G�&�&�A� �A�I�D�D�&�&�Y��T�=U�8V�8V�X�X�C�(��-�-�-�H�d�4�3E�.F�.F�H�H��$�S�)�)�)�K�T�$�2G�-H�-H�J�J�C� ��%�%�%�����d���$�$�$�$�$rN)r
rrr�rrrr�r�qs#������+%�+%�+%�+%�+%rr�c��eZdZdZd�Zd�ZdS)�
BLPEncoderTc	���d}|j�dd��}td��D]5}||dz|dzdz�\}}}}|tjd||||��z
}�6|S)Nrrjr�r(rr�)�im�
getpaletter-r.�pack)r{r1r�r#rCrDrErBs        r�_write_palettezBLPEncoder._write_palette�sy�����'�$�$�V�V�4�4���s���	3�	3�A� ��Q��!�a�%�1��!4�5�J�A�q�!�Q��F�K��q�!�Q��2�2�2�D�D��rc
��|���}dt|��z}tjd|gd�R�}|jj\}}|tjd||zgd�R�z
}||z
}t
|��D]F}t
|��D]4}|tjd|j�||f����z
}�5�Gt|��d|fS)N�r�)rrrrrrrrrrrrrrrr�r)r�r+r.r�r�ryr-�getpixel)	r{�bufsize�palette_datar�r1�w�h�y�xs	         r�encodezBLPEncoder.encode�s����*�*�,�,�� �3�|�#4�#4�4���{�6�6�8�Y�8�8�8���w�|���1����F�A��E�8�Y�8�8�8�8�������q���	D�	D�A��1�X�X�
D�
D�����D�$�'�*:�*:�A�q�6�*B�*B�C�C�C���
D��4�y�y�!�T�!�!rN)r
rr�
_pushes_fdr�r�rrrr�r��s7�������J����"�"�"�"�"rr�c���|jdkrd}t|���|j�d��dkrdnd}|�|��|�tjdd����|�tjd	tj����|�tjd	|j	jd
krdnd����|�tjd	d����|�tjd	d����|�tjdg|j
�R���|dkrP|�tjdd
����|�tjdd����tj||dd|j
zd|jfg��dS)N�PzUnsupported BLP image mode�blp_version�BLP1r`rar�rrhrjrrir!rfrl)
rx�
ValueError�encoderinfo�get�writer.r�rrr�ryr�_save)r�rm�filename�save_allr}ros      rr�r��s���	�w�#�~�~�*����o�o���~�)�)�-�8�8�F�B�B�G�G��E��H�H�U�O�O�O��H�H�V�[��q�
!�
!�"�"�"��H�H�V�[��x�4�
5�
5�6�6�6��H�H�V�[��B�J�O�v�$=�$=�q�q�1�
E�
E�F�F�F��H�H�V�[��q�
!�
!�"�"�"��H�H�V�[��q�
!�
!�"�"�"��H�H�V�[��
)���
)�
)�
)�*�*�*�����
�����T�1�%�%�&�&�&�
�����T�1�%�%�&�&�&�
�O�B��e�V�b�g�%5�q�"�'�B�C�D�D�D�D�Drz.blpr��BLP2rf)F)"rrqr.�enumr�ior�rrr	rrr$rFrRr[�NotImplementedErrorr]rcre�	PyDecoderr�r�r��	PyEncoderr�r��
register_openr��register_extension�register_decoder�
register_save�register_encoderrrr�<module>r�s�����>
�	�	�	�
�
�
�
���������������������
�
�
�
�
�W�
�
�
������w����
�
�
�
�
�G�
�
�
�L�L�L�4�4�4�4�n2�2�2�jC�C�C�L	�	�	�	�	�(�	�	�	�,�,�,�J�J�J�J�J�9�&�J�J�J�69�9�9�9�9�i�)�9�9�9�x!)�!)�!)�!)�!)�/�!)�!)�!)�H,%�,%�,%�,%�,%�/�,%�,%�,%�^"�"�"�"�"��$�"�"�"�:E�E�E�E�*���L�'��w�?�?�?�����,�f�5�5�5����v�{�+�+�+����v�{�+�+�+����L�'��/�/�/����u�j�)�)�)�)�)r

Youez - 2016 - github.com/yon3zu
LinuXploit