
    9c                     n    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d Zy)GzipExtractPluginz 
    Gzip extractor plugin.
    	Signaturei (  c                     | j                   j                  j                  rZ| j                   j                  j                  d      r4| j                   j                  j	                  d dd| j                         y y y )Nzgzip compressed dataz^gzip compressed datagz)txtruleregex	extensioncmd)module	extractorenabledmatchadd_rule)selfs    =/usr/lib/python3/dist-packages/binwalk/plugins/gzipextract.pyinitzGzipExtractPlugin.init   sd    
 ;;  ((T[[-B-B-H-HI_-`KK!!**41H59/3~~ + ? .a(    c                    t         j                  j                  |      }t         j                  j                  |      d   }	 t	        |d      }t        j                  |d      }	 |j                  | j                        }|r|j                  |       nn1|j                          |j                          y# t        $ r}|d }~wt        $ r
}Y d }~yd }~ww xY w)Nr   wbrbTF)ospathabspathsplitextopengzipGzipFileread
BLOCK_SIZEwritecloseKeyboardInterrupt	Exception)r   fnameoutfilefpoutr   dataes          r   r   zGzipExtractPlugin.extractor   s    &''""5)!,	$'Eud+Bwwt/KK%  HHJKKM  ! 	G 		s   A4B8 8	CCCCN)__name__
__module____qualname____doc__MODULESr    r   r    r   r   r   r      s     mGJ	?r   r   )r   r   binwalk.core.pluginbinwalkcorepluginPluginr   r/   r   r   <module>r5      s*    	  )++22 )r   