MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / hook_callback

Method hook_callback

windows/hooks.py:96–110  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

94 self.entry.enabled = True
95
96 def hook_callback(self, *args):
97 adapted_args = []
98 for value, type in zip(args, self.original_types[1:]):
99 if type == ctypes.c_wchar_p:
100 adapted_args.append(ctypes.c_wchar_p(value))
101 elif type == ctypes.c_char_p:
102 adapted_args.append(ctypes.c_char_p((value)))
103 else:
104 adapted_args.append(value)
105
106 def real_function(*args):
107 if args == ():
108 args = adapted_args
109 return self.realfunction(*args)
110 return self.callback(*adapted_args, real_function=real_function)
111
112## New simple hook API based on winproxy
113def setup_hook(target, hook, dll_to_hook):

Callers

nothing calls this directly

Calls 1

callbackMethod · 0.80

Tested by

no test coverage detected