Move module gathering into generator

This commit is contained in:
Andrew Case
2020-04-08 18:17:34 +01:00
committed by ikelos
parent b42dfd614a
commit 719cd0d476
4 changed files with 16 additions and 21 deletions
@@ -111,11 +111,13 @@ class Check_sysctl(plugins.PluginInterface):
except exceptions.InvalidAddressException:
break
def _generator(self, mods: Iterator[Any]):
def _generator(self):
mac.MacUtilities.aslr_mask_symbol_table(self.context, self.config['darwin'], self.config['primary'])
kernel = contexts.Module(self._context, self.config['darwin'], self.config['primary'], 0)
mods = lsmod.Lsmod.list_modules(self.context, self.config['primary'], self.config['darwin'])
handlers = mac.MacUtilities.generate_kernel_handler_info(self.context, self.config['primary'], kernel, mods)
sysctl_list = kernel.object_from_symbol(symbol_name = "sysctl__children")
@@ -133,6 +135,4 @@ class Check_sysctl(plugins.PluginInterface):
def run(self):
return renderers.TreeGrid([("Name", str), ("Number", int), ("Perms", str), ("Handler Address", format_hints.Hex),
("Value", str), ("Handler Module", str), ("Handler Symbol", str)],
self._generator(
lsmod.Lsmod.list_modules(self.context, self.config['primary'],
self.config['darwin'])))
self._generator())