From d4cfe96e2183a9380c741d4ef7206ca1f581fc1e Mon Sep 17 00:00:00 2001 From: lebr0nli <61896187+lebr0nli@users.noreply.github.com> Date: Mon, 23 Jan 2023 23:33:33 +0800 Subject: [PATCH] Add comment about the alignment for "..." when showing opcodes --- pwndbg/gdblib/nearpc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pwndbg/gdblib/nearpc.py b/pwndbg/gdblib/nearpc.py index 63d015202..ec54e094c 100644 --- a/pwndbg/gdblib/nearpc.py +++ b/pwndbg/gdblib/nearpc.py @@ -172,6 +172,7 @@ def nearpc(pc=None, lines=None, emulate=False, repeat=False) -> List[str]: align = show_opcodes_size * 2 + 10 if len(instr.bytes) > show_opcodes_size: opcodes += pwndbg.color.gray("...") + # the length of gray("...") is 12, so we need to add extra 9 (12-3) alignment length for the invisible characters align += 9 # len(pwndbg.color.gray("")) opcodes = opcodes.ljust(align, " ") if pwndbg.gdblib.config.highlight_pc and instr.address == pwndbg.gdblib.regs.pc: