Esempio n. 1
0
        internal Context(Emulator emulator)
        {
            Debug.Assert(emulator != null);

            emulator.Bindings.ContextAlloc(emulator.Handle, ref _context);

            _arch     = emulator._arch;
            _mode     = emulator._mode;
            _emulator = emulator;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Emulator"/> class with the specified <see cref="IBindings"/>
        /// instance.
        /// </summary>
        internal Emulator(UnicornArch arch, UnicornMode mode, IBindings bindings)
        {
            _arch      = arch;
            _mode      = mode;
            _registers = new Registers(this);
            _memory    = new Memory(this);
            _hooks     = new Hooks(this);

            Bindings = bindings;
            Bindings.Open(arch, mode, ref _handle);
        }
Esempio n. 3
0
 public void Open(UnicornArch arch, UnicornMode mode, ref IntPtr uc)
 => ThrowIfError(uc_open((uc_arch)arch, (uc_mode)mode, ref uc));
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Emulator"/> class with the specified <see cref="UnicornArch"/>
 /// and <see cref="UnicornMode"/>.
 /// </summary>
 /// <param name="arch"><see cref="UnicornArch"/> to use.</param>
 /// <param name="mode"><see cref="UnicornMode"/> to use.</param>
 public Emulator(UnicornArch arch, UnicornMode mode) : this(arch, mode, Unicorn.Bindings.Instance)
 {
     /* Space */
 }
Esempio n. 5
0
 public static extern UnicornError uc_open(UnicornArch arch, UnicornMode mode, out IntPtr uc);