MCPcopy Create free account
hub / github.com/qilingframework/qiling / hook_code

Method hook_code

qiling/core_hooks.py:400–416  ·  view source on GitHub ↗

Intercept assembly instructions before they get executed. Args: callback : a method to call upon interception user_data : an additional context to pass to callback (default: `None`) begin : start of memory range to watch end : end o

(self, callback: TraceHookCalback, user_data: Any = None, begin: int = 1, end: int = 0)

Source from the content-addressed store, hash-verified

398 return HookRet(self, hook_type, hook)
399
400 def hook_code(self, callback: TraceHookCalback, user_data: Any = None, begin: int = 1, end: int = 0) -> HookRet:
401 """Intercept assembly instructions before they get executed.
402
403 Args:
404 callback : a method to call upon interception
405 user_data : an additional context to pass to callback (default: `None`)
406 begin : start of memory range to watch
407 end : end of memory range to watch
408
409 Notes:
410 If `begin` and `end` are not specified, the entire memory space will be watched.
411
412 Returns:
413 Hook handle
414 """
415
416 return self.ql_hook(UC_HOOK_CODE, callback, user_data, begin, end)
417
418 # TODO: remove; this is a special case of hook_intno(-1)
419 def hook_intr(self, callback, user_data=None, begin=1, end=0):

Callers 15

_init_stop_guardMethod · 0.80
setup_outputMethod · 0.80
dbg_hookMethod · 0.80
__entry_point_hookMethod · 0.80
__init__Method · 0.80
loadMethod · 0.80
runMethod · 0.80
runMethod · 0.80
enable_full_traceFunction · 0.80
enable_history_traceFunction · 0.80
ql_continueMethod · 0.80
ql_run_selectionMethod · 0.80

Calls 1

ql_hookMethod · 0.95

Tested by 2

run_one_roundMethod · 0.64
get_countFunction · 0.64