private void Given_Globals(params StructureField[] fields) { var sc = new ServiceContainer(); var arch = new Mocks.FakeArchitecture(sc); this.program = new Program( new SegmentMap( mem.BaseAddress, new ImageSegment("code", mem, AccessMode.ReadWriteExecute)), arch, new DefaultPlatform(sc, arch)); var globalStruct = new StructureType(); globalStruct.Fields.AddRange(fields); program.Globals.TypeVariable = new TypeVariable("globals_t", 1) { DataType = globalStruct }; program.Globals.TypeVariable.Class = new EquivalenceClass(program.Globals.TypeVariable) { DataType = globalStruct }; var ptr = new Pointer(globalStruct, 32); program.Globals.TypeVariable.DataType = ptr; }
public void Setup() { this.writer = new LeImageWriter(); var sc = new ServiceContainer(); var arch = new Mocks.FakeArchitecture(sc); this.platform = new Mocks.FakePlatform(sc, arch); }
public void Setup() { mr = new MockRepository(); sc = new ServiceContainer(); var image = new LoadedImage(Address.SegPtr(0xC00, 0), Enumerable.Range(0x0, 0x100).Select(b => (byte)b).ToArray()); var imageMap = image.CreateImageMap(); var arch = new Mocks.FakeArchitecture(); this.program = new Program(image, imageMap, arch, new DefaultPlatform(sc, arch)); }
public void Setup() { this.typelib = new TypeLibrary(); this.platform = new Mock <IPlatform>(); var arch = new Mocks.FakeArchitecture(null); platform.Setup(p => p.PointerType).Returns(Reko.Core.Types.PrimitiveType.Ptr32); platform.Setup(p => p.Architecture).Returns(arch); }
public void Setup() { sc = new ServiceContainer(); var mem = new MemoryArea(Address.SegPtr(0xC00, 0), Enumerable.Range(0x0, 0x100).Select(b => (byte)b).ToArray()); var imageMap = new SegmentMap( mem.BaseAddress, new ImageSegment( "code", mem, AccessMode.ReadWriteExecute)); var arch = new Mocks.FakeArchitecture(sc); this.program = new Program(imageMap, arch, new DefaultPlatform(sc, arch)); }
public void Setup() { mr = new MockRepository(); sc = new ServiceContainer(); var mem = new MemoryArea(Address.SegPtr(0xC00, 0), Enumerable.Range(0x0, 0x100).Select(b => (byte)b).ToArray()); var imageMap = new SegmentMap( mem.BaseAddress, new ImageSegment( "code", mem, AccessMode.ReadWriteExecute)); var arch = new Mocks.FakeArchitecture(); this.program = new Program(imageMap, arch, new DefaultPlatform(sc, arch)); }
private void Globals(params StructureField[] fields) { var arch = new Mocks.FakeArchitecture(); this.prog = new Program( image, image.CreateImageMap(), arch, new DefaultPlatform(null, arch)); var globalStruct = new StructureType(); globalStruct.Fields.AddRange(fields); prog.Globals.TypeVariable = new TypeVariable("globals_t", 1) { DataType = globalStruct }; var ptr = new Pointer(globalStruct, 4); prog.Globals.TypeVariable.DataType = ptr; }
private void Given_Globals(params StructureField[] fields) { var arch = new Mocks.FakeArchitecture(); this.program = new Program( new SegmentMap( mem.BaseAddress, new ImageSegment("code", mem, AccessMode.ReadWriteExecute)), arch, new DefaultPlatform(null, arch)); var globalStruct = new StructureType(); globalStruct.Fields.AddRange(fields); program.Globals.TypeVariable = new TypeVariable("globals_t", 1) { DataType = globalStruct }; program.Globals.TypeVariable.Class = new EquivalenceClass(program.Globals.TypeVariable) { DataType = globalStruct }; var ptr = new Pointer(globalStruct, 4); program.Globals.TypeVariable.DataType = ptr; }