Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit e1f8548

Browse files
Arnaud DiederenArnaud Diederen
authored andcommitted
Backported fixes
1 parent 7a5c731 commit e1f8548

10 files changed

Lines changed: 33 additions & 1 deletion

api_contents2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11379,6 +11379,7 @@
1137911379
'uchar_array_cast',
1138011380
'uchar_array_frompointer',
1138111381
'udc_filter_t_apply',
11382+
'udc_filter_t_cleanup',
1138211383
'udc_filter_t_init',
1138311384
'udc_filter_t_install',
1138411385
'udc_filter_t_match',

api_contents3.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11374,6 +11374,7 @@
1137411374
'uchar_array_cast',
1137511375
'uchar_array_frompointer',
1137611376
'udc_filter_t_apply',
11377+
'udc_filter_t_cleanup',
1137711378
'udc_filter_t_init',
1137811379
'udc_filter_t_install',
1137911380
'udc_filter_t_match',
299 Bytes
Binary file not shown.

python/init.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class IDAPythonStdOut:
5757
"""
5858
Dummy file-like class that receives stout and stderr
5959
"""
60+
encoding = "UTF-8"
61+
6062
def write(self, text):
6163
# NB: in case 'text' is Unicode, msg() will decode it
6264
# and call msg() to print it

pywraps/py_hexrays.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ void hexrays_unloading__clear_python_clearable_references(void)
251251
((valrng_t *) hxc.ptr)->set_none();
252252
break;
253253
case hxclr_udc_filter_t:
254-
install_microcode_filter((microcode_filter_t *) hxc.ptr, false);
254+
{
255+
udc_filter_t *uf = (udc_filter_t *) hxc.ptr;
256+
install_microcode_filter(uf, false);
257+
uf->cleanup();
258+
}
255259
break;
256260
default: INTERR(30499);
257261
}

release_api_contents2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10715,6 +10715,7 @@
1071510715
'uchar_array_cast',
1071610716
'uchar_array_frompointer',
1071710717
'udc_filter_t_apply',
10718+
'udc_filter_t_cleanup',
1071810719
'udc_filter_t_init',
1071910720
'udc_filter_t_install',
1072010721
'udc_filter_t_match',

release_api_contents3.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10719,6 +10719,7 @@
1071910719
'uchar_array_cast',
1072010720
'uchar_array_frompointer',
1072110721
'udc_filter_t_apply',
10722+
'udc_filter_t_cleanup',
1072210723
'udc_filter_t_init',
1072310724
'udc_filter_t_install',
1072410725
'udc_filter_t_match',

release_pydoc_injections2.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36690,6 +36690,10 @@ class udc_filter_t(microcode_filter_t)
3669036690
| the next instruction MERR_INSN - not generated - the caller
3669136691
| should try the standard way else - error
3669236692
|
36693+
| cleanup(self, *args)
36694+
| Cleanup the filter This function properly clears type information
36695+
| associated to this filter.
36696+
|
3669336697
| init(self, *args)
3669436698
| init(self, decl) -> bool
3669536699
| @param decl (C++: const char *)

release_pydoc_injections3.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36745,6 +36745,10 @@ class udc_filter_t(microcode_filter_t)
3674536745
| the next instruction MERR_INSN - not generated - the caller
3674636746
| should try the standard way else - error
3674736747
|
36748+
| cleanup(self, *args) -> 'void'
36749+
| Cleanup the filter This function properly clears type information
36750+
| associated to this filter.
36751+
|
3674836752
| init(self, *args) -> 'bool'
3674936753
| init(self, decl) -> bool
3675036754
| @param decl (C++: const char *)

swig/hexrays.i

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,20 @@ SWIGINTERN void __raise_vdf(const vd_failure_t &e)
283283
%def_opt_handler(optblock_t, install_optblock_handler, remove_optblock_handler, hxclr_optblock_t)
284284
%def_opt_handler(udc_filter_t, install_udc_filter, remove_udc_filter, hxclr_udc_filter_t)
285285

286+
// udc_filter_t::init() will create a tinfo_t from the user-provided
287+
// declaration. We must also ensure the instance is registered
288+
// even if only init() is called (but install() isn't)
289+
%extend udc_filter_t {
290+
bool init(const char *decl)
291+
{
292+
const bool ok = $self->init(decl);
293+
if ( ok )
294+
hexrays_register_python_clearable_instance($self, hxclr_udc_filter_t);
295+
return ok;
296+
}
297+
};
298+
299+
286300
// "Warning 473: Returning a pointer or reference in a director method is not recommended."
287301
%warnfilter(473) codegen_t::emit_micro_mvm;
288302

0 commit comments

Comments
 (0)