示例#1
0
        public Unicorn(UcArch arch, UcMode mode)
        {
            _callbacks  = new Dictionary <int, UnicornCallbackData>();
            _callbackId = 0;

            var result = Marshal.AllocHGlobal(Marshal.SizeOf <IntPtr>());
            var err    = UcNative.UcOpen(arch, mode, result);

            if (err != UcErr.UC_ERR_OK)
            {
                throw new UcException($"Failed to create native Unicorn instance, error {err}.", err);
            }

            Handle = (IntPtr)Marshal.PtrToStructure(result, typeof(IntPtr));
        }
示例#2
0
 public static extern UcErr UcOpen(UcArch arch, UcMode mode, IntPtr engine);