Module index

# Module `ida_range`

Contains the definition of range_t.

A range is a non-empty continuous range of addresses (specified by its start and end addresses, the end address is excluded from the range).

Ranges are stored in the Btree part of the IDA database. To learn more about Btrees (Balanced Trees): \link{http://www.bluerwhite.org/btree/}

## Global variables

`var RANGE_KIND_FUNC`

  func_t

`var RANGE_KIND_HIDDEN_RANGE`

  hidden_range_t

`var RANGE_KIND_SEGMENT`

  segment_t

## Functions

`def range_t_print(cb: range_t)`

  range_t_print(cb) -> str Helper function. Should not be called directly!

  @param cb: range_t const *

## Classes

`class array_of_rangesets (*args)`

  Proxy of C++ qvector< rangeset_t > class.

  init(self) -> array_of_rangesets init(self, x) -> array_of_rangesets

  @param x: qvector< rangeset_t > const &

  ### Instance variables

  `var thisown`

    The membership flag

  ### Methods

  `def add_unique(self, x: rangeset_t) ‑> bool`

    add_unique(self, x) -> bool

    @param x: rangeset_t const &

  `def at(self, _idx: size_t)`

    at(self, _idx) -> rangeset_t

    @param _idx: size_t

  `def back(self)`
  `def begin(self, *args)`

    begin(self) -> rangeset_t

  `def capacity(self)`

    capacity(self) -> size_t

  `def clear(self)`

    clear(self)

  `def empty(self) ‑> bool`

    empty(self) -> bool

  `def end(self, *args)`

    end(self) -> rangeset_t

  `def erase(self, *args)`

    erase(self, it) -> rangeset_t

    @param it: qvector< rangeset_t >::iterator

    erase(self, first, last) -> rangeset_t

    @param first: qvector< rangeset_t >::iterator @param last: qvector< rangeset_t >::iterator

  `def extract(self)`

    extract(self) -> rangeset_t

  `def find(self, *args)`

    find(self, x) -> rangeset_t

    @param x: rangeset_t const &

  `def front(self)`
  `def grow(self, *args)`

    grow(self, x=rangeset_t())

    @param x: rangeset_t const &

  `def has(self, x: rangeset_t) ‑> bool`

    has(self, x) -> bool

    @param x: rangeset_t const &

  `def inject(self, s: rangeset_t, len: size_t)`

    inject(self, s, len)

    @param s: rangeset_t * @param len: size_t

  `def insert(self, it: rangeset_t, x: rangeset_t)`

    insert(self, it, x) -> rangeset_t

    @param it: qvector< rangeset_t >::iterator @param x: rangeset_t const &

  `def pop_back(self)`

    pop_back(self)

  `def push_back(self, *args)`

    push_back(self, x)

    @param x: rangeset_t const &

    push_back(self) -> rangeset_t

  `def qclear(self)`

    qclear(self)

  `def reserve(self, cnt: size_t)`

    reserve(self, cnt)

    @param cnt: size_t

  `def resize(self, *args)`

    resize(self, _newsize, x)

    @param _newsize: size_t @param x: rangeset_t const &

    resize(self, _newsize)

    @param _newsize: size_t

  `def size(self)`

    size(self) -> size_t

  `def swap(self, r: array_of_rangesets)`

    swap(self, r)

    @param r: qvector< rangeset_t > &

  `def truncate(self)`

    truncate(self)

`class range_t (ea1: ea_t = 0, ea2: ea_t = 0)`

  Proxy of C++ range_t class.

  init(self, ea1=0, ea2=0) -> range_t

  @param ea1: ea_t @param ea2: ea_t

  ### Subclasses

  - hidden_range_t
  - regvar_t
  - func_t
  - qbasic_block_t
  - memory_info_t
  - scattered_segm_t
  - segment_t
  - sreg_range_t

  ### Instance variables

  `var end_ea : ea_t`

    end_ea excluded

  `var start_ea : ea_t`

    start_ea included

  `var thisown`

    The membership flag

  ### Methods

  `def clear(self)`

    clear(self) Set start_ea, end_ea to 0.

  `def compare(self, r: range_t) ‑> int`

    compare(self, r) -> int

    @param r: range_t const &

  `def contains(self, *args) ‑> bool`

    contains(self, ea) -> bool Is every ea in 'r' also in this range_t?

    @param ea: ea_t

    contains(self, r) -> bool

    @param r: range_t const &

  `def empty(self) ‑> bool`

    empty(self) -> bool Is the size of the range_t <= 0?

  `def extend(self, ea: ea_t)`

    extend(self, ea) Ensure that the range_t includes 'ea'.

    @param ea: (C++: ea_t)

  `def intersect(self, r: range_t)`

    intersect(self, r) Assign the range_t to the intersection between the range_t and 'r'.

    @param r: (C++: const range_t &) range_t const &

  `def overlaps(self, r: range_t) ‑> bool`

    overlaps(self, r) -> bool Is there an ea in 'r' that is also in this range_t?

    @param r: (C++: const range_t &) range_t const &

  `def size(self)`

    size(self) -> asize_t Get end_ea - start_ea.

`class rangeset_t (*args)`

  Proxy of C++ rangeset_t class.

  init(self) -> rangeset_t init(self, range) -> rangeset_t

  @param range: range_t const &

  init(self, ivs) -> rangeset_t

  @param ivs: rangeset_t const &

  ### Instance variables

  `var thisown`

    The membership flag

  ### Methods

  `def add(self, *args) ‑> bool`

    add(self, range) -> bool Add each element of 'aset' to the set.

    @param range: range_t const &

    @return: false if no elements were added (the set was unchanged) add(self, start, _end) -> bool

    @param start: ea_t @param _end: ea_t

    add(self, aset) -> bool

    @param aset: rangeset_t const &

  `def begin(self, *args)`

    begin(self) -> range_t Get an iterator that points to the first element in the set.

  `def cached_range(self)`

    cached_range(self) -> range_t When searching the rangeset, we keep a cached element to help speed up searches.

    @return: a pointer to the cached element

  `def clear(self)`

    clear(self) Delete all elements from the set. See qvector::clear()

  `def contains(self, *args) ‑> bool`

    contains(self, ea) -> bool Is every element in 'aset' contained in an element of this rangeset?. See range_t::contains(range_t)

    @param ea: ea_t

    contains(self, aset) -> bool

    @param aset: rangeset_t const &

  `def empty(self) ‑> bool`

    empty(self) -> bool Does the set have zero elements.

  `def end(self, *args)`

    end(self) -> range_t Get an iterator that points to the end of the set. (This is NOT the last element)

  `def find_range(self, ea: ea_t)`

    find_range(self, ea) -> range_t Get the element from the set that contains 'ea'.

    @param ea: (C++: ea_t) @return: nullptr if there is no such element

  `def getrange(self, idx: int)`

    getrange(self, idx) -> range_t Get the range_t at index 'idx'.

    @param idx: (C++: int)

  `def has_common(self, *args) ‑> bool`

    has_common(self, range) -> bool Does any element of 'aset' overlap with an element in this rangeset?. See range_t::overlaps()

    @param range: range_t const &

    has_common(self, aset) -> bool

    @param aset: rangeset_t const &

  `def includes(self, range: range_t) ‑> bool`

    includes(self, range) -> bool Is every ea in 'range' contained in the rangeset?

    @param range: (C++: const range_t &) range_t const &

  `def intersect(self, aset: rangeset_t) ‑> bool`

    intersect(self, aset) -> bool Set the rangeset to its intersection with 'aset'.

    @param aset: (C++: const rangeset_t &) rangeset_t const & @return: false if the set was unchanged

  `def is_equal(self, aset: rangeset_t) ‑> bool`

    is_equal(self, aset) -> bool Do this rangeset and 'aset' have identical elements?

    @param aset: (C++: const rangeset_t &) rangeset_t const &

  `def is_subset_of(self, aset: rangeset_t) ‑> bool`

    is_subset_of(self, aset) -> bool Is every element in the rangeset contained in an element of 'aset'?

    @param aset: (C++: const rangeset_t &) rangeset_t const &

  `def lastrange(self)`

    lastrange(self) -> range_t Get the last range_t in the set.

  `def next_addr(self, ea: ea_t)`

    next_addr(self, ea) -> ea_t Get the smallest ea_t value greater than 'ea' contained in the rangeset.

    @param ea: (C++: ea_t)

  `def next_range(self, ea: ea_t)`

    next_range(self, ea) -> ea_t Get the smallest ea_t value greater than 'ea' that is not in the same range as 'ea'.

    @param ea: (C++: ea_t)

  `def nranges(self)`

    nranges(self) -> size_t Get the number of range_t elements in the set.

  `def prev_addr(self, ea: ea_t)`

    prev_addr(self, ea) -> ea_t Get the largest ea_t value less than 'ea' contained in the rangeset.

    @param ea: (C++: ea_t)

  `def prev_range(self, ea: ea_t)`

    prev_range(self, ea) -> ea_t Get the largest ea_t value less than 'ea' that is not in the same range as 'ea'.

    @param ea: (C++: ea_t)

  `def sub(self, *args) ‑> bool`

    sub(self, range) -> bool Subtract each range in 'aset' from the set

    @param range: range_t const &

    @return: false if nothing was subtracted (the set was unchanged) sub(self, ea) -> bool

    @param ea: ea_t

    sub(self, aset) -> bool

    @param aset: rangeset_t const &

  `def swap(self, r: rangeset_t)`

    swap(self, r) Set this = 'r' and 'r' = this. See qvector::swap()

    @param r: (C++: rangeset_t &)

`class rangevec_base_t (*args)`

  Proxy of C++ qvector< range_t > class.

  init(self) -> rangevec_base_t init(self, x) -> rangevec_base_t

  @param x: qvector< range_t > const &

  ### Subclasses

  - rangevec_t

  ### Instance variables

  `var thisown`

    The membership flag

  ### Methods

  `def add_unique(self, x: range_t) ‑> bool`

    add_unique(self, x) -> bool

    @param x: range_t const &

  `def at(self, _idx: size_t)`

    at(self, _idx) -> range_t

    @param _idx: size_t

  `def back(self)`
  `def begin(self, *args)`

    begin(self) -> range_t

  `def capacity(self)`

    capacity(self) -> size_t

  `def clear(self)`

    clear(self)

  `def empty(self) ‑> bool`

    empty(self) -> bool

  `def end(self, *args)`

    end(self) -> range_t

  `def erase(self, *args)`

    erase(self, it) -> range_t

    @param it: qvector< range_t >::iterator

    erase(self, first, last) -> range_t

    @param first: qvector< range_t >::iterator @param last: qvector< range_t >::iterator

  `def extract(self)`

    extract(self) -> range_t

  `def find(self, *args)`

    find(self, x) -> range_t

    @param x: range_t const &

  `def front(self)`
  `def grow(self, *args)`

    grow(self, x=range_t())

    @param x: range_t const &

  `def has(self, x: range_t) ‑> bool`

    has(self, x) -> bool

    @param x: range_t const &

  `def inject(self, s: range_t, len: size_t)`

    inject(self, s, len)

    @param s: range_t * @param len: size_t

  `def insert(self, it: range_t, x: range_t)`

    insert(self, it, x) -> range_t

    @param it: qvector< range_t >::iterator @param x: range_t const &

  `def pop_back(self)`

    pop_back(self)

  `def push_back(self, *args)`

    push_back(self, x)

    @param x: range_t const &

    push_back(self) -> range_t

  `def qclear(self)`

    qclear(self)

  `def reserve(self, cnt: size_t)`

    reserve(self, cnt)

    @param cnt: size_t

  `def resize(self, *args)`

    resize(self, _newsize, x)

    @param _newsize: size_t @param x: range_t const &

    resize(self, _newsize)

    @param _newsize: size_t

  `def size(self)`

    size(self) -> size_t

  `def swap(self, r: rangevec_base_t)`

    swap(self, r)

    @param r: qvector< range_t > &

  `def truncate(self)`

    truncate(self)

`class rangevec_t`

  Proxy of C++ rangevec_t class.

  init(self) -> rangevec_t

  ### Ancestors

  - rangevec_base_t

  ### Subclasses

  - try_handler_t
  - tryblk_t

  ### Inherited members

  - `rangevec_base_t`:
    - `add_unique`
    - `at`
    - `begin`
    - `capacity`
    - `clear`
    - `empty`
    - `end`
    - `erase`
    - `extract`
    - `find`
    - `grow`
    - `has`
    - `inject`
    - `insert`
    - `pop_back`
    - `push_back`
    - `qclear`
    - `reserve`
    - `resize`
    - `size`
    - `swap`
    - `thisown`
    - `truncate`