MCPcopy
hub / github.com/Pennyw0rth/NetExec / get_protocols

Method get_protocols

nxc/loaders/protocolloader.py:17–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 return protocol
16
17 def get_protocols(self):
18 protocols = {}
19
20 proto_path = path_join(dirname(nxc.__file__), "protocols")
21 for protocol in listdir(proto_path):
22 if protocol[-3:] == ".py" and protocol[:-3] != "__init__":
23 protocol_path = path_join(proto_path, protocol)
24 protocol_name = protocol[:-3]
25
26 protocols[protocol_name] = {"path": protocol_path}
27
28 db_file_path = path_join(proto_path, protocol_name, "database.py")
29 db_nav_path = path_join(proto_path, protocol_name, "db_navigator.py")
30 protocol_args_path = path_join(proto_path, protocol_name, "proto_args.py")
31 if exists(db_file_path):
32 protocols[protocol_name]["dbpath"] = db_file_path
33 if exists(db_nav_path):
34 protocols[protocol_name]["nvpath"] = db_nav_path
35 if exists(protocol_args_path):
36 protocols[protocol_name]["argspath"] = protocol_args_path
37 return protocols

Callers 5

db_setupFunction · 0.95
mainFunction · 0.95
init_protocol_dbsFunction · 0.95
gen_cli_argsFunction · 0.95
__init__Method · 0.80

Calls

no outgoing calls

Tested by 1

db_setupFunction · 0.76