diff --git a/src/main.rs b/src/main.rs index 5139c95..78ec7b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,11 +16,11 @@ fn main() { ).expect("failed to initialize Unicorn instance"); let emu = &mut unicorn; - // Map 2 MB memory at the above address for Arm64 Machine Code + // Map executable memory at the above address for Arm64 Machine Code emu.mem_map( - ADDRESS, // Address - 2 * 1024 * 1024, // Size - Permission::ALL // Read, Write and Execute Access + ADDRESS, // Address + arm64_code.len(), // Size + Permission::ALL // Read, Write and Execute Access ).expect("failed to map code page"); // Map 16 MB at 0x01000000 for Memory-Mapped I/O by Allwinner A64 Peripherals