Generalize dynamic hooking