Heuristic to guess if bytes are an encoded DNS pointer.
(x)
| 199 | |
| 200 | |
| 201 | def _is_ptr(x): |
| 202 | """ |
| 203 | Heuristic to guess if bytes are an encoded DNS pointer. |
| 204 | """ |
| 205 | return ( |
| 206 | (x and x[-1] == 0) or |
| 207 | (len(x) >= 2 and (x[-2] & 0xc0) == 0xc0) |
| 208 | ) |
| 209 | |
| 210 | |
| 211 | def dns_encode(x, check_built=False): |
no outgoing calls
no test coverage detected
searching dependent graphs…