Пример #1
0
 public Backwalker(IBackWalkHost host, RtlTransfer xfer, ExpressionSimplifier eval)
 {
     this.host = host;
     this.eval = eval;
     var target = xfer.Target;
     var seq = xfer.Target as MkSequence;
     if (seq != null)
     {
         target = seq.Tail;
     }
     var mem = target as MemoryAccess;
     if (mem == null)
     {
         Index = RegisterOf(target as Identifier);
     }
     else
     {
         Index = DetermineIndexRegister(mem);
     }
     Operations = new List<BackwalkOperation>();
 }
Пример #2
0
        private void RunTest(IntelArchitecture arch, RtlTransfer rtlTransfer, string outputFile)
        {
            using (var fut = new FileUnitTester(outputFile))
            {
                m.Procedure.Write(false, fut.TextWriter);
                fut.TextWriter.Flush();

                var ibw = new Backwalker(host, rtlTransfer, expSimp);
                var bwoList = ibw.BackWalk(m.CurrentBlock);
                Assert.IsNotNull(bwoList);
                foreach (BackwalkOperation bwo in bwoList)
                {
                    fut.TextWriter.WriteLine(bwo);
                }
                fut.TextWriter.WriteLine("Index register: {0}", ibw.Index);
                fut.AssertFilesEqual();
            }
        }