
    9c                     ~    d dl Z d dlZd dlZd dlZd dlZ G d dej                  j                  j                        Z	y)    Nc                   "    e Zd ZdZdgZd Zd Zy)ZLIBExtractPluginz 
    Zlib extractor plugin.
    	Signaturec                     | j                   j                  j                  r4| j                   j                  j                  d dd| j                         y y )Nz^zlib compressed datazlib)txtruleregex	extensioncmd)module	extractorenabledadd_rule)selfs    =/usr/lib/python3/dist-packages/binwalk/plugins/zlibextract.pyinitzZLIBExtractPlugin.init   sH     ;;  ((KK!!**41H5;/3~~ + ? )    c                 .   t         j                  j                  |      d   }	 t        j                  j
                  j                  |      }t        j                  j
                  j                  |d      }t        j                  t        j                  j                  j                  |j                                     }|j                  |       |j                          |j                          y# t        $ r}|d }~wt        $ r
}Y d }~yd }~ww xY w)Nr   wFT)ospathsplitextbinwalkcorecommon	BlockFiler   
decompresscompat	str2bytesreadwritecloseKeyboardInterrupt	Exception)r   fnameoutfilefpinfpout	plaintextes          r   r   zZLIBExtractPlugin.extractor   s    ''""5)!,	<<&&007DLL''11'3?E(;(;(E(Ediik(RSIKK	"JJLKKM  ! 	G 		s   CC3 3	D<C>>DDN)__name__
__module____qualname____doc__MODULESr   r    r   r   r   r      s     mG?r   r   )
r   r   binwalk.core.compatr   binwalk.core.commonbinwalk.core.pluginr   pluginPluginr   r0   r   r   <module>r6      s0    	    !++22 !r   