ui: better website

This commit is contained in:
Dobin
2024-02-17 13:34:39 +00:00
parent c215ae62f3
commit b4ec9031cb
6 changed files with 130 additions and 50 deletions
+30 -1
View File
@@ -100,4 +100,33 @@ def rbrunmode_str(rbrunmode):
elif rbrunmode == "3":
return "setup TLS callback"
else:
return "Invalid"
return "Invalid"
def hexdump(data, addr = 0, num = 0):
s = ''
n = 0
lines = []
if num == 0: num = len(data)
if len(data) == 0:
return '<empty>'
for i in range(0, num, 16):
line = ''
line += '%04x | ' % (addr + i)
n += 16
for j in range(n-16, n):
if j >= len(data): break
line += '%02x ' % (data[j] & 0xff)
line += ' ' * (3 * 16 + 7 - len(line)) + ' | '
for j in range(n-16, n):
if j >= len(data): break
c = data[j] if not (data[j] < 0x20 or data[j] > 0x7e) else '.'
line += '%c' % c
lines.append(line)
return '\n'.join(lines)