diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2016-04-23 21:38:02 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2016-04-23 21:38:02 (GMT) | 
| commit | a5758a42acdfaf0ac20c4cfb9cf162a9b4440e39 (patch) | |
| tree | 21707c2ad7557d80eeb09e300e6c491868a1871a /src/arch | |
| parent | 3284ce333cc4b09d9150b59c60005af8e4ddc417 (diff) | |
Limited the length of displayed SHA1 binary value for Dex files.
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/instruction-int.h | 4 | ||||
| -rw-r--r-- | src/arch/instruction.c | 43 | ||||
| -rw-r--r-- | src/arch/instruction.h | 6 | 
3 files changed, 49 insertions, 4 deletions
| diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h index 69cdc8a..f9f548b 100644 --- a/src/arch/instruction-int.h +++ b/src/arch/instruction-int.h @@ -60,6 +60,8 @@ struct _GArchInstruction      const char *suffix;                     /* Complément au nom affiché   */      char *cached_keyword;                   /* Désignation complète        */ +    phys_t max_displayed_len;               /* Quantité de code affichée   */ +      ArchInstrFlag flags;                    /* Informations complémentaires*/      instr_hook_fc hooks[IPH_COUNT];         /* Traitements complémentaires */ @@ -100,8 +102,6 @@ struct _GArchInstruction      //is_instruction_return_fc is_return;     /* Retour de fonction ou pas ? */      decomp_instr_fc decomp;                 /* Procédure de décompilation  */ -    bool is_return;                         /* Retour de fonction ou pas ? */   // FIXME : à virer -  }; diff --git a/src/arch/instruction.c b/src/arch/instruction.c index 4de70b7..c2e4c7c 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -105,7 +105,7 @@ static void g_arch_instruction_init(GArchInstruction *instr)  {      DL_LIST_ITEM_INIT(&instr->flow); -    instr->is_return = false; +    instr->max_displayed_len = VMPA_NO_PHYSICAL;      g_rw_lock_init(&instr->from_access);      g_atomic_int_set(&instr->hold_from_access, 0); @@ -972,6 +972,45 @@ const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyn  /******************************************************************************  *                                                                             * +*  Paramètres  : instr = instruction d'assemblage à consulter.                * +*                                                                             * +*  Description : Indique si elle existe la quantité maximale de code affiché. * +*                                                                             * +*  Retour      : Quantité de code affichée au plus ou VMPA_NO_PHYSICAL.       * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +phys_t g_arch_instruction_get_displayed_max_length(const GArchInstruction *instr) +{ +    return instr->max_displayed_len; + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : instr = instruction d'assemblage à consulter.                * +*                max   = quantité affichée au plus ou VMPA_NO_PHYSICAL.       * +*                                                                             * +*  Description : Définit la quantité maximale de code affiché.                * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +void g_arch_instruction_set_displayed_max_length(GArchInstruction *instr, phys_t max) +{ +    instr->max_displayed_len = max; + +} + + +/****************************************************************************** +*                                                                             *  *  Paramètres  : instr   = instruction d'assemblage à représenter.            *  *                buffer  = espace où placer ledit contenu.                    *  *                msize   = taille idéale des positions et adresses;           * @@ -997,7 +1036,7 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo      g_buffer_line_add_flag(result, BLF_HAS_CODE); -    g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, true); +    g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, instr->max_displayed_len);      /* Instruction proprement dite */ diff --git a/src/arch/instruction.h b/src/arch/instruction.h index f26a240..3d261a9 100644 --- a/src/arch/instruction.h +++ b/src/arch/instruction.h @@ -233,6 +233,12 @@ size_t g_arch_instruction_compute_group_index(GArchInstruction **, GArchInstruct  /* Fournit le nom humain de l'instruction manipulée. */  const char *g_arch_instruction_get_keyword(const GArchInstruction *, AsmSyntax); +/* Indique si elle existe la quantité maximale de code affiché. */ +phys_t g_arch_instruction_get_displayed_max_length(const GArchInstruction *); + +/* Définit la quantité maximale de code affiché. */ +void g_arch_instruction_set_displayed_max_length(GArchInstruction *, phys_t); +  /* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */  GBufferLine *g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax); | 
