Пример #1
0
        private string GeneratePostArgs(MutableObject mutable)
        {
            var postArgs = "{ \"config\" : [ \"";

            postArgs += "itrace,regs,disasm";
            //postArgs += IncludeITrace.GetFirstValue(mutable) ? "itrace," : "";
            //postArgs += IncludeRegs.GetFirstValue(mutable) ? "regs," : "";
            //postArgs += IncludeDisasm.GetFirstValue(mutable) ? "disasm," : "";
            //postArgs = postArgs.TrimEnd(new char[] { ',' });
            //postArgs += "\"";
            postArgs += IncludeMemtrace.GetFirstValue(mutable) ? "\", \"memtrace" : "";

            var skipCount = Skip.GetFirstValue(mutable);
            var maxCount  = Max.GetFirstValue(mutable);

            if (skipCount != -1)
            {
                postArgs += "\", \"skip," + skipCount;
            }
            if (maxCount != -1)
            {
                postArgs += "\", \"max," + maxCount;
            }

            postArgs += "\" ] }";
            return(postArgs);
        }
Пример #2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            IEnumerator iterator;

            if (SpoofExecution.GetFirstValue(payload.Data))
            {
                ExecutionTarget.SetValue(SpoofTrace(10000, 1), payload.Data);

                iterator = ParseExecution(payload.VisualData.Bound, payload.Data);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
            else
            {
                UseCachedResults = false;

                bool isMemoryTrace = IncludeMemtrace.GetFirstValue(payload.Data);

                var execId = ExecutionId.GetFirstValue(payload.Data);
                if (execId < 0)
                {
                    iterator = UpdateExecutionId(payload.Data);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }
                else
                {
                    FoundExecutionId = (uint)execId;
                }

                if (!UseCachedResults)
                {
                    iterator = GetTracesForCurrentSelections(payload.Data);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }

                var execution = new Execution()
                {
                    ServiceId     = ServiceId,
                    CbId          = BinaryId.Id,
                    CbAuthor      = BinaryId.Author,
                    RequestId     = FoundRequestId,
                    RequestNature = RequestNature.GetFirstValue(payload.Data),
                    ExecutionId   = FoundExecutionId,
                    Success       = CsSuccess,
                    Traces        = Traces,
                    PovType       = PovType
                };


                ExecutionTarget.SetValue(ExecutionToMutable(execution, isMemoryTrace, PovType), payload.Data);

                iterator = ParseExecution(payload.VisualData.Bound, payload.Data);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
        }