Beispiel #1
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
Beispiel #2
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
     assert self.type in handled_signers
     self.signature = decode_signer(self.filepath)
Beispiel #3
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		arg = fileobj if fileobj else filepath
		if not is_archive(arg):
			# Oops, this was not really an archive
			raise ValueError
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		self.archive = make_archive_obj(filepath, fileobj, True)
Beispiel #4
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		if not fileobj:
			path = join(parent_path, filepath)
			fileobj = open(path, 'rb')
		fileobj.seek(0)
		# Skip java compiler version.
		self.magic = read_magic(fileobj)
		self.version = read_version(fileobj)
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
Beispiel #5
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     if not fileobj:
         path = join(parent_path, filepath)
         fileobj = open(path, 'rb')
     fileobj.seek(0)
     # Skip java compiler version.
     self.magic = read_magic(fileobj)
     self.version = read_version(fileobj)
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
Beispiel #6
0
    def info(self):
        """Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and info extracted
		from the binary class file."""
        fileinfo = AbstractFile.info(self)
        fileinfo['magic'] = self.magic
        fileinfo['version-string'] = major_version(self.version[0])
        fileinfo['version'] = self.version
        return fileinfo
Beispiel #7
0
	def info(self):
		"""Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and info extracted
		from the binary class file."""
		fileinfo = AbstractFile.info(self)
		fileinfo['magic'] = self.magic
		fileinfo['version-string'] = major_version(self.version[0])
		fileinfo['version'] = self.version
		return fileinfo
Beispiel #8
0
 def info(self):
     fileinfo = AbstractFile.info(self)
     fileinfo['signature'] = self.signature
     return fileinfo
Beispiel #9
0
	def info(self):
		"""Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and the manifest headers."""
		fileinfo = AbstractFile.info(self)
		fileinfo['manifest-info'] = self.manifestinfo
		return fileinfo
Beispiel #10
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		self.manifestinfo = {}
		self.parse()
Beispiel #11
0
	def info(self):
		fileinfo = AbstractFile.info(self)
		fileinfo['signature'] = self.signature
		return fileinfo
Beispiel #12
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		assert self.type in handled_signers
		self.signature = decode_signer(self.filepath)
Beispiel #13
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)