Exemplo n.º 1
0
 def __init__(self, contents="", handle=None):
     if handle is not None:
         self.handle = core.handle_of_type(handle, core.BNDataBuffer)
     elif isinstance(contents, int) or isinstance(contents, long):
         self.handle = core.BNCreateDataBuffer(None, contents)
     elif isinstance(contents, DataBuffer):
         self.handle = core.BNDuplicateDataBuffer(contents.handle)
     else:
         self.handle = core.BNCreateDataBuffer(contents, len(contents))
Exemplo n.º 2
0
	def __init__(self, contents="", handle=None):
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNDataBuffer)
		elif isinstance(contents, int) or isinstance(contents, long):
			self.handle = core.BNCreateDataBuffer(None, contents)
		elif isinstance(contents, DataBuffer):
			self.handle = core.BNDuplicateDataBuffer(contents.handle)
		else:
			self.handle = core.BNCreateDataBuffer(contents, len(contents))
Exemplo n.º 3
0
	def __init__(self, arch, handle = None, source_func = None):
		self.arch = arch
		self.source_function = source_func
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNMediumLevelILFunction)
		else:
			func_handle = None
			if self.source_function is not None:
				func_handle = self.source_function.handle
			self.handle = core.BNCreateMediumLevelILFunction(arch.handle, func_handle)
Exemplo n.º 4
0
	def __init__(self, arch, handle = None, source_func = None):
		self.arch = arch
		self.source_function = source_func
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNLowLevelILFunction)
		else:
			func_handle = None
			if self.source_function is not None:
				func_handle = self.source_function.handle
			self.handle = core.BNCreateLowLevelILFunction(arch.handle, func_handle)
Exemplo n.º 5
0
	def __init__(self, sym_type, addr, short_name, full_name = None, raw_name = None, handle = None):
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNSymbol)
		else:
			if isinstance(sym_type, str):
				sym_type = SymbolType[sym_type]
			if full_name is None:
				full_name = short_name
			if raw_name is None:
				raw_name = full_name
			self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr)
Exemplo n.º 6
0
	def __init__(self, sym_type, addr, short_name, full_name = None, raw_name = None, handle = None):
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNSymbol)
		else:
			if isinstance(sym_type, str):
				sym_type = SymbolType[sym_type]
			if full_name is None:
				full_name = short_name
			if raw_name is None:
				raw_name = full_name
			self.handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr)
Exemplo n.º 7
0
	def __init__(self, provider, handle = None):
		if handle is None:
			self._cb = core.BNScriptingInstanceCallbacks()
			self._cb.context = 0
			self._cb.destroyInstance = self._cb.destroyInstance.__class__(self._destroy_instance)
			self._cb.executeScriptInput = self._cb.executeScriptInput.__class__(self._execute_script_input)
			self._cb.setCurrentBinaryView = self._cb.setCurrentBinaryView.__class__(self._set_current_binary_view)
			self._cb.setCurrentFunction = self._cb.setCurrentFunction.__class__(self._set_current_function)
			self._cb.setCurrentBasicBlock = self._cb.setCurrentBasicBlock.__class__(self._set_current_basic_block)
			self._cb.setCurrentAddress = self._cb.setCurrentAddress.__class__(self._set_current_address)
			self._cb.setCurrentSelection = self._cb.setCurrentSelection.__class__(self._set_current_selection)
			self.handle = core.BNInitScriptingInstance(provider.handle, self._cb)
		else:
			self.handle = core.handle_of_type(handle, core.BNScriptingInstance)
		self.listeners = []
	def __init__(self, provider, handle = None):
		if handle is None:
			self._cb = core.BNScriptingInstanceCallbacks()
			self._cb.context = 0
			self._cb.destroyInstance = self._cb.destroyInstance.__class__(self._destroy_instance)
			self._cb.executeScriptInput = self._cb.executeScriptInput.__class__(self._execute_script_input)
			self._cb.setCurrentBinaryView = self._cb.setCurrentBinaryView.__class__(self._set_current_binary_view)
			self._cb.setCurrentFunction = self._cb.setCurrentFunction.__class__(self._set_current_function)
			self._cb.setCurrentBasicBlock = self._cb.setCurrentBasicBlock.__class__(self._set_current_basic_block)
			self._cb.setCurrentAddress = self._cb.setCurrentAddress.__class__(self._set_current_address)
			self._cb.setCurrentSelection = self._cb.setCurrentSelection.__class__(self._set_current_selection)
			self.handle = core.BNInitScriptingInstance(provider.handle, self._cb)
		else:
			self.handle = core.handle_of_type(handle, core.BNScriptingInstance)
		self.listeners = []
Exemplo n.º 9
0
	def __init__(self, filename = None, handle = None):
		"""
		Instantiates a new FileMetadata class.

		:param filename: The string path to the file to be opened. Defaults to None.
		:param handle: A handle to the underlying C FileMetadata object. Defaults to None.
		"""
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNFileMetadata)
		else:
			startup._init_plugins()
			self.handle = core.BNCreateFileMetadata()
			if filename is not None:
				core.BNSetFilename(self.handle, str(filename))
		self.nav = None
Exemplo n.º 10
0
    def __init__(self, filename=None, handle=None):
        """
		Instantiates a new FileMetadata class.

		:param filename: The string path to the file to be opened. Defaults to None.
		:param handle: A handle to the underlying C FileMetadata object. Defaults to None.
		"""
        if handle is not None:
            self.handle = core.handle_of_type(handle, core.BNFileMetadata)
        else:
            startup._init_plugins()
            self.handle = core.BNCreateFileMetadata()
            if filename is not None:
                core.BNSetFilename(self.handle, str(filename))
        self.nav = None
Exemplo n.º 11
0
	def __init__(self, handle = None):
		if handle is not None:
			self.handle = core.handle_of_type(handle, core.BNScriptingProvider)
			self.__dict__["name"] = core.BNGetScriptingProviderName(handle)
Exemplo n.º 12
0
 def __init__(self, view, handle):
     self.view = view
     self.handle = core.handle_of_type(handle, core.BNBasicBlock)
     self._arch = None
     self._func = None
Exemplo n.º 13
0
	def __init__(self, view, handle):
		self.view = view
		self.handle = core.handle_of_type(handle, core.BNBasicBlock)
Exemplo n.º 14
0
	def __init__(self, handle):
		self.handle = core.handle_of_type(handle, core.BNRepository)
Exemplo n.º 15
0
	def __init__(self, view, handle):
		self._view = view
		self.handle = core.handle_of_type(handle, core.BNFunction)
		self._advanced_analysis_requests = 0
Exemplo n.º 16
0
 def __init__(self, handle):
     raise Exception("RepoPlugin temporarily disabled!")
     self.handle = core.handle_of_type(handle, core.BNRepoPlugin)
Exemplo n.º 17
0
 def __init__(self, handle=None):
     if handle is not None:
         self.handle = core.handle_of_type(handle, core.BNScriptingProvider)
         self.__dict__["name"] = core.BNGetScriptingProviderName(handle)
Exemplo n.º 18
0
	def __init__(self, handle):
		self.handle = core.handle_of_type(handle, core.BNRepoPlugin)