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.
Attributes
ok |
|
bad start address |
|
bad end address |
|
bad address order |
|
empty try block |
|
illegal try block kind |
|
no catch blocks at all |
|
range would intersect inner tryblk |
|
is EA within a c++ try block? |
|
is EA the start of a c++ catch/cleanup block? |
|
is EA within a seh try block |
|
is EA the start of a seh finally/except block? |
|
is EA the start of a seh filter? |
|
is there a fall through into provided ea from an unwind region |
Classes
Functions
|
------------------------------------------------------------------------- Retrieve try block information from the specified address range. Try blocks are sorted by starting address and their nest levels calculated. |
|
Delete try block information in the specified range. |
|
Add one try block information. |
|
Find the start address of the system eh region including the argument. |
|
Check if the given address ea is part of tryblks description. |
Module Contents
- ida_tryblks.SWIG_PYTHON_LEGACY_BOOL
- class ida_tryblks.tryblks_t(*args)
Bases:
object
- thisown
- push_back(*args) tryblk_t &
- pop_back() None
- size() size_t
- empty() bool
- at(_idx: size_t) tryblk_t const &
- qclear() None
- clear() None
- resize(*args) None
- grow(*args) None
- capacity() size_t
- reserve(cnt: size_t) None
- truncate() None
- extract() tryblk_t *
- begin(*args) qvector< tryblk_t >::const_iterator
- end(*args) qvector< tryblk_t >::const_iterator
- erase(*args) qvector< tryblk_t >::iterator
- find(*args) qvector< tryblk_t >::const_iterator
- front
- back
- class ida_tryblks.catchvec_t(*args)
Bases:
object
- thisown
- push_back(*args) catch_t &
- pop_back() None
- size() size_t
- empty() bool
- at(_idx: size_t) catch_t const &
- qclear() None
- clear() None
- resize(*args) None
- grow(*args) None
- capacity() size_t
- reserve(cnt: size_t) None
- truncate() None
- swap(r: catchvec_t) None
- extract() catch_t *
- begin(*args) qvector< catch_t >::const_iterator
- end(*args) qvector< catch_t >::const_iterator
- erase(*args) qvector< catch_t >::iterator
- find(*args) qvector< catch_t >::const_iterator
- extend(x: catchvec_t) None
- front
- back
- class ida_tryblks.try_handler_t
Bases:
ida_range.rangevec_t
- thisown
- disp: int
- fpreg: int
- clear() None
- class ida_tryblks.seh_t
Bases:
try_handler_t
- thisown
- filter: rangevec_t
- seh_code: ida_idaapi.ea_t
- clear() None
- class ida_tryblks.catch_t
Bases:
try_handler_t
- thisown
- obj: int
- type_id: int
- class ida_tryblks.tryblk_t(*args)
Bases:
ida_range.rangevec_t
- thisown
- level: uchar
- cpp() catchvec_t &
- seh() seh_t &
- get_kind() uchar
- empty() bool
- is_seh() bool
- is_cpp() bool
- clear() None
- set_seh() seh_t &
- set_cpp() catchvec_t &
- ida_tryblks.get_tryblks(tbv: tryblks_t, range: range_t) size_t
————————————————————————- Retrieve try block information from the specified address range. Try blocks are sorted by starting address and their nest levels calculated.
- Parameters:
tbv – output buffer; may be nullptr
range – address range to change
- Returns:
number of found try blocks
- ida_tryblks.del_tryblks(range: range_t) None
Delete try block information in the specified range.
- Parameters:
range – the range to be cleared
- ida_tryblks.add_tryblk(tb: tryblk_t) int
Add one try block information.
- Parameters:
tb – try block to add.
- Returns:
error code; 0 means good
- ida_tryblks.TBERR_OK
ok
- ida_tryblks.TBERR_START
bad start address
- ida_tryblks.TBERR_END
bad end address
- ida_tryblks.TBERR_ORDER
bad address order
- ida_tryblks.TBERR_EMPTY
empty try block
- ida_tryblks.TBERR_KIND
illegal try block kind
- ida_tryblks.TBERR_NO_CATCHES
no catch blocks at all
- ida_tryblks.TBERR_INTERSECT
range would intersect inner tryblk
- ida_tryblks.find_syseh(ea: ida_idaapi.ea_t) ida_idaapi.ea_t
Find the start address of the system eh region including the argument.
- Parameters:
ea – search address
- Returns:
start address of surrounding tryblk, otherwise BADADDR
- ida_tryblks.TBEA_TRY
is EA within a c++ try block?
- ida_tryblks.TBEA_CATCH
is EA the start of a c++ catch/cleanup block?
- ida_tryblks.TBEA_SEHTRY
is EA within a seh try block
- ida_tryblks.TBEA_SEHLPAD
is EA the start of a seh finally/except block?
- ida_tryblks.TBEA_SEHFILT
is EA the start of a seh filter?
- ida_tryblks.TBEA_ANY
- ida_tryblks.TBEA_FALLTHRU
is there a fall through into provided ea from an unwind region
- ida_tryblks.is_ea_tryblks(ea: ida_idaapi.ea_t, flags: int) bool
Check if the given address ea is part of tryblks description.
- Parameters:
ea – address to check
flags – combination of flags for is_ea_tryblks()