diff options
| author | Mason Reed <mason@vector35.com> | 2024-10-30 14:31:52 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-10-30 15:40:40 -0400 |
| commit | 2618b22222f8405e68e20a41d47050b0bb86318d (patch) | |
| tree | 95e827b136d0b343f13d08ec0cbf95da9a516d67 /plugins | |
| parent | e224042bd3b903450113204b80ce4c4bded92f21 (diff) | |
WARP: Fix non relocatable constant pointers being masked
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/warp/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs index c54b80ae..866f7e31 100644 --- a/plugins/warp/src/lib.rs +++ b/plugins/warp/src/lib.rs @@ -110,10 +110,14 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant if let Some(instr_info) = arch.instruction_info(&instr_bytes, instr_addr) { instr_bytes.truncate(instr_info.len()); if let Some(instr_llil) = llil.instruction_at(instr_addr) { - // If instruction is blacklisted dont include the bytes. + // If instruction is blacklisted don't include the bytes. if !is_blacklisted_instr(instr_llil.info()) { if instr_llil.visit_tree(&mut |_expr, expr_info| match expr_info { - ExprInfo::ConstPtr(_) | ExprInfo::ExternPtr(_) => VisitorAction::Halt, + ExprInfo::ConstPtr(op) if view.segment_at(op.value()).is_some() => { + // Constant Pointer must be in a segment for it to be relocatable. + VisitorAction::Halt + }, + ExprInfo::ExternPtr(_) => VisitorAction::Halt, _ => VisitorAction::Descend, }) == VisitorAction::Halt { |
