MCPcopy
hub / github.com/apache/caldera / run

Method run

app/utility/base_obfuscator.py:12–23  ·  view source on GitHub ↗
(self, link, **kwargs)

Source from the content-addressed store, hash-verified

10 self.agent = agent
11
12 def run(self, link, **kwargs):
13 agent = self.__getattribute__('agent')
14 supported_platforms = self.__getattribute__('supported_platforms')
15 try:
16 if agent.platform in supported_platforms and link.executor.name in agent.executors:
17 link.command_hash = hashlib.sha256(str.encode(link.command)).hexdigest()
18 o = self.__getattribute__(link.executor.name)
19 return o(link, **kwargs)
20 except Exception:
21 logging.error('Failed to run BaseObfuscator, returning default decoded bytes')
22
23 return self.decode_bytes(link.command)

Callers 1

obfuscate_commandsMethod · 0.45

Calls 3

decode_bytesMethod · 0.80
oFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected