mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-12 12:47:39 +02:00
Plugins: Make open method clearer to use
This highlights that the FileHandler class can also be seen as a method similar to open, and it removes unnecessary context managers, allowing plugins to close files as they wish (they must, however, remember to close the file for it to be committed).
This commit is contained in:
@@ -58,9 +58,10 @@ class Modules(interfaces.plugins.PluginInterface):
|
||||
|
||||
file_output = "Disabled"
|
||||
if self.config['dump']:
|
||||
file_handle = dlllist.DllList.dump_pe(self.context, pe_table_name, mod, self._file_handler)
|
||||
file_handle = dlllist.DllList.dump_pe(self.context, pe_table_name, mod, self.open)
|
||||
file_output = "Error outputting file"
|
||||
if file_handle:
|
||||
file_handle.close()
|
||||
file_output = file_handle.preferred_filename
|
||||
|
||||
yield (0, (format_hints.Hex(mod.vol.offset), format_hints.Hex(mod.DllBase),
|
||||
|
||||
Reference in New Issue
Block a user