public void Setup() { mr = new MockRepository(); program = new Program(); proc = new Procedure(program.Architecture, "testProc", new Frame(PrimitiveType.Word32)); block = proc.AddBlock("l00100000"); trace = new RtlTrace(0x00100000); r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32)); r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32)); r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32)); sp = new Identifier("sp", PrimitiveType.Word32, new RegisterStorage("sp", 15, 0, PrimitiveType.Word32)); grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte); var sc = new ServiceContainer(); var listener = mr.Stub <DecompilerEventListener>(); scanner = mr.StrictMock <IScanner>(); arch = mr.Stub <IProcessorArchitecture>(); program.Architecture = arch; program.SegmentMap = new SegmentMap( Address.Ptr32(0x00100000), new ImageSegment( ".text", new MemoryArea(Address.Ptr32(0x00100000), new byte[0x20000]), AccessMode.ReadExecute)); arch.Replay(); program.Platform = new DefaultPlatform(null, arch); arch.BackToRecord(); arch.StackRegister = (RegisterStorage)sp.Storage; arch.Stub(s => s.PointerType).Return(PrimitiveType.Ptr32); scanner.Stub(s => s.Services).Return(sc); sc.AddService <DecompilerEventListener>(listener); }
public void Setup() { mr = new MockRepository(); program = new Program(); proc = new Procedure("testProc", new Frame(PrimitiveType.Word32)); block = proc.AddBlock("l00100000"); trace = new RtlTrace(0x00100000); r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32)); r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32)); r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32)); sp = new Identifier("sp", PrimitiveType.Word32, new RegisterStorage("sp", 15, 0, PrimitiveType.Word32)); grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte); var sc = new ServiceContainer(); var listener = mr.Stub<DecompilerEventListener>(); scanner = mr.StrictMock<IScanner>(); arch = mr.Stub<IProcessorArchitecture>(); program.Architecture = arch; program.SegmentMap = new SegmentMap( Address.Ptr32(0x00100000), new ImageSegment( ".text", new MemoryArea(Address.Ptr32(0x00100000), new byte[0x20000]), AccessMode.ReadExecute)); arch.Replay(); program.Platform = new DefaultPlatform(null, arch); arch.BackToRecord(); arch.Stub(s => s.StackRegister).Return((RegisterStorage)sp.Storage); arch.Stub(s => s.PointerType).Return(PrimitiveType.Pointer32); scanner.Stub(s => s.Services).Return(sc); sc.AddService<DecompilerEventListener>(listener); }
public void Setup() { mr = new MockRepository(); program = new Program(); proc = new Procedure("testProc", new Frame(PrimitiveType.Word32)); block = proc.AddBlock("l00100000"); trace = new RtlTrace(0x00100000); r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32)); r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32)); r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32)); grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte); scanner = mr.StrictMock<IScanner>(); arch = mr.DynamicMock<IProcessorArchitecture>(); arch.Stub(s => s.PointerType).Return(PrimitiveType.Pointer32); program.Architecture = arch; arch.Replay(); program.Platform = new DefaultPlatform(null, arch); arch.BackToRecord(); }
public void Setup() { mr = new MockRepository(); program = new Program(); proc = new Procedure("testProc", new Frame(PrimitiveType.Word32)); block = proc.AddBlock("l00100000"); trace = new RtlTrace(0x00100000); r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32)); r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32)); r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32)); grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte); scanner = mr.StrictMock <IScanner>(); arch = mr.DynamicMock <IProcessorArchitecture>(); arch.Stub(s => s.PointerType).Return(PrimitiveType.Pointer32); program.Architecture = arch; arch.Replay(); program.Platform = new DefaultPlatform(null, arch); arch.BackToRecord(); }