(address, maxlen=None, maxread=None)
return sz[:maxlen] + '...'
Returns a printable C-string from address.

    Returns `None` if string contains non-printable chars
    or if the `maxlen` length data does not end up with a null byte.
Returns a printable C-string from address.
Returns a printable C - string from address .
def get(address, maxlen=None, maxread=None):
    """
    Returns a printable C-string from address.

    Returns `None` if string contains non-printable chars
    or if the `maxlen` length data does not end up with a null byte.
    """
    if maxlen is None:
        maxlen = length

    if maxread is None:
        maxread = length

    try:
        sz = pwndbg.memory.string(address, maxread)
    except gdb.error:  # should not happen, but sanity check?
        return None

    sz = sz.decode('latin-1', 'replace')

    if not sz or not all(s in string.printable for s in sz):
        return None

    if len(sz) < maxlen or not maxlen:
        return sz

    return sz[:maxlen] + '...'
def get ( address , maxlen = None , maxread = None ) : if maxlen is None : maxlen = length if maxread is None : maxread = length try : sz = pwndbg . memory . string ( address , maxread ) except gdb . error : # should not happen, but sanity check? return None sz = sz . decode ( 'latin-1' , 'replace' ) if not sz or not all ( s in string . printable for s in sz ) : return None if len ( sz ) < maxlen or not maxlen : return sz return sz [ : maxlen ] + '...'