def process_hook(state: State) -> None: # We can't remove because the globally applied hooks are stored in # the Manticore class, not State self.assertFalse(state.remove_hook(0x400610, process_hook, after=True)) # We can remove this one because it was applied specifically to this # State (or its parent) self.assertTrue(state.remove_hook(None, do_nothing, after=True)) state.add_hook(None, do_nothing, after=False) state.add_hook(None, do_nothing, after=True) state.add_hook(0x400647, fin, after=True) state.add_hook(0x400647, fin, after=False)
def process_hook(state: State) -> None: # We can't remove because the globally applied hooks are stored in # the Manticore class, not State self.assertFalse( state.remove_hook(12, process_hook, after=True, syscall=True)) # We can remove this one because it was applied specifically to this # State (or its parent) self.assertTrue( state.remove_hook(None, do_nothing, after=True, syscall=True)) state.add_hook(None, do_nothing, after=False, syscall=True) state.add_hook(None, do_nothing, after=True, syscall=True) # Should execute directly after sys_brk invocation state.add_hook("sys_brk", fin, after=True, syscall=True)