mirror of https://github.com/pwndbg/pwndbg.git
Add pwndbg config command to dump configuration values
pwndbg> set emulate off Set Unicorn emulation of code near the current instruction to False pwndbg> config Name Value (Def) Documentation -------------------------------------------------- emulate False (True) Unicorn emulation of code near the current instruction hexdump_bytes 64 number of bytes printed by hexdump command hexdump_width 16 line width of hexdump command telescope_lines 8 number of lines to printed by the telescope commandpull/50/merge
parent
dfa8ed8c5a
commit
8633967037
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Dumps all pwndbg-specific configuration points.
|
||||
"""
|
||||
import pwndbg.commands
|
||||
import pwndbg.config
|
||||
|
||||
|
||||
def print_row(name, value, default, docstring):
|
||||
name = name.ljust(20)
|
||||
|
||||
if value != default:
|
||||
defval = '%s (%s)' % (value, default)
|
||||
else:
|
||||
defval = value
|
||||
|
||||
defval = defval.ljust(15)
|
||||
result = ' '.join((name, defval, docstring))
|
||||
print(result)
|
||||
return result
|
||||
|
||||
@pwndbg.commands.Command
|
||||
def config():
|
||||
"""Shows pwndbg-specific configuration points"""
|
||||
header = print_row('Name','Value', 'Def', 'Documentation')
|
||||
print('-' * (len(header)))
|
||||
for k,v in sorted(pwndbg.config.__dict__.items()):
|
||||
if not isinstance(v, pwndbg.config.Parameter):
|
||||
continue
|
||||
print_row(v.name, repr(v.value), repr(v.default), v.docstring)
|
||||
Loading…
Reference in new issue