Skip to content

Commit a73ea01

Browse files
committed
1.5.2 fixing spacing for info
1 parent 2fcf98a commit a73ea01

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vagd"
3-
version = "1.5.2"
3+
version = "1.5.3"
44
authors = [{ name = "0x6fe1be2" }]
55
description = "VirtuAlization GDb integrations in pwntools"
66
readme = "README.md"

src/vagd/cli.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,24 @@ def add_virt(
7676

7777
def _info(binary, color=True) -> str:
7878
from pwnlib.elf.elf import ELF
79+
from pwnlib.term import text
80+
81+
red = text.red if color else str
82+
green = text.green if color else str
7983

8084
exe = ELF(binary, checksec=False)
8185
out = list()
82-
out.append("Arch: ")
83-
arch = "-".join((exe.arch, str(exe.bits), exe.endian))
84-
if color:
85-
arch = typer.style(arch, fg=typer.colors.GREEN)
86+
out.append("Arch:".ljust(12))
87+
arch = green("-".join((exe.arch, str(exe.bits), exe.endian)))
8688
out.append(arch)
8789
out.append("\n")
8890
out.append(exe.checksec(color=color))
89-
out.append("\nComment: ")
91+
out.append("\n")
92+
out.append("Comment:".ljust(12))
9093
if exe.get_section_by_name(".comment") is not None:
91-
comment = exe.section(".comment").replace(b"\0", b"").decode()
92-
if color:
93-
comment = typer.style(comment, fg=typer.colors.GREEN)
94+
comment = green(exe.section(".comment").replace(b"\0", b"").decode())
9495
else:
95-
comment = "No Comment"
96-
if color:
97-
comment = typer.style(comment, fg=typer.colors.RED)
96+
comment = red("No Comment")
9897

9998
out.append(comment)
10099
return "".join(out)
@@ -213,7 +212,7 @@ def template(
213212

214213
if not no_info:
215214
try:
216-
info = "# " + "\n# ".join(_info(binary, color=False).splitlines())
215+
info = "# " + "\n# ".join(_info(binary, color=False).splitlines()) + "\n"
217216
except Exception:
218217
info = ""
219218
else:

0 commit comments

Comments
 (0)