(addr=None)
Print relevant information about an arena's top chunk, default to the
    current thread's arena.
Print relevant information about an arena's top chunk, default to the
    current thread's arena.
Print relevant information about an arena s top chunk default to the current thread s arena .
def top_chunk(addr=None):
    """Print relevant information about an arena's top chunk, default to the
    current thread's arena.
    """
    allocator = pwndbg.heap.current
    arena = allocator.get_arena(addr)
    address = arena['top']
    size = pwndbg.memory.u(int(address) + allocator.chunk_key_offset('size'))

    out = message.off("Top chunk\n") + "Addr: {}\nSize: 0x{:02x}".format(M.get(address), size)
    print(out)
def top_chunk ( addr = None ) : allocator = pwndbg . heap . current arena = allocator . get_arena ( addr ) address = arena [ 'top' ] size = pwndbg . memory . u ( int ( address ) + allocator . chunk_key_offset ( 'size' ) ) out = message . off ( "Top chunk\n" ) + "Addr: {}\nSize: 0x{:02x}" . format ( M . get ( address ) , size ) print ( out )