32 bit arm regs (#315)
* aarch and arm regs * fix arm, remove aarch64 * remove aarch64 mod
This commit is contained in:
parent
7930d42948
commit
44d844e1e2
@ -27,6 +27,13 @@ pub enum Amd64Regs {
|
|||||||
Rflags = 17,
|
Rflags = 17,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// alias registers
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
impl Amd64Regs {
|
||||||
|
pub const Sp: Amd64Regs = Amd64Regs::Rsp;
|
||||||
|
pub const Pc: Amd64Regs = Amd64Regs::Rip;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "python")]
|
#[cfg(feature = "python")]
|
||||||
impl IntoPy<PyObject> for Amd64Regs {
|
impl IntoPy<PyObject> for Amd64Regs {
|
||||||
fn into_py(self, py: Python) -> PyObject {
|
fn into_py(self, py: Python) -> PyObject {
|
||||||
|
47
libafl_qemu/src/arm.rs
Normal file
47
libafl_qemu/src/arm.rs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||||
|
use strum_macros::EnumIter;
|
||||||
|
|
||||||
|
#[cfg(feature = "python")]
|
||||||
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
|
/// Registers for the ARM instruction set.
|
||||||
|
#[derive(IntoPrimitive, TryFromPrimitive, Debug, Clone, Copy, EnumIter)]
|
||||||
|
#[repr(i32)]
|
||||||
|
pub enum ArmRegs {
|
||||||
|
R0 = 0,
|
||||||
|
R1 = 1,
|
||||||
|
R2 = 2,
|
||||||
|
R3 = 3,
|
||||||
|
R4 = 4,
|
||||||
|
R5 = 5,
|
||||||
|
R6 = 6,
|
||||||
|
R7 = 7,
|
||||||
|
R8 = 8,
|
||||||
|
R9 = 9,
|
||||||
|
R10 = 10,
|
||||||
|
R11 = 11,
|
||||||
|
R12 = 12,
|
||||||
|
R13 = 13,
|
||||||
|
R14 = 14,
|
||||||
|
R15 = 15,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// alias registers
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
impl ArmRegs {
|
||||||
|
pub const Sp: ArmRegs = ArmRegs::R13;
|
||||||
|
pub const Lr: ArmRegs = ArmRegs::R14;
|
||||||
|
pub const Pc: ArmRegs = ArmRegs::R15;
|
||||||
|
pub const Sb: ArmRegs = ArmRegs::R9;
|
||||||
|
pub const Sl: ArmRegs = ArmRegs::R10;
|
||||||
|
pub const Fp: ArmRegs = ArmRegs::R11;
|
||||||
|
pub const Ip: ArmRegs = ArmRegs::R12;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "python")]
|
||||||
|
impl IntoPy<PyObject> for ArmRegs {
|
||||||
|
fn into_py(self, py: Python) -> PyObject {
|
||||||
|
let n: i32 = self.into();
|
||||||
|
n.into_py(py)
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
pub mod amd64;
|
pub mod amd64;
|
||||||
|
pub mod arm;
|
||||||
pub mod x86;
|
pub mod x86;
|
||||||
|
|
||||||
pub mod elf;
|
pub mod elf;
|
||||||
|
@ -19,6 +19,13 @@ pub enum X86Regs {
|
|||||||
Eflags = 9,
|
Eflags = 9,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// alias registers
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
impl X86Regs {
|
||||||
|
pub const Sp: X86Regs = X86Regs::Esp;
|
||||||
|
pub const Pc: X86Regs = X86Regs::Eip;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "python")]
|
#[cfg(feature = "python")]
|
||||||
impl IntoPy<PyObject> for X86Regs {
|
impl IntoPy<PyObject> for X86Regs {
|
||||||
fn into_py(self, py: Python) -> PyObject {
|
fn into_py(self, py: Python) -> PyObject {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user