Esempio n. 1
0
        public void ElfLoaderConstructorTest()
        {
            var injectContext = new InjectContext();

            injectContext.SetInstanceType <PspMemory, LazyPspMemory>();
            var memory          = injectContext.GetInstance <PspMemory>();
            var memoryStream    = new PspMemoryStream(memory);
            var memoryPartition = new MemoryPartition(injectContext, PspMemory.MainOffset,
                                                      PspMemory.MainOffset + PspMemory.MainSize);

            var elfLoader = new ElfLoader();

            elfLoader.Load(File.OpenRead("../../../TestInput/minifire.elf"), "minifire.elf");
            elfLoader.AllocateAndWrite(memoryStream, memoryPartition);
            Assert.Equal(1, elfLoader.ProgramHeaders.Length);
            Assert.Equal(3, elfLoader.SectionHeaders.Length);

            Assert.Equal(
                "['','.rodata.sceModuleInfo']".Replace('\'', '"'),
                elfLoader.SectionHeadersByName.Keys.ToJson()
                );

            //ElfLoader.LoadAllocateMemory(MemoryPartition);
            //ElfLoader.LoadWriteToMemory(MemoryStream);

            //var ModuleInfo = ElfLoader.ModuleInfo;

            var pc = elfLoader.Header.EntryPoint;

            //var GP = ModuleInfo.GP;

            Assert.Equal(0x08900008, (int)pc);
            //Assert.Equal(0x00004821, (int)GP);
        }
Esempio n. 2
0
        public void Load(Stream FileStream, Stream MemoryStream, MemoryPartition MemoryPartition, HleModuleManager ModuleManager)
        {
            this.ElfLoader = new ElfLoader();
            this.ModuleManager = ModuleManager;

            this.ElfLoader.Load(FileStream);

            PspEmulatorContext.PspConfig.InfoExeHasRelocation = this.ElfLoader.NeedsRelocation;

            BaseAddress = (uint)(this.ElfLoader.NeedsRelocation ? 0x08900000 : 0);

            this.ElfLoader.AllocateAndWrite(MemoryStream, MemoryPartition, BaseAddress);

            if (this.ElfLoader.NeedsRelocation)
            {
                RelocateFromHeaders();
            }

            this.ModuleInfo = ElfLoader.SectionHeaderFileStream(ElfLoader.SectionHeadersByName[".rodata.sceModuleInfo"]).ReadStruct<ElfPsp.ModuleInfo>(); ;

            //Console.WriteLine(this.ModuleInfo.ToStringDefault());

            this.InitInfo.PC = ElfLoader.Header.EntryPoint + BaseAddress;
            this.InitInfo.GP = this.ModuleInfo.GP + BaseAddress;

            UpdateModuleImports();
        }
Esempio n. 3
0
        public void Load(Stream FileStream, Stream MemoryStream, MemoryPartition MemoryPartition, HleModuleManager ModuleManager)
        {
            this.ElfLoader     = new ElfLoader();
            this.ModuleManager = ModuleManager;

            this.ElfLoader.Load(FileStream);

            PspEmulatorContext.PspConfig.InfoExeHasRelocation = this.ElfLoader.NeedsRelocation;

            BaseAddress = (uint)(this.ElfLoader.NeedsRelocation ? 0x08900000 : 0);

            this.ElfLoader.AllocateAndWrite(MemoryStream, MemoryPartition, BaseAddress);

            if (this.ElfLoader.NeedsRelocation)
            {
                RelocateFromHeaders();
            }

            this.ModuleInfo = ElfLoader.SectionHeaderFileStream(ElfLoader.SectionHeadersByName[".rodata.sceModuleInfo"]).ReadStruct <ElfPsp.ModuleInfo>();;

            //Console.WriteLine(this.ModuleInfo.ToStringDefault());

            this.InitInfo.PC = ElfLoader.Header.EntryPoint + BaseAddress;
            this.InitInfo.GP = this.ModuleInfo.GP + BaseAddress;

            UpdateModuleImports();
        }
Esempio n. 4
0
        public void ElfLoaderConstructorTest()
        {
            var PspConfig          = new PspConfig();
            var PspEmulatorContext = new PspEmulatorContext(PspConfig);

            PspEmulatorContext.SetInstanceType <PspMemory, LazyPspMemory>();
            var Memory          = PspEmulatorContext.GetInstance <PspMemory>();
            var MemoryStream    = new PspMemoryStream(Memory);
            var MemoryPartition = new MemoryPartition(PspMemory.MainOffset, PspMemory.MainOffset + PspMemory.MainSize);

            var ElfLoader = new ElfLoader();

            ElfLoader.Load(File.OpenRead("../../../TestInput/minifire.elf"));
            ElfLoader.AllocateAndWrite(MemoryStream, MemoryPartition);
            Assert.AreEqual(1, ElfLoader.ProgramHeaders.Length);
            Assert.AreEqual(3, ElfLoader.SectionHeaders.Length);

            Assert.AreEqual(
                "['','.rodata.sceModuleInfo']".Replace('\'', '"'),
                ElfLoader.SectionHeadersByName.Keys.ToJson()
                );

            //ElfLoader.LoadAllocateMemory(MemoryPartition);
            //ElfLoader.LoadWriteToMemory(MemoryStream);

            //var ModuleInfo = ElfLoader.ModuleInfo;

            var PC = ElfLoader.Header.EntryPoint;

            //var GP = ModuleInfo.GP;

            Assert.AreEqual(0x08900008, (int)PC);
            //Assert.AreEqual(0x00004821, (int)GP);
        }
 protected override void ModuleInitialize()
 {
     GpuStateStructPartition = MemoryManager.GetPartition(MemoryPartitions.Kernel0).Allocate(
         sizeof(GpuStateStruct),
         Name: "GpuStateStruct"
         );
     GpuStateStructPointer = (GpuStateStruct *)GpuStateStructPartition.GetLowPointerSafe <GpuStateStruct>();
 }
Esempio n. 6
0
        protected override void ModuleInitialize()
        {
            GpuStateStructPartition = MemoryManager.GetPartition(MemoryPartitions.Kernel0).Allocate(
                GpuStateStruct.StructSizeInBytes,
                Name: "GpuStateStruct"
                );

            DefaultGpuStateData = GpuStateStructPartition.GetLowPointerSafe <uint>(GpuStateStruct.StructSizeInWords);
        }
Esempio n. 7
0
        public void AllocateAndWrite(Stream MemoryStream, MemoryPartition MemoryPartition, uint BaseAddress = 0)
        {
            this.MemoryStream = MemoryStream;
            this.MemoryPartition = MemoryPartition;
            this.BaseAddress = BaseAddress;

            AllocateMemory();
            WriteToMemory();
        }
Esempio n. 8
0
        public void AllocateAndWrite(Stream MemoryStream, MemoryPartition MemoryPartition, uint BaseAddress = 0)
        {
            this.MemoryStream    = MemoryStream;
            this.MemoryPartition = MemoryPartition;
            this.BaseAddress     = BaseAddress;

            AllocateMemory();
            WriteToMemory();
        }
Esempio n. 9
0
		public int _sceGeListEnQueue(uint InstructionAddressStart, uint InstructionAddressStall, int CallbackId, PspGeListArgs* Args, Action<GpuDisplayList> Action)
		{
			//Console.WriteLine("aaaaaaaaaaa");

			if (GpuStateStructPartition == null)
			{
				GpuStateStructPartition = MemoryManager.GetPartition(Managers.HleMemoryManager.Partitions.Kernel0).Allocate(
					sizeof(GpuStateStruct),
					Name: "GpuStateStruct"
				);
				GpuStateStructPointer = (GpuStateStruct*)MemoryManager.Memory.PspAddressToPointerSafe(GpuStateStructPartition.Low, Marshal.SizeOf(typeof(GpuStateStruct)));
			}

			//Console.WriteLine("_sceGeListEnQueue");
			try
			{
				var DisplayList = GpuProcessor.DequeueFreeDisplayList();
				{
					DisplayList.InstructionAddressStart = InstructionAddressStart;
					DisplayList.InstructionAddressCurrent = InstructionAddressStart;
					DisplayList.InstructionAddressStall = InstructionAddressStall;
					DisplayList.CallbacksId = -1;
					DisplayList.Callbacks = default(PspGeCallbackData);
					if (CallbackId != -1)
					{
						try
						{
							//DisplayList.Callbacks = Callbacks[CallbackId];
							DisplayList.Callbacks = Callbacks[CallbackId];
							DisplayList.CallbacksId = CallbackId;
						}
						catch
						{
						}
					}
					DisplayList.GpuStateStructPointer = null;
					if (Args != null)
					{
						DisplayList.GpuStateStructPointer = (GpuStateStruct*)CpuProcessor.Memory.PspAddressToPointerSafe(Args[0].GpuStateStructAddress, Marshal.SizeOf(typeof(GpuStateStruct)));
					}

					if (DisplayList.GpuStateStructPointer == null)
					{
						DisplayList.GpuStateStructPointer = GpuStateStructPointer;
					}
					Action(DisplayList);
				}
				return DisplayList.Id;
			}
			catch (Exception Exception)
			{
				Console.Error.WriteLine(Exception);
				//return -1;
				throw(Exception);
			}
		}
Esempio n. 10
0
            public void Init(HleThreadManager ThreadManager, PspMemory PspMemory, HleMemoryManager MemoryManager)
            {
                var BlockType = Attributes.HasFlag(MsgPipeAttributes.UseHighAddress)
                                        ? MemoryPartition.Anchor.High
                                        : MemoryPartition.Anchor.Low
                ;

                this.ThreadManager = ThreadManager;
                this.PspMemory     = PspMemory;
                this.PoolPartition = MemoryManager.GetPartition(PartitionId).Allocate(Size, BlockType, Alignment: 16);
            }
Esempio n. 11
0
        public void AllocateAndWrite(Stream MemoryStream, MemoryPartition MemoryPartition, uint BaseAddress = 0)
        {
            this.MemoryStream = MemoryStream;
            this.MemoryPartition = MemoryPartition;
            this.BaseAddress = BaseAddress;

            AllocateMemory();
            WriteToMemory();

            //((PspMemoryStream)MemoryStream).Memory.Dump("after_allocate_and_write_dump.bin");
        }
Esempio n. 12
0
        public void AllocateAndWrite(Stream memoryStream, MemoryPartition memoryPartition, uint baseAddress = 0)
        {
            MemoryStream    = memoryStream;
            MemoryPartition = memoryPartition;
            BaseAddress     = baseAddress;

            AllocateMemory();
            WriteToMemory();

            //((PspMemoryStream)MemoryStream).Memory.Dump("after_allocate_and_write_dump.bin");
        }
            public GuestHleIoDriver(InjectContext InjectContext, PspIoDrv *PspIoDrv)
            {
                InjectContext.InjectDependencesTo(this);

                this.PspIoDrvArgPartition = Alloc(new PspIoDrvArg()
                {
                    DriverPointer   = PspMemory.PointerToPspAddressUnsafe(PspIoDrv),
                    ArgumentPointer = 0,
                });
                this.PspIoDrvArg = (PspIoDrvArg *)PspIoDrvArgPartition.LowPointer;
                this.PspIoDrv    = PspIoDrv;
            }
Esempio n. 14
0
            public void Init()
            {
                var Partition = MemoryManager.GetPartition(PartitionId);

                this.MemoryPartition = Partition.Allocate(NumberOfBlocks * BlockSize);
                this.FreeBlocks      = new List <uint>();
                this.UsedBlocks      = new List <uint>();
                for (int n = 0; n < NumberOfBlocks; n++)
                {
                    this.FreeBlocks.Add(GetAddressFromBlockIndex(n));
                }
            }
Esempio n. 15
0
			public VirtualTimer(PspEmulatorContext PspEmulatorContext, string Name)
			{
				PspEmulatorContext.InjectDependencesTo(this);

				this.Timer = PspRtc.CreateVirtualTimer(Handler);
				this.Name = Name;
				this.Timer.Enabled = false;
				this.PspSharedInfoMemoryPartition = MemoryManager.GetPartition(HleMemoryManager.Partitions.Kernel0).Allocate(
					sizeof(PspSharedInfoStruct),
					Name: "VTimer.PspSharedInfoStruct"
				);
				this.PspSharedInfo = (PspSharedInfoStruct*)CpuProcessor.Memory.PspAddressToPointerSafe(this.PspSharedInfoMemoryPartition.Low);
			}
Esempio n. 16
0
        public VirtualTimer(InjectContext InjectContext, string Name)
        {
            InjectContext.InjectDependencesTo(this);

            this.Timer         = PspRtc.CreateVirtualTimer(Handler);
            this.Name          = Name;
            this.Timer.Enabled = false;
            this.PspSharedInfoMemoryPartition = MemoryManager.GetPartition(MemoryPartitions.Kernel0).Allocate(
                sizeof(PspSharedInfoStruct),
                Name: "VTimer.PspSharedInfoStruct"
                );
            this.PspSharedInfo =
                (PspSharedInfoStruct *)CpuProcessor.Memory.PspAddressToPointerSafe(
                    this.PspSharedInfoMemoryPartition.Low);
        }
Esempio n. 17
0
			public void Init()
			{
				var High = Info.Attribute.HasFlag(VplAttributeEnum.PSP_VPL_ATTR_ADDR_HIGH);

#if true
				ExternalMemoryAnchor = High ? Hle.MemoryPartition.Anchor.High : Hle.MemoryPartition.Anchor.Low;
				InternalMemoryAnchor = Hle.MemoryPartition.Anchor.Low;
#else
				InternalMemoryAnchor = High ? Hle.MemoryPartition.Anchor.High : Hle.MemoryPartition.Anchor.Low;
				ExternalMemoryAnchor = Hle.MemoryPartition.Anchor.Low;
#endif

				this.MemoryPartition = ThreadManForUser.MemoryManager.GetPartition(PartitionId).Allocate(
					Info.PoolSize,
					ExternalMemoryAnchor,
					Name: "<Vpl> : " + Info.Name
				);
			}
Esempio n. 18
0
            public void Init()
            {
                var High = Info.Attribute.HasFlag(VplAttributeEnum.PSP_VPL_ATTR_ADDR_HIGH);

#if true
                ExternalMemoryAnchor = High ? Hle.MemoryPartition.Anchor.High : Hle.MemoryPartition.Anchor.Low;
                //InternalMemoryAnchor = Hle.MemoryPartition.Anchor.High;
                InternalMemoryAnchor       = Hle.MemoryPartition.Anchor.Low;
                InternalMemoryAnchorReturn = Hle.MemoryPartition.Anchor.Low;
#else
                InternalMemoryAnchor = High ? Hle.MemoryPartition.Anchor.High : Hle.MemoryPartition.Anchor.Low;
                ExternalMemoryAnchor = Hle.MemoryPartition.Anchor.Low;
#endif

                this.MemoryPartition = ThreadManForUser.MemoryManager.GetPartition(PartitionId).Allocate(
                    Info.PoolSize,
                    ExternalMemoryAnchor,
                    Name: "<Vpl> : " + Info.Name
                    );
            }
Esempio n. 19
0
			public Atrac(PspEmulatorContext PspEmulatorContext, byte[] Data)
			{
				PspEmulatorContext.InjectDependencesTo(this);

				PrimaryBuffer = HleMemoryManager.GetPartition(Managers.HleMemoryManager.Partitions.User).Allocate(1024);

				CodecType = CodecType.PSP_MODE_AT_3_PLUS;
				SetData(Data);
			}
Esempio n. 20
0
			public Atrac(PspEmulatorContext PspEmulatorContext, CodecType CodecType)
			{
				PspEmulatorContext.InjectDependencesTo(this);

				PrimaryBuffer = HleMemoryManager.GetPartition(Managers.HleMemoryManager.Partitions.User).Allocate(1024);

				this.CodecType = CodecType;
			}
Esempio n. 21
0
			void IDisposable.Dispose()
			{
				if (this.MemoryPartition != null)
				{
					this.MemoryPartition.DeallocateFromParent();
					this.MemoryPartition = null;
				}
			}
Esempio n. 22
0
            public void Init()
            {
                var Alignment = Options.Alignment;
                if (Alignment == 0) Alignment = 4;
                //if (Alignment == 0) Alignment = 0x1000;
                if (Attributes != (FplAttributes)0)
                {
                    Console.Error.WriteLine("FPL: Unhandled Attribute : {0}", Attributes);
                    //throw (new NotImplementedException());
                }
                var Partition = MemoryManager.GetPartition(PartitionId);

                //var TEST_FIXED_ADDRESS = 0x08800000U;
                //var TEST_FIXED_ADDRESS = 0x08865980U;
                //var TEST_FIXED_ADDRESS = 0x088A0000U;
                //this.MemoryPartition = Partition.Allocate(NumberOfBlocks * BlockSize, Hle.MemoryPartition.Anchor.Set, TEST_FIXED_ADDRESS, Alignment);
                //Partition.Dump();

                this.MemoryPartition = Partition.Allocate(
                    NumberOfBlocks * BlockSize,
                    Hle.MemoryPartition.Anchor.Low,
                    0,
                    Alignment,
                    "<Fpl>: " + Name
                );

                //Console.Error.WriteLine("FixedPool.Init: 0x{0:X}", this.MemoryPartition.Low);
                this.FreeBlocks = new List<uint>();
                this.UsedBlocks = new List<uint>();
                this.WaitItemList = new List<WaitItem>();
                for (int n = 0; n < NumberOfBlocks; n++)
                {
                    this.FreeBlocks.Add(GetAddressFromBlockIndex(n));
                }

                //Console.Error.WriteLine(this);
            }
Esempio n. 23
0
        public HleModuleGuest LoadModule(Stream fileStream, Stream memoryStream, MemoryPartition memoryPartition,
                                         HleModuleManager moduleManager, string gameTitle, string moduleName, bool isMainModule)
        {
            HleModuleGuest = InjectContext.NewInstance <HleModuleGuest>();

            ElfLoader     = new ElfLoader();
            ModuleManager = moduleManager;

            var magic = fileStream.SliceWithLength(0, 4).ReadString(4);

            _logger.Info("Magic: '{0}'", magic);
            if (magic == "~PSP")
            {
                try
                {
                    var decryptedData = new EncryptedPrx().Decrypt(fileStream.ReadAll(), true);
                    File.WriteAllBytes("last_decoded_prx.bin", decryptedData);
                    fileStream = new MemoryStream(decryptedData);
                }
                catch (Exception exception)
                {
                    _logger.Error(exception);
                    throw;
                }
            }

            ElfLoader.Load(fileStream, moduleName);

            ElfConfig.InfoExeHasRelocation = ElfLoader.NeedsRelocation;

            if (ElfLoader.NeedsRelocation)
            {
                var dummyPartition = memoryPartition.Allocate(0x4000, Name: "Dummy");
                BaseAddress = memoryPartition.ChildPartitions.OrderByDescending(partition => partition.Size).First()
                              .Low;
                _logger.Info("BASE ADDRESS (Try    ): 0x{0:X}", BaseAddress);
                BaseAddress = MathUtils.NextAligned(BaseAddress, 0x1000);
                _logger.Info("BASE ADDRESS (Aligned): 0x{0:X}", BaseAddress);
            }
            else
            {
                BaseAddress = 0;
            }

            ElfConfig.RelocatedBaseAddress = BaseAddress;
            ElfConfig.GameTitle            = gameTitle;

            ElfLoader.AllocateAndWrite(memoryStream, memoryPartition, BaseAddress);

            LoadModuleInfo();

            if (ElfLoader.NeedsRelocation)
            {
                RelocateFromHeaders();
            }

            LoadModuleInfo();

            //Console.WriteLine(this.ModuleInfo.ToStringDefault());

            HleModuleGuest.InitInfo = new InitInfoStruct()
            {
                Pc = ElfLoader.Header.EntryPoint + BaseAddress,
                Gp = HleModuleGuest.ModuleInfo.Gp,
            };

            UpdateModuleImports();
            UpdateModuleExports();

            moduleManager.LoadedGuestModules.Add(HleModuleGuest);

            return(HleModuleGuest);
        }
Esempio n. 24
0
            public Atrac(InjectContext InjectContext, CodecType CodecType)
            {
                InjectContext.InjectDependencesTo(this);

                PrimaryBuffer = HleMemoryManager.GetPartition(MemoryPartitions.User).Allocate(1024);

                this.CodecType = CodecType;
            }
            public void Init(HleThreadManager ThreadManager, PspMemory PspMemory, HleMemoryManager MemoryManager)
            {
                var BlockType = Attributes.HasFlag(MsgPipeAttributes.UseHighAddress)
                    ? MemoryPartition.Anchor.High
                    : MemoryPartition.Anchor.Low
                ;

                this.ThreadManager = ThreadManager;
                this.PspMemory = PspMemory;
                this.PoolPartition = MemoryManager.GetPartition(PartitionId).Allocate(
                    Size,
                    BlockType,
                    Alignment: 16,
                    Name: "<MsgPipe> : " + Name
                );
            }
Esempio n. 26
0
 public void Init()
 {
     var Partition = MemoryManager.GetPartition(PartitionId);
     this.MemoryPartition = Partition.Allocate(NumberOfBlocks * BlockSize);
     this.FreeBlocks = new List<uint>();
     this.UsedBlocks = new List<uint>();
     for (int n = 0; n < NumberOfBlocks; n++)
     {
         this.FreeBlocks.Add(GetAddressFromBlockIndex(n));
     }
 }
 public MemoryPartitionTest()
 {
     PartitionRoot = new MemoryPartition(InjectContext, 0x000, 0x100);
 }
Esempio n. 28
0
            public Atrac(InjectContext InjectContext, byte* Data, int DataLength)
            {
                InjectContext.InjectDependencesTo(this);

                PrimaryBuffer = HleMemoryManager.GetPartition(MemoryPartitions.User).Allocate(1024);

                CodecType = CodecType.PSP_MODE_AT_3_PLUS;
                SetData(Data, DataLength);
            }
Esempio n. 29
0
        public HleModuleGuest LoadModule(Stream FileStream, Stream MemoryStream, MemoryPartition MemoryPartition, HleModuleManager ModuleManager, String GameTitle, string ModuleName, bool IsMainModule)
        {
            this.HleModuleGuest = new HleModuleGuest(PspEmulatorContext);

            this.ElfLoader = new ElfLoader();
            this.ModuleManager = ModuleManager;

            var Magic = FileStream.SliceWithLength(0, 4).ReadString(4);
            Logger.Info("Magic: '{0}'", Magic);
            if (Magic == "~PSP")
            {
                try
                {
                    var DecryptedData = new EncryptedPrx().Decrypt(FileStream.ReadAll(), true);
                    File.WriteAllBytes("last_decoded_prx.bin", DecryptedData);
                    FileStream = new MemoryStream(DecryptedData);
                }
                catch (Exception Exception)
                {
                    Logger.Error(Exception);
                    throw (Exception);
                }
            }

            this.ElfLoader.Load(FileStream, ModuleName);

            PspEmulatorContext.PspConfig.InfoExeHasRelocation = this.ElfLoader.NeedsRelocation;

            if (this.ElfLoader.NeedsRelocation)
            {
                var DummyPartition = MemoryPartition.Allocate(
                    0x4000,
                    Name: "Dummy"
                );
                BaseAddress = MemoryPartition.ChildPartitions.OrderByDescending(Partition => Partition.Size).First().Low;
                Logger.Info("BASE ADDRESS (Try    ): 0x{0:X}", BaseAddress);
                BaseAddress = MathUtils.NextAligned(BaseAddress, 0x1000);
                Logger.Info("BASE ADDRESS (Aligned): 0x{0:X}", BaseAddress);
            }
            else
            {
                BaseAddress = 0;
            }

            PspEmulatorContext.PspConfig.RelocatedBaseAddress = BaseAddress;
            PspEmulatorContext.PspConfig.GameTitle = GameTitle;

            this.ElfLoader.AllocateAndWrite(MemoryStream, MemoryPartition, BaseAddress);

            if (this.ElfLoader.NeedsRelocation)
            {
                RelocateFromHeaders();
            }

            if (!ElfLoader.SectionHeadersByName.ContainsKey(".rodata.sceModuleInfo"))
            {
                throw(new Exception("Can't find segment '.rodata.sceModuleInfo'"));
            }

            HleModuleGuest.ModuleInfo = ElfLoader.SectionHeaderFileStream(ElfLoader.SectionHeadersByName[".rodata.sceModuleInfo"]).ReadStruct<ElfPsp.ModuleInfo>(); ;

            //Console.WriteLine(this.ModuleInfo.ToStringDefault());

            HleModuleGuest.InitInfo = new InitInfoStruct()
            {
                PC = ElfLoader.Header.EntryPoint + BaseAddress,
                GP = HleModuleGuest.ModuleInfo.GP + BaseAddress,
            };

            UpdateModuleImports();
            UpdateModuleExports();

            ModuleManager.LoadedGuestModules.Add(HleModuleGuest);

            return HleModuleGuest;
        }
Esempio n. 30
0
 protected override void ModuleInitialize()
 {
     GpuStateStructPartition = MemoryManager.GetPartition(MemoryPartitions.Kernel0).Allocate(
         sizeof(GpuStateStruct),
         Name: "GpuStateStruct"
     );
     GpuStateStructPointer = (GpuStateStruct*)GpuStateStructPartition.GetLowPointerSafe<GpuStateStruct>();
 }
 public void AllocateAlignedStackOnNonAlignedSegmentTest()
 {
     PartitionRoot = new MemoryPartition(InjectContext, 0x000, 0x260);
     PartitionRoot.Allocate(0x100, MemoryPartition.Anchor.High, Alignment: 0x100);
 }
Esempio n. 32
0
 public void SetUp()
 {
     PartitionRoot = new MemoryPartition(0x000, 0x100);
 }