Exemplo n.º 1
0
        public void TrfTerminatingProcedure()
        {
            var eax = m.Procedure.Frame.EnsureRegister(Registers.eax);

            m.Assign(eax, m.Word32(0x40));
            m.Call(exit, 4);

            flow[m.Block] = CreateBlockFlow(m.Block, m.Frame);
            flow[exit]    = new ProcedureFlow(exit, prog.Architecture);
            flow[exit].TerminatesProcess = true;
            trf = CreateTrashedRegisterFinder(prog);
            trf.ProcessBlock(m.Block);
            Assert.AreEqual("", DumpValues());
        }
Exemplo n.º 2
0
        public void TrfProcessBlock()
        {
            Identifier eax = m.Procedure.Frame.EnsureRegister(Registers.eax);
            Identifier esp = m.Procedure.Frame.EnsureRegister(Registers.esp);

            m.Store(m.ISub(esp, 4), eax);
            m.Assign(eax, m.Int32(3));
            m.Assign(eax, m.LoadDw(m.ISub(esp, 4)));

            flow[m.Block] = CreateBlockFlow(m.Block, m.Frame);
            flow[m.Block].SymbolicIn.SetValue(esp, m.Frame.FramePointer);
            trf = CreateTrashedRegisterFinder(prog);
            trf.ProcessBlock(m.Block);
            Assert.AreEqual("(eax:eax), (esp:fp), (Stack -4:eax)", DumpValues());
        }
Exemplo n.º 3
0
        public void TrfTerminatingProcedure()
        {
            var eax = m.Procedure.Frame.EnsureRegister(Registers.eax);
            m.Assign(eax, m.Word32(0x40));
            m.Call(exit, 4);

            flow[m.Block] = CreateBlockFlow(m.Block, m.Frame);
            flow[exit] = new ProcedureFlow(exit, program.Architecture);
            flow[exit].TerminatesProcess = true;
            trf = CreateTrashedRegisterFinder(program);
            trf.ProcessBlock(m.Block);
            Assert.AreEqual("", DumpValues());
        }
Exemplo n.º 4
0
        public void TrfProcessBlock()
        {
            Identifier eax = m.Procedure.Frame.EnsureRegister(Registers.eax);
            Identifier esp = m.Procedure.Frame.EnsureRegister(Registers.esp);
            m.Store(m.ISub(esp, 4), eax);
            m.Assign(eax, m.Int32(3));
            m.Assign(eax, m.LoadDw(m.ISub(esp, 4)));

            flow[m.Block] = CreateBlockFlow(m.Block, m.Frame);
            flow[m.Block].SymbolicIn.SetValue(esp, m.Frame.FramePointer);
            trf = CreateTrashedRegisterFinder(program);
            trf.ProcessBlock(m.Block);
            Assert.AreEqual("(eax:eax), (esp:fp), (Stack -4:eax)", DumpValues());
        }