|
IDA SDK
|
This class manages the offset and size of a value that occupies a number of contiguous bits within some container - generally a byte array.
A special state - empty range (both offset and size are zeroes) - determines the value as all bits of the container.
Public Member Functions | |||||||||
| bitrange_t (uint16 bit_ofs=0, uint16 size_in_bits=0) | |||||||||
| Constructor. | |||||||||
| void | init (uint16 bit_ofs, uint16 size_in_bits) | ||||||||
| Initialize offset and size to given values. | |||||||||
| void | reset () | ||||||||
| Make the bitrange empty. | |||||||||
| bool | empty () const | ||||||||
| Is the bitrange empty? | |||||||||
| uint | bitoff () const | ||||||||
| Get offset of 1st bit. | |||||||||
| uint | bitsize () const | ||||||||
| Get size of the value in bits. | |||||||||
| uint | bytesize () const | ||||||||
| Size of the value in bytes. | |||||||||
| uint64 | mask64 () const | ||||||||
| Convert to mask of 64 bits. | |||||||||
| bool | combine (const bitrange_t &subrange) | ||||||||
| Make the superposition of the current bitrange and given bitrange. | |||||||||
| void | intersect (const bitrange_t &r) | ||||||||
| Intersect two ranges. | |||||||||
| void | create_union (const bitrange_t &r) | ||||||||
| Create union of 2 ranges including the hole between them. | |||||||||
| void | shift_down (uint cnt) | ||||||||
| Shift range down (left) | |||||||||
| void | shift_up (uint cnt) | ||||||||
| Shift range up (right) | |||||||||
| template<class T > | |||||||||
| void | assign_max_nonzero (T mask) | ||||||||
| Initialize bitrange_t with offset/size defined by given mask. | |||||||||
Extract | |||||||||
Extract a value from 'src' according to the bitrange
| |||||||||
| bool | extract (bytevec_t *dst, const void *src, size_t src_size, bool is_mf) const | ||||||||
| bool | extract (void *dst, size_t dst_size, const void *src, size_t src_size, bool is_mf) const | ||||||||
Inject | |||||||||
Inject a value into 'dst' according to the bitrange
| |||||||||
| bool | inject (void *dst, size_t dst_size, const void *src, size_t src_size, bool is_mf) const | ||||||||
| bool | inject (void *dst, size_t dst_size, const bytevec_t &src, bool is_mf) const | ||||||||
1.8.9.1