MCPcopy Create free account
hub / github.com/longld/peda / pager

Function pager

lib/utils.py:247–270  ·  view source on GitHub ↗

Paging output, mimic external command less/more

(text, pagesize=None)

Source from the content-addressed store, hash-verified

245 return '\n'.join(trimmed)
246
247def pager(text, pagesize=None):
248 """
249 Paging output, mimic external command less/more
250 """
251 if not pagesize:
252 pagesize = config.Option.get("pagesize")
253
254 if pagesize <= 0:
255 msg(text)
256 return
257
258 i = 1
259 text = text.splitlines()
260 l = len(text)
261
262 for line in text:
263 msg(line)
264 if i % pagesize == 0:
265 ans = input("--More--(%d/%d)" % (i, l))
266 if ans.lower().strip() == "q":
267 break
268 i += 1
269
270 return
271
272def execute_external_command(command, cmd_input=None):
273 """

Callers 14

hexprintMethod · 0.85
hexdumpMethod · 0.85
profileMethod · 0.85
searchmemMethod · 0.85
refsearchMethod · 0.85
lookupMethod · 0.85
telescopeMethod · 0.85
stringsMethod · 0.85
asmsearchMethod · 0.85
ropsearchMethod · 0.85
dumpropMethod · 0.85
ropgadgetMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected