Skip to content

Commit

Permalink
dereference_from: Use GEF_MAX_STRING_LENGTH
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Mar 9, 2024
1 parent cdaf158 commit b1771a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -8508,8 +8508,8 @@ def dereference_from(address: int) -> List[str]:
s = gef.memory.read_cstring(addr.value)
if len(s) < gef.arch.ptrsize:
txt = f'{format_address(deref)} ("{Color.colorify(s, string_color)}"?)'
elif len(s) > 50:
txt = Color.colorify(f'"{s[:50]}[...]"', string_color)
elif len(s) > GEF_MAX_STRING_LENGTH:
txt = Color.colorify(f'"{s[:GEF_MAX_STRING_LENGTH]}[...]"', string_color)
else:
txt = Color.colorify(f'"{s}"', string_color)

Expand Down

0 comments on commit b1771a7

Please sign in to comment.