Beispiel #1
0
    def initializeContext(self, context):
        # Don't bother if the call can never happen.
        if context.invocationMaySucceed(self):
            # Caller-independant initalization.
            if context not in self.liveContexts:
                # Mark as initialized
                self.liveContexts.add(context)

                code = context.signature.code

                # HACK convert the calls before analysis to eliminate UnpackTuple nodes.
                callConverter(self.extractor, code)

                if code not in self.liveCode:
                    self.liveCode.add(code)

                # Check to see if we can just fold it.
                # Dynamic folding only calculates the output,
                # so we still evaluate the constraints.
                folded = self.fold(context)

                # Extract the constraints
                exdf = ExtractDataflow(self, context, folded)
                exdf.process()
            return True
        return False
Beispiel #2
0
	def initializeContext(self, context):
		# Don't bother if the call can never happen.
		if context.invocationMaySucceed(self):
			# Caller-independant initalization.
			if context not in self.liveContexts:
				# Mark as initialized
				self.liveContexts.add(context)

				code = context.signature.code

				# HACK convert the calls before analysis to eliminate UnpackTuple nodes.
				callConverter(self.extractor, code)

				if code not in self.liveCode:
					self.liveCode.add(code)

				# Check to see if we can just fold it.
				# Dynamic folding only calculates the output,
				# so we still evaluate the constraints.
				folded = self.fold(context)

				# Extract the constraints
				exdf = ExtractDataflow(self, context, folded)
				exdf.process()
			return True
		return False
Beispiel #3
0
    def getCode(self, obj):
        start = time.clock()

        assert obj.isObjectName()

        code = self.extractor.getCall(obj.obj())
        if code is None:
            code = self.extractor.stubs.exports['interpreter_call']

        callConverter(self.extractor, code)

        if code not in self.liveCode:
            self.liveCode.add(code)

        end = time.clock()
        self.decompileTime += end - start

        return code
Beispiel #4
0
	def getCode(self, obj):
		start = time.clock()

		assert obj.isObjectName()

		code = self.extractor.getCall(obj.obj())
		if code is None:
			code = self.extractor.stubs.exports['interpreter_call']

		callConverter(self.extractor, code)

		if code not in self.liveCode:
			self.liveCode.add(code)

		end = time.clock()
		self.decompileTime += end-start

		return code