Skip to content

Commit

Permalink
fix CI; impls. for should_lift for x86
Browse files Browse the repository at this point in the history
  • Loading branch information
xorpse committed May 14, 2024
1 parent 1704683 commit 009eacc
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
59 changes: 55 additions & 4 deletions fugue-high/src/arch/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,65 @@ pub trait X86Arch: Arch {
}

impl X86Arch for x86_32 {
fn should_lift(_insn: &Self::Instruction) -> bool {
true
fn should_lift(insn: &Self::Instruction) -> bool {
use yaxpeax_x86::protected_mode::Opcode;

return match insn.opcode() {
Opcode::JO |
Opcode::JB |
Opcode::JZ |
Opcode::JA |
Opcode::JS |
Opcode::JP |
Opcode::JL |
Opcode::JG |
Opcode::JMP |
Opcode::JNO |
Opcode::JNB |
Opcode::JNZ |
Opcode::JNA |
Opcode::JNS |
Opcode::JNP |
Opcode::JGE |
Opcode::JLE |
Opcode::JMPF |
Opcode::JMPE |
Opcode::JECXZ => true,
Opcode::CALL | Opcode::CALLF => true,
Opcode::RETF | Opcode::RETURN => true,
_ => false,
}
}
}

impl X86Arch for x86_64 {
fn should_lift(_insn: &Self::Instruction) -> bool {
true
fn should_lift(insn: &Self::Instruction) -> bool {
use yaxpeax_x86::amd64::Opcode;

return match insn.opcode() {
Opcode::JO |
Opcode::JB |
Opcode::JZ |
Opcode::JA |
Opcode::JS |
Opcode::JP |
Opcode::JL |
Opcode::JG |
Opcode::JMP |
Opcode::JNO |
Opcode::JNB |
Opcode::JNZ |
Opcode::JNA |
Opcode::JNS |
Opcode::JNP |
Opcode::JGE |
Opcode::JLE |
Opcode::JMPF |
Opcode::JMPE => true,
Opcode::CALL | Opcode::CALLF => true,
Opcode::RETF | Opcode::RETURN => true,
_ => false,
}
}
}

Expand Down
1 change: 1 addition & 0 deletions fugue-high/src/eval/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ mod test {
use super::*;

#[test]
#[ignore]
fn test_single_step() -> anyhow::Result<()> {
let lbuilder = LanguageBuilder::new("data")?;
let language = lbuilder.build("ARM:LE:32:v7", "default")?;
Expand Down
1 change: 1 addition & 0 deletions fugue-high/src/loader/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ mod test {
use crate::util::BytesOrMapping;

#[test]
#[ignore]
fn test_elf() -> Result<(), Box<dyn std::error::Error>> {
let lb = LanguageBuilder::new("data/processors")?;
let elf = Object::new(BytesOrMapping::from_file("tests/ls.elf")?)?;
Expand Down

0 comments on commit 009eacc

Please sign in to comment.