Beispiel #1
0
        private HookHandle AddInternal(CodeHookCallback callback, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_hookcode((uc, addr, size, user_data) =>
            {
                Debug.Assert(uc == Emulator.Handle);
                callback(Emulator, addr, size, userToken);
            });

            return(Add(UnicornHookType.Code, wrapper, begin, end));
        }
Beispiel #2
0
        private HookHandle AddInternal(BlockHookCallback callback, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_hookcode((uc, addr, size, user_data) =>
            {
                Debug.Assert(uc == Emulator.Bindings.UCHandle);
                callback(Emulator, addr, size, userToken);
            });

            var ptr = Marshal.GetFunctionPointerForDelegate(wrapper);

            return(Add(Bindings.HookType.Block, ptr, begin, end));
        }