예제 #1
0
        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;
        }
예제 #2
0
        public void Setup()
        {
            this.writer = new LeImageWriter();
            var sc   = new ServiceContainer();
            var arch = new Mocks.FakeArchitecture(sc);

            this.platform = new Mocks.FakePlatform(sc, arch);
        }
예제 #3
0
 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));
 }
예제 #4
0
        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);
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }
예제 #7
0
 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));
 }
예제 #8
0
 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;
 }
예제 #9
0
 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;
 }
예제 #10
0
        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;
        }