From 42f7aa1f1cd281648fce65ff106c2063bc72b107 Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Thu, 25 Apr 2024 01:21:18 +0200 Subject: [PATCH] fix declared fields in the dex module There was some mismatch between the declared fields and the ones filled by the module: - `dex.field[*].static` and `dex.field[*].instance` were defined, but not declared, making their use impossible. They are now properly declared. - several fields in `dex.method[*].code_item` were declared but never defined: `padding`, `tries` and `handlers`. Those are removed since they couldn't have been used. --- libyara/modules/dex/dex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libyara/modules/dex/dex.c b/libyara/modules/dex/dex.c index a1efdd0a8a..690c00fe87 100644 --- a/libyara/modules/dex/dex.c +++ b/libyara/modules/dex/dex.c @@ -328,6 +328,8 @@ begin_declarations declare_string("class_name"); declare_string("name"); declare_string("proto"); + declare_integer("static"); + declare_integer("instance"); declare_integer("field_idx_diff"); declare_integer("access_flags"); end_struct_array("field") @@ -358,11 +360,6 @@ begin_declarations declare_integer("debug_info_off"); declare_integer("insns_size"); declare_string("insns"); - declare_integer("padding"); - begin_struct("tries") - end_struct("tries"); - begin_struct_array("handlers") - end_struct_array("handlers"); end_struct("code_item") end_struct_array("method") end_declarations