示例#1
0
        public void Setup()
        {
            Position = 0x0;
            Size     = 0x1000;

            EntryPoint = Position;

            ATranslator Translator = new ATranslator();

            RamPointer = Marshal.AllocHGlobal(new IntPtr(Size));
            Memory     = new AMemory(RamPointer);
            Memory.Map(Position, 0, Size);
            Thread = new AThread(Translator, Memory, EntryPoint);
        }
示例#2
0
        public void HleMapProcessCode(long Position, long Size)
        {
            long PagesCount = Size / PageSize;

            if (!Allocator.TryAllocate(Size, out long PA))
            {
                throw new InvalidOperationException();
            }

            lock (Blocks)
            {
                InsertBlock(Position, PagesCount, MemoryState.CodeStatic, MemoryPermission.ReadAndExecute);

                CpuMemory.Map(Position, PA, Size);
            }
        }
示例#3
0
        public void Setup()
        {
            Position = 0x1000;
            Size     = 0x1000;

            EntryPoint = Position;

            ATranslator Translator = new ATranslator();

            RamPointer = Marshal.AllocHGlobal(new IntPtr(Size));
            Memory     = new AMemory(RamPointer);
            Memory.Map(Position, 0, Size);
            Thread = new AThread(Translator, Memory, EntryPoint);

            if (UnicornAvailable)
            {
                UnicornEmu = new UnicornAArch64();
                UnicornEmu.MemoryMap((ulong)Position, (ulong)Size, MemoryPermission.READ | MemoryPermission.EXEC);
                UnicornEmu.PC = (ulong)EntryPoint;
            }
        }