Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TmuxTerminal = terminal{"tmux", "splitw", "-h"} XtermTerminal = terminal{"xterm", "-e"} GnomeTerminal = terminal{"gnome-terminal", "--"} )
var (
ErrInteractiveModeNotSupported = errors.New("interactive mode only supported for TCP or binary")
)
var (
ErrTerminalNotFound = errors.New("can't get terminal")
)
Functions ¶
func Debug ¶
func Debug(client Client, opts ...option)
Debug starts a gdb debugging session for the given client. It panics if the client is not a *conn or if the underlying process is not a *bin. The function requires gdb installed and terminal (tmux, xterm or gnome-terminal). Otherwise, the function will panic.
func WithGDBScript ¶ added in v0.0.3
func WithGDBScript(script string) func(*debugger)
WithGDBScript returns an option that sets the commands to be executed by gdb when attaching to the process. The commands are split by newline characters, so the following is a valid command string:
break main\n info registers\n continue\n
The function can be used to set arbitrary commands to be executed by gdb when attaching to the process. The commands are executed in the order they are given in the string.
func WithTerminal ¶
func WithTerminal(term terminal) func(*debugger)
WithTerminal returns an option that sets the terminal to use when spawning gdb to attach to the process. If this option is not used, the terminal is tried to be determined automatically.
Types ¶
type Client ¶
type Client interface {
io.ReadWriteCloser
ReadAll() (out []byte, n int, err error)
ReadUntil(data []byte) (out []byte, err error)
ReadLine() (out []byte, err error)
ReadStringLine() (string, error)
WriteLine(b []byte) error
WriteStringLine(s string) error
Interactive()
}
Client is an interface that represents a pwn client (binary, tcp, udp, etc).
func NewBinary ¶
NewBinary creates a new binary client given a path to a binary. It returns a new client from the given binary. Function panics on error.