public void Setup() { this.sc = new ServiceContainer(); this.x86 = new X86ArchitectureFlat32(); this.ppc = new PowerPcArchitecture32(); this.m = new ProcedureBuilder(); this.printfChr = new ProcedureCharacteristics() { VarargsParserClass = "Reko.Libraries.Libc.PrintfFormatParser,Reko.Libraries.Libc" }; this.x86PrintfSig = new FunctionType( null, StackId(null, 4, CStringType()), StackId("...", 8, new UnknownType())); this.x86SprintfSig = new FunctionType( null, StackId(null, 4, CStringType()), StackId(null, 8, CStringType()), StackId("...", 12, new UnknownType())); this.ppcPrintfSig = new FunctionType( null, RegId(null, ppc, "r3", CStringType()), RegId("...", ppc, "r4", new UnknownType())); this.addrInstr = Address.Ptr32(0x123400); }
public void PPCArch_GetTrampoline() { var arch = new PowerPcArchitecture32(); var m = new InstructionBuilder(arch, Address.Ptr32(0x10030000)); m.Lis(m.r11, 0x1006); m.Lwz(m.r11, 0x1234, m.r11); m.Mtctr(m.r11); m.Bctr(); var host = mr.Stub<IRewriterHost>(); host.Stub(h => h.GetImportedProcedure( Arg<Address>.Matches(a => a.ToLinear() == 0x10061234), Arg<Address>.Is.Anything)).Return(new ExternalProcedure("foo", null)); mr.ReplayAll(); ProcedureBase proc = arch.GetTrampolineDestination(m.Instructions, host); Assert.IsNotNull(proc); Assert.AreEqual("foo", proc.Name); }
public void PPCArch_Create() { IProcessorArchitecture arch = new PowerPcArchitecture32(); }