(addr)
return dict({ renames.get(key, key): int(val[key]) for key in val.type.keys() })
Read a chunk's metadata.
Read a chunk's metadata.
Read a chunk s metadata .
def read_chunk(addr):
    """Read a chunk's metadata."""
    # In GLIBC versions <= 2.24 the `mchunk_[prev_]size` field was named `[prev_]size`.
    # To support both versions, change the new names to the old ones here so that
    # the rest of the code can deal with uniform names.
    renames = {
        "mchunk_size": "size",
        "mchunk_prev_size": "prev_size",
    }
    val = pwndbg.typeinfo.read_gdbvalue("struct malloc_chunk", addr)
    return dict({ renames.get(key, key): int(val[key]) for key in val.type.keys() })
def read_chunk ( addr ) : # In GLIBC versions <= 2.24 the `mchunk_[prev_]size` field was named `[prev_]size`. # To support both versions, change the new names to the old ones here so that # the rest of the code can deal with uniform names. renames = { "mchunk_size" : "size" , "mchunk_prev_size" : "prev_size" , } val = pwndbg . typeinfo . read_gdbvalue ( "struct malloc_chunk" , addr ) return dict ( { renames . get ( key , key ) : int ( val [ key ] ) for key in val . type . keys ( ) } )