Beispiel #1
0
        private void dbg_UserBreakpoint(ref iDbg.CException except)
        {
            bool validPointer = false;
            int  pFormat      = 0;

            int l = dbg.ReadRegister(iDbg.Registers.esp);

            if (dbg.ReadLng(l, ref pFormat))
            {
                validPointer = true;
            }

            string msg = "UserBreakpoint @ " + except.ExceptionAddress.ToString("X") +
                         " Disasm = " + except.Disasm +
                         " Esp = " + l.ToString("X") + "  ";

            if (validPointer)
            {
                msg += dbg.GetMemory(pFormat, true);
            }
            else
            {
                msg += dbg.GetMemory(l, true);
            }

            listBox1.Items.Add(msg);
            dbg.StepOver();
        }
Beispiel #2
0
        private void dbg_SingleStep(ref iDbg.CException except)
        {
            string msg = "Single step at addr " + except.ExceptionAddress.ToString("X") +
                         " disasm = " + except.Disasm +
                         " return value = " + dbg.ReadRegister(iDbg.Registers.Eax).ToString("X");

            listBox1.Items.Add(msg);

            if (except.ExceptionAddress <= 0x401024)
            {
                dbg.StepInto();
            }
            else
            {
                dbg.Continue(DBG_CONTINUE);
            }
        }
Beispiel #3
0
        private void dbg_Exception(ref iDbg.CException except)
        {
            listBox1.Items.Add("Caught Exception At address 0x" +
                               except.ExceptionAddress.ToString("X") +
                               " Current Inst: " + except.Disasm.ToString()
                               );

            if (dbg.LastEventAddress == except.ExceptionAddress &&
                dbg.LastEventCode == (int)except.ExceptionCode)
            {
                dbg.StopDbg();
                listBox1.Items.Add("Crash in same place killing app");
            }
            else
            {
                dbg.Continue(DBG_DONT_HANDLE);
                listBox1.Items.Add("Passing err to seh handlers");
                textBox2.Text += except.Enviroment;
            }
        }