MCPcopy Index your code
hub / github.com/Pennyw0rth/NetExec / load_module

Method load_module

nxc/loaders/moduleloader.py:49–59  ·  view source on GitHub ↗

Load a module, initializing it and checking that it has the proper attributes

(self, module_path)

Source from the content-addressed store, hash-verified

47 return not module_error
48
49 def load_module(self, module_path):
50 """Load a module, initializing it and checking that it has the proper attributes"""
51 try:
52 spec = importlib.util.spec_from_file_location("NXCModule", module_path)
53 module = spec.loader.load_module().NXCModule()
54
55 if self.module_is_sane(module, module_path):
56 return module
57 except Exception as e:
58 self.logger.fail(f"Failed loading module at {module_path}: {e}")
59 self.logger.debug(traceback.format_exc())
60
61 def init_module(self, module_path):
62 """Initialize a module for execution"""

Callers 2

init_moduleMethod · 0.95
get_module_infoMethod · 0.80

Calls 2

module_is_saneMethod · 0.95
failMethod · 0.80

Tested by

no test coverage detected