diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2018-06-17 13:12:08 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2018-06-17 13:12:08 (GMT) | 
| commit | 2c7e1c63e601ead0098929c62c582a650907b586 (patch) | |
| tree | 45888b25390c8ebcad09c52e54f91110304ce5e8 /src | |
| parent | f223a47ecf2dfab68ba9291cba8491ccfaec4753 (diff) | |
Skipped labels when computing limits of routines.
Diffstat (limited to 'src')
| -rw-r--r-- | src/analysis/disass/routines.c | 25 | 
1 files changed, 19 insertions, 6 deletions
| diff --git a/src/analysis/disass/routines.c b/src/analysis/disass/routines.c index b1bc8c8..a0f756c 100644 --- a/src/analysis/disass/routines.c +++ b/src/analysis/disass/routines.c @@ -278,26 +278,39 @@ static void g_routines_study_process(GRoutinesStudy *study, GtkStatusStack *stat  void g_routines_study_compute_limits(GRoutinesStudy *study, GBinRoutine *routine, size_t index)  {      GBinSymbol *symbol;                     /* Version alternative         */ +    const vmpa2t *next;                     /* Début de la zone suivante   */      GBinSymbol *next_symbol;                /* Eventuel symbole suivant    */      const mrange_t *range;                  /* Zone du symbole suivant     */ -    const vmpa2t *next;                     /* Début de la zone suivante   */ +    vmpa2t _next;                           /* Emplacement de zone         */      symbol = G_BIN_SYMBOL(routine); -    if ((index + 1) < study->count) +    for (next = NULL, index++; next == NULL && index < study->count; index++)      {          next_symbol = g_binary_format_get_symbol(study->format, index + 1); +        /** +         * Les étiquettes à l'intérieur de code ne doivent pas constituer +         * une profonde coupure à l'intérieur d'une routine. +         * +         * On recherche donc la fin de la routine courante via les +         * symboles suivants. +         */ + +        if (g_binary_symbol_get_target_type(next_symbol) == STP_CODE_LABEL) +            goto skip_symbol; +          range = g_binary_symbol_get_range(next_symbol); -        next = get_mrange_addr(range); + +        copy_vmpa(&_next, get_mrange_addr(range)); +        next = &_next; + + skip_symbol:          g_object_unref(G_OBJECT(next_symbol));      } -    else -        next = NULL; -      compute_routine_limit(symbol, next, study->proc, study->portions);  } | 
