Skip to content
Permalink
Browse files

bug in heap command #568 (fix) (#571)

* add support of PIE for r2

* Update radare2.py

API update

* fix bug in command heap

* Update heap.py
  • Loading branch information...
matrix1001 authored and disconnect3d committed Feb 27, 2019
1 parent 40d173e commit 0f4e31e72a10320670f04616041ab800fc9cadf1
Showing with 8 additions and 1 deletion.
  1. +8 −1 pwndbg/commands/heap.py
@@ -97,8 +97,15 @@ def heap(addr=None):

# Print out all chunks on the heap
# TODO: Add an option to print out only free or allocated chunks

# Check if there is an alignment at the start of the heap
size_t = pwndbg.arch.ptrsize
first_chunk_size = pwndbg.arch.unpack(pwndbg.memory.read(addr + size_t, size_t))
if first_chunk_size == 0:
addr += size_t * 2 # Skip the alignment

while addr < page.vaddr + page.memsz:
chunk = malloc_chunk(addr)
chunk = malloc_chunk(addr) # Prints the chunk
size = int(chunk['size'])

# Clear the bottom 3 bits

0 comments on commit 0f4e31e

Please sign in to comment.
You can’t perform that action at this time.