2008-07-31 07:00:10 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using AbstractPipe;
|
|
|
|
|
using DebugProtocol;
|
|
|
|
|
|
|
|
|
|
namespace KDBGProtocol
|
|
|
|
|
{
|
|
|
|
|
public class KDBG : IDebugProtocol
|
|
|
|
|
{
|
|
|
|
|
bool mRunning = true;
|
|
|
|
|
Pipe mConnection;
|
|
|
|
|
List<string> mCommandBuffer = new List<string>();
|
|
|
|
|
Dictionary<string, ulong> mModuleList = new Dictionary<string, ulong>();
|
|
|
|
|
ulong []mRegisters = new ulong[32];
|
|
|
|
|
|
|
|
|
|
public KDBG(Pipe connection)
|
|
|
|
|
{
|
|
|
|
|
mConnection = connection;
|
|
|
|
|
mConnection.PipeReceiveEvent += PipeReceiveEvent;
|
|
|
|
|
mConnection.PipeErrorEvent += PipeErrorEvent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PipeErrorEvent(object sender, PipeErrorEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Regex mMemoryRowUpdate = new Regex("<(?<addr>[^>]+)>: (?<row>[0-9a-fA-F? ]*)");
|
|
|
|
|
static Regex mModuleOffset = new Regex("(?<modname>[^:]+):(?<offset>[0-9a-fA-f]+).*");
|
|
|
|
|
static Regex mModuleUpdate = new Regex("(?<base>[0-9a-fA-F]+) (?<size>[0-9a-fA-F]+) (?<modname>\\w+\\.\\w+)");
|
|
|
|
|
static Regex mRegLineCS_EIP = new Regex("CS:EIP 0x(?<cs>[0-9a-fA-F]+):0x(?<eip>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mRegLineSS_ESP = new Regex("SS:ESP 0x(?<ss>[0-9a-fA-F]+):0x(?<esp>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mRegLineEAX_EBX = new Regex("EAX 0x(?<eax>[0-9a-fA-F]+)[ \t]+EBX 0x(?<ebx>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mRegLineECX_EDX = new Regex("ECX 0x(?<ecx>[0-9a-fA-F]+)[ \t]+EDX 0x(?<edx>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mRegLineEBP = new Regex("EBP 0x(?<ebp>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mRegLineEFLAGS = new Regex("EFLAGS 0x(?<eflags>[0-9a-fA-F]+).*");
|
|
|
|
|
static Regex mSregLine = new Regex("[CDEFGS]S 0x(?<seg>[0-9a-fA-F]+).*");
|
2008-08-12 10:48:38 +00:00
|
|
|
|
static Regex mProcListHeading = new Regex("PID[ \\t]+State[ \\t]+Filename.*");
|
|
|
|
|
static Regex mThreadListHeading = new Regex("TID[ \\t]+State[ \\t]+Prio.*");
|
|
|
|
|
static Regex mProcListEntry = new Regex("^(?<cur>([*]|))0x(?<pid>[0-9a-fA-F]+)[ \\t]+(?<state>.*)");
|
2008-08-17 11:44:03 +00:00
|
|
|
|
static Regex mThreadListEntry = new Regex("^(?<cur>([*]|))0x(?<tid>[0-9a-fA-F]+)[ \\t]+(?<state>.*)0x(?<eip>[0-9a-fA-F]*)");
|
2008-07-31 07:00:10 +00:00
|
|
|
|
|
2008-08-02 09:48:48 +00:00
|
|
|
|
bool mFirstModuleUpdate = false;
|
2008-08-12 10:48:38 +00:00
|
|
|
|
bool mReceivingProcs = false;
|
|
|
|
|
bool mReceivingThreads = false;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
StringBuilder mInputBuffer = new StringBuilder();
|
2008-08-12 10:48:38 +00:00
|
|
|
|
int mUsedInput;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
|
|
|
|
|
void PipeReceiveEvent(object sender, PipeReceiveEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
bool tookText = false;
|
|
|
|
|
string inbufStr;
|
|
|
|
|
int promptIdx;
|
|
|
|
|
|
|
|
|
|
mInputBuffer.Append(args.Received);
|
|
|
|
|
|
2008-08-12 10:48:38 +00:00
|
|
|
|
if (mInputBuffer.ToString().Substring(mUsedInput).Contains("key to continue"))
|
2008-07-31 07:00:10 +00:00
|
|
|
|
{
|
|
|
|
|
mConnection.Write("\r");
|
2008-08-12 10:48:38 +00:00
|
|
|
|
mUsedInput = mInputBuffer.Length;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while ((promptIdx = (inbufStr = mInputBuffer.ToString()).IndexOf("kdb:> ")) != -1)
|
|
|
|
|
{
|
|
|
|
|
string pretext = inbufStr.Substring(0, promptIdx);
|
|
|
|
|
string[] theInput = pretext.Split(new char[] { '\n' });
|
|
|
|
|
int remove = pretext.Length + "kdb:> ".Length;
|
|
|
|
|
|
|
|
|
|
mInputBuffer.Remove(0, remove);
|
2008-08-12 10:48:38 +00:00
|
|
|
|
mUsedInput = Math.Max(0, mUsedInput - remove);
|
2008-07-31 07:00:10 +00:00
|
|
|
|
|
|
|
|
|
if (!tookText)
|
|
|
|
|
{
|
|
|
|
|
if (mRunning)
|
|
|
|
|
{
|
|
|
|
|
mRunning = false;
|
|
|
|
|
GetRegisterUpdate();
|
2008-08-12 10:48:38 +00:00
|
|
|
|
GetProcesses();
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
tookText = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (string line in theInput)
|
|
|
|
|
{
|
|
|
|
|
string cleanedLine = line.Trim();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (cleanedLine.StartsWith("Entered debugger on "))
|
|
|
|
|
{
|
2008-08-12 10:48:38 +00:00
|
|
|
|
mReceivingProcs = false;
|
|
|
|
|
mReceivingThreads = false;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
GetRegisterUpdate();
|
2008-08-12 10:48:38 +00:00
|
|
|
|
GetProcesses();
|
2008-07-31 07:00:10 +00:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-02 09:48:48 +00:00
|
|
|
|
if (!mFirstModuleUpdate)
|
|
|
|
|
{
|
|
|
|
|
GetModuleUpdate();
|
|
|
|
|
mFirstModuleUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-31 07:00:10 +00:00
|
|
|
|
Match memoryMatch = mMemoryRowUpdate.Match(cleanedLine);
|
|
|
|
|
if (memoryMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
string addrStr = memoryMatch.Groups["addr"].ToString();
|
|
|
|
|
Match modOffset = mModuleOffset.Match(addrStr);
|
|
|
|
|
ulong updateAddress;
|
|
|
|
|
if (modOffset.Success)
|
|
|
|
|
{
|
|
|
|
|
string modname = modOffset.Groups["modname"].ToString();
|
|
|
|
|
ulong offset = ulong.Parse(modOffset.Groups["offset"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
ulong modbase;
|
|
|
|
|
if (mModuleList.TryGetValue(modname.ToUpper(), out modbase))
|
|
|
|
|
updateAddress = modbase + offset;
|
|
|
|
|
else
|
|
|
|
|
continue; // Couldn't resolve the address of the named module ...
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
updateAddress = ulong.Parse(addrStr, NumberStyles.HexNumber);
|
|
|
|
|
}
|
|
|
|
|
string[] memWords = memoryMatch.Groups["row"].ToString().Split(new char[] { ' ' });
|
|
|
|
|
byte []updateBytes = new byte[4 * memWords.Length];
|
|
|
|
|
int ctr = 0;
|
|
|
|
|
foreach (string word in memWords)
|
|
|
|
|
{
|
|
|
|
|
if (word[0] == '?')
|
|
|
|
|
{
|
|
|
|
|
if (MemoryUpdateEvent != null)
|
|
|
|
|
MemoryUpdateEvent(this, new MemoryUpdateEventArgs((updateAddress & ~0xfffUL), null));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int wordParsed = int.Parse(word, NumberStyles.HexNumber);
|
|
|
|
|
int curCtr = ctr;
|
|
|
|
|
for (ctr = curCtr; ctr < curCtr + 4; ctr++)
|
|
|
|
|
{
|
|
|
|
|
updateBytes[ctr] = (byte)(wordParsed & 0xff);
|
|
|
|
|
wordParsed >>= 8;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (MemoryUpdateEvent != null)
|
|
|
|
|
MemoryUpdateEvent(this, new MemoryUpdateEventArgs(updateAddress, updateBytes));
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match moduleMatch = mModuleUpdate.Match(cleanedLine);
|
|
|
|
|
if (moduleMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
ulong baseAddress = ulong.Parse(moduleMatch.Groups["base"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
uint moduleSize = uint.Parse(moduleMatch.Groups["size"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
string moduleName = moduleMatch.Groups["modname"].ToString();
|
|
|
|
|
mModuleList[moduleName.ToUpper()] = baseAddress;
|
|
|
|
|
if (ModuleListEvent != null)
|
|
|
|
|
ModuleListEvent(this, new ModuleListEventArgs(moduleName, baseAddress));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match csEipMatch = mRegLineCS_EIP.Match(cleanedLine);
|
|
|
|
|
if (csEipMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
uint cs = uint.Parse(csEipMatch.Groups["cs"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
ulong eip = ulong.Parse(csEipMatch.Groups["eip"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[8] = eip;
|
|
|
|
|
mRegisters[10] = cs;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match ssEspMatch = mRegLineSS_ESP.Match(cleanedLine);
|
|
|
|
|
if (ssEspMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
uint ss = uint.Parse(ssEspMatch.Groups["ss"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
ulong esp = ulong.Parse(ssEspMatch.Groups["esp"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[4] = esp;
|
|
|
|
|
mRegisters[15] = ss;
|
2008-08-12 10:48:38 +00:00
|
|
|
|
continue;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match eaxEbxMatch = mRegLineEAX_EBX.Match(cleanedLine);
|
|
|
|
|
if (eaxEbxMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
ulong eax = ulong.Parse(eaxEbxMatch.Groups["eax"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
ulong ebx = ulong.Parse(eaxEbxMatch.Groups["ebx"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[0] = eax;
|
|
|
|
|
mRegisters[3] = ebx;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match ecxEdxMatch = mRegLineECX_EDX.Match(cleanedLine);
|
|
|
|
|
if (ecxEdxMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
ulong ecx = ulong.Parse(ecxEdxMatch.Groups["ecx"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
ulong edx = ulong.Parse(ecxEdxMatch.Groups["edx"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[1] = ecx;
|
|
|
|
|
mRegisters[2] = edx;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match ebpMatch = mRegLineEBP.Match(cleanedLine);
|
|
|
|
|
if (ebpMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
ulong ebp = ulong.Parse(ebpMatch.Groups["ebp"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[5] = ebp;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match eflagsMatch = mRegLineEFLAGS.Match(cleanedLine);
|
|
|
|
|
if (eflagsMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
ulong eflags = ulong.Parse(eflagsMatch.Groups["eflags"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
mRegisters[9] = eflags;
|
|
|
|
|
if (RegisterChangeEvent != null)
|
|
|
|
|
RegisterChangeEvent(this, new RegisterChangeEventArgs(mRegisters));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match sregMatch = mSregLine.Match(cleanedLine);
|
|
|
|
|
if (sregMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
char []segmap = new char[] { 'C','D','E','F','G','S' };
|
|
|
|
|
uint sreg = uint.Parse(sregMatch.Groups["seg"].ToString(), NumberStyles.HexNumber);
|
|
|
|
|
int findSeg;
|
|
|
|
|
for (findSeg = 0; findSeg < segmap.Length; findSeg++)
|
|
|
|
|
{
|
|
|
|
|
if (segmap[findSeg] == cleanedLine[0])
|
|
|
|
|
{
|
|
|
|
|
mRegisters[10 + findSeg] = sreg;
|
|
|
|
|
if (segmap[findSeg] == 'S' && RegisterChangeEvent != null)
|
|
|
|
|
RegisterChangeEvent(this, new RegisterChangeEventArgs(mRegisters));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2008-08-12 10:48:38 +00:00
|
|
|
|
|
|
|
|
|
Match pidHeadMatch = mProcListHeading.Match(cleanedLine);
|
|
|
|
|
if (pidHeadMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
mReceivingThreads = false;
|
|
|
|
|
mReceivingProcs = true;
|
|
|
|
|
if (ProcessListEvent != null)
|
|
|
|
|
ProcessListEvent(this, new ProcessListEventArgs());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Match pidEntryMatch = mProcListEntry.Match(cleanedLine);
|
2008-08-16 03:30:22 +00:00
|
|
|
|
if (pidEntryMatch.Success && mReceivingProcs)
|
2008-08-12 10:48:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (ProcessListEvent != null)
|
|
|
|
|
ProcessListEvent(this, new ProcessListEventArgs(ulong.Parse(pidEntryMatch.Groups["pid"].ToString(), NumberStyles.HexNumber), pidEntryMatch.Groups["cur"].Length > 0));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ((mReceivingProcs || cleanedLine.Contains("No processes")) && ProcessListEvent != null)
|
|
|
|
|
ProcessListEvent(this, new ProcessListEventArgs(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Match tidHeadMatch = mThreadListHeading.Match(cleanedLine);
|
|
|
|
|
if (tidHeadMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
mReceivingThreads = true;
|
|
|
|
|
mReceivingProcs = false;
|
|
|
|
|
if (ThreadListEvent != null)
|
|
|
|
|
ThreadListEvent(this, new ThreadListEventArgs());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Match tidEntryMatch = mThreadListEntry.Match(cleanedLine);
|
2008-08-16 03:30:22 +00:00
|
|
|
|
if (tidEntryMatch.Success && mReceivingThreads)
|
2008-08-12 10:48:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (ThreadListEvent != null)
|
2008-08-17 11:44:03 +00:00
|
|
|
|
ThreadListEvent(this, new ThreadListEventArgs(ulong.Parse(tidEntryMatch.Groups["tid"].ToString(), NumberStyles.HexNumber), tidEntryMatch.Groups["cur"].Length > 0, ulong.Parse(tidEntryMatch.Groups["eip"].ToString(), NumberStyles.HexNumber)));
|
2008-08-12 10:48:38 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (mReceivingThreads && ThreadListEvent != null)
|
|
|
|
|
ThreadListEvent(this, new ThreadListEventArgs(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception) { /* Error line ... we'll ignore it for now */ }
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tookText)
|
|
|
|
|
{
|
|
|
|
|
lock (mCommandBuffer)
|
|
|
|
|
{
|
|
|
|
|
if (mCommandBuffer.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
string firstCommand = mCommandBuffer[0];
|
|
|
|
|
mCommandBuffer.RemoveAt(0);
|
|
|
|
|
mConnection.Write(firstCommand + "\r");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetBreakpoint(Breakpoint bp)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveBreakpoint(Breakpoint bp)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public event ConsoleOutputEventHandler ConsoleOutputEvent;
|
|
|
|
|
public event RegisterChangeEventHandler RegisterChangeEvent;
|
|
|
|
|
public event SignalDeliveredEventHandler SignalDeliveredEvent;
|
|
|
|
|
public event RemoteGDBErrorHandler RemoteGDBError;
|
|
|
|
|
public event MemoryUpdateEventHandler MemoryUpdateEvent;
|
|
|
|
|
public event ModuleListEventHandler ModuleListEvent;
|
2008-08-12 10:48:38 +00:00
|
|
|
|
public event ProcessListEventHandler ProcessListEvent;
|
|
|
|
|
public event ThreadListEventHandler ThreadListEvent;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
|
|
|
|
|
public void GetRegisterUpdate()
|
|
|
|
|
{
|
|
|
|
|
QueueCommand("regs");
|
|
|
|
|
QueueCommand("sregs");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void GetModuleUpdate()
|
|
|
|
|
{
|
|
|
|
|
QueueCommand("mod");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void GetMemoryUpdate(ulong address, int len)
|
|
|
|
|
{
|
|
|
|
|
QueueCommand(string.Format("x 0x{0:X} L {1}", address, len));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void WriteMemory(ulong address, byte[] buf)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void QueueCommand(string command)
|
|
|
|
|
{
|
|
|
|
|
lock (mCommandBuffer)
|
|
|
|
|
{
|
|
|
|
|
mCommandBuffer.Add(command);
|
|
|
|
|
if (mCommandBuffer.Count == 1)
|
2008-08-08 18:03:59 +00:00
|
|
|
|
{
|
2008-07-31 07:00:10 +00:00
|
|
|
|
mConnection.Write(command + "\r");
|
2008-08-08 18:03:59 +00:00
|
|
|
|
mCommandBuffer.RemoveAt(0); //useful???
|
|
|
|
|
}
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Step()
|
|
|
|
|
{
|
|
|
|
|
QueueCommand("step");
|
|
|
|
|
GetRegisterUpdate();
|
2008-08-02 09:48:48 +00:00
|
|
|
|
GetModuleUpdate();
|
2008-08-12 10:48:38 +00:00
|
|
|
|
GetProcesses();
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Next()
|
|
|
|
|
{
|
|
|
|
|
QueueCommand("next");
|
|
|
|
|
GetRegisterUpdate();
|
2008-08-02 09:48:48 +00:00
|
|
|
|
GetModuleUpdate();
|
2008-08-12 10:48:38 +00:00
|
|
|
|
GetProcesses();
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Break()
|
|
|
|
|
{
|
|
|
|
|
mConnection.Write("\r");
|
|
|
|
|
GetRegisterUpdate();
|
2008-08-02 09:48:48 +00:00
|
|
|
|
GetModuleUpdate();
|
2008-07-31 07:00:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Go(ulong address)
|
|
|
|
|
{
|
|
|
|
|
mRunning = true;
|
2008-08-02 09:48:48 +00:00
|
|
|
|
mFirstModuleUpdate = false;
|
2008-07-31 07:00:10 +00:00
|
|
|
|
QueueCommand("cont");
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-12 10:48:38 +00:00
|
|
|
|
public void GetProcesses()
|
|
|
|
|
{
|
|
|
|
|
QueueCommand("proc list");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void GetThreads(ulong pid)
|
|
|
|
|
{
|
|
|
|
|
QueueCommand(string.Format("thread list 0x{0:X8}", pid));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetProcess(ulong pid)
|
|
|
|
|
{
|
|
|
|
|
QueueCommand(string.Format("proc attach 0x{0:X8}", pid));
|
|
|
|
|
GetRegisterUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetThread(ulong tid)
|
|
|
|
|
{
|
|
|
|
|
QueueCommand(string.Format("thread attach 0x{0:X8}", tid));
|
|
|
|
|
GetRegisterUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-31 07:00:10 +00:00
|
|
|
|
public void Write(string wr) { mConnection.Write(wr); }
|
|
|
|
|
|
|
|
|
|
public void Close()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|