public bool WriteMemory(uint address, byte[] buf, int offset, int length)
        {
            int count = length;
            int pos = offset;

            while (count > 0)
            {
                WireProtocol.Commands.Monitor_WriteMemory cmd = new WireProtocol.Commands.Monitor_WriteMemory();
                int len = System.Math.Min(1024, count);

                cmd.PrepareForSend(address, buf, pos, len);

                WireProtocol.IncomingMessage reply = SyncMessage(WireProtocol.Commands.c_Monitor_WriteMemory, 0, cmd);

                if (!WireProtocol.IncomingMessage.IsPositiveAcknowledge(reply)) return false;

                address += (uint)len;
                count -= len;
                pos += len;
            }

            return true;
        }
Esempio n. 2
0
        public bool WriteMemory( uint address, byte[ ] buf, int offset, int length )
        {
            int count = length;
            int pos = offset;

            while( count > 0 )
            {
                Commands.Monitor_WriteMemory cmd = new Commands.Monitor_WriteMemory( );
                int len = Math.Min( 1024, count );

                cmd.PrepareForSend( address, buf, pos, len );

                DebuggerEventSource.Log.EngineWriteMemory( address, len );
                IncomingMessage reply = SyncMessage( Commands.c_Monitor_WriteMemory, 0, cmd );

                if( !IncomingMessage.IsPositiveAcknowledge( reply ) )
                    return false;

                address += ( uint )len;
                count -= len;
                pos += len;
            }

            return true;
        }