MCPcopy Create free account
hub / github.com/Fadi002/de4py / _decode_chr_chains

Method _decode_chr_chains

de4py/engines/onyx/string_decoder.py:312–322  ·  view source on GitHub ↗
(self, source: str)

Source from the content-addressed store, hash-verified

310 return p2.sub(d2, source)
311
312 def _decode_chr_chains(self, source: str) -> str:
313 pattern = re.compile(r'(?:chr\s*\(\s*\d{1,3}\s*\)\s*\+\s*)*chr\s*\(\s*\d{1,3}\s*\)')
314 def d(m):
315 try:
316 result = eval(m.group(0), {'__builtins__':{}}, {'chr':chr})
317 if isinstance(result, str) and result.isprintable():
318 return repr(result)
319 except Exception:
320 pass
321 return m.group(0)
322 return pattern.sub(d, source)
323
324 def _decode_join_chr_list(self, source: str) -> str:
325 p1 = re.compile(r'["\']["\']\.join\s*\(\s*\[?\s*chr\s*\(\s*\w+\s*\)\s+for\s+\w+\s+in\s+\[([0-9,\s]+)\]\s*\]?\s*\)')

Callers 1

_single_passMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected