def arenas(): """ Prints out allocated arenas """ heap = pwndbg.heap.current addr = None arena = heap.get_arena(addr) main_arena_addr = int(arena.address) fmt = '[%%%ds]' % (pwndbg.arch.ptrsize * 2) while addr != main_arena_addr: h = heap.get_region(addr) if not h: print(red('Could not find the heap')) return hdr = bold(fmt % (hex(addr) if addr else 'main')) print(hdr, M.heap(str(h))) addr = int(arena['next']) arena = heap.get_arena(addr)
def __str__(self): fmt = '[%%%ds]' % (pwndbg.arch.ptrsize * 2) return message.hint(fmt % (hex(self.first_chunk))) + M.heap(str(pwndbg.vmmap.find(self.addr)))