Exemplo n.º 1
0
 def existing_views(self):
     length = ctypes.c_ulonglong()
     result = core.BNGetExistingViews(self.handle, ctypes.byref(length))
     views = []
     for i in range(length.value):
         views.append(pyNativeStr(result[i]))
     core.BNFreeStringList(result, length)
     return views
Exemplo n.º 2
0
 def keys(self):
     length = ctypes.c_ulonglong()
     result = core.BNSettingsKeysList(self.handle, ctypes.byref(length))
     out_list = []
     for i in range(length.value):
         out_list.append(pyNativeStr(result[i]))
     core.BNFreeStringList(result, length)
     return out_list
Exemplo n.º 3
0
	def query_property_string_list(self, key, property_name):
		length = ctypes.c_ulonglong()
		result = core.BNSettingsQueryPropertyStringList(self.handle, key, property_name, ctypes.byref(length))
		out_list = []
		for i in range(length.value):
			out_list.append(pyNativeStr(result[i]))
		core.BNFreeStringList(result, length)
		return out_list
Exemplo n.º 4
0
def authentication_methods() -> List[Tuple[str, str]]:
    """
	Get a list of authentication methods accepted by the Enterprise Server.
	:return: List of (<method name>, <method display name>) tuples
	"""
    if not is_connected():
        connect()
    methods = ctypes.POINTER(ctypes.c_char_p)()
    names = ctypes.POINTER(ctypes.c_char_p)()
    count = core.BNGetEnterpriseServerAuthenticationMethods(methods, names)
    results = []
    for i in range(count):
        results.append(
            (core.pyNativeStr(methods[i]), core.pyNativeStr(names[i])))
    core.BNFreeStringList(methods, count)
    core.BNFreeStringList(names, count)
    return results
Exemplo n.º 5
0
	def get_string_list(self, key, view = None):
		if view is not None:
			view = view.handle
		length = ctypes.c_ulonglong()
		result = core.BNSettingsGetStringList(self.handle, key, view, None, ctypes.byref(length))
		out_list = []
		for i in range(length.value):
			out_list.append(pyNativeStr(result[i]))
		core.BNFreeStringList(result, length)
		return out_list
Exemplo n.º 6
0
	def get_string_list_with_scope(self, key, view = None, scope = SettingsScope.SettingsAutoScope):
		if view is not None:
			view = view.handle
		c_scope = core.SettingsScopeEnum(scope)
		length = ctypes.c_ulonglong()
		result = core.BNSettingsGetStringList(self.handle, key, view, ctypes.byref(c_scope), ctypes.byref(length))
		out_list = []
		for i in range(length.value):
			out_list.append(pyNativeStr(result[i]))
		core.BNFreeStringList(result, length)
		return (out_list, SettingsScope(c_scope.value))
Exemplo n.º 7
0
	def alternate_names(self):
		"""
		A list of extra names that will be considered a match by ``Platform.get_type_libraries_by_name``
		"""
		count = ctypes.c_ulonglong(0)
		result = []
		names = core.BNGetTypeLibraryAlternateNames(self.handle, count)
		for i in range(0, count.value):
			result.append(names[i])
		core.BNFreeStringList(names, count.value)
		return result
Exemplo n.º 8
0
	def aliases(self):
		"""
		List of aliases tied to this symbol.
		Aliases are the names of any other symbols that also happen to be at the same address.
		"""
		result = []
		count = ctypes.c_ulonglong(0)
		aliases = core.BNGetSymbolAliases(self.handle, count)
		for i in range(count.value):
			result.append(aliases[i])
		core.BNFreeStringList(aliases, count)
		return result
Exemplo n.º 9
0
    def keys(self):
        """
		``keys`` retrieve the list of setting identifiers in the active settings schema

		:return: list of setting identifiers
		:rtype: list(str)
		"""
        length = ctypes.c_ulonglong()
        result = core.BNSettingsKeysList(self.handle, ctypes.byref(length))
        out_list = []
        for i in range(length.value):
            out_list.append(pyNativeStr(result[i]))
        core.BNFreeStringList(result, length)
        return out_list
Exemplo n.º 10
0
 def get_string_list(self, name, default_value=[]):
     length = ctypes.c_ulonglong()
     length.value = len(default_value)
     default_list = (ctypes.c_char_p * len(default_value))()
     for i in range(len(default_value)):
         default_list[i] = default_value[i].encode('charmap')
     result = core.BNSettingGetStringList(self.plugin_name,
                                          name, default_list,
                                          ctypes.byref(length))
     out_list = []
     for i in range(length.value):
         out_list.append(pyNativeStr(result[i]))
     core.BNFreeStringList(result, length)
     return out_list
Exemplo n.º 11
0
	def platform_names(self):
		"""
		Returns a list of all platform names that this type library will register with during platform
		type registration.

		This returns strings, not Platform objects, as type libraries can be distributed with support for
		Platforms that may not be present.
		"""
		count = ctypes.c_ulonglong(0)
		result = []
		platforms = core.BNGetTypeLibraryPlatforms(self.handle, count)
		for i in range(0, count.value):
			result.append(platforms[i])
		core.BNFreeStringList(platforms, count.value)
		return result