Add start command category (#1500)

pull/1501/head
Gulshan Singh 3 years ago committed by GitHub
parent e8a9ffa743
commit ddc8fe2770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,6 +21,7 @@ command_names = set()
class CommandCategory(str, Enum): class CommandCategory(str, Enum):
START = "Start"
NEXT = "Step/Next/Continue" NEXT = "Step/Next/Continue"
CONTEXT = "Context" CONTEXT = "Context"
HEAP = "Heap" HEAP = "Heap"

@ -12,6 +12,7 @@ import pwndbg.commands
import pwndbg.gdblib.elf import pwndbg.gdblib.elf
import pwndbg.gdblib.events import pwndbg.gdblib.events
import pwndbg.gdblib.symbol import pwndbg.gdblib.symbol
from pwndbg.commands import CommandCategory
break_on_first_instruction = False break_on_first_instruction = False
@ -52,7 +53,7 @@ parser.add_argument(
) )
@pwndbg.commands.ArgparsedCommand(parser, aliases=["main", "init"]) @pwndbg.commands.ArgparsedCommand(parser, aliases=["main", "init"], category=CommandCategory.START)
def start(args=None) -> None: def start(args=None) -> None:
if args is None: if args is None:
args = [] args = []
@ -102,7 +103,7 @@ parser.add_argument(
) )
@pwndbg.commands.ArgparsedCommand(parser) @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.START)
@pwndbg.commands.OnlyWithFile @pwndbg.commands.OnlyWithFile
def entry(args=[]) -> None: def entry(args=[]) -> None:
global break_on_first_instruction global break_on_first_instruction
@ -111,7 +112,9 @@ def entry(args=[]) -> None:
gdb.execute(run, from_tty=False) gdb.execute(run, from_tty=False)
@pwndbg.commands.ArgparsedCommand("Alias for 'tbreak __libc_start_main; run'.") @pwndbg.commands.ArgparsedCommand(
"Alias for 'tbreak __libc_start_main; run'.", category=CommandCategory.START
)
@pwndbg.commands.OnlyWithFile @pwndbg.commands.OnlyWithFile
def sstart() -> None: def sstart() -> None:
gdb.Breakpoint("__libc_start_main", temporary=True) gdb.Breakpoint("__libc_start_main", temporary=True)

Loading…
Cancel
Save