Skip to content

Commit

Permalink
Move script init after vmi init
Browse files Browse the repository at this point in the history
  • Loading branch information
xabiugarte committed Oct 31, 2017
1 parent 33b7f57 commit 1c7fb20
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pyrebox/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,22 @@ def init(platform, root_path, volatility_path):
from ipython_shell import initialize_shell
initialize_shell()

return vol_profile
except Exception as e:
# Do this to make sure we print the stack trace to help trouble-shooting
traceback.print_exc()
raise e


def init_plugins():
try:
# Locate python modules that should be loaded by default
for (module, enable) in config.items("MODULES"):
for (module, enable) in conf_m.config.items("MODULES"):
if enable.strip().lower() == "true" or enable.strip().lower() == "yes":
import_module(module)

pp_debug("[*] Finished python module initialization\n")
return vol_profile
return True
except Exception as e:
# Do this to make sure we print the stack trace to help trouble-shooting
traceback.print_exc()
Expand Down
7 changes: 7 additions & 0 deletions pyrebox/pyrebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ int pyrebox_init(void){
//Set the vol profile in vmi.cpp
vmi_init(s);

py_args_tuple = PyTuple_New(1);
//Now that we initialized the VMI, init the plugins
py_init_plugins = PyDict_GetItemString(py_global_dict, "init_plugins");
PyObject* result = PyObject_CallObject(py_init_plugins, py_args_tuple);
if (result == 0 || result == Py_None){
return 1;
}
return 0;
};

Expand Down

0 comments on commit 1c7fb20

Please sign in to comment.