()
return pwndbg.proc.exe
Returns exe name, tries AUXV first which should work fine on both
    local and remote (gdbserver, qemu gdbserver) targets.

    If the value is somehow not present in AUXV, we just fallback to
    local exe filepath.

    NOTE: This might be wrong for remote targets.
Returns exe name, tries AUXV first which should work fine on both
    local and remote (gdbserver, qemu gdbserver) targets.
Returns exe name tries AUXV first which should work fine on both local and remote ( gdbserver qemu gdbserver ) targets .
def get_exe_name():
    """
    Returns exe name, tries AUXV first which should work fine on both
    local and remote (gdbserver, qemu gdbserver) targets.

    If the value is somehow not present in AUXV, we just fallback to
    local exe filepath.

    NOTE: This might be wrong for remote targets.
    """
    path = pwndbg.auxv.get().get('AT_EXECFN')

    # When GDB is launched on a file that is a symlink to the target,
    # the AUXV's AT_EXECFN stores the absolute path of to the symlink.
    # On the other hand, the vmmap, if taken from /proc/pid/maps will contain
    # the absolute and real path of the binary (after symlinks).
    # And so we have to read this path here.
    real_path = pwndbg.file.readlink(path)

    if real_path == '':  # the `path` was not a symlink
        real_path = path

    if real_path is not None:
        # We normalize the path as `AT_EXECFN` might contain e.g. './a.out'
        # so matching it against Page.objfile later on will be wrong;
        # We want just 'a.out'
        return os.path.normpath(real_path)

    return pwndbg.proc.exe
def get_exe_name ( ) : path = pwndbg . auxv . get ( ) . get ( 'AT_EXECFN' ) # When GDB is launched on a file that is a symlink to the target, # the AUXV's AT_EXECFN stores the absolute path of to the symlink. # On the other hand, the vmmap, if taken from /proc/pid/maps will contain # the absolute and real path of the binary (after symlinks). # And so we have to read this path here. real_path = pwndbg . file . readlink ( path ) if real_path == '' : # the `path` was not a symlink real_path = path if real_path is not None : # We normalize the path as `AT_EXECFN` might contain e.g. './a.out' # so matching it against Page.objfile later on will be wrong; # We want just 'a.out' return os . path . normpath ( real_path ) return pwndbg . proc . exe