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:
parent
b44aa78c49
commit
3289b2a3aa
|
@ -266,8 +266,13 @@ impl FunctionSlices {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StepResult::Illegal => {
|
StepResult::Illegal => {
|
||||||
log::debug!("Illegal instruction @ {:#010X}", ins_addr);
|
if ins.code == 0 {
|
||||||
Ok(ExecCbResult::End(false))
|
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 {
|
StepResult::Jump(target) => match target {
|
||||||
BranchTarget::Unknown
|
BranchTarget::Unknown
|
||||||
|
|
|
@ -348,12 +348,15 @@ impl Tracker {
|
||||||
}
|
}
|
||||||
Ok(ExecCbResult::Continue)
|
Ok(ExecCbResult::Continue)
|
||||||
}
|
}
|
||||||
StepResult::Illegal => bail!(
|
StepResult::Illegal => {
|
||||||
"Illegal instruction hit @ {:#010X} (function {:#010X}-{:#010X})",
|
log::debug!(
|
||||||
ins_addr,
|
"Illegal instruction hit @ {:#010X} (function {:#010X}-{:#010X})",
|
||||||
function_start,
|
ins_addr,
|
||||||
function_end
|
function_start,
|
||||||
),
|
function_end
|
||||||
|
);
|
||||||
|
Ok(ExecCbResult::Continue)
|
||||||
|
}
|
||||||
StepResult::Jump(target) => match target {
|
StepResult::Jump(target) => match target {
|
||||||
BranchTarget::Unknown
|
BranchTarget::Unknown
|
||||||
| BranchTarget::Return
|
| BranchTarget::Return
|
||||||
|
|
Loading…
Reference in New Issue