Module ida_tryblks

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

TBEA_ANY

TBEA_ANY = 31

TBEA_CATCH

TBEA_CATCH = 2

TBEA_FALLTHRU

TBEA_FALLTHRU = 32

TBEA_SEHFILT

TBEA_SEHFILT = 16

TBEA_SEHLPAD

TBEA_SEHLPAD = 8

TBEA_SEHTRY

TBEA_SEHTRY = 4

TBEA_TRY

TBEA_TRY = 1

TBERR_EMPTY

TBERR_EMPTY = 4

TBERR_END

TBERR_END = 2

TBERR_INTERSECT

TBERR_INTERSECT = 7

TBERR_KIND

TBERR_KIND = 5

TBERR_NO_CATCHES

TBERR_NO_CATCHES = 6

TBERR_OK

TBERR_OK = 0

TBERR_ORDER

TBERR_ORDER = 3

TBERR_START

TBERR_START = 1

Functions

add_tryblk(tb: tryblk_t) ‑> int

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

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

del_tryblks(range: range_t) ‑> void

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

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

find_syseh(ea: ea_t) ‑> ea_t

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

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

get_tryblks(tbv: tryblks_t, range: range_t) ‑> size_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.

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

is_ea_tryblks(ea: ea_t, flags: uint32) ‑> bool

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

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

Classes

catch_t()

: Proxy of C++ catch_t class.

__init__(self) -> catch_t

Ancestors (in MRO)

* ida_tryblks.try_handler_t
* ida_range.rangevec_t
* ida_range.rangevec_base_t

Instance variables

  • obj: sval_t obj


  • type_id: sval_t type_id


catchvec_t(*args)

: Proxy of C++ qvector< catch_t > class.

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

 x: qvector< catch_t > const &

Methods

  • add_unique(self, x: catch_t) ‑> bool add_unique(self, x) -> bool

    x: catch_t const &


  • at(self, _idx: size_t) ‑> catch_t const & at(self, _idx) -> catch_t

    _idx: size_t


  • back(self)


  • begin(self, *args) ‑> qvector< catch_t >::const_iterator begin(self) -> catch_t


  • capacity(self) ‑> size_t capacity(self) -> size_t


  • clear(self) ‑> void clear(self)


  • empty(self) ‑> bool empty(self) -> bool


  • end(self, *args) ‑> qvector< catch_t >::const_iterator end(self) -> catch_t


  • erase(self, *args) ‑> qvector< catch_t >::iterator erase(self, it) -> catch_t

    it: qvector< catch_t >::iterator

    erase(self, first, last) -> catch_t

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


  • extract(self) ‑> catch_t * extract(self) -> catch_t


  • find(self, *args) ‑> qvector< catch_t >::const_iterator find(self, x) -> catch_t

    x: catch_t const &


  • front(self)


  • grow(self, *args) ‑> void grow(self, x=catch_t())

    x: catch_t const &


  • has(self, x: catch_t) ‑> bool has(self, x) -> bool

    x: catch_t const &


  • inject(self, s: catch_t, len: size_t) ‑> void inject(self, s, len)

    s: catch_t * len: size_t


  • insert(self, it: catch_t, x: catch_t) ‑> qvector< catch_t >::iterator insert(self, it, x) -> catch_t

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


  • pop_back(self) ‑> void pop_back(self)


  • push_back(self, *args) ‑> catch_t & push_back(self, x)

    x: catch_t const &

    push_back(self) -> catch_t


  • qclear(self) ‑> void qclear(self)


  • reserve(self, cnt: size_t) ‑> void reserve(self, cnt)

    cnt: size_t


  • resize(self, *args) ‑> void resize(self, _newsize, x)

    _newsize: size_t x: catch_t const &

    resize(self, _newsize)

    _newsize: size_t


  • size(self) ‑> size_t size(self) -> size_t


  • swap(self, r: catchvec_t) ‑> void swap(self, r)

    r: qvector< catch_t > &


  • truncate(self) ‑> void truncate(self)


seh_t()

: Proxy of C++ seh_t class.

__init__(self) -> seh_t

Ancestors (in MRO)

* ida_tryblks.try_handler_t
* ida_range.rangevec_t
* ida_range.rangevec_base_t

Instance variables

  • filter: rangevec_t filter


  • seh_code: ea_t seh_code


try_handler_t()

: Proxy of C++ try_handler_t class.

__init__(self) -> try_handler_t

Ancestors (in MRO)

* ida_range.rangevec_t
* ida_range.rangevec_base_t

Descendants

* ida_tryblks.catch_t
* ida_tryblks.seh_t

Instance variables

  • disp: sval_t disp


  • fpreg: int fpreg


tryblk_t(*args)

: Proxy of C++ tryblk_t class.

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

 r: tryblk_t const &

Ancestors (in MRO)

* ida_range.rangevec_t
* ida_range.rangevec_base_t

Instance variables

  • level: uchar level


Methods

  • cpp(self) ‑> catchvec_t & cpp(self) -> catchvec_t


  • get_kind(self) ‑> uchar get_kind(self) -> uchar


  • is_cpp(self) ‑> bool is_cpp(self) -> bool


  • is_seh(self) ‑> bool is_seh(self) -> bool


  • seh(self) ‑> seh_t & seh(self) -> seh_t


  • set_cpp(self) ‑> catchvec_t & set_cpp(self) -> catchvec_t


  • set_seh(self) ‑> seh_t & set_seh(self) -> seh_t


tryblks_t(*args)

: Proxy of C++ qvector< tryblk_t > class.

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

 x: qvector< tryblk_t > const &

Methods

  • add_unique(self, x: tryblk_t) ‑> bool add_unique(self, x) -> bool

    x: tryblk_t const &


  • at(self, _idx: size_t) ‑> tryblk_t const & at(self, _idx) -> tryblk_t

    _idx: size_t


  • back(self)


  • begin(self, *args) ‑> qvector< tryblk_t >::const_iterator begin(self) -> tryblk_t


  • capacity(self) ‑> size_t capacity(self) -> size_t


  • clear(self) ‑> void clear(self)


  • empty(self) ‑> bool empty(self) -> bool


  • end(self, *args) ‑> qvector< tryblk_t >::const_iterator end(self) -> tryblk_t


  • erase(self, *args) ‑> qvector< tryblk_t >::iterator erase(self, it) -> tryblk_t

    it: qvector< tryblk_t >::iterator

    erase(self, first, last) -> tryblk_t

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


  • extract(self) ‑> tryblk_t * extract(self) -> tryblk_t


  • find(self, *args) ‑> qvector< tryblk_t >::const_iterator find(self, x) -> tryblk_t

    x: tryblk_t const &


  • front(self)


  • grow(self, *args) ‑> void grow(self, x=tryblk_t())

    x: tryblk_t const &


  • has(self, x: tryblk_t) ‑> bool has(self, x) -> bool

    x: tryblk_t const &


  • inject(self, s: tryblk_t, len: size_t) ‑> void inject(self, s, len)

    s: tryblk_t * len: size_t


  • insert(self, it: tryblk_t, x: tryblk_t) ‑> qvector< tryblk_t >::iterator insert(self, it, x) -> tryblk_t

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


  • pop_back(self) ‑> void pop_back(self)


  • push_back(self, *args) ‑> tryblk_t & push_back(self, x)

    x: tryblk_t const &

    push_back(self) -> tryblk_t


  • qclear(self) ‑> void qclear(self)


  • reserve(self, cnt: size_t) ‑> void reserve(self, cnt)

    cnt: size_t


  • resize(self, *args) ‑> void resize(self, _newsize, x)

    _newsize: size_t x: tryblk_t const &

    resize(self, _newsize)

    _newsize: size_t


  • size(self) ‑> size_t size(self) -> size_t


  • swap(self, r: tryblks_t) ‑> void swap(self, r)

    r: qvector< tryblk_t > &


  • truncate(self) ‑> void truncate(self)


Last updated