Module ida_bitrange
Definition of the bitrange_t class.
Classes
class bitrange_t (bit_ofs: uint16 = 0, size_in_bits: uint16 = 0)-
Proxy of C++ bitrange_t class.
init(self, bit_ofs=0, size_in_bits=0) -> bitrange_t
@param bit_ofs: uint16 @param size_in_bits: uint16
Instance variables
var thisown-
The membership flag
Methods
def apply_mask(self, subrange: bitrange_t) ‑> bool-
apply_mask(self, subrange) -> bool Apply mask to a bitrange
@param subrange: (C++: const bitrange_t &) range inside the main bitrange to keep After this operation the main bitrange will be truncated to have only the bits that are specified by subrange. Example: [off=8,nbits=4], subrange[off=1,nbits=2] => [off=9,nbits=2] @return: success
def bitoff(self)-
bitoff(self) -> uint Get offset of 1st bit.
def bitsize(self)-
bitsize(self) -> uint Get size of the value in bits.
def bytesize(self)-
bytesize(self) -> uint Size of the value in bytes.
def compare(self, r: bitrange_t) ‑> int-
compare(self, r) -> int
@param r: bitrange_t const &
def create_union(self, r: bitrange_t)-
create_union(self, r) Create union of 2 ranges including the hole between them.
@param r: (C++: const bitrange_t &) bitrange_t const &
def empty(self) ‑> bool-
empty(self) -> bool Is the bitrange empty?
def extract(self, src: void const *, is_mf: bool)-
extract(self, src, is_mf) -> bool
@param src: void const * @param is_mf: bool
def has_common(self, r: bitrange_t) ‑> bool-
has_common(self, r) -> bool Does have common bits with another bitrange?
@param r: (C++: const bitrange_t &) bitrange_t const &
def init(self, bit_ofs: uint16, size_in_bits: uint16)-
init(self, bit_ofs, size_in_bits) Initialize offset and size to given values.
@param bit_ofs: (C++: uint16) @param size_in_bits: (C++: uint16)
def inject(self, dst: void *, src: bytevec_t const &, is_mf: bool)-
inject(self, dst, src, is_mf) -> bool
@param dst: void * @param src: bytevec_t const & @param is_mf: bool
def intersect(self, r: bitrange_t)-
intersect(self, r) Intersect two ranges.
@param r: (C++: const bitrange_t &) bitrange_t const &
def mask64(self)-
mask64(self) -> uint64 Convert to mask of 64 bits.
def reset(self)-
reset(self) Make the bitrange empty.
def shift_down(self, cnt: uint)-
shift_down(self, cnt) Shift range down (left)
@param cnt: (C++: uint)
def shift_up(self, cnt: uint)-
shift_up(self, cnt) Shift range up (right)
@param cnt: (C++: uint)
def sub(self, r: bitrange_t) ‑> bool-
sub(self, r) -> bool Subtract a bitrange.
@param r: (C++: const bitrange_t &) bitrange_t const &