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); }
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); } }
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; } }