Ignore invalid instructions

This could be a bad idea, but
it's unclear how to properly
handle these cases.

Resolves #55
This commit is contained in:
Luke Street 2024-06-10 00:40:37 -06:00
parent b44aa78c49
commit 3289b2a3aa
2 changed files with 16 additions and 8 deletions

View File

@ -266,8 +266,13 @@ impl FunctionSlices {
}
}
StepResult::Illegal => {
log::debug!("Illegal instruction @ {:#010X}", ins_addr);
Ok(ExecCbResult::End(false))
if ins.code == 0 {
log::debug!("Hit zeroed padding @ {:#010X}", ins_addr);
Ok(ExecCbResult::End(false))
} else {
log::debug!("Illegal instruction @ {:#010X}", ins_addr);
Ok(ExecCbResult::Continue)
}
}
StepResult::Jump(target) => match target {
BranchTarget::Unknown

View File

@ -348,12 +348,15 @@ impl Tracker {
}
Ok(ExecCbResult::Continue)
}
StepResult::Illegal => bail!(
"Illegal instruction hit @ {:#010X} (function {:#010X}-{:#010X})",
ins_addr,
function_start,
function_end
),
StepResult::Illegal => {
log::debug!(
"Illegal instruction hit @ {:#010X} (function {:#010X}-{:#010X})",
ins_addr,
function_start,
function_end
);
Ok(ExecCbResult::Continue)
}
StepResult::Jump(target) => match target {
BranchTarget::Unknown
| BranchTarget::Return