@ -944,7 +944,7 @@ group.add_argument(
nargs = " ? " ,
nargs = " ? " ,
type = lambda n : max ( int ( n , 0 ) , 1 ) ,
type = lambda n : max ( int ( n , 0 ) , 1 ) ,
default = pwndbg . config . default_visualize_chunk_number ,
default = pwndbg . config . default_visualize_chunk_number ,
help = " Number of chunks to visualize. " ,
help = " Number of chunks to visualize. If the value is big enough and addr isn' t provided, this is interpreted as addr instead. " ,
)
)
parser . add_argument ( " addr " , nargs = " ? " , default = None , help = " Address of the first chunk. " )
parser . add_argument ( " addr " , nargs = " ? " , default = None , help = " Address of the first chunk. " )
parser . add_argument (
parser . add_argument (
@ -985,6 +985,11 @@ def vis_heap_chunks(
allocator = pwndbg . gdblib . heap . current
allocator = pwndbg . gdblib . heap . current
assert isinstance ( allocator , GlibcMemoryAllocator )
assert isinstance ( allocator , GlibcMemoryAllocator )
# If the first argument (count) is big enough (and address isn't provided) interpret it as an address
if addr is None and count is not None and count > 0x1000 :
addr = count
count = pwndbg . config . default_visualize_chunk_number
if addr is not None :
if addr is not None :
cursor = int ( addr )
cursor = int ( addr )
heap_region = Heap ( cursor )
heap_region = Heap ( cursor )