public byte[] GetStackData(int offsetToEBP, uint size) { //return new byte[size]; // from debugstub: //// sends a stack value //// Serial Params: //// 1: x32 - offset relative to EBP //// 2: x32 - size of data to send if (!IsConnected) { return(null); } var xData = new byte[8]; mDataSize = (int)size; // EBP is first //offsetToEBP += 4; Array.Copy(BitConverter.GetBytes(offsetToEBP), 0, xData, 0, 4); Array.Copy(BitConverter.GetBytes(size), 0, xData, 4, 4); SendCmd(Vs2Ds.SendMethodContext, xData); // todo: make "crossplatform". this code assumes stack space of 32bit per "item" byte[] xResult; xResult = MethodContextDatas.First(); MethodContextDatas.RemoveAt(0); return(xResult); }
protected void PacketMethodContext(byte[] aPacket) { MethodContextDatas.Add(aPacket.ToArray()); WaitForMessage(); }