Exemple #1
0
        private HookHandle AddInInternal(InstructionInHookCallback callback, Instruction instruction, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_insn_in((uc, port, size, user_data) =>
            {
                Debug.Assert(uc == Emulator.Handle);
                return(callback(Emulator, port, size, userToken));
            });

            return(AddInternal(wrapper, begin, end, instruction));
        }
        private HookHandle AddInInternal(InstructionInHookCallback callback, Instruction instruction, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_insn_in((uc, port, size, user_data) =>
            {
                Debug.Assert(uc == Emulator.Bindings.UCHandle);
                return(callback(Emulator, port, size, userToken));
            });

            var ptr = Marshal.GetFunctionPointerForDelegate(wrapper);

            return(AddInternal(ptr, begin, end, instruction));
        }