Open zachriggle opened 4 years ago
Thanks for reporting! I'll take a look.
I pushed changes in ba719e3a359fcae5e68034470c3080ed484eeaf1 that'll hopefully fix this, but let me know if not. I wasn't able to reproduce the same error on my machine (MacOS with built in terminal and oh-my-zsh installed), but did find some issues that could potentially be causing this.
Here's what my completion looked like:
asm -- Assemble shellcode into bytes
checksec -- Check binary security settings
constgrep -- Looking up constants from header files.
Example: constgrep -c freebsd -m ^PROT_ 3
cyclic -- Cyclic pattern creator/finder
debug -- Debug a binary in GDB
disablenx -- Disable NX for an ELF binary
disasm -- Disassemble bytes into text format
elfdiff -- Compare two ELF files
elfpatch -- Patch an ELF file
errno -- Prints out error messages
hex --
Hex-encodes data provided on the command line or stdin
phd -- Pwnlib HexDump
pwnstrip -- Strip binaries for CTF usage
scramble -- Shellcode encoder
shellcraft -- Microwave shellcode -- Easy, fast and delicious
template -- Generate an exploit template
unhex --
Decodes hex-encoded data provided on the command line or via stdin.
update -- Check for pwntools updates
+ 4
There are a few tools I've been looking at recently to automatically generate completions for the pwn
command.
https://kislyuk.github.io/argcomplete/ https://pypi.org/project/genzshcomp/
I've filed an issue with genzshcomp
since it only seems to work with individual commands and not the central pwn
entry point
I see. I think I looked into both of those tools before writing this one and they didn't quite do what I was looking for. Did my change fix the issue you reported? If so, I'm going to close out this issue.
I updated (ba719e3) and regenerated this via ./zargparse.py ~/github.com/pwntools/pwnlib/commandline/asm.py
and still get similar behavior.
~ ❯❯❯ pwn checksec
-- command --
checksec asm -- Assemble shellcode into bytes
constgrep -- Check binary security settings
cyclic -- Looking up constants from header files.\n\nExample: constgrep -c freebsd -m ^PROT_ "3 + 4"
debug -- Cyclic pattern creator/finder
disablenx -- Disassemble bytes into text format
disasm -- Debug a binary in GDB
elfdiff -- Disable NX for an ELF binary
elfpatch -- Compare two ELF files
errno -- Patch an ELF file
hex -- Prints out error messages
phd -- Hex-encodes data provided on the command line or stdin
pwnstrip -- Pwnlib HexDump
scramble -- Strip binaries for CTF usage
shellcraft -- Shellcode encoder
template -- Microwave shellcode -- Easy, fast and delicious
unhex -- Generate an exploit template
update -- Decodes hex-encoded data provided on the command line or via stdin.
The completions generated for Pwntools'
pwn
command are incorrect:Compare to the completion generated:
It looks like there are some issues with newline processing