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 exapnds $EDITOR and $VISUAL environment variables to find the path to the default text editor.

P = ParamSpec('P') module-attribute

T = TypeVar('T') module-attribute

cymbol_editor = pwndbg.config.add_param('cymbol-editor', '', 'path to the editor for editing custom structures', param_class=pwndbg.lib.config.PARAM_OPTIONAL_FILENAME) module-attribute

gcc_compiler_path = pwndbg.config.add_param('gcc-compiler-path', '', 'path to the gcc/g++ toolchain for generating imported symbols', param_class=pwndbg.lib.config.PARAM_OPTIONAL_FILENAME) module-attribute

loaded_symbols: Dict[str, str] = {} module-attribute

parser = argparse.ArgumentParser(description='Add, show, load, edit, or delete custom structures in plain C.') module-attribute

pwndbg_cachedir = pwndbg.lib.tempfile.cachedir('custom-symbols') module-attribute

OnlyWhenStructFileExists(func)

add_custom_structure(custom_structure_name)

cymbol(add, remove, edit, load, show)

edit_custom_structure(custom_structure_name, custom_structure_path='')

generate_debug_symbols(custom_structure_path, pwndbg_debug_symbols_output_file=None)

load_custom_structure(custom_structure_name, custom_structure_path='')

remove_custom_structure(custom_structure_name, custom_structure_path='')

show_custom_structure(custom_structure_name, custom_structure_path='')

unload_loaded_symbol(custom_structure_name)