summaryrefslogtreecommitdiff
path: root/plugins/androhelpers/try_n_catch.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/androhelpers/try_n_catch.c')
-rw-r--r--plugins/androhelpers/try_n_catch.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/androhelpers/try_n_catch.c b/plugins/androhelpers/try_n_catch.c
index 1fa3971..811f8c5 100644
--- a/plugins/androhelpers/try_n_catch.c
+++ b/plugins/androhelpers/try_n_catch.c
@@ -80,13 +80,14 @@ static bool check_covered_area(const try_item *try, const GBinRoutine *routine)
off_t length; /* Taille de la zone de code */
vmpa_t covered_start; /* Début de la zone couverte */
vmpa_t covered_end; /* Fin de la zone couverte */
-
- length = g_binary_routine_get_size(routine);
+ const mrange_t *range; /* Emplacement du symbole */
covered_start = try->start_addr * sizeof(uint16_t);
covered_end = covered_start + try->insn_count * sizeof(uint16_t);
- return (covered_end <= length);
+ range = g_binary_symbol_get_range(G_BIN_SYMBOL(routine));
+
+ return (covered_end <= get_mrange_length(range));
}
@@ -109,6 +110,7 @@ static bool check_covered_area(const try_item *try, const GBinRoutine *routine)
static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *routine, const try_item *try, const caught_exception *handlers, size_t count)
{
+ const mrange_t *range; /* Emplacement du symbole */
vmpa_t start; /* Début de la zone couverte */
vmpa_t end; /* Fin de la zone couverte */
GArchProcessor *proc; /* Processeur de l'architecture*/
@@ -119,7 +121,9 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r
GArchInstruction *iter; /* Boucle de parcours #1 */
size_t i; /* Boucle de parcours #2 */
- start = g_binary_routine_get_address(routine);
+ range = g_binary_symbol_get_range(G_BIN_SYMBOL(routine));
+
+ start = get_mrange_addr(range)->virtual;
start += try->start_addr * sizeof(uint16_t);
end = start + try->insn_count * sizeof(uint16_t);
@@ -236,6 +240,7 @@ static void mark_exception_handlers(const GLoadedBinary *binary, uleb128_t size,
static caught_exception **build_all_destinations_list(const GLoadedBinary *binary, const GBinRoutine *routine, const encoded_catch_handler_list *hlist, size_t **count)
{
+ const mrange_t *range; /* Emplacement du symbole */
caught_exception **result; /* Liste de listes à retourner */
vmpa_t start; /* Début du code de la routine */
GDexFormat *format; /* Format du binaire chargé */
@@ -248,7 +253,9 @@ static caught_exception **build_all_destinations_list(const GLoadedBinary *binar
caught_exception *excep; /* Raccourci confortable */
GDataType *type; /* Type de l'exception */
- start = g_binary_routine_get_address(routine);
+ range = g_binary_symbol_get_range(G_BIN_SYMBOL(routine));
+
+ start = get_mrange_addr(range)->virtual;
format = G_DEX_FORMAT(g_loaded_binary_get_format(binary));