MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / value

Method value

rust/src/low_level_il/operation.rs:1045–1073  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1043 }
1044
1045 pub fn value(&self) -> u64 {
1046 #[cfg(debug_assertions)]
1047 {
1048 let raw = self.op.operands[0] as i64;
1049
1050 let is_safe = match raw.overflowing_shr(self.op.size as u32 * 8) {
1051 (_, true) => true,
1052 (res, false) => [-1, 0].contains(&res),
1053 };
1054
1055 if !is_safe {
1056 log::error!(
1057 "il expr @ {:x} contains constant 0x{:x} as {} byte value (doesn't fit!)",
1058 self.op.address,
1059 self.op.operands[0],
1060 self.op.size
1061 );
1062 }
1063 }
1064
1065 let mut mask = -1i64 as u64;
1066
1067 if self.op.size < mem::size_of::<u64>() {
1068 mask <<= self.op.size * 8;
1069 mask = !mask;
1070 }
1071
1072 self.op.operands[0] & mask
1073 }
1074}
1075
1076impl<A, M, F> Debug for Operation<'_, A, M, F, Const>

Callers 1

fmtMethod · 0.45

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected