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()); }
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()); }
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()); }
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()); }