ClearRow() public static method

public static ClearRow ( ) : void
return void
Ejemplo n.º 1
0
        private static void CompressedWriteMemory()
        {
            uint id      = GetID();
            uint address = GetDataUInt32(0);
            uint length  = GetDataUInt32(4);
            uint size    = GetDataUInt32(8);

            //uint uncompresscrc = GetDataUInt32(12);

            LZF.Decompress(new IntPtr(Address.DebuggerBuffer + HeaderSize), length, new IntPtr(address), size);

            Screen.Goto(15, 0);
            Screen.ClearRow();
            Screen.Write("[CompressedWriteMemory]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write(id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
            Screen.Write(" Len: ");
            Screen.Write(length, 10, 5);
            Screen.Write(" Size: ");
            Screen.Write(size, 10, 5);
            Screen.Write(" CRC: ");

            //Screen.Write(uncompresscrc, 16, 8);

            //if (uncompresscrc == computedcrc)
            //	Screen.Write(" OK");
            //else
            //	Screen.Write(" BAD");

            SendResponse(id, DebugCode.CompressedWriteMemory);
        }
Ejemplo n.º 2
0
        public static void ProcessQueue()
        {
            if (queueNext == queueCurrent)
            {
                return;
            }

            if (!UnitTestRunner.IsReady())
            {
                return;
            }

            uint marker = Native.Get32(queueCurrent);

            if (marker == uint.MaxValue)
            {
                queueCurrent = Address.UnitTestQueue;
            }

            uint len      = Native.Get32(queueCurrent);
            uint id       = Native.Get32(queueCurrent + 4);
            uint address  = Native.Get32(queueCurrent + 8);
            uint type     = Native.Get32(queueCurrent + 12);
            uint paramcnt = Native.Get32(queueCurrent + 16);

            UnitTestRunner.SetUnitTestMethodAddress(address);
            UnitTestRunner.SetUnitTestResultType(type);
            UnitTestRunner.SetUnitTestMethodParameterCount(paramcnt);

            for (uint index = 0; index < paramcnt; index++)
            {
                uint value = Native.Get32(queueCurrent + 20 + (index * 4));
                UnitTestRunner.SetUnitTestMethodParameter(index, value);
            }

            queueCurrent = queueCurrent + len + 4;
            --count;

            Screen.Goto(17, 0);
            Screen.ClearRow();
            Screen.Write("[Unit Test]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write(id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
            Screen.Write(" Param: ");
            Screen.Write(paramcnt, 10, 2);
            Screen.Write(" Len: ");
            Screen.Write(len, 10, 4);
            Screen.Write(" - Cnt: ");
            Screen.Write(count, 10, 4);

            UnitTestRunner.StartTest(id);
        }
Ejemplo n.º 3
0
        private static void ProcessCommand()
        {
            // [0]![1]ID[5]CODE[6]LEN[10]DATA[LEN]

            int  code = GetCode();
            uint id   = GetID();
            uint len  = GetLength();

            Screen.Goto(13, 0);
            Screen.ClearRow();
            Screen.Write("[Data]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write(id, 10, 5);
            Screen.Write(" Code: ");
            Screen.Write((uint)code, 10, 4);
            Screen.Write(" Len: ");
            Screen.Write(len, 10, 5);

            switch (code)
            {
            case DebugCode.Ping: SendResponse(GetID(), DebugCode.Ping); return;

            case DebugCode.ReadMemory: ReadMemory(); return;

            case DebugCode.ReadCR3: SendResponse(GetID(), DebugCode.ReadCR3, (int)Native.GetCR3()); return;

            case DebugCode.Scattered32BitReadMemory: Scattered32BitReadMemory(); return;

            case DebugCode.WriteMemory: WriteMemory(); return;

            case DebugCode.CompressedWriteMemory: CompressedWriteMemory(); return;

            case DebugCode.ClearMemory: ClearMemory(); return;

            case DebugCode.HardJump: HardJump(); return;

            case DebugCode.ExecuteUnitTest: QueueUnitTest(); return;

            case DebugCode.GetMemoryCRC: GetMemoryCRC(); return;

            default: return;
            }
        }
Ejemplo n.º 4
0
        private unsafe static void HardJump()
        {
            uint id      = GetID();
            uint address = GetUInt32(16);

            SendResponse(id, DebugCode.HardJump);

            idt_stack->EIP = address;

            Screen.Goto(15, 0);
            Screen.ClearRow();
            Screen.Write("[HardJump]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write((uint)id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
        }
Ejemplo n.º 5
0
        private static void WriteMemory()
        {
            uint id      = GetID();
            uint address = GetUInt32(16);
            uint length  = GetUInt32(20);

            SendResponse(id, DebugCode.WriteMemory);

            uint at = 0;

            while (at + 4 < length)
            {
                uint value = GetUInt32(24 + at);

                Native.Set32(address + at, value);

                at = at + 4;
            }

            while (at < length)
            {
                byte value = GetByte(24 + at);

                Native.Set8(address + at, value);

                at = at + 1;
            }

            Screen.Goto(15, 0);
            Screen.ClearRow();
            Screen.Write("[WriteMemory]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write((uint)id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
            Screen.Write(" Len: ");
            Screen.Write(length, 10, 5);
        }
Ejemplo n.º 6
0
        private static void WriteMemory()
        {
            uint id      = GetID();
            var  address = GetDataPointer(0);
            uint length  = GetDataUInt32(4);

            SendResponse(id, DebugCode.WriteMemory);

            uint at = 0;

            while (at + 4 < length)
            {
                uint value = GetDataUInt32(8 + at);

                Intrinsic.Store32(address, at, value);

                at += 4;
            }

            while (at < length)
            {
                byte value = GetDataByte(8 + at);

                Intrinsic.Store8(address, at, value);

                at++;
            }

            Screen.Goto(15, 0);
            Screen.ClearRow();
            Screen.Write("[WriteMemory]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write(id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write((uint)address.ToInt32(), 16, 8);
            Screen.Write(" Len: ");
            Screen.Write(length, 10, 5);
        }
Ejemplo n.º 7
0
        private static void CompressedWriteMemory()
        {
            uint id            = GetID();
            uint address       = GetUInt32(16);
            uint length        = GetUInt32(20);
            uint size          = GetUInt32(24);
            uint uncompresscrc = GetUInt32(28);

            LZF.Decompress(Address.DebuggerBuffer + 32, length, address, size);

            uint computedcrc = ComputeMemoryCRC(address, size);

            Screen.Goto(15, 0);
            Screen.ClearRow();
            Screen.Write("[CompressedWriteMemory]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write((uint)id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
            Screen.Write(" Len: ");
            Screen.Write(length, 10, 5);
            Screen.Write(" Size: ");
            Screen.Write(size, 10, 5);
            Screen.Write(" CRC: ");
            Screen.Write(uncompresscrc, 16, 8);

            if (uncompresscrc == computedcrc)
            {
                Screen.Write(" OK");
            }
            else
            {
                Screen.Write(" BAD");
            }

            SendResponse(id, DebugCode.CompressedWriteMemory);
        }
Ejemplo n.º 8
0
        public static void EnterTestReadyLoop()
        {
            uint testCount = 0;

            Debugger.Ready();

            Screen.Write("Waiting for unit tests...");
            Screen.NextLine();
            Screen.NextLine();

            // allocate space on stack for parameters
            uint esp = Native.AllocateStackSpace(MaxParameters * 4);

            Screen.Write("Stack @ ");
            Screen.Write((uint)esp, 16, 8);

            Screen.NextLine();
            Screen.NextLine();

            uint row = Screen.Row;

            while (true)
            {
                if (testReady == 1)
                {
                    Screen.Goto(row, 0);
                    Screen.ClearRow();

                    Screen.Write("Test #: ");
                    Screen.Write(++testCount, 10, 7);

                    testResult         = 0;
                    testResultReady    = 0;
                    testResultReported = 0;
                    testReady          = 0;

                    // copy parameters into stack
                    for (uint index = 0; index < testParameters; index++)
                    {
                        uint value = new Pointer(Address.UnitTestStack).Load32(index * 4);

                        new Pointer(esp).Store32(index * 4, value);
                    }

                    switch (testResultType)
                    {
                    case 0: Native.FrameCall(testMethodAddress); break;

                    case 1: testResult = Native.FrameCallRetU4(testMethodAddress); break;

                    case 2: testResult = Native.FrameCallRetU8(testMethodAddress); break;

                    case 3: testResult = Native.FrameCallRetR8(testMethodAddress); break;

                    default: break;
                    }

                    testResultReady = 1;

                    Native.Int(255);
                }
            }
        }
Ejemplo n.º 9
0
        private static void ProcessCommand()
        {
            // [0]MAGIC[4]ID[8]CODE[12]LEN[16]DATA[LEN]CHECKSUM

            int  code        = GetCode();
            uint id          = GetID();
            uint len         = GetLength();
            uint receivedCRC = GetCRC();

            uint computedCRC = ComputeCRC();

            Screen.Goto(13, 0);
            Screen.ClearRow();
            Screen.Write("[Data]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write((uint)id, 10, 5);
            Screen.Write(" Code: ");
            Screen.Write((uint)code, 10, 4);
            Screen.Write(" Len: ");
            Screen.Write(len, 10, 5);
            Screen.Write(" CRC: ");
            Screen.Write(receivedCRC, 16, 8);

            if (receivedCRC == computedCRC)
            {
                Screen.Write(" OK");
            }
            else
            {
                Screen.Write(" BAD");
            }

            // TODO: if crc is invalid

            switch (code)
            {
            case DebugCode.Ping: SendResponse(GetID(), DebugCode.Ping); return;

            case DebugCode.ReadMemory: ReadMemory(); return;

            case DebugCode.ReadCR3: SendResponse(GetID(), DebugCode.ReadCR3, (int)Native.GetCR3()); return;

            case DebugCode.Scattered32BitReadMemory: Scattered32BitReadMemory(); return;

            case DebugCode.WriteMemory: WriteMemory(); return;

            case DebugCode.CompressedWriteMemory: CompressedWriteMemory(); return;

            case DebugCode.ClearMemory: ClearMemory(); return;

            case DebugCode.HardJump: HardJump(); return;

            case DebugCode.ExecuteUnitTest: QueueUnitTest(); return;

            case DebugCode.GetMemoryCRC: GetMemoryCRC(); return;

            default: return;
            }
        }