MCPcopy
hub / github.com/Gallopsled/pwntools / register

Method register

pwnlib/term/keymap.py:61–81  ·  view source on GitHub ↗
(self, desc, cb = None)

Source from the content-addressed store, hash-verified

59 self.send(k)
60
61 def register(self, desc, cb = None):
62 if isinstance(desc, dict):
63 for k, v in desc.items():
64 self.register(k, v)
65 else:
66 if desc == '<match>':
67 self.on_match(cb)
68 elif desc == '<nomatch>':
69 self.on_nomatch(cb)
70 elif desc == '<any>':
71 self.on_key(cb)
72 else:
73 ms = map(key.Matcher, desc.split(' '))
74 if not ms:
75 return
76 t = self._top
77 for m in ms:
78 if m not in t:
79 t[m] = ({}, [])
80 t, cbs = t[m]
81 cbs.append(cb)
82
83 def unregister(self, desc, cb = None):
84 ms = map(key.Matcher, desc.split(' '))

Callers 15

__init__Method · 0.95
make_elfFunction · 0.80
asmFunction · 0.80
disasmFunction · 0.80
debug_assemblyFunction · 0.80
debug_shellcodeFunction · 0.80
atexit.pyFile · 0.80
_extract_debfileFunction · 0.80
attachFunction · 0.80
initFunction · 0.80
cache_dirMethod · 0.80
forwardFunction · 0.80

Calls 5

on_matchMethod · 0.95
on_nomatchMethod · 0.95
on_keyMethod · 0.95
itemsMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected