Module index

# Module `ida_tryblks`

Architecture independent exception handling info.

Try blocks have the following general properties: * A try block specifies a possibly fragmented guarded code region. * Each try block has always at least one catch/except block description * Each catch block contains its boundaries and a filter. * Additionally a catch block can hold sp adjustment and the offset to the exception object offset (C++). * Try blocks can be nested. Nesting is automatically calculated at the retrieval time. * There may be (nested) multiple try blocks starting at the same address.

See examples in tests/input/src/eh_tests.

## Global variables

`var TBEA_CATCH`

  is EA the start of a c++ catch/cleanup block?

`var TBEA_FALLTHRU`

  is there a fall through into provided ea from an unwind region

`var TBEA_SEHFILT`

  is EA the start of a seh filter?

`var TBEA_SEHLPAD`

  is EA the start of a seh finally/except block?

`var TBEA_SEHTRY`

  is EA within a seh try block

`var TBEA_TRY`

  is EA within a c++ try block?

`var TBERR_EMPTY`

  empty try block

`var TBERR_END`

  bad end address

`var TBERR_INTERSECT`

  range would intersect inner tryblk

`var TBERR_KIND`

  illegal try block kind

`var TBERR_NO_CATCHES`

  no catch blocks at all

`var TBERR_OK`

  ok

`var TBERR_ORDER`

  bad address order

`var TBERR_START`

  bad start address

## Functions

`def add_tryblk(tb: tryblk_t) ‑> int`

  add_tryblk(tb) -> int Add one try block information.

  @param tb: (C++: const tryblk_t &) try block to add. @return: error code; 0 means good

`def del_tryblks(range: range_t)`

  del_tryblks(range) Delete try block information in the specified range.

  @param range: (C++: const range_t &) the range to be cleared

`def find_syseh(ea: ea_t)`

  find_syseh(ea) -> ea_t Find the start address of the system eh region including the argument.

  @param ea: (C++: ea_t) search address @return: start address of surrounding tryblk, otherwise BADADDR

`def get_tryblks(tbv: tryblks_t, range: range_t)`

  get_tryblks(tbv, range) -> size_t Retrieve try block information from the specified address range. Try blocks are sorted by starting address and their nest levels calculated.

  @param tbv: (C++: tryblks_t *) output buffer; may be nullptr @param range: (C++: const range_t &) address range to change @return: number of found try blocks

`def is_ea_tryblks(ea: ea_t, flags: uint32)`

  is_ea_tryblks(ea, flags) -> bool Check if the given address ea is part of tryblks description.

  @param ea: (C++: ea_t) address to check @param flags: (C++: uint32) combination of flags for is_ea_tryblks()

## Classes

`class catch_t`

  Proxy of C++ catch_t class.

  init(self) -> catch_t

  ### Ancestors

  - try_handler_t
  - rangevec_t
  - rangevec_base_t

  ### Instance variables

  `var obj : sval_t`

    obj

  `var type_id : sval_t`

    type_id

  ### Inherited members

  - `try_handler_t`:
    - `add_unique`
    - `at`
    - `begin`
    - `capacity`
    - `clear`
    - `disp`
    - `empty`
    - `end`
    - `erase`
    - `extract`
    - `find`
    - `fpreg`
    - `grow`
    - `has`
    - `inject`
    - `insert`
    - `pop_back`
    - `push_back`
    - `qclear`
    - `reserve`
    - `resize`
    - `size`
    - `swap`
    - `thisown`
    - `truncate`
`class catchvec_t (*args)`

  Proxy of C++ qvector< catch_t > class.

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

  @param x: qvector< catch_t > const &

  ### Instance variables

  `var thisown`

    The membership flag

  ### Methods

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

    add_unique(self, x) -> bool

    @param x: catch_t const &

  `def at(self, _idx: size_t)`

    at(self, _idx) -> catch_t

    @param _idx: size_t

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

    begin(self) -> catch_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) -> catch_t

  `def erase(self, *args)`

    erase(self, it) -> catch_t

    @param it: qvector< catch_t >::iterator

    erase(self, first, last) -> catch_t

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

  `def extract(self)`

    extract(self) -> catch_t

  `def find(self, *args)`

    find(self, x) -> catch_t

    @param x: catch_t const &

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

    grow(self, x=catch_t())

    @param x: catch_t const &

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

    has(self, x) -> bool

    @param x: catch_t const &

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

    inject(self, s, len)

    @param s: catch_t * @param len: size_t

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

    insert(self, it, x) -> catch_t

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

  `def pop_back(self)`

    pop_back(self)

  `def push_back(self, *args)`

    push_back(self, x)

    @param x: catch_t const &

    push_back(self) -> catch_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: catch_t const &

    resize(self, _newsize)

    @param _newsize: size_t

  `def size(self)`

    size(self) -> size_t

  `def swap(self, r: catchvec_t)`

    swap(self, r)

    @param r: qvector< catch_t > &

  `def truncate(self)`

    truncate(self)

`class seh_t`

  Proxy of C++ seh_t class.

  init(self) -> seh_t

  ### Ancestors

  - try_handler_t
  - rangevec_t
  - rangevec_base_t

  ### Instance variables

  `var filter : rangevec_t`

    filter

  `var seh_code : ea_t`

    seh_code

  ### Inherited members

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

  Proxy of C++ try_handler_t class.

  init(self) -> try_handler_t

  ### Ancestors

  - rangevec_t
  - rangevec_base_t

  ### Subclasses

  - catch_t
  - seh_t

  ### Instance variables

  `var disp : sval_t`

    disp

  `var fpreg : int`

    fpreg

  ### Inherited members

  - `rangevec_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`
`class tryblk_t (*args)`

  Proxy of C++ tryblk_t class.

  init(self) -> tryblk_t init(self, r) -> tryblk_t

  @param r: tryblk_t const &

  ### Ancestors

  - rangevec_t
  - rangevec_base_t

  ### Instance variables

  `var level : uchar`

    level

  ### Methods

  `def cpp(self)`

    cpp(self) -> catchvec_t

  `def get_kind(self)`

    get_kind(self) -> uchar

  `def is_cpp(self) ‑> bool`

    is_cpp(self) -> bool

  `def is_seh(self) ‑> bool`

    is_seh(self) -> bool

  `def seh(self)`

    seh(self) -> seh_t

  `def set_cpp(self)`

    set_cpp(self) -> catchvec_t

  `def set_seh(self)`

    set_seh(self) -> seh_t

  ### Inherited members

  - `rangevec_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`
`class tryblks_t (*args)`

  Proxy of C++ qvector< tryblk_t > class.

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

  @param x: qvector< tryblk_t > const &

  ### Instance variables

  `var thisown`

    The membership flag

  ### Methods

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

    add_unique(self, x) -> bool

    @param x: tryblk_t const &

  `def at(self, _idx: size_t)`

    at(self, _idx) -> tryblk_t

    @param _idx: size_t

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

    begin(self) -> tryblk_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) -> tryblk_t

  `def erase(self, *args)`

    erase(self, it) -> tryblk_t

    @param it: qvector< tryblk_t >::iterator

    erase(self, first, last) -> tryblk_t

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

  `def extract(self)`

    extract(self) -> tryblk_t

  `def find(self, *args)`

    find(self, x) -> tryblk_t

    @param x: tryblk_t const &

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

    grow(self, x=tryblk_t())

    @param x: tryblk_t const &

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

    has(self, x) -> bool

    @param x: tryblk_t const &

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

    inject(self, s, len)

    @param s: tryblk_t * @param len: size_t

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

    insert(self, it, x) -> tryblk_t

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

  `def pop_back(self)`

    pop_back(self)

  `def push_back(self, *args)`

    push_back(self, x)

    @param x: tryblk_t const &

    push_back(self) -> tryblk_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: tryblk_t const &

    resize(self, _newsize)

    @param _newsize: size_t

  `def size(self)`

    size(self) -> size_t

  `def swap(self, r: tryblks_t)`

    swap(self, r)

    @param r: qvector< tryblk_t > &

  `def truncate(self)`

    truncate(self)