示例#1
0
        public void Kill()
        {
            var command = new Kill();

            GDBClient.SendCommand(command);

            Disconnect();
        }
示例#2
0
        public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead)
        {
            var command = new ReadMemory(address, size, OnMemoryRead);

            OnMemoryReadMap.Add(command, onMemoryRead);

            GDBClient.SendCommand(command);
        }
示例#3
0
        private static void Main()
        {
            var tcpClient = new TcpClient("localhost", 2345);

            var gdbClient = new GDBClient();

            gdbClient.Stream = new GDBNetworkStream(tcpClient.Client, true);

            gdbClient.SendCommand(new ReadMemory(0x0, 2, ReadMemory));

            //gdbClient.SendCommandAsync(new SetSoftwareBreakPoint(0x400030, 1, Response));
            gdbClient.SendCommand(new SetSoftwareBreakPoint(0x4571B9, 1, Response));
            gdbClient.SendCommand(new GetRegisters(GetRegisters));
            gdbClient.SendCommand(new Continue(Response));

            Thread.Sleep(2000);
            gdbClient.SendBreak();
            gdbClient.SendCommand(new GetRegisters(GetRegisters));
            gdbClient.SendCommand(new Continue(Response));

            Thread.Sleep(2000);
            gdbClient.SendBreak();
            gdbClient.SendCommand(new GetRegisters(GetRegisters));

            //0x400030
            //gdbClient.SendCommandAsync(new GeneralRegisterRead(Response));

            while (true)
            {
                //loop
            }
        }
示例#4
0
        public void Kill()
        {
            var command = new Kill();

            GDBClient.SendCommand(command);

            Thread.Sleep(100);             // give it time to terminate

            Disconnect();
        }
示例#5
0
        public void Step(bool skipOnStep = false)
        {
            if (IsRunning)
            {
                return;
            }

            IsPaused = false;
            CallOnRunning();

            var command = skipOnStep ? new Step(OnStepQuiet) : new Step(OnStep);

            GDBClient.SendCommand(command);
        }
示例#6
0
        public void Continue()
        {
            if (IsRunning)
            {
                return;
            }

            IsPaused = false;
            CallOnRunning();

            var command = new Continue(OnStop);

            GDBClient.SendCommand(command);
        }
示例#7
0
        public void StepN(uint stepCount)
        {
            if (IsRunning)
            {
                return;
            }

            var command = new Step();

            for (uint currentStep = 0; currentStep < stepCount - 1; currentStep++)
            {
                GDBClient.SendCommand(command);
            }

            Step();
        }
示例#8
0
        public void GetRegisters()
        {
            var command = new GetRegisters(OnGetRegisters);

            GDBClient.SendCommand(command);
        }
示例#9
0
        public void ClearBreakPoint(ulong address)
        {
            var command = new ClearBreakPoint(address, 4, 0);

            GDBClient.SendCommand(command);
        }
示例#10
0
        public void ExtendedMode()
        {
            var command = new ExtendedMode();

            GDBClient.SendCommand(command);
        }
示例#11
0
        public void GetReasonHalted()
        {
            var command = new GetReasonHalted();

            GDBClient.SendCommand(command);
        }