Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 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)))
Exemplo n.º 3
0
 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)))