mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
strutils.hexdump returns native_strings
This commit is contained in:
parent
c7cbbf5f0d
commit
0a21d27004
@ -172,7 +172,7 @@ class ViewHex(View):
|
|||||||
def _format(data):
|
def _format(data):
|
||||||
for offset, hexa, s in strutils.hexdump(data):
|
for offset, hexa, s in strutils.hexdump(data):
|
||||||
yield [
|
yield [
|
||||||
("offset", offset + b" "),
|
("offset", offset + " "),
|
||||||
("text", hexa + " "),
|
("text", hexa + " "),
|
||||||
("text", s)
|
("text", s)
|
||||||
]
|
]
|
||||||
|
@ -146,7 +146,7 @@ def hexdump(s):
|
|||||||
A generator of (offset, hex, str) tuples
|
A generator of (offset, hex, str) tuples
|
||||||
"""
|
"""
|
||||||
for i in range(0, len(s), 16):
|
for i in range(0, len(s), 16):
|
||||||
offset = "{:0=10x}".format(i).encode()
|
offset = "{:0=10x}".format(i)
|
||||||
part = s[i:i + 16]
|
part = s[i:i + 16]
|
||||||
x = " ".join("{:0=2x}".format(i) for i in six.iterbytes(part))
|
x = " ".join("{:0=2x}".format(i) for i in six.iterbytes(part))
|
||||||
x = x.ljust(47) # 16*2 + 15
|
x = x.ljust(47) # 16*2 + 15
|
||||||
|
Loading…
Reference in New Issue
Block a user