diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-08-12 23:32:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-08-12 23:32:21 (GMT) |
commit | 9cfe738c2e9bb49eb2872e92bc4422c548edb517 (patch) | |
tree | ee8dbe5965b9d46394395b8beee87676e098a9f1 /plugins/theseus | |
parent | fc49e98dc2b3e0ae08a5874ecacaef046a0f3ec1 (diff) |
Cleaned the code and handled file binaries properly.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@259 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/theseus')
-rw-r--r-- | plugins/theseus/theseus.c | 42 | ||||
-rw-r--r-- | plugins/theseus/theseus.h | 2 |
2 files changed, 22 insertions, 22 deletions
diff --git a/plugins/theseus/theseus.c b/plugins/theseus/theseus.c index 5cc2d98..ea119ef 100644 --- a/plugins/theseus/theseus.c +++ b/plugins/theseus/theseus.c @@ -30,7 +30,7 @@ /* Traite en premier lieu les adresses marquées "impératives". */ -static bool register_white_list(GOpenidaBinary *); +static bool register_white_list(GLoadedBinary *); /* Indique si une ligne peut faire l'objet d'un nouveau suivi. */ static bool can_line_be_followed(const GRenderingLine *); @@ -42,13 +42,13 @@ static bool can_line_be_processed(const GRenderingLine *); static void mark_line_as_done(GRenderingLine *, bool); /* Suit le flot d'exécution à partir d'un point donné. */ -static bool follow_flow_from_line(GOpenidaBinary *, vmpa_t); +static bool follow_flow_from_line(GLoadedBinary *, vmpa_t); /* Désassemble une nouvelle instruction à partir d'une adresse. */ -static GRenderingLine *disassemble_target_address(GOpenidaBinary *, GRenderingLine *, vmpa_t); +static GRenderingLine *disassemble_target_address(GLoadedBinary *, GRenderingLine *, vmpa_t); /* Insère dans le flux existant les nouvelles lignes crées. */ -static bool insert_new_lines_into_flow(GOpenidaBinary *, GRenderingLine *, GRenderingLine *); +static bool insert_new_lines_into_flow(GLoadedBinary *, GRenderingLine *, GRenderingLine *); @@ -140,7 +140,7 @@ G_MODULE_EXPORT PluginAction get_plugin_action(void) * * ******************************************************************************/ -G_MODULE_EXPORT bool execute_action_on_binary(GOpenidaBinary *binary, PluginAction action) +G_MODULE_EXPORT bool execute_action_on_binary(GLoadedBinary *binary, PluginAction action) { bool result; /* Bilan à retourner */ GRenderingLine *lines; /* Lignes désassemblées */ @@ -153,12 +153,12 @@ G_MODULE_EXPORT bool execute_action_on_binary(GOpenidaBinary *binary, PluginActi GRenderingLine *iter; - lines = g_openida_binary_get_lines(binary); + lines = g_loaded_binary_get_lines(binary); - format = g_openida_binary_get_format(binary); + format = g_loaded_binary_get_format(binary); start = g_exe_format_get_entry_point(format); @@ -173,7 +173,7 @@ G_MODULE_EXPORT bool execute_action_on_binary(GOpenidaBinary *binary, PluginActi - options = g_openida_binary_get_options(binary); + options = g_loaded_binary_get_options(binary); for (iter = lines; iter != NULL; iter = g_rendering_line_get_next_iter(lines, iter, NULL)) { @@ -212,7 +212,7 @@ G_MODULE_EXPORT bool execute_action_on_binary(GOpenidaBinary *binary, PluginActi * * ******************************************************************************/ -static bool register_white_list(GOpenidaBinary *binary) +static bool register_white_list(GLoadedBinary *binary) { bool result; /* Bilan à retourner */ GRenderingLine *lines; /* Lignes désassemblées */ @@ -223,7 +223,7 @@ static bool register_white_list(GOpenidaBinary *binary) result = true; - lines = g_openida_binary_get_lines(binary); + lines = g_loaded_binary_get_lines(binary); for (i = 0; i < _white_list_count && result; i++) { @@ -327,7 +327,7 @@ static void mark_line_as_done(GRenderingLine *line, bool white) * * ******************************************************************************/ -static bool follow_flow_from_line(GOpenidaBinary *binary, vmpa_t start) +static bool follow_flow_from_line(GLoadedBinary *binary, vmpa_t start) { bool result; /* Bilan de opérations */ GRenderingLine *lines; /* Lignes désassemblées */ @@ -339,7 +339,7 @@ static bool follow_flow_from_line(GOpenidaBinary *binary, vmpa_t start) InstructionLinkType type; /* Type de référence */ GRenderingLine *target; /* Ligne visée par la référence*/ - lines = g_openida_binary_get_lines(binary); + lines = g_loaded_binary_get_lines(binary); first = g_rendering_line_find_by_address(lines, NULL, start); first = g_rendering_line_loop_for_code(first, NULL); @@ -466,7 +466,7 @@ static bool follow_flow_from_line(GOpenidaBinary *binary, vmpa_t start) * * ******************************************************************************/ -static GRenderingLine *disassemble_target_address(GOpenidaBinary *binary, GRenderingLine *old, vmpa_t target) +static GRenderingLine *disassemble_target_address(GLoadedBinary *binary, GRenderingLine *old, vmpa_t target) { GRenderingLine *result; /* Lignes en place à renvoyer */ GExeFormat *format; /* Format du binaire fourni */ @@ -482,11 +482,11 @@ static GRenderingLine *disassemble_target_address(GOpenidaBinary *binary, GRende result = NULL; - format = g_openida_binary_get_format(binary); + format = g_loaded_binary_get_format(binary); proc = get_arch_processor_from_format(format); - options = g_openida_binary_get_options(binary); + options = g_loaded_binary_get_options(binary); - data = g_openida_binary_get_data(binary, &length); + data = g_loaded_binary_get_data(binary, &length); old_addr = get_rendering_line_address(old); if (!g_exe_format_translate_address_into_offset(format, old_addr, &offset)) @@ -532,7 +532,7 @@ static GRenderingLine *disassemble_target_address(GOpenidaBinary *binary, GRende * * ******************************************************************************/ -static bool insert_new_lines_into_flow(GOpenidaBinary *binary, GRenderingLine *old, GRenderingLine *new) +static bool insert_new_lines_into_flow(GLoadedBinary *binary, GRenderingLine *old, GRenderingLine *new) { bool result; /* Bilan de opérations */ GExeFormat *format; /* Format du binaire fourni */ @@ -551,11 +551,11 @@ static bool insert_new_lines_into_flow(GOpenidaBinary *binary, GRenderingLine *o GRenderingLine *line; /* Nouvelle ligne de rendu */ GRenderingLine *last; /* Dernière ligne à vérifier */ - format = g_openida_binary_get_format(binary); + format = g_loaded_binary_get_format(binary); proc = get_arch_processor_from_format(format); - options = g_openida_binary_get_options(binary); + options = g_loaded_binary_get_options(binary); - data = g_openida_binary_get_data(binary, &length); + data = g_loaded_binary_get_data(binary, &length); /* Etendue du bloc de remplacement */ @@ -568,7 +568,7 @@ static bool insert_new_lines_into_flow(GOpenidaBinary *binary, GRenderingLine *o /* Bourrage nécessaire ? */ - root = g_openida_binary_get_lines_root(binary); + root = g_loaded_binary_get_lines_root(binary); iter = g_rendering_line_find_by_address(*root, NULL, end); diff --git a/plugins/theseus/theseus.h b/plugins/theseus/theseus.h index 2fa4ac1..e1a6f36 100644 --- a/plugins/theseus/theseus.h +++ b/plugins/theseus/theseus.h @@ -42,7 +42,7 @@ G_MODULE_EXPORT bool init_plugin(GObject *); G_MODULE_EXPORT PluginAction get_plugin_action(void); /* Exécute une action définie sur un binaire chargé. */ -G_MODULE_EXPORT bool execute_action_on_binary(GOpenidaBinary *, PluginAction); +G_MODULE_EXPORT bool execute_action_on_binary(GLoadedBinary *, PluginAction); |