Skip to content

cymbol ¤

Add, load, show, edit, or delete symbols for custom structures.

For the generation of the symbols g++/gcc is being used under the hood.

In case of remote debugging a binary which is not native to your architecture it is advised to configure the 'gcc-config-path' config parameter to your own cross-platform gnu gcc compiled toolchain for your target architecture.

You are advised to configure the 'cymbol-editor' config parameter to the path of your favorite text editor. Otherwise cymbol expands $EDITOR and $VISUAL environment variables to find the path to the default text editor.

Functions:

Attributes:

P module-attribute ¤

P = ParamSpec('P')

T module-attribute ¤

T = TypeVar('T')

cymbol_editor module-attribute ¤

cymbol_editor = add_param(
    "cymbol-editor",
    "",
    "path to the editor for editing custom structures",
    param_class=PARAM_OPTIONAL_FILENAME,
)

loaded_symbols module-attribute ¤

loaded_symbols: dict[str, str] = {}

pwndbg_cachedir module-attribute ¤

pwndbg_cachedir = cachedir('custom-symbols')

parser module-attribute ¤

parser = ArgumentParser(
    description="Manage custom C structures in pwndbg. Supports project-specific auto-loading from .gdbinit."
)

subparsers module-attribute ¤

subparsers = add_subparsers(dest='subcommand', help='Available subcommands')

add_parser module-attribute ¤

add_parser = add_parser(
    "add", help="Add a custom structure", description="Add a custom structure."
)

remove_parser module-attribute ¤

remove_parser = add_parser(
    "remove",
    help="Remove a custom structure",
    description="Remove a custom structure.",
)

edit_parser module-attribute ¤

edit_parser = add_parser(
    "edit",
    help="Edit a custom structure",
    description="Edit a custom structure.",
)

load_parser module-attribute ¤

load_parser = add_parser(
    "load",
    help="Load a custom structure",
    description="Load a custom structure.",
)

show_parser module-attribute ¤

show_parser = add_parser(
    "show",
    help="Show a custom structure",
    description="Show a custom structure.",
)

file_parser module-attribute ¤

file_parser = add_parser(
    "file",
    help="Add a structure from a header file",
    description="Add a structure from a header file.",
)

show_all_parser module-attribute ¤

show_all_parser = add_parser(
    "show-all",
    help="Show all stored structures",
    description="Show all stored structures.",
)

create_temp_header_file ¤

create_temp_header_file(content: str) -> str

Create a temporary header file with the given content.

unload_loaded_symbol ¤

unload_loaded_symbol(custom_structure_name: str) -> None

OnlyWhenStructFileExists ¤

OnlyWhenStructFileExists(
    func: _OnlyWhenStructFileExists,
) -> _OnlyWhenStructFileExists

generate_debug_symbols ¤

generate_debug_symbols(
    custom_structure_path: str,
    pwndbg_debug_symbols_output_file: str | None = None,
) -> str | None

add_custom_structure ¤

add_custom_structure(custom_structure_name: str, force=False)

add_structure_from_header ¤

add_structure_from_header(
    header_file: str, custom_structure_name: str = None, force: bool = False
) -> None

edit_custom_structure ¤

edit_custom_structure(
    custom_structure_name: str, custom_structure_path: str = ""
) -> None

remove_custom_structure ¤

remove_custom_structure(
    custom_structure_name: str, custom_structure_path: str = ""
) -> None

load_custom_structure ¤

load_custom_structure(
    custom_structure_name: str, custom_structure_path: str = ""
) -> None

show_custom_structure ¤

show_custom_structure(
    custom_structure_name: str, custom_structure_path: str = ""
) -> None

cymbol ¤

cymbol(subcommand: str = None, name: str = None, path: str = None, force=False)