/* OpenIDA - Outil d'analyse de fichiers binaires * line.h - prototypes pour la représentation des lignes de rendu * * Copyright (C) 2008 Cyrille Bagard * * This file is part of OpenIDA. * * OpenIDA is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * OpenIDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Foobar. If not, see . */ #ifndef _ANALYSIS_LINE_H #define _ANALYSIS_LINE_H #include #include #include "../arch/processor.h" #include "../format/exe_format.h" /* Définitions des types de ligne */ typedef enum _RenderingLineType { RLT_PROLOGUE, /* Description de l'analyse */ RLT_PROTOTYPE, /* Prototype de fonction */ RLT_CODE /* Code en langage machine */ } RenderingLineType; /* Image à afficher en marge de ligne */ typedef enum _RenderingLineFlag { RLF_NONE = (0 << 0), /* Ligne commune */ RLF_ENTRY_POINT = (1 << 0), /* Point d'entrée du prgm. */ RLF_BREAK_POINT = (1 << 1) /* Point d'arrêt */ } RenderingLineFlag; /* Passage de paramètres compact */ typedef struct _disass_options { bool show_address; /* Affichage de l'adresse ? */ bool show_code; /* Affichage du code brut ? */ exe_format *format; /* Format du contenu bianire */ asm_processor *proc; /* Architecture utilisée */ } disass_options; /* Ligne de représentation générique */ typedef struct _rendering_line rendering_line; /* Ajoute une information supplémentaire à une ligne. */ void add_rendering_line_flag(rendering_line *, RenderingLineFlag); /* Retire une information supplémentaire d'une ligne. */ void remove_rendering_line_flag(rendering_line *, RenderingLineFlag); /* Fournit les informations supplémentaires d'une ligne. */ RenderingLineFlag get_rendering_line_flags(const rendering_line *); /* Ajoute une ligne à un ensemble existant. */ void add_line_to_rendering_lines(rendering_line **, rendering_line *); /* Insère une ligne dans un ensemble existant. */ void insert_line_into_rendering_lines(rendering_line **, rendering_line *, bool); /* Recherche une ligne d'après sa position en mémoire/physique. */ rendering_line *find_offset_in_rendering_lines(rendering_line *, uint64_t); /* Procède à l'initialisation des bases d'une représentation. */ void draw_rendering_line(rendering_line *, GdkDrawable *, GdkGC *, gint, gint, gint, gint); /* ------------------------ TRAITEMENT DES LIGNES PAR GROUPE ------------------------ */ /* Fournit l'élement suivant un autre pour un parcours. */ rendering_line *g_rendering_line_get_next_iter(rendering_line *, const rendering_line *); /* Met à jour le nombre d'octets maximal par instruction. */ void g_rendering_lines_update_bin_len(rendering_line *); /* Fournit les dimensions de lignes de représentation. */ void g_rendering_lines_get_size(rendering_line *, int *, int *, int *); /* ------------------------- LIGNE EN TETE DE DESASSEMBLAGE ------------------------- */ /* Crée une des lignes de description initiales. */ rendering_line *create_prologue_line(const char *); /* ----------------------- COMMENTAIRES SUR UNE LIGNE ENTIERE ----------------------- */ /* Crée une ligne de commentaires entière. */ rendering_line *create_comment_line(uint64_t, RenderingLineType, const char *, const disass_options *); /* ------------------------ LIGNE DE CODE EN LANGAGE MACHINE ------------------------ */ /* Crée une ligne de représentation de code binaire. */ rendering_line *create_code_line(asm_instr *, uint64_t, const disass_options *); #endif /* _ANALYSIS_LINE_H */