public PowerPcXenonDisassemblerTests()
 {
     this.arch = new PowerPcBe32Architecture(CreateServiceContainer(), "ppc-be-32", new Dictionary <string, object>
     {
         { "Model", "Xenon" }
     });
 }
 public PowerPcXenonDisassemblerTests()
 {
     this.arch = new PowerPcBe32Architecture(new ServiceContainer(), "ppc-be-32");
     this.arch.LoadUserOptions(new Dictionary <string, object>
     {
         { "Model", "Xenon" }
     });
 }
        public void PPCArch_GetTrampoline()
        {
            var arch = new PowerPcBe32Architecture("ppc-be-32");
            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_GetTrampoline()
        {
            var arch = new PowerPcBe32Architecture(new ServiceContainer(), "ppc-be-32");
            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 = new Mock <IRewriterHost>();

            host.Setup(h => h.GetImportedProcedure(
                           It.IsNotNull <IProcessorArchitecture>(),
                           It.Is <Address>(a => a.ToLinear() == 0x10061234),
                           It.IsAny <Address>()))
            .Returns(new ExternalProcedure("foo", new FunctionType()));

            ProcedureBase proc = arch.GetTrampolineDestination(m.Instructions, host.Object);

            Assert.IsNotNull(proc);
            Assert.AreEqual("foo", proc.Name);
        }