Skip to content

Commit

Permalink
Merge pull request volatilityfoundation#1403 from j-t-1/text_renderer
Browse files Browse the repository at this point in the history
Tiny change text_renderer.py
  • Loading branch information
ikelos authored Dec 16, 2024
2 parents 71de86d + c8c3983 commit dc4eedb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions volatility3/cli/text_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def hex_bytes_as_text(value: bytes, width: int = 16) -> str:
output += "\n"
printables = ""

# Handle leftovers when the lenght is not mutiple of width
# Handle leftovers when the length is not mutiple of width
if printables:
padding = width - len(printables)
output += " " * (padding)
output += " " * padding
output += printables
output += " " * (padding)
output += " " * padding

return output

Expand Down Expand Up @@ -132,7 +132,7 @@ def display_disassembly(disasm: interfaces.renderers.Disassembly) -> str:
for i in disasm_types[disasm.architecture].disasm(
disasm.data, disasm.offset
):
output += f"\n0x{i.address:x}:\t{i.mnemonic}\t{i.op_str}"
output += f"\n{i.address:#x}:\t{i.mnemonic}\t{i.op_str}"
return output
return QuickTextRenderer._type_renderers[bytes](disasm.data)

Expand Down Expand Up @@ -342,7 +342,7 @@ def render(self, grid: interfaces.renderers.TreeGrid) -> None:
column_separator = " | "

tree_indent_column = "".join(
random.choice(string.ascii_uppercase + string.digits) for _ in range(20)
random.choices(string.ascii_uppercase + string.digits, k=20)
)
max_column_widths = dict(
[(column.name, len(column.name)) for column in grid.columns]
Expand Down

0 comments on commit dc4eedb

Please sign in to comment.