|
|
|
@ -15,6 +15,10 @@ def get(address, limit=5):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
result = []
|
|
|
|
result = []
|
|
|
|
for i in range(limit):
|
|
|
|
for i in range(limit):
|
|
|
|
|
|
|
|
# Don't follow cycles, except to stop at the second occurrence.
|
|
|
|
|
|
|
|
if result.count(address) >= 2:
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
result.append(address)
|
|
|
|
result.append(address)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
address = int(pwndbg.memory.poi(pwndbg.types.ppvoid, address))
|
|
|
|
address = int(pwndbg.memory.poi(pwndbg.types.ppvoid, address))
|
|
|
|
@ -36,9 +40,12 @@ def format(value):
|
|
|
|
|
|
|
|
|
|
|
|
# Otherwise, the last element in the chain is the non-pointer value.
|
|
|
|
# Otherwise, the last element in the chain is the non-pointer value.
|
|
|
|
# We want to enhance the last pointer value.
|
|
|
|
# We want to enhance the last pointer value.
|
|
|
|
else:
|
|
|
|
elif len(chain) < 6:
|
|
|
|
enhanced = pwndbg.enhance.enhance(chain[-2])
|
|
|
|
enhanced = pwndbg.enhance.enhance(chain[-2])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
enhanced = '...'
|
|
|
|
|
|
|
|
|
|
|
|
# Colorize the rest
|
|
|
|
# Colorize the rest
|
|
|
|
rest = []
|
|
|
|
rest = []
|
|
|
|
for link in chain[:-1]:
|
|
|
|
for link in chain[:-1]:
|
|
|
|
|