summaryrefslogtreecommitdiff
path: root/src/analysis/disass/fetch.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-12-25 16:31:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-12-25 16:31:33 (GMT)
commit19e1a97fafb1b73d0efcd995b31951daf1a5c661 (patch)
tree9cbc897ddb1d3005fb8dadfa3ad830c607acdddd /src/analysis/disass/fetch.c
parent9cab778bfaaca2589a383445e8569d99d73374d5 (diff)
Cleaned all the code for immediate operands.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@444 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass/fetch.c')
-rw-r--r--src/analysis/disass/fetch.c114
1 files changed, 113 insertions, 1 deletions
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c
index dea6645..1fd5550 100644
--- a/src/analysis/disass/fetch.c
+++ b/src/analysis/disass/fetch.c
@@ -434,8 +434,10 @@ static GArchInstruction *load_code_binary(const GLoadedBinary *binary, const vmp
+ g_arch_instruction_call_hook(instr, IPH_LINK, NULL, format);
- g_arch_instruction_call_post_prod_function(instr, format); /* FIXME */
+
+ g_arch_instruction_call_hook(instr, IPH_POST, NULL, format);
@@ -447,6 +449,116 @@ static GArchInstruction *load_code_binary(const GLoadedBinary *binary, const vmp
}
+
+
+
+
+/******************************************************************************
+* *
+* Paramètres : binary = représentation de binaire chargé. *
+* statusbar = barre de statut avec progression à mettre à jour.*
+* id = identifiant du message affiché à l'utilisateur. *
+* *
+* Description : Procède au désassemblage basique d'un contenu binaire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static GArchInstruction *follow_execution_flow(const GLoadedBinary *binary, GProcContext *ctx, mem_area *areas, size_t count, GtkExtStatusBar *statusbar, bstatus_id_t id)
+{
+ GBinFormat *format; /* Format du fichier binaire */
+
+ virt_t addr;
+
+
+
+ mem_area *area; /* Zone de désassemblage */
+
+
+ format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
+
+ /* Insertion du point de départ */
+
+ addr = g_binary_format_get_entry_point(format);
+
+ g_proc_context_push_drop_point(ctx, addr);
+
+ /* Suivi de l'exécution autant que possible */
+
+ while (g_proc_context_has_drop_points(ctx))
+ {
+ //virt = g_proc_context_pop_drop_point(ctx);
+
+
+ area = NULL;
+
+
+
+
+ }
+
+
+
+
+ // ctx.add(entry_point)
+
+ // while (ctx.has_pending_addresses)
+
+ // virt = ctx.pop
+ // find mem_area for virt
+
+ // if area.limit < virt then continue
+
+
+
+
+
+}
+
+
+
+
+
+
+/******************************************************************************
+* *
+* Paramètres : binary = représentation de binaire chargé. *
+* statusbar = barre de statut avec progression à mettre à jour.*
+* id = identifiant du message affiché à l'utilisateur. *
+* *
+* Description : Procède au désassemblage basique d'un contenu binaire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GArchInstruction *disassemble_binary_content_new(const GLoadedBinary *binary, GtkExtStatusBar *statusbar, bstatus_id_t id)
+{
+
+ GBinFormat *format; /* Format du fichier binaire */
+ GArchProcessor *proc; /* Architecture du binaire */
+
+ GProcContext *ctx; /* Contexte de désassemblage */
+
+
+
+ format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
+ proc = get_arch_processor_from_format(G_EXE_FORMAT(format));
+
+
+ ctx = g_arch_processor_get_context(proc);
+
+
+
+}
+
+
+
/******************************************************************************
* *
* Paramètres : binary = représentation de binaire chargé. *