MCPcopy Create free account
hub / github.com/Geeoon/asploit / __set

Method __set

src/LocalCommandProcessor.py:108–127  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

106 invalid.
107 """
108 def __set(self, options: str):
109 if len(options) == 0: # list all variables
110 print((f"{'{0: <20}'.format(f'VARIABLE')} "
111 f"{'{0: <50}'.format('VALUE')} "
112 f"REQUIRED"))
113 for var in self.variables:
114 print((f"{'{0: <20}'.format(var)} "
115 f"{'{0: <50}'.format(self.variables[var]['value'])} "
116 f"{str(self.variables[var]['required']).upper()}"))
117 else:
118 split = options.split(" ", 1)
119 var = split[0].upper()
120 if var in self.variables:
121 value = ""
122 if len(split) > 1:
123 value = split[1]
124 self.variables[var]["value"] = value
125 print(f"'{var}' set to '{value}'")
126 else:
127 raise CommandException(f"'{var}' is not a variable.")
128
129 """
130 @brief Loan an external extension (an exploit processor).

Callers

nothing calls this directly

Calls 1

CommandExceptionClass · 0.85

Tested by

no test coverage detected