diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..7cb24b4ea --- /dev/null +++ b/404.html @@ -0,0 +1,2395 @@ + + + +
+ + + + + + + + + + + + + + +GEF
http_get
http_get(url: str) → Optional[bytes]
+
+Basic HTTP wrapper for GET request. Return the body of the page if HTTP code is OK, otherwise return None.
+update_gef
update_gef(argv: List[str]) → int
+
+Obsolete. Use gef.sh
.
reset_all_caches
reset_all_caches() → None
+
+Free all caches. If an object is cached, it will have a callable attribute cache_clear
which will be invoked to purge the function cache.
reset
reset() → None
+
+highlight_text
highlight_text(text: str) → str
+
+Highlight text using gef.ui.highlight_table
{ match -> color } settings.
If RegEx is enabled it will create a match group around all items in the gef.ui.highlight_table
and wrap the specified color in the gef.ui.highlight_table
around those matches.
If RegEx is disabled, split by ANSI codes and 'colorify' each match found within the specified string.
+gef_print
gef_print(*args: str, end='\n', sep=' ', **kwargs: Any) → None
+
+Wrapper around print(), using string buffering feature.
+bufferize
bufferize(f: Callable) → Callable
+
+Store the content to be printed for a function in memory, and flush it on function exit.
+p8
p8(
+ x: int,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → bytes
+
+Pack one byte respecting the current architecture endianness.
+p16
p16(
+ x: int,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → bytes
+
+Pack one word respecting the current architecture endianness.
+p32
p32(
+ x: int,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → bytes
+
+Pack one dword respecting the current architecture endianness.
+p64
p64(
+ x: int,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → bytes
+
+Pack one qword respecting the current architecture endianness.
+u8
u8(
+ x: bytes,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → int
+
+Unpack one byte respecting the current architecture endianness.
+u16
u16(
+ x: bytes,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → int
+
+Unpack one word respecting the current architecture endianness.
+u32
u32(
+ x: bytes,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → int
+
+Unpack one dword respecting the current architecture endianness.
+u64
u64(
+ x: bytes,
+ s: bool = False,
+ e: Optional[ForwardRef('Endianness')] = None
+) → int
+
+Unpack one qword respecting the current architecture endianness.
+is_ascii_string
is_ascii_string(address: int) → bool
+
+Helper function to determine if the buffer pointed by address
is an ASCII string (in GDB)
is_alive
is_alive() → bool
+
+Check if GDB is running.
+calling_function
calling_function() → Optional[str]
+
+Return the name of the calling function
+only_if_gdb_running
only_if_gdb_running(f: Callable) → Callable
+
+Decorator wrapper to check if GDB is running.
+only_if_gdb_target_local
only_if_gdb_target_local(f: Callable) → Callable
+
+Decorator wrapper to check if GDB is running locally (target not remote).
+deprecated
deprecated(solution: str = '') → Callable
+
+Decorator to add a warning when a command is obsolete and will be removed.
+experimental_feature
experimental_feature(f: Callable) → Callable
+
+Decorator to add a warning when a feature is experimental.
+only_if_events_supported
only_if_events_supported(event_type: str) → Callable
+
+Checks if GDB supports events without crashing.
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+wrapped_f
wrapped_f(*args: Any, **kwargs: Any) → Any
+
+FakeExit
FakeExit(*args: Any, **kwargs: Any) → NoReturn
+
+parse_arguments
parse_arguments(
+ required_arguments: Dict[Union[str, Tuple[str, str]], Any],
+ optional_arguments: Dict[Union[str, Tuple[str, str]], Any]
+) → Callable
+
+Argument parsing decorator.
+search_for_main_arena
search_for_main_arena() → int
+
+search_for_main_arena
is DEPRECATED and will be removed in the future.
+ Use GefHeapManager.find_main_arena_addr()
get_libc_version
get_libc_version() → Tuple[int, ...]
+
+get_libc_version
is DEPRECATED and will be removed in the future.
+ Use GefLibcManager.find_libc_version()
titlify
titlify(
+ text: str,
+ color: Optional[str] = None,
+ msg_color: Optional[str] = None
+) → str
+
+Print a centered title.
+dbg
dbg(msg: str) → None
+
+err
err(msg: str) → None
+
+warn
warn(msg: str) → None
+
+ok
ok(msg: str) → None
+
+info
info(msg: str) → None
+
+push_context_message
push_context_message(level: str, message: str) → None
+
+Push the message to be displayed the next time the context is invoked.
+show_last_exception
show_last_exception() → None
+
+Display the last Python exception.
+gef_pystring
gef_pystring(x: bytes) → str
+
+Returns a sanitized version as string of the bytes list given in input.
+gef_pybytes
gef_pybytes(x: str) → bytes
+
+Returns an immutable bytes list from the string given as input.
+style_byte
style_byte(b: int, color: bool = True) → str
+
+hexdump
hexdump(
+ source: ByteString,
+ length: int = 16,
+ separator: str = '.',
+ show_raw: bool = False,
+ show_symbol: bool = True,
+ base: int = 0
+) → str
+
+Return the hexdump of src
argument. @param source MUST be of type bytes or bytearray @param length is the length of items per line @param separator is the default character to use if one byte is not printable @param show_raw if True, do not add the line nor the text translation @param base is the start address of the block being hexdump @return a string with the hexdump
is_debug
is_debug() → bool
+
+Check if debug mode is enabled.
+buffer_output
buffer_output() → bool
+
+Check if output should be buffered until command completion.
+hide_context
hide_context() → bool
+
+Helper function to hide the context pane.
+unhide_context
unhide_context() → bool
+
+Helper function to unhide the context pane.
+enable_redirect_output
enable_redirect_output(to_file: str = '/dev/null') → None
+
+Redirect all GDB output to to_file
parameter. By default, to_file
redirects to /dev/null
.
disable_redirect_output
disable_redirect_output() → None
+
+Disable the output redirection, if any.
+gef_makedirs
gef_makedirs(path: str, mode: int = 493) → Path
+
+Recursive mkdir() creation. If successful, return the absolute path of the directory created.
+ gef_makedirs
is DEPRECATED and will be removed in the future.
+ use pathlib.Path(...).mkdir()
gdb_disassemble
gdb_disassemble(
+ start_pc: int,
+ **kwargs: int
+) → Generator[__main__.Instruction, NoneType, NoneType]
+
+Disassemble instructions from start_pc
(Integer). Accepts the following named
parameters:
+end_pc
(Integer) only instructions whose start address fall in the interval from start_pc to end_pc are returned. count
(Integer) list at most this many disassembled instructions If end_pc
and count
are not provided, the function will behave as if count=1
. Return an iterator of Instruction objects gdb_get_nth_previous_instruction_address
gdb_get_nth_previous_instruction_address(addr: int, n: int) → Optional[int]
+
+Return the address (Integer) of the n
-th instruction before addr
.
gdb_get_nth_next_instruction_address
gdb_get_nth_next_instruction_address(addr: int, n: int) → int
+
+Return the address of the n
-th instruction after addr
.
+ gdb_get_nth_next_instruction_address
is DEPRECATED and will be removed in the future.
+ Use gef_instruction_n().address
gef_instruction_n
gef_instruction_n(addr: int, n: int) → Instruction
+
+Return the n
-th instruction after addr
as an Instruction object. Note that n
is treated as an positive index, starting from 0 (current instruction address)
gef_get_instruction_at
gef_get_instruction_at(addr: int) → Instruction
+
+Return the full Instruction found at the specified address.
+gef_current_instruction
gef_current_instruction(addr: int) → Instruction
+
+Return the current instruction as an Instruction object.
+gef_next_instruction
gef_next_instruction(addr: int) → Instruction
+
+Return the next instruction as an Instruction object.
+gef_disassemble
gef_disassemble(
+ addr: int,
+ nb_insn: int,
+ nb_prev: int = 0
+) → Generator[__main__.Instruction, NoneType, NoneType]
+
+Disassemble nb_insn
instructions after addr
and nb_prev
before addr
. Return an iterator of Instruction objects.
gef_execute_external
gef_execute_external(
+ command: Sequence[str],
+ as_list: bool = False,
+ **kwargs: Any
+) → Union[str, List[str]]
+
+Execute an external command and return the result.
+gef_execute_gdb_script
gef_execute_gdb_script(commands: str) → None
+
+Execute the parameter source
as GDB command. This is done by writing commands
to a temporary file, which is then executed via GDB source
command. The tempfile is then deleted.
checksec
checksec(filename: str) → Dict[str, bool]
+
+checksec
is DEPRECATED and will be removed in the future.
+ Use Elf(fname).checksec()
get_arch
get_arch() → str
+
+Return the binary's architecture.
+ get_arch
is DEPRECATED and will be removed in the future.
+ Use gef.arch
instead
get_entry_point
get_entry_point() → Optional[int]
+
+Return the binary entry point.
+ get_entry_point
is DEPRECATED and will be removed in the future.
+ Use gef.binary.entry_point
instead
is_pie
is_pie(fpath: str) → bool
+
+is_big_endian
is_big_endian() → bool
+
+is_big_endian
is DEPRECATED and will be removed in the future.
+ Prefer gef.arch.endianness == Endianness.BIG_ENDIAN
is_little_endian
is_little_endian() → bool
+
+is_little_endian
is DEPRECATED and will be removed in the future.
+ gef.arch.endianness == Endianness.LITTLE_ENDIAN
flags_to_human
flags_to_human(reg_value: int, value_table: Dict[int, str]) → str
+
+Return a human readable string showing the flag states.
+register_architecture
register_architecture(
+ cls: Type[ForwardRef('Architecture')]
+) → Type[ForwardRef('Architecture')]
+
+register_architecture
is DEPRECATED and will be removed in the future.
+ Using the decorator register_architecture
is unecessary
copy_to_clipboard
copy_to_clipboard(data: bytes) → None
+
+Helper function to submit data to the clipboard
+use_stdtype
use_stdtype() → str
+
+use_default_type
use_default_type() → str
+
+use_golang_type
use_golang_type() → str
+
+use_rust_type
use_rust_type() → str
+
+to_unsigned_long
to_unsigned_long(v: gdb.Value) → int
+
+Cast a gdb.Value to unsigned long.
+get_path_from_info_proc
get_path_from_info_proc() → Optional[str]
+
+get_os
get_os() → str
+
+get_os
is DEPRECATED and will be removed in the future.
+ Use gef.session.os
get_filepath
get_filepath() → Optional[str]
+
+Return the local absolute path of the file currently debugged.
+get_function_length
get_function_length(sym: str) → int
+
+Attempt to get the length of the raw bytes of a function.
+process_lookup_address
process_lookup_address(address: int) → Optional[__main__.Section]
+
+Look up for an address in memory. Return an Address object if found, None otherwise.
+xor
xor(data: ByteString, key: str) → bytearray
+
+Return data
xor-ed with key
.
is_hex
is_hex(pattern: str) → bool
+
+Return whether provided string is a hexadecimal value.
+continue_handler
continue_handler(_: 'gdb.events.ContinueEvent') → None
+
+GDB event handler for new object continue cases.
+hook_stop_handler
hook_stop_handler(_: 'gdb.events.StopEvent') → None
+
+GDB event handler for stop cases.
+new_objfile_handler
new_objfile_handler(
+ evt: Optional[ForwardRef('gdb.events.NewObjFileEvent')]
+) → None
+
+GDB event handler for new object file cases.
+exit_handler
exit_handler(_: 'gdb.events.ExitedEvent') → None
+
+GDB event handler for exit cases.
+memchanged_handler
memchanged_handler(_: 'gdb.events.MemoryChangedEvent') → None
+
+GDB event handler for mem changes cases.
+regchanged_handler
regchanged_handler(_: 'gdb.events.RegisterChangedEvent') → None
+
+GDB event handler for reg changes cases.
+get_terminal_size
get_terminal_size() → Tuple[int, int]
+
+Return the current terminal size.
+reset_architecture
reset_architecture(arch: Optional[str] = None) → None
+
+Sets the current architecture. If an architecture is explicitly specified by parameter, try to use that one. If this fails, an OSError
exception will occur. If no architecture is specified, then GEF will attempt to determine automatically based on the current ELF target. If this fails, an OSError
exception will occur.
get_memory_alignment
get_memory_alignment(in_bits: bool = False) → int
+
+Try to determine the size of a pointer on this system. First, try to parse it out of the ELF header. Next, use the size of size_t
. Finally, try the size of $pc. If in_bits
is set to True, the result is returned in bits, otherwise in bytes.
+ get_memory_alignment
is DEPRECATED and will be removed in the future.
+ Use gef.arch.ptrsize
instead
clear_screen
clear_screen(tty: str = '') → None
+
+Clear the screen.
+format_address
format_address(addr: int) → str
+
+Format the address according to its size.
+format_address_spaces
format_address_spaces(addr: int, left: bool = True) → str
+
+Format the address according to its size, but with spaces instead of zeroes.
+align_address
align_address(address: int) → int
+
+Align the provided address to the process's native length.
+align_address_to_size
align_address_to_size(address: int, align: int) → int
+
+Align the address to the given size.
+align_address_to_page
align_address_to_page(address: int) → int
+
+Align the address to a page.
+parse_address
parse_address(address: str) → int
+
+Parse an address and return it as an Integer.
+is_in_x86_kernel
is_in_x86_kernel(address: int) → bool
+
+is_remote_debug
is_remote_debug() → bool
+
+"Return True is the current debugging session is running through GDB remote session.
+de_bruijn
de_bruijn(alphabet: bytes, n: int) → Generator[int, NoneType, NoneType]
+
+De Bruijn sequence for alphabet and subsequences of length n (for compat. w/ pwnlib).
+generate_cyclic_pattern
generate_cyclic_pattern(length: int, cycle: int = 4) → bytearray
+
+Create a length
byte bytearray of a de Bruijn cyclic pattern.
safe_parse_and_eval
safe_parse_and_eval(value: str) → Optional[ForwardRef('gdb.Value')]
+
+GEF wrapper for gdb.parse_and_eval(): this function returns None instead of raising gdb.error if the eval failed.
+gef_convenience
gef_convenience(value: Union[str, bytes]) → str
+
+Defines a new convenience value.
+parse_string_range
parse_string_range(s: str) → Iterator[int]
+
+Parses an address range (e.g. 0x400000-0x401000)
+gef_get_pie_breakpoint
gef_get_pie_breakpoint(num: int) → PieVirtualBreakpoint
+
+gef_get_pie_breakpoint
is DEPRECATED and will be removed in the future.
+ Use gef.session.pie_breakpoints[num]
endian_str
endian_str() → str
+
+endian_str
is DEPRECATED and will be removed in the future.
+ Use str(gef.arch.endianness)
instead
get_gef_setting
get_gef_setting(name: str) → Any
+
+get_gef_setting
is DEPRECATED and will be removed in the future.
+ Use gef.config[key]
set_gef_setting
set_gef_setting(name: str, value: Any) → None
+
+set_gef_setting
is DEPRECATED and will be removed in the future.
+ Use gef.config[key] = value
gef_getpagesize
gef_getpagesize() → int
+
+gef_getpagesize
is DEPRECATED and will be removed in the future.
+ Use gef.session.pagesize
gef_read_canary
gef_read_canary() → Optional[Tuple[int, int]]
+
+gef_read_canary
is DEPRECATED and will be removed in the future.
+ Use gef.session.canary
get_pid
get_pid() → int
+
+get_pid
is DEPRECATED and will be removed in the future.
+ Use gef.session.pid
get_filename
get_filename() → str
+
+get_filename
is DEPRECATED and will be removed in the future.
+ Use gef.session.file.name
get_glibc_arena
get_glibc_arena() → Optional[__main__.GlibcArena]
+
+get_glibc_arena
is DEPRECATED and will be removed in the future.
+ Use gef.heap.main_arena
get_register
get_register(regname) → Optional[int]
+
+get_register
is DEPRECATED and will be removed in the future.
+ Use gef.arch.register(regname)
get_process_maps
get_process_maps() → List[__main__.Section]
+
+get_process_maps
is DEPRECATED and will be removed in the future.
+ Use gef.memory.maps
set_arch
set_arch(arch: Optional[str] = None, _: Optional[str] = None) → None
+
+set_arch
is DEPRECATED and will be removed in the future.
+ Use reset_architecture
register_external_context_pane
register_external_context_pane(
+ pane_name: str,
+ display_pane_function: Callable[[], NoneType],
+ pane_title_function: Callable[[], Optional[str]],
+ condition: Optional[Callable[[], bool]] = None
+) → None
+
+Registering function for new GEF Context View. pane_name: a string that has no spaces (used in settings) display_pane_function: a function that uses gef_print() to print strings pane_title_function: a function that returns a string or None, which will be displayed as the title. If None, no title line is displayed. condition: an optional callback: if not None, the callback will be executed first. If it returns true, then only the pane title and content will displayed. Otherwise, it's simply skipped.
+Example usage for a simple text to show when we hit a syscall: def only_syscall(): return gef_current_instruction(gef.arch.pc).is_syscall() def display_pane(): gef_print("Wow, I am a context pane!") def pane_title(): return "example:pane" register_external_context_pane("example_pane", display_pane, pane_title, only_syscall)
+register_external_context_layout_mapping
register_external_context_layout_mapping(
+ current_pane_name: str,
+ display_pane_function: Callable[[], NoneType],
+ pane_title_function: Callable[[], Optional[str]],
+ condition: Optional[Callable[[], bool]] = None
+) → None
+
+register_external_command
register_external_command(
+ cls: Type[ForwardRef('GenericCommand')]
+) → Type[ForwardRef('GenericCommand')]
+
+Registering function for new GEF (sub-)command to GDB.
+ register_external_command
is DEPRECATED and will be removed in the future.
+ Use register()
, and inherit from GenericCommand
instead
register_command
register_command(
+ cls: Type[ForwardRef('GenericCommand')]
+) → Type[ForwardRef('GenericCommand')]
+
+Decorator for registering new GEF (sub-)command to GDB.
+ register_command
is DEPRECATED and will be removed in the future.
+ Use register()
, and inherit from GenericCommand
instead
register_priority_command
register_priority_command(
+ cls: Type[ForwardRef('GenericCommand')]
+) → Type[ForwardRef('GenericCommand')]
+
+Decorator for registering new command with priority, meaning that it must loaded before the other generic commands.
+ register_priority_command
is DEPRECATED and will be removed in the future.
register
register(
+ cls: Union[Type[ForwardRef('ValidCommandType')], Type[ForwardRef('ValidFunctionType')]]
+) → Union[Type[ForwardRef('ValidCommandType')], Type[ForwardRef('ValidFunctionType')]]
+
+register_function
register_function(
+ cls: Type[ForwardRef('GenericFunction')]
+) → Type[ForwardRef('GenericFunction')]
+
+Decorator for registering a new convenience function to GDB.
+ register_function
is DEPRECATED and will be removed in the future.
target_remote_posthook
target_remote_posthook()
+
+AARCH64
Determine the size of pointer from the current CPU mode
+AARCH64.canary_address
canary_address() → int
+
+AARCH64.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+AARCH64.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+AARCH64.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+AARCH64.is_aarch32
is_aarch32() → bool
+
+Determine if the CPU is currently in AARCH32 mode from runtime.
+AARCH64.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+AARCH64.is_call
is_call(insn: __main__.Instruction) → bool
+
+AARCH64.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+AARCH64.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+AARCH64.is_thumb
is_thumb() → bool
+
+Determine if the machine is currently in THUMB mode.
+AARCH64.is_thumb32
is_thumb32() → bool
+
+Determine if the CPU is currently in THUMB32 mode from runtime.
+AARCH64.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+AARCH64.register
register(name: str) → int
+
+AARCH64.reset_caches
reset_caches() → None
+
+AARCH64.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
ARM
ARM.canary_address
canary_address() → int
+
+ARM.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+ARM.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+ARM.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+ARM.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+ARM.is_call
is_call(insn: __main__.Instruction) → bool
+
+ARM.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+ARM.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+ARM.is_thumb
is_thumb() → bool
+
+Determine if the machine is currently in THUMB mode.
+ARM.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+ARM.register
register(name: str) → int
+
+ARM.reset_caches
reset_caches() → None
+
+ARM.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
ASLRCommand
View/modify the ASLR setting of GDB. By default, GDB will disable ASLR when it starts the process. (i.e. not attached). This command allows to change that setting.
+ +ASLRCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ASLRCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ASLRCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ASLRCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ASLRCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ASLRCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ASLRCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ASLRCommand.post_load
post_load() → None
+
+ASLRCommand.pre_load
pre_load() → None
+
+ASLRCommand.usage
usage() → None
+
+Address
GEF representation of memory addresses.
+ +Address.__init__
__init__(**kwargs: Any) → None
+
+Address.dereference
dereference() → Optional[int]
+
+Address.is_in_heap_segment
is_in_heap_segment() → bool
+
+Address.is_in_stack_segment
is_in_stack_segment() → bool
+
+Address.is_in_text_segment
is_in_text_segment() → bool
+
+AliasesAddCommand
Command to add aliases.
+ +AliasesAddCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+AliasesAddCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
AliasesAddCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
AliasesAddCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+AliasesAddCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
AliasesAddCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
AliasesAddCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+AliasesAddCommand.post_load
post_load() → None
+
+AliasesAddCommand.pre_load
pre_load() → None
+
+AliasesAddCommand.usage
usage() → None
+
+AliasesCommand
Base command to add, remove, or list aliases.
+ +AliasesCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+AliasesCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
AliasesCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
AliasesCommand.do_invoke
do_invoke(_: List[str]) → None
+
+AliasesCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
AliasesCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
AliasesCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+AliasesCommand.post_load
post_load() → None
+
+AliasesCommand.pre_load
pre_load() → None
+
+AliasesCommand.usage
usage() → None
+
+AliasesListCommand
Command to list aliases.
+ +AliasesListCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+AliasesListCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
AliasesListCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
AliasesListCommand.do_invoke
do_invoke(_: List[str]) → None
+
+AliasesListCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
AliasesListCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
AliasesListCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+AliasesListCommand.post_load
post_load() → None
+
+AliasesListCommand.pre_load
pre_load() → None
+
+AliasesListCommand.usage
usage() → None
+
+AliasesRmCommand
Command to remove aliases.
+ +AliasesRmCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+AliasesRmCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
AliasesRmCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
AliasesRmCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+AliasesRmCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
AliasesRmCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
AliasesRmCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+AliasesRmCommand.post_load
post_load() → None
+
+AliasesRmCommand.pre_load
pre_load() → None
+
+AliasesRmCommand.usage
usage() → None
+
+AlreadyRegisteredException
ArchCommand
Manage the current loaded architecture.
+ +ArchCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ArchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ArchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ArchCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ArchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ArchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ArchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ArchCommand.post_load
post_load() → None
+
+ArchCommand.pre_load
pre_load() → None
+
+ArchCommand.usage
usage() → None
+
+ArchGetCommand
Get the current loaded architecture.
+ +ArchGetCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ArchGetCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ArchGetCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ArchGetCommand.do_invoke
do_invoke(args: List[str]) → None
+
+ArchGetCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ArchGetCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ArchGetCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ArchGetCommand.post_load
post_load() → None
+
+ArchGetCommand.pre_load
pre_load() → None
+
+ArchGetCommand.usage
usage() → None
+
+ArchListCommand
List the available architectures.
+ +ArchListCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ArchListCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ArchListCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ArchListCommand.do_invoke
do_invoke(args: List[str]) → None
+
+ArchListCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ArchListCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ArchListCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ArchListCommand.post_load
post_load() → None
+
+ArchListCommand.pre_load
pre_load() → None
+
+ArchListCommand.usage
usage() → None
+
+ArchSetCommand
Set the current loaded architecture.
+ +ArchSetCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ArchSetCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ArchSetCommand.complete
complete(text: str, word: str) → List[str]
+
+ArchSetCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ArchSetCommand.do_invoke
do_invoke(args: List[str]) → None
+
+ArchSetCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ArchSetCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ArchSetCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ArchSetCommand.post_load
post_load() → None
+
+ArchSetCommand.pre_load
pre_load() → None
+
+ArchSetCommand.usage
usage() → None
+
+Architecture
Generic metaclass for the architecture supported by GEF.
+Architecture.canary_address
canary_address() → int
+
+Architecture.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+Architecture.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+Architecture.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+Architecture.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+Architecture.is_call
is_call(insn: __main__.Instruction) → bool
+
+Architecture.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+Architecture.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+Architecture.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+Architecture.register
register(name: str) → int
+
+Architecture.reset_caches
reset_caches() → None
+
+Architecture.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
ArchitectureBase
Class decorator for declaring an architecture to GEF.
+BssBaseFunction
Return the current bss base address plus the given offset.
+ +BssBaseFunction.__init__
__init__() → None
+
+BssBaseFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+BssBaseFunction.do_invoke
do_invoke(args: List) → int
+
+BssBaseFunction.invoke
invoke(*args: Any) → int
+
+CanaryCommand
Shows the canary value of the current process.
+ +CanaryCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+CanaryCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
CanaryCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
CanaryCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+CanaryCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
CanaryCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
CanaryCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+CanaryCommand.post_load
post_load() → None
+
+CanaryCommand.pre_load
pre_load() → None
+
+CanaryCommand.usage
usage() → None
+
+ChangeFdCommand
ChangeFdCommand: redirect file descriptor during runtime.
+ +ChangeFdCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ChangeFdCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ChangeFdCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ChangeFdCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ChangeFdCommand.get_fd_from_result
get_fd_from_result(res: str) → int
+
+ChangeFdCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ChangeFdCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ChangeFdCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ChangeFdCommand.post_load
post_load() → None
+
+ChangeFdCommand.pre_load
pre_load() → None
+
+ChangeFdCommand.usage
usage() → None
+
+ChangePermissionBreakpoint
When hit, this temporary breakpoint will restore the original code, and position $pc correctly.
+ +ChangePermissionBreakpoint.__init__
__init__(loc: str, code: ByteString, pc: int) → None
+
+ChangePermissionBreakpoint.stop
stop() → bool
+
+ChecksecCommand
Checksec the security properties of the current executable or passed as argument. The command checks for the following protections: +- PIE +- NX +- RelRO +- Glibc Stack Canaries +- Fortify Source
+ +ChecksecCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ChecksecCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ChecksecCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ChecksecCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ChecksecCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ChecksecCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ChecksecCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ChecksecCommand.post_load
post_load() → None
+
+ChecksecCommand.pre_load
pre_load() → None
+
+ChecksecCommand.print_security_properties
print_security_properties(filename: str) → None
+
+ChecksecCommand.usage
usage() → None
+
+Color
Used to colorify terminal output.
+Color.blinkify
blinkify(msg: str) → str
+
+Color.blueify
blueify(msg: str) → str
+
+Color.boldify
boldify(msg: str) → str
+
+Color.colorify
colorify(text: str, attrs: str) → str
+
+Color text according to the given attributes.
+Color.cyanify
cyanify(msg: str) → str
+
+Color.grayify
grayify(msg: str) → str
+
+Color.greenify
greenify(msg: str) → str
+
+Color.highlightify
highlightify(msg: str) → str
+
+Color.light_grayify
light_grayify(msg: str) → str
+
+Color.pinkify
pinkify(msg: str) → str
+
+Color.redify
redify(msg: str) → str
+
+Color.underlinify
underlinify(msg: str) → str
+
+Color.yellowify
yellowify(msg: str) → str
+
+ContextCommand
Displays a comprehensive and modular summary of runtime context. Unless setting enable
is set to False, this command will be spawned automatically every time GDB hits a breakpoint, a watchpoint, or any kind of interrupt. By default, it will show panes that contain the register states, the stack, and the disassembly code around $pc.
ContextCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ContextCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ContextCommand.addr_has_breakpoint
addr_has_breakpoint(address: int, bp_locations: List[str]) → bool
+
+ContextCommand.context_additional_information
context_additional_information() → None
+
+ContextCommand.context_args
context_args() → None
+
+ContextCommand.context_code
context_code() → None
+
+ContextCommand.context_memory
context_memory() → None
+
+ContextCommand.context_regs
context_regs() → None
+
+ContextCommand.context_source
context_source() → None
+
+ContextCommand.context_stack
context_stack() → None
+
+ContextCommand.context_threads
context_threads() → None
+
+ContextCommand.context_title
context_title(m: Optional[str]) → None
+
+ContextCommand.context_trace
context_trace() → None
+
+ContextCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ContextCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ContextCommand.empty_extra_messages
empty_extra_messages(_) → None
+
+ContextCommand.get_pc_context_info
get_pc_context_info(pc: int, line: str) → str
+
+ContextCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ContextCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ContextCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ContextCommand.line_has_breakpoint
line_has_breakpoint(
+ file_name: str,
+ line_number: int,
+ bp_locations: List[str]
+) → bool
+
+ContextCommand.post_load
post_load() → None
+
+ContextCommand.pre_load
pre_load() → None
+
+ContextCommand.print_arguments_from_symbol
print_arguments_from_symbol(function_name: str, symbol: 'gdb.Symbol') → None
+
+If symbols were found, parse them and print the argument adequately.
+ContextCommand.print_guessed_arguments
print_guessed_arguments(function_name: str) → None
+
+When no symbol, read the current basic block and look for "interesting" instructions.
+ContextCommand.show_legend
show_legend() → None
+
+ContextCommand.update_registers
update_registers(_) → None
+
+ContextCommand.usage
usage() → None
+
+DereferenceCommand
Dereference recursively from an address and display information. This acts like WinDBG dps
command.
DereferenceCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+DereferenceCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
DereferenceCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
DereferenceCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+DereferenceCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
DereferenceCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
DereferenceCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+DereferenceCommand.post_load
post_load() → None
+
+DereferenceCommand.pprint_dereferenced
pprint_dereferenced(addr: int, idx: int, base_offset: int = 0) → str
+
+DereferenceCommand.pre_load
pre_load() → None
+
+DereferenceCommand.usage
usage() → None
+
+DetailRegistersCommand
Display full details on one, many or all registers value from current architecture.
+ +DetailRegistersCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+DetailRegistersCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
DetailRegistersCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
DetailRegistersCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+DetailRegistersCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
DetailRegistersCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
DetailRegistersCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+DetailRegistersCommand.post_load
post_load() → None
+
+DetailRegistersCommand.pre_load
pre_load() → None
+
+DetailRegistersCommand.usage
usage() → None
+
+DisableContextOutputContext
Elf
Basic ELF parsing. Ref: +- http://www.skyfree.org/linux/references/ELF_Format.pdf +- https://refspecs.linuxfoundation.org/elf/elfspec_ppc.pdf +- https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html
+ +Elf.__init__
__init__(path: Union[str, pathlib.Path]) → None
+
+Instantiate an ELF object. A valid ELF must be provided, or an exception will be thrown.
+Check the security property of the ELF binary. The following properties are: +- Canary +- NX +- PIE +- Fortify +- Partial/Full RelRO. Return a dict() with the different keys mentioned above, and the boolean associated whether the protection was found.
+Elf.is_valid
is_valid(path: pathlib.Path) → bool
+
+Elf.read
read(size: int) → bytes
+
+Elf.read_and_unpack
read_and_unpack(fmt: str) → Tuple[Any, ...]
+
+Elf.seek
seek(off: int) → None
+
+ElfInfoCommand
Display a limited subset of ELF header information. If no argument is provided, the command will show information about the current ELF being debugged.
+ +ElfInfoCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ElfInfoCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ElfInfoCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ElfInfoCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+ElfInfoCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ElfInfoCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ElfInfoCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ElfInfoCommand.post_load
post_load() → None
+
+ElfInfoCommand.pre_load
pre_load() → None
+
+ElfInfoCommand.usage
usage() → None
+
+Endianness
An enumeration.
+EntryBreakBreakpoint
Breakpoint used internally to stop execution at the most convenient entry point.
+ +EntryBreakBreakpoint.__init__
__init__(location: str) → None
+
+EntryBreakBreakpoint.stop
stop() → bool
+
+EntryPointBreakCommand
Tries to find best entry point and sets a temporary breakpoint on it. The command will test for well-known symbols for entry points, such as main
, _main
, __libc_start_main
, etc. defined by the setting entrypoint_symbols
.
EntryPointBreakCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+EntryPointBreakCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
EntryPointBreakCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
EntryPointBreakCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+EntryPointBreakCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
EntryPointBreakCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
EntryPointBreakCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+EntryPointBreakCommand.post_load
post_load() → None
+
+EntryPointBreakCommand.pre_load
pre_load() → None
+
+EntryPointBreakCommand.set_init_tbreak
set_init_tbreak(addr: int) → EntryBreakBreakpoint
+
+EntryPointBreakCommand.set_init_tbreak_pie
set_init_tbreak_pie(addr: int, argv: List[str]) → EntryBreakBreakpoint
+
+EntryPointBreakCommand.usage
usage() → None
+
+ExternalStructureManager
ExternalStructureManager.__init__
__init__() → None
+
+ExternalStructureManager.clear_caches
clear_caches() → None
+
+FileFormat
FileFormat.__init__
__init__(path: Union[str, pathlib.Path]) → None
+
+FileFormat.is_valid
is_valid(_: pathlib.Path) → bool
+
+FileFormatSection
FlagsCommand
Edit flags in a human friendly way.
+ +FlagsCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+FlagsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
FlagsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
FlagsCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+FlagsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
FlagsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
FlagsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+FlagsCommand.post_load
post_load() → None
+
+FlagsCommand.pre_load
pre_load() → None
+
+FlagsCommand.usage
usage() → None
+
+FormatStringBreakpoint
Inspect stack for format string.
+ +FormatStringBreakpoint.__init__
__init__(spec: str, num_args: int) → None
+
+FormatStringBreakpoint.stop
stop() → bool
+
+FormatStringSearchCommand
Exploitable format-string helper: this command will set up specific breakpoints at well-known dangerous functions (printf, snprintf, etc.), and check if the pointer holding the format string is writable, and therefore susceptible to format string attacks if an attacker can control its content.
+ +FormatStringSearchCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+FormatStringSearchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
FormatStringSearchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
FormatStringSearchCommand.do_invoke
do_invoke(_: List[str]) → None
+
+FormatStringSearchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
FormatStringSearchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
FormatStringSearchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+FormatStringSearchCommand.post_load
post_load() → None
+
+FormatStringSearchCommand.pre_load
pre_load() → None
+
+FormatStringSearchCommand.usage
usage() → None
+
+GdbRemoveReadlineFinder
GdbRemoveReadlineFinder.find_module
find_module(fullname, path=None)
+
+GdbRemoveReadlineFinder.load_module
load_module(fullname)
+
+Gef
The GEF root class, which serves as a entrypoint for all the debugging session attributes (architecture, memory, settings, etc.).
+ +Gef.__init__
__init__() → None
+
+Gef.reinitialize_managers
reinitialize_managers() → None
+
+Reinitialize the managers. Avoid calling this function directly, using pi reset()
is preferred
Gef.reset_caches
reset_caches() → None
+
+Recursively clean the cache of all the managers. Avoid calling this function directly, using reset-cache
is preferred
Gef.setup
setup() → None
+
+Setup initialize the runtime setup, which may require for the gef
to be not None.
GefAlias
Simple aliasing wrapper because GDB doesn't do what it should.
+ +GefAlias.__init__
__init__(
+ alias: str,
+ command: str,
+ completer_class: int = 0,
+ command_class: int = -1
+) → None
+
+GefAlias.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefAlias.lookup_command
lookup_command(cmd: str) → Optional[Tuple[str, __main__.GenericCommand]]
+
+GefCommand
GEF main command: view all new commands by typing gef
.
GefCommand.__init__
__init__() → None
+
+loaded_commands
is DEPRECATED and will be removed in the future.
loaded_functions
is DEPRECATED and will be removed in the future.
missing_commands
is DEPRECATED and will be removed in the future.
GefCommand.add_context_layout_mapping
add_context_layout_mapping(
+ current_pane_name: str,
+ display_pane_function: Callable,
+ pane_title_function: Callable,
+ condition: Optional[Callable]
+) → None
+
+Add a new context layout mapping.
+GefCommand.add_context_pane
add_context_pane(
+ pane_name: str,
+ display_pane_function: Callable,
+ pane_title_function: Callable,
+ condition: Optional[Callable]
+) → None
+
+Add a new context pane to ContextCommand.
+GefCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefCommand.load
load() → None
+
+Load all the commands and functions defined by GEF into GDB.
+GefCommand.load_extra_plugins
load_extra_plugins(extra_plugins_dir: Optional[pathlib.Path] = None) → int
+
+Load the plugins from the gef-extras setting. Returns the number of new plugins added.
+GefCommand.setup
setup() → None
+
+GefCommand.show_banner
show_banner() → None
+
+GefConfigCommand
GEF configuration sub-command This command will help set/view GEF settings for the current debugging session. It is possible to make those changes permanent by running gef save
(refer to this command help), and/or restore previously saved settings by running gef restore
(refer help).
GefConfigCommand.__init__
__init__() → None
+
+GefConfigCommand.complete
complete(text: str, word: str) → List[str]
+
+GefConfigCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GefConfigCommand.print_setting
print_setting(plugin_name: str, verbose: bool = False) → None
+
+GefConfigCommand.print_settings
print_settings() → None
+
+GefConfigCommand.set_setting
set_setting(argv: List[str]) → bool
+
+GefFunctionsCommand
List the convenience functions provided by GEF.
+ +GefFunctionsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GefFunctionsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GefFunctionsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GefFunctionsCommand.do_invoke
do_invoke(argv) → None
+
+GefFunctionsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GefFunctionsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GefFunctionsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GefFunctionsCommand.post_load
post_load() → None
+
+GefFunctionsCommand.pre_load
pre_load() → None
+
+GefFunctionsCommand.usage
usage() → None
+
+GefHeapManager
Class managing session heap.
+ +GefHeapManager.__init__
__init__() → None
+
+GefHeapManager.csize2tidx
csize2tidx(size: int) → int
+
+GefHeapManager.malloc_align_address
malloc_align_address(address: int) → int
+
+Align addresses according to glibc's MALLOC_ALIGNMENT. See also Issue #689 on Github
+GefHeapManager.reset_caches
reset_caches() → None
+
+GefHeapManager.tidx2size
tidx2size(idx: int) → int
+
+GefHelpCommand
GEF help sub-command.
+ +GefHelpCommand.__init__
__init__() → None
+
+GefHelpCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefInstallExtraScriptCommand
gef install
command: installs one or more scripts from the gef-extras
script repo. Note that the command doesn't check for external dependencies the script(s) might require.
GefInstallExtraScriptCommand.__init__
__init__() → None
+
+GefInstallExtraScriptCommand.invoke
invoke(argv: str, from_tty: bool) → None
+
+GefLibcManager
Class managing everything libc-related (except heap).
+ +GefLibcManager.__init__
__init__() → None
+
+GefLibcManager.reset_caches
reset_caches() → None
+
+Reset the LRU-cached attributes
+GefManager
GefManager.reset_caches
reset_caches() → None
+
+Reset the LRU-cached attributes
+GefMemoryManager
Class that manages memory access for gef.
+ +GefMemoryManager.__init__
__init__() → None
+
+GefMemoryManager.append
append(section: __main__.Section)
+
+GefMemoryManager.parse_gdb_info_proc_maps
parse_gdb_info_proc_maps() → Generator[__main__.Section, NoneType, NoneType]
+
+Get the memory mapping from GDB's command maintenance info sections
(limited info).
GefMemoryManager.parse_info_mem
parse_info_mem()
+
+Get the memory mapping from GDB's command info mem
. This can be provided by certain gdbserver implementations.
GefMemoryManager.parse_monitor_info_mem
parse_monitor_info_mem() → Generator[__main__.Section, NoneType, NoneType]
+
+Get the memory mapping from GDB's command monitor info mem
This can raise an exception, which the memory manager takes to mean that this method does not work to get a map.
GefMemoryManager.parse_procfs_maps
parse_procfs_maps() → Generator[__main__.Section, NoneType, NoneType]
+
+Get the memory mapping from procfs.
+GefMemoryManager.read
read(addr: int, length: int = 16) → bytes
+
+Return a length
long byte array with the copy of the process memory at addr
.
GefMemoryManager.read_ascii_string
read_ascii_string(address: int) → Optional[str]
+
+Read an ASCII string from memory
+GefMemoryManager.read_cstring
read_cstring(
+ address: int,
+ max_length: int = 50,
+ encoding: Optional[str] = None
+) → str
+
+Return a C-string read from memory.
+GefMemoryManager.read_integer
read_integer(addr: int) → int
+
+Return an integer read from memory.
+GefMemoryManager.reset_caches
reset_caches() → None
+
+GefMemoryManager.write
write(address: int, buffer: ByteString, length: Optional[int] = None) → None
+
+Write buffer
at address address
.
GefMissingCommand
GEF missing sub-command Display the GEF commands that could not be loaded, along with the reason of why they could not be loaded.
+ +GefMissingCommand.__init__
__init__() → None
+
+GefMissingCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefRemoteSessionManager
Class for managing remote sessions with GEF. It will create a temporary environment designed to clone the remote one.
+ +GefRemoteSessionManager.__init__
__init__(
+ host: str,
+ port: int,
+ pid: int = -1,
+ qemu: Optional[pathlib.Path] = None
+) → None
+
+Return a tuple of the canary address and value, read from the canonical location if supported by the architecture. Otherwise, read from the auxiliary vector.
+Path to the file being debugged as seen by the remote endpoint.
+Local path to the file being debugged.
+Return a tuple of the initial canary address and value, read from the auxiliary vector.
+Return the current OS.
+Get the system page size
+Return the PID of the target process.
+GefRemoteSessionManager.close
close() → None
+
+GefRemoteSessionManager.connect
connect(pid: int) → bool
+
+Connect to remote target. If in extended mode, also attach to the given PID.
+GefRemoteSessionManager.remote_objfile_event_handler
remote_objfile_event_handler(evt: 'gdb.events.NewObjFileEvent') → None
+
+GefRemoteSessionManager.reset_caches
reset_caches() → None
+
+GefRemoteSessionManager.setup
setup() → bool
+
+GefRemoteSessionManager.sync
sync(src: str, dst: Optional[str] = None) → bool
+
+Copy the src
into the temporary chroot. If dst
is provided, that path will be used instead of src
.
GefRestoreCommand
GEF restore sub-command. Loads settings from file '~/.gef.rc' and apply them to the configuration of GEF.
+ +GefRestoreCommand.__init__
__init__() → None
+
+GefRestoreCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GefRestoreCommand.reload
reload(quiet: bool)
+
+GefRunCommand
Override GDB run commands with the context from GEF. Simple wrapper for GDB run command to use arguments set from gef set args
.
GefRunCommand.__init__
__init__() → None
+
+GefRunCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefSaveCommand
GEF save sub-command. Saves the current configuration of GEF to disk (by default in file '~/.gef.rc').
+ +GefSaveCommand.__init__
__init__() → None
+
+GefSaveCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefSessionManager
Class managing the runtime properties of GEF.
+ +GefSessionManager.__init__
__init__() → None
+
+Return a tuple of the canary address and value, read from the canonical location if supported by the architecture. Otherwise, read from the auxiliary vector.
+Return a Path object of the target process.
+Returns the Path to the procfs entry for the memory mapping.
+Return a tuple of the initial canary address and value, read from the auxiliary vector.
+Return the current OS.
+Get the system page size
+Return the PID of the target process.
+Returns the path to the process's root directory.
+GefSessionManager.reset_caches
reset_caches() → None
+
+GefSetCommand
Override GDB set commands with the context from GEF.
+ +GefSetCommand.__init__
__init__() → None
+
+GefSetCommand.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefSetting
Basic class for storing gef settings as objects
+ +GefSetting.__init__
__init__(
+ value: Any,
+ cls: Optional[type] = None,
+ description: Optional[str] = None,
+ hooks: Optional[Dict[str, List[Callable]]] = None
+) → None
+
+GefSetting.add_hook
add_hook(access: str, funcs: List[Callable])
+
+GefSetting.create_folder_tree
create_folder_tree(value: pathlib.Path)
+
+GefSetting.must_exist
must_exist(value: pathlib.Path)
+
+GefSetting.no_spaces
no_spaces(value: pathlib.Path)
+
+GefSettingsManager
GefSettings acts as a dict where the global settings are stored and can be read, written or deleted as any other dict. For instance, to read a specific command setting: gef.config[mycommand.mysetting]
GefSettingsManager.raw_entry
raw_entry(name: str) → GefSetting
+
+GefThemeCommand
Customize GEF appearance.
+ +GefThemeCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GefThemeCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GefThemeCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GefThemeCommand.do_invoke
do_invoke(args: List[str]) → None
+
+GefThemeCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GefThemeCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GefThemeCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GefThemeCommand.post_load
post_load() → None
+
+GefThemeCommand.pre_load
pre_load() → None
+
+GefThemeCommand.usage
usage() → None
+
+GefTmuxSetup
Setup a comfortable tmux debugging environment.
+ +GefTmuxSetup.__init__
__init__() → None
+
+GefTmuxSetup.invoke
invoke(args: Any, from_tty: bool) → None
+
+GefTmuxSetup.screen_setup
screen_setup() → None
+
+Hackish equivalent of the tmux_setup() function for screen.
+GefTmuxSetup.tmux_setup
tmux_setup() → None
+
+Prepare the tmux environment by vertically splitting the current pane, and forcing the context to be redirected there.
+GefUiManager
Class managing UI settings.
+ +GefUiManager.__init__
__init__() → None
+
+GefUiManager.reset_caches
reset_caches() → None
+
+Reset the LRU-cached attributes
+GenericArchitecture
GenericArchitecture.canary_address
canary_address() → int
+
+GenericArchitecture.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+GenericArchitecture.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+GenericArchitecture.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+GenericArchitecture.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+GenericArchitecture.is_call
is_call(insn: __main__.Instruction) → bool
+
+GenericArchitecture.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+GenericArchitecture.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+GenericArchitecture.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+GenericArchitecture.register
register(name: str) → int
+
+GenericArchitecture.reset_caches
reset_caches() → None
+
+GenericArchitecture.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
GenericCommand
This is an abstract class for invoking commands, should not be instantiated.
+ +GenericCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+GenericCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GenericCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GenericCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+GenericCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GenericCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GenericCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GenericCommand.post_load
post_load() → None
+
+GenericCommand.pre_load
pre_load() → None
+
+GenericCommand.usage
usage() → None
+
+GenericFunction
This is an abstract class for invoking convenience functions, should not be instantiated.
+ +GenericFunction.__init__
__init__() → None
+
+GenericFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+GenericFunction.do_invoke
do_invoke(args: Any) → int
+
+GenericFunction.invoke
invoke(*args: Any) → int
+
+GlibcArena
Glibc arena class
+ +GlibcArena.__init__
__init__(addr: str) → None
+
+GlibcArena.bin
bin(i: int) → Tuple[int, int]
+
+GlibcArena.bin_at
bin_at(i) → int
+
+GlibcArena.fastbin
fastbin(i: int) → Optional[ForwardRef('GlibcFastChunk')]
+
+Return head chunk in fastbinsY[i].
+GlibcArena.get_heap_for_ptr
get_heap_for_ptr(ptr: int) → int
+
+Find the corresponding heap for a given pointer (int). See https://github.com/bminor/glibc/blob/glibc-2.34/malloc/arena.c#L129
+GlibcArena.get_heap_info_list
get_heap_info_list() → Optional[List[__main__.GlibcHeapInfo]]
+
+GlibcArena.heap_addr
heap_addr(allow_unaligned: bool = False) → Optional[int]
+
+GlibcArena.is_main_arena
is_main_arena() → bool
+
+GlibcArena.malloc_state_t
malloc_state_t() → Type[_ctypes.Structure]
+
+GlibcArena.reset
reset()
+
+GlibcArena.verify
verify(addr: int) → bool
+
+Verify that the address matches a possible valid GlibcArena
+GlibcChunk
Glibc chunk class. The default behavior (from_base=False) is to interpret the data starting at the memory address pointed to as the chunk data. Setting from_base to True instead treats that data as the chunk header. Ref: https://sploitfun.wordpress.com/2015/02/10/understanding-glibc-malloc/.
+ +GlibcChunk.__init__
__init__(
+ addr: int,
+ from_base: bool = False,
+ allow_unaligned: bool = True
+) → None
+
+GlibcChunk.get_next_chunk
get_next_chunk(allow_unaligned: bool = False) → GlibcChunk
+
+GlibcChunk.get_next_chunk_addr
get_next_chunk_addr() → int
+
+GlibcChunk.get_prev_chunk_size
get_prev_chunk_size() → int
+
+GlibcChunk.get_usable_size
get_usable_size() → int
+
+GlibcChunk.has_m_bit
has_m_bit() → bool
+
+GlibcChunk.has_n_bit
has_n_bit() → bool
+
+GlibcChunk.has_p_bit
has_p_bit() → bool
+
+GlibcChunk.is_used
is_used() → bool
+
+Check if the current block is used by: +- checking the M bit is true +- or checking that next chunk PREV_INUSE flag is true
+GlibcChunk.malloc_chunk_t
malloc_chunk_t() → Type[_ctypes.Structure]
+
+GlibcChunk.psprint
psprint() → str
+
+GlibcChunk.reset
reset()
+
+GlibcChunk.resolve_type
resolve_type() → str
+
+GlibcFastChunk
GlibcFastChunk.__init__
__init__(
+ addr: int,
+ from_base: bool = False,
+ allow_unaligned: bool = True
+) → None
+
+GlibcFastChunk.get_next_chunk
get_next_chunk(allow_unaligned: bool = False) → GlibcChunk
+
+GlibcFastChunk.get_next_chunk_addr
get_next_chunk_addr() → int
+
+GlibcFastChunk.get_prev_chunk_size
get_prev_chunk_size() → int
+
+GlibcFastChunk.get_usable_size
get_usable_size() → int
+
+GlibcFastChunk.has_m_bit
has_m_bit() → bool
+
+GlibcFastChunk.has_n_bit
has_n_bit() → bool
+
+GlibcFastChunk.has_p_bit
has_p_bit() → bool
+
+GlibcFastChunk.is_used
is_used() → bool
+
+Check if the current block is used by: +- checking the M bit is true +- or checking that next chunk PREV_INUSE flag is true
+GlibcFastChunk.malloc_chunk_t
malloc_chunk_t() → Type[_ctypes.Structure]
+
+GlibcFastChunk.protect_ptr
protect_ptr(pos: int, pointer: int) → int
+
+https://elixir.bootlin.com/glibc/glibc-2.32/source/malloc/malloc.c#L339
+GlibcFastChunk.psprint
psprint() → str
+
+GlibcFastChunk.reset
reset()
+
+GlibcFastChunk.resolve_type
resolve_type() → str
+
+GlibcFastChunk.reveal_ptr
reveal_ptr(pointer: int) → int
+
+https://elixir.bootlin.com/glibc/glibc-2.32/source/malloc/malloc.c#L341
+GlibcHeapArenaCommand
Display information on a heap chunk.
+ +GlibcHeapArenaCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+GlibcHeapArenaCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapArenaCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapArenaCommand.do_invoke
do_invoke(_: List[str]) → None
+
+GlibcHeapArenaCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapArenaCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapArenaCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapArenaCommand.post_load
post_load() → None
+
+GlibcHeapArenaCommand.pre_load
pre_load() → None
+
+GlibcHeapArenaCommand.usage
usage() → None
+
+GlibcHeapArenaSummary
GlibcHeapArenaSummary.__init__
__init__(resolve_type=False) → None
+
+GlibcHeapArenaSummary.print
print() → None
+
+GlibcHeapArenaSummary.process_chunk
process_chunk(chunk: __main__.GlibcChunk) → None
+
+GlibcHeapBinsCommand
Display information on the bins on an arena (default: main_arena). See https://github.com/sploitfun/lsploits/blob/master/glibc/malloc/malloc.c#L1123.
+ +GlibcHeapBinsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapBinsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapBinsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapBinsCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+GlibcHeapBinsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapBinsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapBinsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapBinsCommand.post_load
post_load() → None
+
+GlibcHeapBinsCommand.pprint_bin
pprint_bin(arena_addr: str, index: int, _type: str = '') → int
+
+GlibcHeapBinsCommand.pre_load
pre_load() → None
+
+GlibcHeapBinsCommand.usage
usage() → None
+
+GlibcHeapChunkCommand
Display information on a heap chunk. See https://github.com/sploitfun/lsploits/blob/master/glibc/malloc/malloc.c#L1123.
+ +GlibcHeapChunkCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapChunkCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapChunkCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapChunkCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapChunkCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapChunkCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapChunkCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapChunkCommand.post_load
post_load() → None
+
+GlibcHeapChunkCommand.pre_load
pre_load() → None
+
+GlibcHeapChunkCommand.usage
usage() → None
+
+GlibcHeapChunkSummary
GlibcHeapChunkSummary.__init__
__init__(desc='')
+
+GlibcHeapChunkSummary.process_chunk
process_chunk(chunk: __main__.GlibcChunk) → None
+
+GlibcHeapChunksCommand
Display all heap chunks for the current arena. As an optional argument the base address of a different arena can be passed
+ +GlibcHeapChunksCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapChunksCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapChunksCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapChunksCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapChunksCommand.dump_chunks_arena
dump_chunks_arena(
+ arena: __main__.GlibcArena,
+ ctx: __main__.GlibcHeapWalkContext
+) → None
+
+GlibcHeapChunksCommand.dump_chunks_heap
dump_chunks_heap(
+ start: int,
+ end: int,
+ arena: __main__.GlibcArena,
+ ctx: __main__.GlibcHeapWalkContext
+) → bool
+
+GlibcHeapChunksCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapChunksCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapChunksCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapChunksCommand.post_load
post_load() → None
+
+GlibcHeapChunksCommand.pre_load
pre_load() → None
+
+GlibcHeapChunksCommand.should_process_chunk
should_process_chunk(
+ chunk: __main__.GlibcChunk,
+ ctx: __main__.GlibcHeapWalkContext
+) → bool
+
+GlibcHeapChunksCommand.usage
usage() → None
+
+GlibcHeapCommand
Base command to get information about the Glibc heap structure.
+ +GlibcHeapCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapCommand.do_invoke
do_invoke(_: List[str]) → None
+
+GlibcHeapCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapCommand.post_load
post_load() → None
+
+GlibcHeapCommand.pre_load
pre_load() → None
+
+GlibcHeapCommand.usage
usage() → None
+
+GlibcHeapFastbinsYCommand
Display information on the fastbinsY on an arena (default: main_arena). See https://github.com/sploitfun/lsploits/blob/master/glibc/malloc/malloc.c#L1123.
+ +GlibcHeapFastbinsYCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapFastbinsYCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapFastbinsYCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapFastbinsYCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapFastbinsYCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapFastbinsYCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapFastbinsYCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapFastbinsYCommand.post_load
post_load() → None
+
+GlibcHeapFastbinsYCommand.pre_load
pre_load() → None
+
+GlibcHeapFastbinsYCommand.usage
usage() → None
+
+GlibcHeapInfo
Glibc heap_info struct
+ +GlibcHeapInfo.__init__
__init__(addr: Union[str, int]) → None
+
+GlibcHeapInfo.heap_info_t
heap_info_t() → Type[_ctypes.Structure]
+
+GlibcHeapInfo.reset
reset()
+
+GlibcHeapLargeBinsCommand
Convenience command for viewing large bins.
+ +GlibcHeapLargeBinsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapLargeBinsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapLargeBinsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapLargeBinsCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapLargeBinsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapLargeBinsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapLargeBinsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapLargeBinsCommand.post_load
post_load() → None
+
+GlibcHeapLargeBinsCommand.pre_load
pre_load() → None
+
+GlibcHeapLargeBinsCommand.usage
usage() → None
+
+GlibcHeapSetArenaCommand
Set the address of the main_arena or the currently selected arena.
+ +GlibcHeapSetArenaCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapSetArenaCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapSetArenaCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapSetArenaCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapSetArenaCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapSetArenaCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapSetArenaCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapSetArenaCommand.post_load
post_load() → None
+
+GlibcHeapSetArenaCommand.pre_load
pre_load() → None
+
+GlibcHeapSetArenaCommand.usage
usage() → None
+
+GlibcHeapSmallBinsCommand
Convenience command for viewing small bins.
+ +GlibcHeapSmallBinsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapSmallBinsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapSmallBinsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapSmallBinsCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapSmallBinsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapSmallBinsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapSmallBinsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapSmallBinsCommand.post_load
post_load() → None
+
+GlibcHeapSmallBinsCommand.pre_load
pre_load() → None
+
+GlibcHeapSmallBinsCommand.usage
usage() → None
+
+GlibcHeapTcachebinsCommand
Display information on the Tcachebins on an arena (default: main_arena). See https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d5c3fafc4307c9b7a4c7d5cb381fcdbfad340bcc.
+ +GlibcHeapTcachebinsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapTcachebinsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapTcachebinsCommand.check_thread_ids
check_thread_ids(tids: List[int]) → List[int]
+
+Return the subset of tids that are currently valid.
+GlibcHeapTcachebinsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapTcachebinsCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+GlibcHeapTcachebinsCommand.find_tcache
find_tcache() → int
+
+Return the location of the current thread's tcache.
+GlibcHeapTcachebinsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapTcachebinsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapTcachebinsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapTcachebinsCommand.post_load
post_load() → None
+
+GlibcHeapTcachebinsCommand.pre_load
pre_load() → None
+
+GlibcHeapTcachebinsCommand.tcachebin
tcachebin(
+ tcache_base: int,
+ i: int
+) → Tuple[Optional[__main__.GlibcTcacheChunk], int]
+
+Return the head chunk in tcache[i] and the number of chunks in the bin.
+GlibcHeapTcachebinsCommand.usage
usage() → None
+
+GlibcHeapUnsortedBinsCommand
Display information on the Unsorted Bins of an arena (default: main_arena). See: https://github.com/sploitfun/lsploits/blob/master/glibc/malloc/malloc.c#L1689.
+ +GlibcHeapUnsortedBinsCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+GlibcHeapUnsortedBinsCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GlibcHeapUnsortedBinsCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GlibcHeapUnsortedBinsCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GlibcHeapUnsortedBinsCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GlibcHeapUnsortedBinsCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GlibcHeapUnsortedBinsCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GlibcHeapUnsortedBinsCommand.post_load
post_load() → None
+
+GlibcHeapUnsortedBinsCommand.pre_load
pre_load() → None
+
+GlibcHeapUnsortedBinsCommand.usage
usage() → None
+
+GlibcHeapWalkContext
GlibcHeapWalkContext.__init__
__init__(
+ print_arena: bool = False,
+ allow_unaligned: bool = False,
+ min_size: int = 0,
+ max_size: int = 0,
+ count: int = -1,
+ resolve_type: bool = False,
+ summary: bool = False
+) → None
+
+GlibcTcacheChunk
GlibcTcacheChunk.__init__
__init__(
+ addr: int,
+ from_base: bool = False,
+ allow_unaligned: bool = True
+) → None
+
+GlibcTcacheChunk.get_next_chunk
get_next_chunk(allow_unaligned: bool = False) → GlibcChunk
+
+GlibcTcacheChunk.get_next_chunk_addr
get_next_chunk_addr() → int
+
+GlibcTcacheChunk.get_prev_chunk_size
get_prev_chunk_size() → int
+
+GlibcTcacheChunk.get_usable_size
get_usable_size() → int
+
+GlibcTcacheChunk.has_m_bit
has_m_bit() → bool
+
+GlibcTcacheChunk.has_n_bit
has_n_bit() → bool
+
+GlibcTcacheChunk.has_p_bit
has_p_bit() → bool
+
+GlibcTcacheChunk.is_used
is_used() → bool
+
+Check if the current block is used by: +- checking the M bit is true +- or checking that next chunk PREV_INUSE flag is true
+GlibcTcacheChunk.malloc_chunk_t
malloc_chunk_t() → Type[_ctypes.Structure]
+
+GlibcTcacheChunk.protect_ptr
protect_ptr(pos: int, pointer: int) → int
+
+https://elixir.bootlin.com/glibc/glibc-2.32/source/malloc/malloc.c#L339
+GlibcTcacheChunk.psprint
psprint() → str
+
+GlibcTcacheChunk.reset
reset()
+
+GlibcTcacheChunk.resolve_type
resolve_type() → str
+
+GlibcTcacheChunk.reveal_ptr
reveal_ptr(pointer: int) → int
+
+https://elixir.bootlin.com/glibc/glibc-2.32/source/malloc/malloc.c#L341
+GotBaseFunction
Return the current GOT base address plus the given offset.
+ +GotBaseFunction.__init__
__init__() → None
+
+GotBaseFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+GotBaseFunction.do_invoke
do_invoke(args: List) → int
+
+GotBaseFunction.invoke
invoke(*args: Any) → int
+
+GotCommand
Display current status of the got inside the process.
+ +GotCommand.__init__
__init__()
+
+Return the list of settings for this command.
+GotCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
GotCommand.build_line
build_line(name: str, color: str, address_val: int, got_address: int) → str
+
+GotCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
GotCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+GotCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
GotCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
GotCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+GotCommand.post_load
post_load() → None
+
+GotCommand.pre_load
pre_load() → None
+
+GotCommand.print_got_for
print_got_for(file: str, argv: List[str]) → None
+
+GotCommand.usage
usage() → None
+
+HeapAnalysisCommand
Heap vulnerability analysis helper: this command aims to track dynamic heap allocation done through malloc()/free() to provide some insights on possible heap vulnerabilities. The following vulnerabilities are checked: +- NULL free +- Use-after-Free +- Double Free +- Heap overlap
+ +HeapAnalysisCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HeapAnalysisCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HeapAnalysisCommand.clean
clean(_: 'gdb.events.ExitedEvent') → None
+
+HeapAnalysisCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HeapAnalysisCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+HeapAnalysisCommand.dump_tracked_allocations
dump_tracked_allocations() → None
+
+HeapAnalysisCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HeapAnalysisCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HeapAnalysisCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HeapAnalysisCommand.post_load
post_load() → None
+
+HeapAnalysisCommand.pre_load
pre_load() → None
+
+HeapAnalysisCommand.setup
setup() → None
+
+HeapAnalysisCommand.usage
usage() → None
+
+HeapBaseFunction
Return the current heap base address plus an optional offset.
+ +HeapBaseFunction.__init__
__init__() → None
+
+HeapBaseFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+HeapBaseFunction.do_invoke
do_invoke(args: List) → int
+
+HeapBaseFunction.invoke
invoke(*args: Any) → int
+
+HexdumpByteCommand
Display SIZE lines of hexdump as BYTE from the memory location pointed by ADDRESS.
+ +HexdumpByteCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HexdumpByteCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HexdumpByteCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HexdumpByteCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+HexdumpByteCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HexdumpByteCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HexdumpByteCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HexdumpByteCommand.post_load
post_load() → None
+
+HexdumpByteCommand.pre_load
pre_load() → None
+
+HexdumpByteCommand.usage
usage() → None
+
+HexdumpCommand
Display SIZE lines of hexdump from the memory location pointed by LOCATION.
+ +HexdumpCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HexdumpCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HexdumpCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HexdumpCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+HexdumpCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HexdumpCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HexdumpCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HexdumpCommand.post_load
post_load() → None
+
+HexdumpCommand.pre_load
pre_load() → None
+
+HexdumpCommand.usage
usage() → None
+
+HexdumpDwordCommand
Display SIZE lines of hexdump as DWORD from the memory location pointed by ADDRESS.
+ +HexdumpDwordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HexdumpDwordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HexdumpDwordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HexdumpDwordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+HexdumpDwordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HexdumpDwordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HexdumpDwordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HexdumpDwordCommand.post_load
post_load() → None
+
+HexdumpDwordCommand.pre_load
pre_load() → None
+
+HexdumpDwordCommand.usage
usage() → None
+
+HexdumpQwordCommand
Display SIZE lines of hexdump as QWORD from the memory location pointed by ADDRESS.
+ +HexdumpQwordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HexdumpQwordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HexdumpQwordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HexdumpQwordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+HexdumpQwordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HexdumpQwordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HexdumpQwordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HexdumpQwordCommand.post_load
post_load() → None
+
+HexdumpQwordCommand.pre_load
pre_load() → None
+
+HexdumpQwordCommand.usage
usage() → None
+
+HexdumpWordCommand
Display SIZE lines of hexdump as WORD from the memory location pointed by ADDRESS.
+ +HexdumpWordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HexdumpWordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HexdumpWordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HexdumpWordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+HexdumpWordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HexdumpWordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HexdumpWordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HexdumpWordCommand.post_load
post_load() → None
+
+HexdumpWordCommand.pre_load
pre_load() → None
+
+HexdumpWordCommand.usage
usage() → None
+
+HighlightAddCommand
Add a match to the highlight table.
+ +HighlightAddCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+HighlightAddCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HighlightAddCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HighlightAddCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+HighlightAddCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HighlightAddCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HighlightAddCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HighlightAddCommand.post_load
post_load() → None
+
+HighlightAddCommand.pre_load
pre_load() → None
+
+HighlightAddCommand.usage
usage() → None
+
+HighlightClearCommand
Clear the highlight table, remove all matches.
+ +HighlightClearCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+HighlightClearCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HighlightClearCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HighlightClearCommand.do_invoke
do_invoke(_: List[str]) → None
+
+HighlightClearCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HighlightClearCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HighlightClearCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HighlightClearCommand.post_load
post_load() → None
+
+HighlightClearCommand.pre_load
pre_load() → None
+
+HighlightClearCommand.usage
usage() → None
+
+HighlightCommand
Highlight user-defined text matches in GEF output universally.
+ +HighlightCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+HighlightCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HighlightCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HighlightCommand.do_invoke
do_invoke(_: List[str]) → None
+
+HighlightCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HighlightCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HighlightCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HighlightCommand.post_load
post_load() → None
+
+HighlightCommand.pre_load
pre_load() → None
+
+HighlightCommand.usage
usage() → None
+
+HighlightListCommand
Show the current highlight table with matches to colors.
+ +HighlightListCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+HighlightListCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HighlightListCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HighlightListCommand.do_invoke
do_invoke(_: List[str]) → None
+
+HighlightListCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HighlightListCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HighlightListCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HighlightListCommand.post_load
post_load() → None
+
+HighlightListCommand.pre_load
pre_load() → None
+
+HighlightListCommand.print_highlight_table
print_highlight_table() → None
+
+HighlightListCommand.usage
usage() → None
+
+HighlightRemoveCommand
Remove a match in the highlight table.
+ +HighlightRemoveCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+HighlightRemoveCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
HighlightRemoveCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
HighlightRemoveCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+HighlightRemoveCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
HighlightRemoveCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
HighlightRemoveCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+HighlightRemoveCommand.post_load
post_load() → None
+
+HighlightRemoveCommand.pre_load
pre_load() → None
+
+HighlightRemoveCommand.usage
usage() → None
+
+Instruction
GEF representation of a CPU instruction.
+ +Instruction.__init__
__init__(
+ address: int,
+ location: str,
+ mnemo: str,
+ operands: List[str],
+ opcodes: bytes
+) → None
+
+Instruction.is_valid
is_valid() → bool
+
+Instruction.next
next() → Instruction
+
+Instruction.size
size() → int
+
+JustSilentStopBreakpoint
When hit, this temporary breakpoint stop the execution.
+ +JustSilentStopBreakpoint.__init__
__init__(loc: str) → None
+
+MIPS
MIPS.canary_address
canary_address() → int
+
+MIPS.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+MIPS.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+MIPS.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+MIPS.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+MIPS.is_call
is_call(insn: __main__.Instruction) → bool
+
+MIPS.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+MIPS.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+MIPS.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+MIPS.register
register(name: str) → int
+
+MIPS.reset_caches
reset_caches() → None
+
+MIPS.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
MIPS64
MIPS64.canary_address
canary_address() → int
+
+MIPS64.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+MIPS64.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+MIPS64.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+MIPS64.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+MIPS64.is_call
is_call(insn: __main__.Instruction) → bool
+
+MIPS64.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+MIPS64.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+MIPS64.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+MIPS64.register
register(name: str) → int
+
+MIPS64.reset_caches
reset_caches() → None
+
+MIPS64.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+MemoryCommand
Add or remove address ranges to the memory view.
+ +MemoryCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+MemoryCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
MemoryCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
MemoryCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+MemoryCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
MemoryCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
MemoryCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+MemoryCommand.post_load
post_load() → None
+
+MemoryCommand.pre_load
pre_load() → None
+
+MemoryCommand.usage
usage() → None
+
+MemoryUnwatchCommand
Removes address ranges to the memory view.
+ +MemoryUnwatchCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+MemoryUnwatchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
MemoryUnwatchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
MemoryUnwatchCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+MemoryUnwatchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
MemoryUnwatchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
MemoryUnwatchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+MemoryUnwatchCommand.post_load
post_load() → None
+
+MemoryUnwatchCommand.pre_load
pre_load() → None
+
+MemoryUnwatchCommand.usage
usage() → None
+
+MemoryWatchCommand
Adds address ranges to the memory view.
+ +MemoryWatchCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+MemoryWatchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
MemoryWatchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
MemoryWatchCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+MemoryWatchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
MemoryWatchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
MemoryWatchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+MemoryWatchCommand.post_load
post_load() → None
+
+MemoryWatchCommand.pre_load
pre_load() → None
+
+MemoryWatchCommand.usage
usage() → None
+
+MemoryWatchListCommand
Lists all watchpoints to display in context layout.
+ +MemoryWatchListCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+MemoryWatchListCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
MemoryWatchListCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
MemoryWatchListCommand.do_invoke
do_invoke(_: List[str]) → None
+
+MemoryWatchListCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
MemoryWatchListCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
MemoryWatchListCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+MemoryWatchListCommand.post_load
post_load() → None
+
+MemoryWatchListCommand.pre_load
pre_load() → None
+
+MemoryWatchListCommand.usage
usage() → None
+
+MemoryWatchResetCommand
Removes all watchpoints.
+ +MemoryWatchResetCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+MemoryWatchResetCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
MemoryWatchResetCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
MemoryWatchResetCommand.do_invoke
do_invoke(_: List[str]) → None
+
+MemoryWatchResetCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
MemoryWatchResetCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
MemoryWatchResetCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+MemoryWatchResetCommand.post_load
post_load() → None
+
+MemoryWatchResetCommand.pre_load
pre_load() → None
+
+MemoryWatchResetCommand.usage
usage() → None
+
+NamedBreakpoint
Breakpoint which shows a specified name, when hit.
+ +NamedBreakpoint.__init__
__init__(location: str, name: str) → None
+
+NamedBreakpoint.stop
stop() → bool
+
+NamedBreakpointCommand
Sets a breakpoint and assigns a name to it, which will be shown, when it's hit.
+ +NamedBreakpointCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+NamedBreakpointCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
NamedBreakpointCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
NamedBreakpointCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+NamedBreakpointCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
NamedBreakpointCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
NamedBreakpointCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+NamedBreakpointCommand.post_load
post_load() → None
+
+NamedBreakpointCommand.pre_load
pre_load() → None
+
+NamedBreakpointCommand.usage
usage() → None
+
+NopCommand
Patch the instruction(s) pointed by parameters with NOP. Note: this command is architecture aware.
+ +NopCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+NopCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
NopCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
NopCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+NopCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
NopCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
NopCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+NopCommand.post_load
post_load() → None
+
+NopCommand.pre_load
pre_load() → None
+
+NopCommand.usage
usage() → None
+
+ObsoleteException
PCustomCommand
Dump user defined structure. This command attempts to reproduce WinDBG awesome dt
command for GDB and allows to apply structures (from symbols or custom) directly to an address. Custom structures can be defined in pure Python using ctypes, and should be stored in a specific directory, whose path must be stored in the pcustom.struct_path
configuration setting.
PCustomCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PCustomCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PCustomCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PCustomCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PCustomCommand.explode_type
explode_type(arg: str) → Tuple[str, str]
+
+PCustomCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PCustomCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PCustomCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PCustomCommand.post_load
post_load() → None
+
+PCustomCommand.pre_load
pre_load() → None
+
+PCustomCommand.usage
usage() → None
+
+PCustomEditCommand
PCustom: edit the content of a given structure
+ +PCustomEditCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PCustomEditCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PCustomEditCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PCustomEditCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PCustomEditCommand.explode_type
explode_type(arg: str) → Tuple[str, str]
+
+PCustomEditCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PCustomEditCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PCustomEditCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PCustomEditCommand.post_load
post_load() → None
+
+PCustomEditCommand.pre_load
pre_load() → None
+
+PCustomEditCommand.usage
usage() → None
+
+PCustomListCommand
PCustom: list available structures
+ +PCustomListCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PCustomListCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PCustomListCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PCustomListCommand.do_invoke
do_invoke(_: List) → None
+
+Dump the list of all the structures and their respective.
+PCustomListCommand.explode_type
explode_type(arg: str) → Tuple[str, str]
+
+PCustomListCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PCustomListCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PCustomListCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PCustomListCommand.post_load
post_load() → None
+
+PCustomListCommand.pre_load
pre_load() → None
+
+PCustomListCommand.usage
usage() → None
+
+PCustomShowCommand
PCustom: show the content of a given structure
+ +PCustomShowCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PCustomShowCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PCustomShowCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PCustomShowCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PCustomShowCommand.explode_type
explode_type(arg: str) → Tuple[str, str]
+
+PCustomShowCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PCustomShowCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PCustomShowCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PCustomShowCommand.post_load
post_load() → None
+
+PCustomShowCommand.pre_load
pre_load() → None
+
+PCustomShowCommand.usage
usage() → None
+
+PatchByteCommand
Write specified BYTE to the specified address.
+ +PatchByteCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatchByteCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchByteCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchByteCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatchByteCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchByteCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchByteCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchByteCommand.post_load
post_load() → None
+
+PatchByteCommand.pre_load
pre_load() → None
+
+PatchByteCommand.usage
usage() → None
+
+PatchCommand
Write specified values to the specified address.
+ +PatchCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchCommand.post_load
post_load() → None
+
+PatchCommand.pre_load
pre_load() → None
+
+PatchCommand.usage
usage() → None
+
+PatchDwordCommand
Write specified DWORD to the specified address.
+ +PatchDwordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatchDwordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchDwordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchDwordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatchDwordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchDwordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchDwordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchDwordCommand.post_load
post_load() → None
+
+PatchDwordCommand.pre_load
pre_load() → None
+
+PatchDwordCommand.usage
usage() → None
+
+PatchQwordCommand
Write specified QWORD to the specified address.
+ +PatchQwordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatchQwordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchQwordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchQwordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatchQwordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchQwordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchQwordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchQwordCommand.post_load
post_load() → None
+
+PatchQwordCommand.pre_load
pre_load() → None
+
+PatchQwordCommand.usage
usage() → None
+
+PatchStringCommand
Write specified string to the specified memory location pointed by ADDRESS.
+ +PatchStringCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PatchStringCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchStringCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchStringCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PatchStringCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchStringCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchStringCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchStringCommand.post_load
post_load() → None
+
+PatchStringCommand.pre_load
pre_load() → None
+
+PatchStringCommand.usage
usage() → None
+
+PatchWordCommand
Write specified WORD to the specified address.
+ +PatchWordCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatchWordCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatchWordCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatchWordCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatchWordCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatchWordCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatchWordCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatchWordCommand.post_load
post_load() → None
+
+PatchWordCommand.pre_load
pre_load() → None
+
+PatchWordCommand.usage
usage() → None
+
+PatternCommand
Generate or Search a De Bruijn Sequence of unique substrings of length N and a total length of LENGTH. The default value of N is set to match the currently loaded architecture.
+ +PatternCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PatternCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatternCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatternCommand.do_invoke
do_invoke(_: List[str]) → None
+
+PatternCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatternCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatternCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatternCommand.post_load
post_load() → None
+
+PatternCommand.pre_load
pre_load() → None
+
+PatternCommand.usage
usage() → None
+
+PatternCreateCommand
Generate a De Bruijn Sequence of unique substrings of length N and a total length of LENGTH. The default value of N is set to match the currently loaded architecture.
+ +PatternCreateCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PatternCreateCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatternCreateCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatternCreateCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatternCreateCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatternCreateCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatternCreateCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatternCreateCommand.post_load
post_load() → None
+
+PatternCreateCommand.pre_load
pre_load() → None
+
+PatternCreateCommand.usage
usage() → None
+
+PatternSearchCommand
Search a De Bruijn Sequence of unique substrings of length N and a maximum total length of MAX_LENGTH. The default value of N is set to match the currently loaded architecture. The PATTERN argument can be a GDB symbol (such as a register name), a string or a hexadecimal value
+ +PatternSearchCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PatternSearchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PatternSearchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PatternSearchCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PatternSearchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PatternSearchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PatternSearchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PatternSearchCommand.post_load
post_load() → None
+
+PatternSearchCommand.pre_load
pre_load() → None
+
+PatternSearchCommand.search
search(pattern: str, size: int, period: int) → None
+
+PatternSearchCommand.usage
usage() → None
+
+Permission
GEF representation of Linux permission.
+Phdr
Phdr.__init__
__init__(elf: __main__.Elf, off: int) → None
+
+PieAttachCommand
Do attach with PIE breakpoint support.
+ +PieAttachCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieAttachCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieAttachCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieAttachCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PieAttachCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieAttachCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieAttachCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieAttachCommand.post_load
post_load() → None
+
+PieAttachCommand.pre_load
pre_load() → None
+
+PieAttachCommand.usage
usage() → None
+
+PieBreakpointCommand
Set a PIE breakpoint at an offset from the target binaries base address.
+ +PieBreakpointCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieBreakpointCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieBreakpointCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieBreakpointCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PieBreakpointCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieBreakpointCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieBreakpointCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieBreakpointCommand.post_load
post_load() → None
+
+PieBreakpointCommand.pre_load
pre_load() → None
+
+PieBreakpointCommand.set_pie_breakpoint
set_pie_breakpoint(set_func: Callable[[int], str], addr: int) → None
+
+PieBreakpointCommand.usage
usage() → None
+
+PieCommand
PIE breakpoint support.
+ +PieCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PieCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PieCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieCommand.post_load
post_load() → None
+
+PieCommand.pre_load
pre_load() → None
+
+PieCommand.usage
usage() → None
+
+PieDeleteCommand
Delete a PIE breakpoint.
+ +PieDeleteCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieDeleteCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieDeleteCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieDeleteCommand.delete_bp
delete_bp(breakpoints: List[__main__.PieVirtualBreakpoint]) → None
+
+PieDeleteCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PieDeleteCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieDeleteCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieDeleteCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieDeleteCommand.post_load
post_load() → None
+
+PieDeleteCommand.pre_load
pre_load() → None
+
+PieDeleteCommand.usage
usage() → None
+
+PieInfoCommand
Display breakpoint info.
+ +PieInfoCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieInfoCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieInfoCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieInfoCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PieInfoCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieInfoCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieInfoCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieInfoCommand.post_load
post_load() → None
+
+PieInfoCommand.pre_load
pre_load() → None
+
+PieInfoCommand.usage
usage() → None
+
+PieRemoteCommand
Attach to a remote connection with PIE breakpoint support.
+ +PieRemoteCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieRemoteCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieRemoteCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieRemoteCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PieRemoteCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieRemoteCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieRemoteCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieRemoteCommand.post_load
post_load() → None
+
+PieRemoteCommand.pre_load
pre_load() → None
+
+PieRemoteCommand.usage
usage() → None
+
+PieRunCommand
Run process with PIE breakpoint support.
+ +PieRunCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+PieRunCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PieRunCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PieRunCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+PieRunCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PieRunCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PieRunCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PieRunCommand.post_load
post_load() → None
+
+PieRunCommand.pre_load
pre_load() → None
+
+PieRunCommand.usage
usage() → None
+
+PieVirtualBreakpoint
PIE virtual breakpoint (not real breakpoint).
+ +PieVirtualBreakpoint.__init__
__init__(set_func: Callable[[int], str], vbp_num: int, addr: int) → None
+
+PieVirtualBreakpoint.destroy
destroy() → None
+
+PieVirtualBreakpoint.instantiate
instantiate(base: int) → None
+
+PowerPC
PowerPC.canary_address
canary_address() → int
+
+PowerPC.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+PowerPC.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+PowerPC.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+PowerPC.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+PowerPC.is_call
is_call(insn: __main__.Instruction) → bool
+
+PowerPC.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+PowerPC.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+PowerPC.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+PowerPC.register
register(name: str) → int
+
+PowerPC.reset_caches
reset_caches() → None
+
+PowerPC.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
PowerPC64
PowerPC64.canary_address
canary_address() → int
+
+PowerPC64.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+PowerPC64.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+PowerPC64.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+PowerPC64.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+PowerPC64.is_call
is_call(insn: __main__.Instruction) → bool
+
+PowerPC64.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+PowerPC64.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+PowerPC64.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+PowerPC64.register
register(name: str) → int
+
+PowerPC64.reset_caches
reset_caches() → None
+
+PowerPC64.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
PrintFormatCommand
Print bytes format in commonly used formats, such as literals in high level languages.
+ +PrintFormatCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+PrintFormatCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
PrintFormatCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
PrintFormatCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+PrintFormatCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
PrintFormatCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
PrintFormatCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+PrintFormatCommand.post_load
post_load() → None
+
+PrintFormatCommand.pre_load
pre_load() → None
+
+PrintFormatCommand.usage
usage() → None
+
+ProcessListingCommand
List and filter process. If a PATTERN is given as argument, results shown will be grepped by this pattern.
+ +ProcessListingCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ProcessListingCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ProcessListingCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ProcessListingCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+ProcessListingCommand.get_processes
get_processes() → Generator[Dict[str, str], NoneType, NoneType]
+
+ProcessListingCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ProcessListingCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ProcessListingCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ProcessListingCommand.post_load
post_load() → None
+
+ProcessListingCommand.pre_load
pre_load() → None
+
+ProcessListingCommand.usage
usage() → None
+
+ProcessStatusCommand
Extends the info given by GDB info proc
, by giving an exhaustive description of the process status (file descriptors, ancestor, descendants, etc.).
ProcessStatusCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ProcessStatusCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ProcessStatusCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ProcessStatusCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ProcessStatusCommand.get_children_pids
get_children_pids(pid: int) → List[int]
+
+ProcessStatusCommand.get_cmdline_of
get_cmdline_of(pid: int) → str
+
+ProcessStatusCommand.get_process_path_of
get_process_path_of(pid: int) → str
+
+ProcessStatusCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ProcessStatusCommand.get_state_of
get_state_of(pid: int) → Dict[str, str]
+
+ProcessStatusCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ProcessStatusCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ProcessStatusCommand.list_sockets
list_sockets(pid: int) → List[int]
+
+ProcessStatusCommand.parse_ip_port
parse_ip_port(addr: str) → Tuple[str, int]
+
+ProcessStatusCommand.post_load
post_load() → None
+
+ProcessStatusCommand.pre_load
pre_load() → None
+
+ProcessStatusCommand.show_ancestor
show_ancestor() → None
+
+ProcessStatusCommand.show_connections
show_connections() → None
+
+ProcessStatusCommand.show_descendants
show_descendants() → None
+
+ProcessStatusCommand.show_fds
show_fds() → None
+
+ProcessStatusCommand.show_info_proc
show_info_proc() → None
+
+ProcessStatusCommand.usage
usage() → None
+
+RISCV
RISCV.canary_address
canary_address() → int
+
+RISCV.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+RISCV.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+RISCV.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+RISCV.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+RISCV.is_call
is_call(insn: __main__.Instruction) → bool
+
+RISCV.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+RISCV.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+RISCV.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+RISCV.register
register(name: str) → int
+
+RISCV.reset_caches
reset_caches() → None
+
+RISCV.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
RedirectOutputContext
RedirectOutputContext.__init__
__init__(to_file: str = '/dev/null') → None
+
+RemoteCommand
GDB target remote
command on steroids. This command will use the remote procfs to create a local copy of the execution environment, including the target binary and its libraries in the local temporary directory (the value by default is in gef.config.tempdir
). Additionally, it will fetch all the /proc/PID/maps and loads all its information. If procfs is not available remotely, the command will likely fail. You can however still use the limited command provided by GDB target remote
.
RemoteCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+RemoteCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
RemoteCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
RemoteCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+RemoteCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
RemoteCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
RemoteCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+RemoteCommand.post_load
post_load() → None
+
+RemoteCommand.pre_load
pre_load() → None
+
+RemoteCommand.usage
usage() → None
+
+ResetCacheCommand
Reset cache of all stored data. This command is here for debugging and test purposes, GEF handles properly the cache reset under "normal" scenario.
+ +ResetCacheCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ResetCacheCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ResetCacheCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ResetCacheCommand.do_invoke
do_invoke(_: List[str]) → None
+
+ResetCacheCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ResetCacheCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ResetCacheCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ResetCacheCommand.post_load
post_load() → None
+
+ResetCacheCommand.pre_load
pre_load() → None
+
+ResetCacheCommand.usage
usage() → None
+
+SPARC
Refs: +- https://www.cse.scu.edu/~atkinson/teaching/sp05/259/sparc.pdf
+SPARC.canary_address
canary_address() → int
+
+SPARC.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+SPARC.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+SPARC.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+SPARC.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+SPARC.is_call
is_call(insn: __main__.Instruction) → bool
+
+SPARC.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+SPARC.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+SPARC.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+SPARC.register
register(name: str) → int
+
+SPARC.reset_caches
reset_caches() → None
+
+SPARC.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
SPARC64
Refs: +- http://math-atlas.sourceforge.net/devel/assembly/abi_sysV_sparc.pdf +- https://cr.yp.to/2005-590/sparcv9.pdf
+SPARC64.canary_address
canary_address() → int
+
+SPARC64.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+SPARC64.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+SPARC64.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+SPARC64.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+SPARC64.is_call
is_call(insn: __main__.Instruction) → bool
+
+SPARC64.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+SPARC64.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+SPARC64.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+SPARC64.register
register(name: str) → int
+
+SPARC64.reset_caches
reset_caches() → None
+
+SPARC64.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
ScanSectionCommand
Search for addresses that are located in a memory mapping (haystack) that belonging to another (needle).
+ +ScanSectionCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ScanSectionCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ScanSectionCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ScanSectionCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ScanSectionCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ScanSectionCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ScanSectionCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ScanSectionCommand.post_load
post_load() → None
+
+ScanSectionCommand.pre_load
pre_load() → None
+
+ScanSectionCommand.usage
usage() → None
+
+SearchPatternCommand
SearchPatternCommand: search a pattern in memory. If given an hex value (starting with 0x) the command will also try to look for upwards cross-references to this address.
+ +SearchPatternCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+SearchPatternCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
SearchPatternCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
SearchPatternCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+SearchPatternCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
SearchPatternCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
SearchPatternCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+SearchPatternCommand.post_load
post_load() → None
+
+SearchPatternCommand.pre_load
pre_load() → None
+
+SearchPatternCommand.print_loc
print_loc(loc: Tuple[int, int, str]) → None
+
+SearchPatternCommand.print_section
print_section(section: __main__.Section) → None
+
+SearchPatternCommand.search_binpattern_by_address
search_binpattern_by_address(
+ binpattern: bytes,
+ start_address: int,
+ end_address: int
+) → List[Tuple[int, int, str]]
+
+Search a binary pattern within a range defined by arguments.
+SearchPatternCommand.search_pattern
search_pattern(pattern: str, section_name: str) → None
+
+Search a pattern within the whole userland memory.
+SearchPatternCommand.search_pattern_by_address
search_pattern_by_address(
+ pattern: str,
+ start_address: int,
+ end_address: int
+) → List[Tuple[int, int, str]]
+
+Search a pattern within a range defined by arguments.
+SearchPatternCommand.usage
usage() → None
+
+Section
GEF representation of process memory sections.
+ +Section.__init__
__init__(**kwargs: Any) → None
+
+Section.contains
contains(addr: int) → bool
+
+Section.is_executable
is_executable() → bool
+
+Section.is_readable
is_readable() → bool
+
+Section.is_writable
is_writable() → bool
+
+Section.overlaps
overlaps(other: 'Section') → bool
+
+SectionBaseFunction
Return the matching file's base address plus an optional offset. Defaults to current file. Note that quotes need to be escaped
+ +SectionBaseFunction.__init__
__init__() → None
+
+SectionBaseFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+SectionBaseFunction.do_invoke
do_invoke(args: List) → int
+
+SectionBaseFunction.invoke
invoke(*args: Any) → int
+
+Shdr
Shdr.__init__
__init__(elf: Optional[__main__.Elf], off: int) → None
+
+ShellcodeCommand
ShellcodeCommand uses @JonathanSalwan simple-yet-awesome shellcode API to download shellcodes.
+ +ShellcodeCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+ShellcodeCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ShellcodeCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ShellcodeCommand.do_invoke
do_invoke(_: List[str]) → None
+
+ShellcodeCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ShellcodeCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ShellcodeCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ShellcodeCommand.post_load
post_load() → None
+
+ShellcodeCommand.pre_load
pre_load() → None
+
+ShellcodeCommand.usage
usage() → None
+
+ShellcodeGetCommand
Download shellcode from shell-storm's shellcode database.
+ +ShellcodeGetCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ShellcodeGetCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ShellcodeGetCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ShellcodeGetCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ShellcodeGetCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ShellcodeGetCommand.get_shellcode
get_shellcode(sid: int) → None
+
+ShellcodeGetCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ShellcodeGetCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ShellcodeGetCommand.post_load
post_load() → None
+
+ShellcodeGetCommand.pre_load
pre_load() → None
+
+ShellcodeGetCommand.usage
usage() → None
+
+ShellcodeSearchCommand
Search pattern in shell-storm's shellcode database.
+ +ShellcodeSearchCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+ShellcodeSearchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
ShellcodeSearchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
ShellcodeSearchCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+ShellcodeSearchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
ShellcodeSearchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
ShellcodeSearchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+ShellcodeSearchCommand.post_load
post_load() → None
+
+ShellcodeSearchCommand.pre_load
pre_load() → None
+
+ShellcodeSearchCommand.search_shellcode
search_shellcode(search_options: List) → None
+
+ShellcodeSearchCommand.usage
usage() → None
+
+SkipiCommand
Skip N instruction(s) execution
+ +SkipiCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+SkipiCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
SkipiCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
SkipiCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+SkipiCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
SkipiCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
SkipiCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+SkipiCommand.post_load
post_load() → None
+
+SkipiCommand.pre_load
pre_load() → None
+
+SkipiCommand.usage
usage() → None
+
+SmartEvalCommand
SmartEval: Smart eval (vague approach to mimic WinDBG ?
).
SmartEvalCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+SmartEvalCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
SmartEvalCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
SmartEvalCommand.distance
distance(args: List[str]) → None
+
+SmartEvalCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+SmartEvalCommand.evaluate
evaluate(expr: List[str]) → None
+
+SmartEvalCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
SmartEvalCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
SmartEvalCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+SmartEvalCommand.post_load
post_load() → None
+
+SmartEvalCommand.pre_load
pre_load() → None
+
+SmartEvalCommand.usage
usage() → None
+
+StackOffsetFunction
Return the current stack base address plus an optional offset.
+ +StackOffsetFunction.__init__
__init__() → None
+
+StackOffsetFunction.arg_to_long
arg_to_long(args: List, index: int, default: int = 0) → int
+
+StackOffsetFunction.do_invoke
do_invoke(args: List) → int
+
+StackOffsetFunction.invoke
invoke(*args: Any) → int
+
+StepoverCommand
Breaks on the instruction immediately following this one. Ex: Step over call instruction
+ +StepoverCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+StepoverCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
StepoverCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
StepoverCommand.do_invoke
do_invoke(_: List[str]) → None
+
+StepoverCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
StepoverCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
StepoverCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+StepoverCommand.post_load
post_load() → None
+
+StepoverCommand.pre_load
pre_load() → None
+
+StepoverCommand.usage
usage() → None
+
+StubBreakpoint
Create a breakpoint to permanently disable a call (fork/alarm/signal/etc.).
+ +StubBreakpoint.__init__
__init__(func: str, retval: Optional[int]) → None
+
+StubBreakpoint.stop
stop() → bool
+
+StubCommand
Stub out the specified function. This function is useful when needing to skip one function to be called and disrupt your runtime flow (ex. fork).
+ +StubCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+StubCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
StubCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
StubCommand.wrapper
wrapper(*args: Any, **kwargs: Any) → Callable
+
+StubCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
StubCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
StubCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+StubCommand.post_load
post_load() → None
+
+StubCommand.pre_load
pre_load() → None
+
+StubCommand.usage
usage() → None
+
+TraceFreeBreakpoint
Track calls to free() and attempts to detect inconsistencies.
+ +TraceFreeBreakpoint.__init__
__init__() → None
+
+TraceFreeBreakpoint.stop
stop() → bool
+
+TraceFreeRetBreakpoint
Internal temporary breakpoint to track free()d values.
+ +TraceFreeRetBreakpoint.__init__
__init__(addr: int) → None
+
+TraceFreeRetBreakpoint.stop
stop() → bool
+
+TraceMallocBreakpoint
Track allocations done with malloc() or calloc().
+ +TraceMallocBreakpoint.__init__
__init__(name: str) → None
+
+TraceMallocBreakpoint.stop
stop() → bool
+
+TraceMallocRetBreakpoint
Internal temporary breakpoint to retrieve the return value of malloc().
+ +TraceMallocRetBreakpoint.__init__
__init__(size: int, name: str) → None
+
+TraceMallocRetBreakpoint.stop
stop() → bool
+
+TraceReallocBreakpoint
Track re-allocations done with realloc().
+ +TraceReallocBreakpoint.__init__
__init__() → None
+
+TraceReallocBreakpoint.stop
stop() → bool
+
+TraceReallocRetBreakpoint
Internal temporary breakpoint to retrieve the return value of realloc().
+ +TraceReallocRetBreakpoint.__init__
__init__(ptr: int, size: int) → None
+
+TraceReallocRetBreakpoint.stop
stop() → bool
+
+TraceRunCommand
Create a runtime trace of all instructions executed from $pc to LOCATION specified. The trace is stored in a text file that can be next imported in IDA Pro to visualize the runtime path.
+ +TraceRunCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+TraceRunCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
TraceRunCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
TraceRunCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+TraceRunCommand.get_frames_size
get_frames_size() → int
+
+TraceRunCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
TraceRunCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
TraceRunCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+TraceRunCommand.post_load
post_load() → None
+
+TraceRunCommand.pre_load
pre_load() → None
+
+TraceRunCommand.start_tracing
start_tracing(loc_start: int, loc_end: int, depth: int) → None
+
+TraceRunCommand.trace
trace(loc_start: int, loc_end: int, depth: int) → None
+
+TraceRunCommand.usage
usage() → None
+
+UafWatchpoint
Custom watchpoints set TraceFreeBreakpoint() to monitor free()d pointers being used.
+ +UafWatchpoint.__init__
__init__(addr: int) → None
+
+UafWatchpoint.stop
stop() → bool
+
+If this method is triggered, we likely have a UaF. Break the execution and report it.
+VMMapCommand
Display a comprehensive layout of the virtual memory mapping. If a filter argument, GEF will filter out the mapping whose pathname do not match that filter.
+ +VMMapCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+VMMapCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
VMMapCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
VMMapCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+VMMapCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
VMMapCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
VMMapCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+VMMapCommand.is_integer
is_integer(n: str) → bool
+
+VMMapCommand.post_load
post_load() → None
+
+VMMapCommand.pre_load
pre_load() → None
+
+VMMapCommand.print_entry
print_entry(entry: __main__.Section) → None
+
+VMMapCommand.show_legend
show_legend() → None
+
+VMMapCommand.usage
usage() → None
+
+ValidationError
VersionCommand
Display GEF version info.
+ +VersionCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+VersionCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
VersionCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
VersionCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+VersionCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
VersionCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
VersionCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+VersionCommand.post_load
post_load() → None
+
+VersionCommand.pre_load
pre_load() → None
+
+VersionCommand.usage
usage() → None
+
+X86
X86.canary_address
canary_address() → int
+
+X86.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+X86.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+X86.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+X86.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+X86.is_call
is_call(insn: __main__.Instruction) → bool
+
+X86.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+X86.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+X86.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+X86.register
register(name: str) → int
+
+X86.reset_caches
reset_caches() → None
+
+X86.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
X86_64
X86_64.canary_address
canary_address() → int
+
+X86_64.flag_register_to_human
flag_register_to_human(val: Optional[int] = None) → str
+
+X86_64.get_ith_parameter
get_ith_parameter(i: int, in_func: bool = True) → Tuple[str, Optional[int]]
+
+Retrieves the correct parameter used for the current function call.
+X86_64.get_ra
get_ra(insn: __main__.Instruction, frame: 'gdb.Frame') → Optional[int]
+
+X86_64.is_branch_taken
is_branch_taken(insn: __main__.Instruction) → Tuple[bool, str]
+
+X86_64.is_call
is_call(insn: __main__.Instruction) → bool
+
+X86_64.is_conditional_branch
is_conditional_branch(insn: __main__.Instruction) → bool
+
+X86_64.is_ret
is_ret(insn: __main__.Instruction) → bool
+
+X86_64.mprotect_asm
mprotect_asm(addr: int, size: int, perm: __main__.Permission) → str
+
+X86_64.register
register(name: str) → int
+
+X86_64.reset_caches
reset_caches() → None
+
+X86_64.supports_gdb_arch
supports_gdb_arch(gdb_arch: str) → Optional[bool]
+
+If implemented by a child Architecture
, this function dictates if the current class supports the loaded ELF file (which can be accessed via gef.binary
). This callback function will override any assumption made by GEF to determine the architecture.
XAddressInfoCommand
Retrieve and display runtime information for the location(s) given as parameter.
+ +XAddressInfoCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+XAddressInfoCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
XAddressInfoCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
XAddressInfoCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+XAddressInfoCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
XAddressInfoCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
XAddressInfoCommand.infos
infos(address: int) → None
+
+XAddressInfoCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+XAddressInfoCommand.post_load
post_load() → None
+
+XAddressInfoCommand.pre_load
pre_load() → None
+
+XAddressInfoCommand.usage
usage() → None
+
+XFilesCommand
Shows all libraries (and sections) loaded by binary. This command extends the GDB command info files
, by retrieving more information from extra sources, and providing a better display. If an argument FILE is given, the output will grep information related to only that file. If an argument name is also given, the output will grep to the name within FILE.
XFilesCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+XFilesCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
XFilesCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
XFilesCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+XFilesCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
XFilesCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
XFilesCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+XFilesCommand.post_load
post_load() → None
+
+XFilesCommand.pre_load
pre_load() → None
+
+XFilesCommand.usage
usage() → None
+
+XorMemoryCommand
XOR a block of memory. The command allows to simply display the result, or patch it runtime at runtime.
+ +XorMemoryCommand.__init__
__init__() → None
+
+Return the list of settings for this command.
+XorMemoryCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
XorMemoryCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
XorMemoryCommand.do_invoke
do_invoke(_: List[str]) → None
+
+XorMemoryCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
XorMemoryCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
XorMemoryCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+XorMemoryCommand.post_load
post_load() → None
+
+XorMemoryCommand.pre_load
pre_load() → None
+
+XorMemoryCommand.usage
usage() → None
+
+XorMemoryDisplayCommand
Display a block of memory pointed by ADDRESS by xor-ing each byte with KEY. The key must be provided in hexadecimal format.
+ +XorMemoryDisplayCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+XorMemoryDisplayCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
XorMemoryDisplayCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
XorMemoryDisplayCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+XorMemoryDisplayCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
XorMemoryDisplayCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
XorMemoryDisplayCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+XorMemoryDisplayCommand.post_load
post_load() → None
+
+XorMemoryDisplayCommand.pre_load
pre_load() → None
+
+XorMemoryDisplayCommand.usage
usage() → None
+
+XorMemoryPatchCommand
Patch a block of memory pointed by ADDRESS by xor-ing each byte with KEY. The key must be provided in hexadecimal format.
+ +XorMemoryPatchCommand.__init__
__init__(*args: Any, **kwargs: Any) → None
+
+Return the list of settings for this command.
+XorMemoryPatchCommand.add_setting
add_setting(
+ name: str,
+ value: Tuple[Any, type, str],
+ description: str = ''
+) → None
+
+add_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name] = value
instead
XorMemoryPatchCommand.del_setting
del_setting(name: str) → None
+
+del_setting
is DEPRECATED and will be removed in the future.
+ Use del self[setting_name]
instead
XorMemoryPatchCommand.do_invoke
do_invoke(argv: List[str]) → None
+
+XorMemoryPatchCommand.get_setting
get_setting(name: str) → Any
+
+get_setting
is DEPRECATED and will be removed in the future.
+ Use self[setting_name]
instead
XorMemoryPatchCommand.has_setting
has_setting(name: str) → bool
+
+has_setting
is DEPRECATED and will be removed in the future.
+ Use setting_name in self
instead
XorMemoryPatchCommand.invoke
invoke(args: str, from_tty: bool) → None
+
+XorMemoryPatchCommand.post_load
post_load() → None
+
+XorMemoryPatchCommand.pre_load
pre_load() → None
+
+XorMemoryPatchCommand.usage
usage() → None
+
+Zone
Zone(name, zone_start, zone_end, filename)
+classproperty
Make the attribute a classproperty
.
This file was automatically generated via lazydocs.
+ + + + + + + + + + + + + +GEF
intends to provide a battery-included, quickly installable and crazy fast debugging
+environment sitting on top of GDB.
But it most importantly provides all the primitives required to allow hackers to quickly create
+their own commands. This page intends to summarize how to create advanced GDB commands in moments
+using GEF
as a library.
A dedicated repository was born to host external
+scripts. This repo is open to all for
+contributions, no restrictions and the most valuable ones will be integrated into gef.py
.
Here is the most basic skeleton for creating a new GEF
command named newcmd
:
@register
+class NewCommand(GenericCommand):
+ """Dummy new command."""
+ _cmdline_ = "newcmd"
+ _syntax_ = f"{_cmdline_}"
+ # optionally
+ # _examples_ = [f"{_cmdline_} arg1 ...", ]
+ # _aliases_ = ["alias_to_cmdline", ]
+
+ @only_if_gdb_running # not required, ensures that the debug session is started
+ def do_invoke(self, argv):
+ # let's say we want to print some info about the architecture of the current binary
+ print(f"gef.arch={gef.arch}")
+ # or showing the current $pc
+ print(f"gef.arch.pc={gef.arch.pc:#x}")
+
+Loading it in GEF
is as easy as
gef➤ source /path/to/newcmd.py
+[+] Loading 'NewCommand'
+
+The new command is now loaded and part of GEF and can be invoked as such:
+gef➤ newcmd
+gef.arch=<__main__.X86_64 object at 0x7fd5583571c0>
+gef.arch.pc=0x55555555a7d0
+
+Yes, that's it! Check out the complete API to see what else GEF offers.
+Our new command must be a class that inherits from GEF's GenericCommand
. The only requirements are:
_cmdline_
attribute (the command to type on the GDB prompt)._syntax_
attribute, which GEF will use to auto-generate the help menu.do_invoke(self, args)
which will be executed when the command is invoked. args
is a
+ list of the command line args provided when invoked.We make GEF aware of this new command by registering it in the __main__
section of the script, by
+invoking the global function register_external_command()
.
Now you have a new GEF command which you can load, either from cli:
+gef➤ source /path/to/newcmd.py
+
+or add to your ~/.gdbinit
:
echo source /path/to/newcmd.py >> ~/.gdbinit
+
+Sometimes you want something similar to a command to run on each break-like event and display itself
+as a part of the GEF context. This can be achieved using the following
+function register_external_context_pane()
.
Here is a simple example of how to make a custom context pane:
+__start_time__ = int(time.time())
+def wasted_time_debugging():
+ gef_print("You have wasted {} seconds!".format(int(time.time()) - __start_time__))
+
+def wasted_time_debugging_title():
+ return "wasted:time:debugging:{}".format(int(time.time()) - __start_time__)
+
+register_external_context_pane("wasted_time_debugging", wasted_time_debugging, wasted_time_debugging_title)
+
+Loading it in GEF
is as easy as loading a command
gef➤ source /path/to/custom_context_pane.py
+
+It can even be included in the same file as a Command. Now on each break you will notice a new pane
+near the bottom of the context. The order can be modified in the GEF
context config.
The API demonstrated above requires very specific argument types:
+def register_external_context_pane(
+ name: str,
+ context_callback: Callable[None,[]],
+ context_callback_title: Callable[str, []],
+ condition_callback: Optional[Callable[bool, []]] = None
+) -> None:
+
+name
: a string that will be used as the panes setting namecontext_callback
: a function that uses gef_print()
to print content in the panecontext_callback_title
: a function that returns the title string or None to hide the titlecondition_callback
(optional): a function that returns a boolean deciding whether this context
+ pane should be shownThis API is designed for registering a new layout mapping for a GEF Context View. It specifies +the interface for the function register_external_context_layout_mapping which operates similarly +to the previously discussed register_external_context_pane. Pane must have been previously +established in the layout configuration.
+def register_external_context_layout_mapping(
+ current_pane_name: str,
+ display_pane_function: Callable[[], None],
+ pane_title_function: Callable[[], Optional[str]],
+ condition: Optional[Callable[[], bool]] = None
+) -> None:
+
+Registers a new mapping for an existing pane within the GEF Context View.
+current_pane_name
: the name of an already registered pane in the layoutdisplay_pane_function
: a function that prints content in the pane using gef_print()
pane_title_function
: a function that returns a string to be used as the pane title or
+None if no title should be displayedcondition
: (optional) a predicate function that must return True for the pane content
+and title to be displayed; if it returns False, the pane is skippedSome of the most important parts of the API for creating new commands are mentioned (but not limited
+to) below. To see the full help of a function, open GDB and GEF, and use the embedded Python
+interpreter's help
command.
For example:
+gef➤ pi help(Architecture)
+
+or even from outside GDB:
+gdb -q -ex 'pi help(hexdump)' -ex quit
+
+The GEF API aims to provide a simpler and more Pythonic approach to GDB's.
+Some basic examples:
+gef ➤ pi print(hexdump( gef.memory.read(parse_address("$pc"), length=0x20 )))
+0x0000000000000000 f3 0f 1e fa 31 ed 49 89 d1 5e 48 89 e2 48 83 e4 ....1.I..^H..H..
+0x0000000000000010 f0 50 54 4c 8d 05 66 0d 01 00 48 8d 0d ef 0c 01 .PTL..f...H.....
+
+gef ➤ pi print('\n'.join([ f"{x.page_start:#x} -> {x.page_end:#x}" for x in gef.memory.maps]))
+0x555555554000 -> 0x555555558000
+0x555555558000 -> 0x55555556c000
+0x55555556c000 -> 0x555555575000
+0x555555576000 -> 0x555555577000
+0x555555577000 -> 0x555555578000
+0x555555578000 -> 0x55555559a000
+0x7ffff7cd8000 -> 0x7ffff7cda000
+0x7ffff7cda000 -> 0x7ffff7ce1000
+0x7ffff7ce1000 -> 0x7ffff7cf2000
+0x7ffff7cf2000 -> 0x7ffff7cf7000
+[...]
+
+The API also offers a number of decorators to simplify the creation of new/existing commands, such as:
+@only_if_gdb_running
to execute only if a GDB session is running.@only_if_gdb_target_local
to check if the target is local i.e. not debugging using GDB remote
.For a complete reference of the API offered by GEF, visit docs/api/gef.md
.
@parse_arguments( {"required_argument_1": DefaultValue1, ...}, {"--optional-argument-1": DefaultValue1, ...} )
+
+This decorator aims to facilitate the argument passing to a command. If added, it will use the
+argparse
module to parse arguments, and will store them in the kwargs["arguments"]
of the
+calling function (therefore the function must have *args, **kwargs
added to its signature).
+Argument type is inferred directly from the default value except for boolean, where a value of
+True
corresponds to argparse
's store_true
action. For more details on argparse
, refer to its
+Python documentation.
Values given for the parameters also allow list of arguments being past. This can be useful in the
+case where the number of exact option values is known in advance. This can be achieved simply by
+using a type of tuple
or list
for the default value. parse_arguments
will determine the type
+of what to expect based on the first default value of the iterable, so make sure it's not empty. For
+instance:
@parse_arguments( {"instructions": ["nop", "int3", "hlt"], }, {"--arch": "x64", } )
+
+Argument flags are also supported, allowing to write simpler version of the flag such as
+@parse_arguments( {}, {("--long-argument", "-l"): value, } )
+
+A basic example would be as follow:
+class MyCommand(GenericCommand):
+ [...]
+
+ @parse_arguments({"foo": [1,]}, {"--bleh": "", ("--blah", "-l): False})
+ def do_invoke(self, argv, *args, **kwargs):
+ args = kwargs["arguments"]
+ if args.foo == 1: ...
+ if args.blah == True: ...
+
+When the user enters the following command:
+gef➤ mycommand --blah 3 14 159 2653
+
+The function MyCommand!do_invoke()
can use the command line argument value
args.foo == [3, 14, 159, 2653] # a List(int) from user input
+args.bleh == "" # the default value
+args.blah == True # set to True because user input declared the option (would have been False otherwise)
+
+Support for new architectures can be added by inheriting from the Architecture
class. Examples can
+be found in gef-extras.
Sometimes architectures can more precisely determine whether they apply to the current target by
+looking at the architecture determined by gdb. For these cases the custom architecture may implement
+the supports_gdb_arch()
static function to signal that they should be used instead of the default.
+The function receives only one argument:
gdb_str
(of type str
) which is the architecture name as reported by GDB.The function must return:
+True
if the current Architecture
class supports the target binary; False
otherwise.None
to simply ignore this check and let GEF try to determine the architecture.One example is the ARM Cortex-M architecture which in some cases should be used over the generic ARM +one:
+@staticmethod
+def supports_gdb_arch(gdb_arch: str) -> Optional[bool]:
+ return bool(re.search("^armv.*-m$", gdb_arch))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+