Returns a sanitized version as string of the bytes list given in input.
(x: bytes)
| 1809 | |
| 1810 | |
| 1811 | def gef_pystring(x: bytes) -> str: |
| 1812 | """Returns a sanitized version as string of the bytes list given in input.""" |
| 1813 | res = str(x, encoding="utf-8") |
| 1814 | substs = [("\n", "\\n"), ("\r", "\\r"), ("\t", "\\t"), ("\v", "\\v"), ("\b", "\\b"), ] |
| 1815 | for x, y in substs: res = res.replace(x, y) |
| 1816 | return res |
| 1817 | |
| 1818 | |
| 1819 | def gef_pybytes(x: str) -> bytes: |
no outgoing calls
no test coverage detected