(data)
| 137 | |
| 138 | |
| 139 | def ui_string_decode(data): |
| 140 | res = "" |
| 141 | try: |
| 142 | if len(data) > 32: |
| 143 | res = "Data with len {}".format(len(data)) |
| 144 | elif b"\x00\x00" in data: |
| 145 | res = "(utf16) " + data.decode("utf-16le") |
| 146 | else: |
| 147 | res = "(utf8) " + data.decode("utf-8") |
| 148 | except Exception as e: |
| 149 | res = "(bytes) " + data.hex() |
| 150 | |
| 151 | return res |
| 152 | |
| 153 | |
| 154 | def ascii_to_hex_bytes(ascii_bytes): |
no test coverage detected