MCPcopy
hub / github.com/AsahiLinux/m1n1 / chexdump

Function chexdump

proxyclient/m1n1/utils.py:38–54  ·  view source on GitHub ↗
(s, st=0, abbreviate=True, stride=16, indent="", print_fn=print)

Source from the content-addressed store, hash-verified

36 return s2
37
38def chexdump(s, st=0, abbreviate=True, stride=16, indent="", print_fn=print):
39 last = None
40 skip = False
41 for i in range(0,len(s),stride):
42 val = s[i:i+stride]
43 if val == last and abbreviate:
44 if not skip:
45 print_fn(indent+"%08x *" % (i + st))
46 skip = True
47 else:
48 print_fn(indent+"%08x %s |%s|" % (
49 i + st,
50 " ".join(hexdump(val[i:i+8], ' ').ljust(23)
51 for i in range(0, stride, 8)),
52 _ascii(val).ljust(stride)))
53 last = val
54 skip = False
55
56def chexdiff32(prev, cur, ascii=True, offset=0, offset2=None):
57 assert len(cur) % 4 == 0

Callers 15

ioctlptr_reqMethod · 0.90
ioctlrespMethod · 0.90
read_txbufMethod · 0.90
read_rxbufMethod · 0.90
SendMethod · 0.85
RecvMethod · 0.85
log_spihid_pktMethod · 0.85
packetMethod · 0.85
AdvertiseMethod · 0.85
SetValMethod · 0.85
log_mesaMethod · 0.85

Calls 2

hexdumpFunction · 0.85
_asciiFunction · 0.85

Tested by 2

test_hw_keyFunction · 0.68
test_custom_keyFunction · 0.68