def get_jar( self, idc = -1 ):
"""
Get the content of all files present in the JAR file stored in the
field 9.184. The returned dictionnary contains the as follow::
{
'file name': 'file content',
...
}
The content of the files are not parsed, but returned as string value.
:param idc: IDC value.
:type idc: int
:return: Content of all files stored in the JAR file.
:rtype: dict
"""
idc = self.checkIDC( 9, idc )
data = self.get_field( "9.184", idc )
if data != None:
data = base64.decodestring( data )
buffer = StringIO()
buffer.write( data )
ret = defaultdict()
with zipfile.ZipFile( buffer, "r" ) as zip:
for f in zip.namelist():
name, _ = os.path.splitext( f )
with zip.open( f, "r" ) as fp:
ret[ name ] = fp.read()
return dict( ret )
else:
return None
############################################################################
#
# User defined fields
#
############################################################################
评论列表
文章目录