MCPcopy Index your code
hub / github.com/longld/peda / search

Method search

lib/shellcode.py:308–343  ·  view source on GitHub ↗
(self, keyword)

Source from the content-addressed store, hash-verified

306
307 """ search() and display() use the shell-storm API """
308 def search(self, keyword):
309 if keyword is None:
310 return None
311 try:
312 msg("Connecting to shell-storm.org...")
313 s = six.moves.http_client.HTTPConnection("shell-storm.org")
314
315 s.request("GET", "/api/?s="+str(keyword))
316 res = s.getresponse()
317 read_result = res.read().decode('utf-8')
318 data_l = [x for x in read_result.split('\n') if x] # remove empty results
319 except Exception as e:
320 if config.Option.get("debug") == "on":
321 msg("Exception: %s" %e)
322 traceback.print_exc()
323 error_msg("Cannot connect to shell-storm.org")
324 return None
325
326 data_dl = []
327 for data in data_l:
328 try:
329 desc = data.split("::::")
330 dico = {
331 'ScAuthor': desc[0],
332 'ScArch': desc[1],
333 'ScTitle': desc[2],
334 'ScId': desc[3],
335 'ScUrl': desc[4]
336 }
337 data_dl.append(dico)
338 except Exception as e:
339 if config.Option.get("debug") == "on":
340 msg("Exception: %s" %e)
341 traceback.print_exc()
342
343 return data_dl
344
345 def display(self, shellcodeId):
346 if shellcodeId is None:

Callers 15

parse_and_evalMethod · 0.80
getfileMethod · 0.80
prev_instMethod · 0.80
current_instMethod · 0.80
next_instMethod · 0.80
xrefsMethod · 0.80
stepuntilMethod · 0.80
eval_targetMethod · 0.80
examine_mem_valueMethod · 0.80
elfentryMethod · 0.80
elfsymbolsMethod · 0.80
main_entryMethod · 0.80

Calls 2

error_msgFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected