| 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*\)') |