diff --git a/api_contents2.txt b/api_contents2.txt index 2e6adb6..9b00e35 100644 --- a/api_contents2.txt +++ b/api_contents2.txt @@ -2844,10 +2844,6 @@ 'delete_optblock_t', 'delete_optinsn_t', 'delete_pattern_id_t', - 'delete_pkt_clean_db_t', - 'delete_pkt_debugctl_t', - 'delete_pkt_dump_md_result_t', - 'delete_pkt_dump_md_t', 'delete_pkt_get_pop_result_t', 'delete_pkt_get_pop_t', 'delete_pkt_helo_t', @@ -8177,10 +8173,6 @@ 'new_optinsn_t', 'new_packet', 'new_pattern_id_t', - 'new_pkt_clean_db_t', - 'new_pkt_debugctl_t', - 'new_pkt_dump_md_result_t', - 'new_pkt_dump_md_t', 'new_pkt_get_pop_result_t', 'new_pkt_get_pop_t', 'new_pkt_helo_t', @@ -8859,12 +8851,6 @@ 'ph_get_segreg_size', 'ph_get_tbyte_size', 'ph_get_version', - 'pkt_debugctl_t_args_get', - 'pkt_debugctl_t_args_set', - 'pkt_dump_md_result_t_contents_get', - 'pkt_dump_md_result_t_contents_set', - 'pkt_dump_md_t_sort_get', - 'pkt_dump_md_t_sort_set', 'pkt_get_pop_result_t_results_get', 'pkt_get_pop_result_t_results_set', 'pkt_get_pop_t_nresults_get', diff --git a/api_contents3.txt b/api_contents3.txt index 4501204..b3ec3c3 100644 --- a/api_contents3.txt +++ b/api_contents3.txt @@ -2844,10 +2844,6 @@ 'delete_optblock_t', 'delete_optinsn_t', 'delete_pattern_id_t', - 'delete_pkt_clean_db_t', - 'delete_pkt_debugctl_t', - 'delete_pkt_dump_md_result_t', - 'delete_pkt_dump_md_t', 'delete_pkt_get_pop_result_t', 'delete_pkt_get_pop_t', 'delete_pkt_helo_t', @@ -8175,10 +8171,6 @@ 'new_optinsn_t', 'new_packet', 'new_pattern_id_t', - 'new_pkt_clean_db_t', - 'new_pkt_debugctl_t', - 'new_pkt_dump_md_result_t', - 'new_pkt_dump_md_t', 'new_pkt_get_pop_result_t', 'new_pkt_get_pop_t', 'new_pkt_helo_t', @@ -8856,12 +8848,6 @@ 'ph_get_segreg_size', 'ph_get_tbyte_size', 'ph_get_version', - 'pkt_debugctl_t_args_get', - 'pkt_debugctl_t_args_set', - 'pkt_dump_md_result_t_contents_get', - 'pkt_dump_md_result_t_contents_set', - 'pkt_dump_md_t_sort_get', - 'pkt_dump_md_t_sort_set', 'pkt_get_pop_result_t_results_get', 'pkt_get_pop_result_t_results_set', 'pkt_get_pop_t_nresults_get', diff --git a/examples/hexrays/vds3.py b/examples/hexrays/vds3.py index 6e1f5eb..9c2c717 100644 --- a/examples/hexrays/vds3.py +++ b/examples/hexrays/vds3.py @@ -105,7 +105,7 @@ class hexrays_callback_info(object): return - def invert_if(self, cfunc, insn): + def invert_if(self, insn): if insn.opname != 'if': return False @@ -168,12 +168,11 @@ class hexrays_callback_info(object): def invert_if_event(self, vu): - cfunc = vu.cfunc.__deref__() i = self.find_if_statement(vu) if not i: return False - if self.invert_if(cfunc, i): + if self.invert_if(i): vu.refresh_ctext() self.add_location(i.ea) @@ -192,7 +191,7 @@ class hexrays_callback_info(object): def visit_insn(self, i): try: if i.op == ida_hexrays.cit_if and i.ea in self.inverter.stored: - self.inverter.invert_if(self.cfunc, i) + self.inverter.invert_if(i) except: traceback.print_exc() return 0 # continue enumeration diff --git a/examples/hexrays/vds_xrefs.py b/examples/hexrays/vds_xrefs.py index 3a41b5d..1eef5dd 100644 --- a/examples/hexrays/vds_xrefs.py +++ b/examples/hexrays/vds_xrefs.py @@ -133,7 +133,7 @@ class XrefsForm(ida_kernwin.PluginForm): lines = [] for stmt in insnvec: - qp = ida_hexrays.qstring_printer_t(cfunc.__deref__(), False) + qp = ida_hexrays.qstring_printer_t(cfunc, False) stmt._print(0, qp) s = qp.s.split('\n')[0] diff --git a/out_of_tree/parsed_notifications.zip b/out_of_tree/parsed_notifications.zip index 8590779..6b53929 100644 Binary files a/out_of_tree/parsed_notifications.zip and b/out_of_tree/parsed_notifications.zip differ diff --git a/pydoc_injections2.txt b/pydoc_injections2.txt index 0e94cdd..81455a7 100644 --- a/pydoc_injections2.txt +++ b/pydoc_injections2.txt @@ -66640,135 +66640,6 @@ class pattern_id_t(__builtin__.object) | __swig_destroy__ = | delete_pattern_id_t(self) -Help on class pkt_clean_db_t in module ida_lumina: - -class pkt_clean_db_t(__builtin__.object) - | Proxy of C++ pkt_clean_db_t class. - | - | Methods defined here: - | - | __init__(self, *args) - | __init__(self) -> pkt_clean_db_t - | - | __repr__ = _swig_repr(self) - | - | ---------------------------------------------------------------------- - | Data descriptors defined here: - | - | __dict__ - | dictionary for instance variables (if defined) - | - | __weakref__ - | list of weak references to the object (if defined) - | - | thisown - | The membership flag - | - | ---------------------------------------------------------------------- - | Data and other attributes defined here: - | - | __swig_destroy__ = - | delete_pkt_clean_db_t(self) - -Help on class pkt_debugctl_t in module ida_lumina: - -class pkt_debugctl_t(__builtin__.object) - | Proxy of C++ pkt_debugctl_t class. - | - | Methods defined here: - | - | __init__(self, *args) - | __init__(self) -> pkt_debugctl_t - | - | __repr__ = _swig_repr(self) - | - | ---------------------------------------------------------------------- - | Data descriptors defined here: - | - | __dict__ - | dictionary for instance variables (if defined) - | - | __weakref__ - | list of weak references to the object (if defined) - | - | args - | pkt_debugctl_t_args_get(self) -> qstrvec_t * - | - | thisown - | The membership flag - | - | ---------------------------------------------------------------------- - | Data and other attributes defined here: - | - | __swig_destroy__ = - | delete_pkt_debugctl_t(self) - -Help on class pkt_dump_md_result_t in module ida_lumina: - -class pkt_dump_md_result_t(__builtin__.object) - | Proxy of C++ pkt_dump_md_result_t class. - | - | Methods defined here: - | - | __init__(self, *args) - | __init__(self) -> pkt_dump_md_result_t - | - | __repr__ = _swig_repr(self) - | - | ---------------------------------------------------------------------- - | Data descriptors defined here: - | - | __dict__ - | dictionary for instance variables (if defined) - | - | __weakref__ - | list of weak references to the object (if defined) - | - | contents - | pkt_dump_md_result_t_contents_get(self) -> func_info_pattern_and_frequency_vec_t - | - | thisown - | The membership flag - | - | ---------------------------------------------------------------------- - | Data and other attributes defined here: - | - | __swig_destroy__ = - | delete_pkt_dump_md_result_t(self) - -Help on class pkt_dump_md_t in module ida_lumina: - -class pkt_dump_md_t(__builtin__.object) - | Proxy of C++ pkt_dump_md_t class. - | - | Methods defined here: - | - | __init__(self, *args) - | __init__(self) -> pkt_dump_md_t - | - | __repr__ = _swig_repr(self) - | - | ---------------------------------------------------------------------- - | Data descriptors defined here: - | - | __dict__ - | dictionary for instance variables (if defined) - | - | __weakref__ - | list of weak references to the object (if defined) - | - | sort - | pkt_dump_md_t_sort_get(self) -> dump_md_sort_type_t - | - | thisown - | The membership flag - | - | ---------------------------------------------------------------------- - | Data and other attributes defined here: - | - | __swig_destroy__ = - | delete_pkt_dump_md_t(self) - Help on class pkt_get_pop_result_t in module ida_lumina: class pkt_get_pop_result_t(__builtin__.object) diff --git a/swig/hexrays.i b/swig/hexrays.i index b65d7d3..bb2982d 100644 --- a/swig/hexrays.i +++ b/swig/hexrays.i @@ -310,6 +310,41 @@ SWIGINTERN void __raise_vdf(const vd_failure_t &e) %delobject create_cfunc; +%fragment("cvt_cfunc_t", "header") +{ + bool cvt_cfunc_t(cfunc_t **out, PyObject *obj) + { + cfunc_t *cfunc = 0; + int res = SWIG_ConvertPtr(obj, (void **) &cfunc, SWIGTYPE_p_cfunc_t, 0 | 0); + if ( SWIG_IsOK(res) ) + { + *out = cfunc; + } + else + { + cfuncptr_t *cfuncptr = 0; + res = SWIG_ConvertPtr(obj, (void **) &cfuncptr, SWIGTYPE_p_qrefcnt_tT_cfunc_t_t, 0 | 0); + if ( SWIG_IsOK(res) ) + *out = *cfuncptr; + } + return res; + } +} + +%typemap(typecheck, fragment="cvt_cfunc_t", precedence=SWIG_TYPECHECK_POINTER) cfunc_t * { + // %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) cfunc_t * + cfunc_t *cfunc = nullptr; + const int res$argnum = cvt_cfunc_t(&cfunc, $input); + _v = SWIG_CheckState(res$argnum); +} + +%typemap(in, fragment="cvt_cfunc_t") cfunc_t * { + // %typemap(in, fragment="cvt_cfunc_t") cfunc_t * + int res$argnum = cvt_cfunc_t(&$1, $input); + if ( !SWIG_IsOK(res$argnum) ) + SWIG_exception_fail(SWIG_ArgError(res$argnum), "in method '$symname', argument $argnum of type $1_type"); +} + %extend cfunc_t { %immutable argidx;