Esempio n. 1
0
        internal BfdDisassembler(Process process, bool is_x86_64)
        {
            this.process = process;

            read_handler = new ReadMemoryHandler (read_memory_func);
            output_handler = new OutputHandler (output_func);
            print_handler = new PrintAddressHandler (print_address_func);

            handle = bfd_glue_create_disassembler (
                is_x86_64, read_handler, output_handler, print_handler);
        }
Esempio n. 2
0
        internal BfdDisassembler(Process process, bool is_x86_64)
        {
            this.process = process;

            read_handler   = new ReadMemoryHandler(read_memory_func);
            output_handler = new OutputHandler(output_func);
            print_handler  = new PrintAddressHandler(print_address_func);

            handle = bfd_glue_create_disassembler(
                is_x86_64, read_handler, output_handler, print_handler);
        }
Esempio n. 3
0
        /// <summary>
        /// Constructs a configurable memory map of the given size
        /// </summary>
        /// <param name="size">Size in bytes of the memory map (min: 0x0001, max: 0x10000</param>
        public ConfigurableMemoryMap(uint size)
        {
            if (size <= 0 || size > ushort.MaxValue + 1)
            {
                throw new ArgumentOutOfRangeException("size");
            }
            Size = size;

            readMemoryHandlers  = new ReadMemoryHandler[Size];
            writeMemoryHandlers = new WriteMemoryHandler[Size];
            memory = new byte[Size];

            ResetConfiguration();
        }
Esempio n. 4
0
        /// <summary>
        /// Configure a memory read handler for a given memory address range
        /// </summary>
        /// <param name="startAddress">starting address to configure</param>
        /// <param name="length">length of the address range to configure</param>
        /// <param name="readMemoryHandler">delegate to handle memory reads at the given address range</param>
        public void ConfigureMemoryReadRange(ushort startAddress, ushort length, ReadMemoryHandler readMemoryHandler)
        {
            int endAddressExclusive = startAddress + length;

            if (endAddressExclusive > Size)
            {
                throw new ArgumentOutOfRangeException("length");
            }

            for (ushort address = startAddress; address < endAddressExclusive; address++)
            {
                readMemoryHandlers[address] = readMemoryHandler;
            }
        }
Esempio n. 5
0
 static extern IntPtr bfd_glue_create_disassembler(bool is_x86_64, ReadMemoryHandler read_memory_cb, OutputHandler output_cb, PrintAddressHandler print_address_cb);
Esempio n. 6
0
 /// <summary>
 /// Configure a memory read handler for a given memory address
 /// </summary>
 /// <param name="address">Memory address to associate to the read handler</param>
 /// <param name="readMemoryHandler">delegate to handle memory reads at the given address</param>
 public void ConfigureMemoryRead(ushort address, ReadMemoryHandler readMemoryHandler)
 {
     readMemoryHandlers[address] = readMemoryHandler;
 }
Esempio n. 7
0
 /// <summary>
 /// Configure memory read and write handlers for a given memory address
 /// </summary>
 /// <param name="address">Memory address to associate to the handlers</param>
 /// <param name="readMemoryHandler">delegate to handle memory reads at the given address</param>
 /// <param name="writeMemoryHandler">delegate to handle memory writes at the given address</param>
 public void ConfigureMemoryAccess(ushort address, ReadMemoryHandler readMemoryHandler, WriteMemoryHandler writeMemoryHandler)
 {
     readMemoryHandlers[address]  = readMemoryHandler;
     writeMemoryHandlers[address] = writeMemoryHandler;
 }
Esempio n. 8
0
 extern static IntPtr bfd_glue_create_disassembler(bool is_x86_64, ReadMemoryHandler read_memory_cb, OutputHandler output_cb, PrintAddressHandler print_address_cb);