Ejemplo n.º 1
0
        private HookHandle AddEventInternal(MemoryEventHookType type, MemoryEventHookCallback callback, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_eventmem((uc, _type, addr, size, value, user_data) =>
            {
                Debug.Assert(uc == Emulator.Handle);
                return(callback(Emulator, (MemoryType)_type, addr, size, value, userToken));
            });

            return(Add((UnicornHookType)type, wrapper, begin, end));
        }
Ejemplo n.º 2
0
        private HookHandle AddEventInternal(MemoryEventHookType type, MemoryEventHookCallback callback, ulong begin, ulong end, object userToken)
        {
            var wrapper = new uc_cb_eventmem((uc, _type, addr, size, value, user_data) =>
            {
                Debug.Assert(uc == Emulator.Bindings.UCHandle);
                return(callback(Emulator, (MemoryType)_type, addr, size, value, userToken));
            });

            var ptr = Marshal.GetFunctionPointerForDelegate(wrapper);

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