Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions plugins/workflow_objc/src/activities/remove_memory_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use binaryninja::{
lifting::LowLevelILLabel,
LowLevelILRegisterKind,
},
variable::PossibleValueSet,
workflow::AnalysisContext,
};

Expand All @@ -36,10 +37,12 @@ fn is_call_to_ignorable_memory_management_function<'func>(
) -> bool {
let target = match instr.kind() {
LowLevelILInstructionKind::Call(call) | LowLevelILInstructionKind::TailCall(call) => {
let LowLevelILExpressionKind::ConstPtr(address) = call.target().kind() else {
return false;
};
address.value()
match call.target().possible_values() {
PossibleValueSet::ConstantValue { value }
| PossibleValueSet::ConstantPointerValue { value }
| PossibleValueSet::ImportedAddressValue { value } => value as u64,
_ => return false,
}
}
LowLevelILInstructionKind::Goto(target) => target.address(),
_ => return false,
Expand Down
Loading