avoid searching 0-length in memory (#181)

This will result in an internal exception and make pwndbg stop
searching. Just avoid and exit this search block if the current
search length equals zero.
pull/187/head
Levente Polyak 9 years ago committed by Zach Riggle
parent a6dbb6140f
commit 2a4eaa927e

@ -49,7 +49,11 @@ def search(searchfor, mapping=None, start=None, end=None,
if not pwndbg.memory.peek(start):
break
start = i.search_memory(start, end - start, searchfor)
length = end - start
if length <= 0:
break
start = i.search_memory(start, length, searchfor)
if start is None:
break

Loading…
Cancel
Save