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 /src/analysis/disass | |
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 'src/analysis/disass')
-rw-r--r-- | src/analysis/disass/disassembler.c | 14 | ||||
-rw-r--r-- | src/analysis/disass/disassembler.h | 2 | ||||
-rw-r--r-- | src/analysis/disass/fetch.c | 6 | ||||
-rw-r--r-- | src/analysis/disass/fetch.h | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c index 872dc09..73d75cf 100644 --- a/src/analysis/disass/disassembler.c +++ b/src/analysis/disass/disassembler.c @@ -60,7 +60,7 @@ typedef struct _GDelayedDisassembly { GDelayedWork parent; /* A laisser en premier */ - const GOpenidaBinary *binary; /* Destinataire final */ + const GLoadedBinary *binary; /* Destinataire final */ const GExeFormat *format; /* Format du binaire représenté*/ GBinPart **parts; /* Parties binaires à traiter */ @@ -89,7 +89,7 @@ static void g_delayed_disassembly_class_init(GDelayedDisassemblyClass *); static void g_delayed_disassembly_init(GDelayedDisassembly *); /* Crée une tâche de désassemblage différé. */ -static GDelayedDisassembly *g_delayed_disassembly_new(const GOpenidaBinary *, GBinPart **, size_t, GCodeBuffer *); +static GDelayedDisassembly *g_delayed_disassembly_new(const GLoadedBinary *, GBinPart **, size_t, GCodeBuffer *); /* Assure le désassemblage en différé. */ static void g_delayed_disassembly_process(GDelayedDisassembly *, GtkExtStatusBar *); @@ -165,14 +165,14 @@ static void g_delayed_disassembly_init(GDelayedDisassembly *disass) * * ******************************************************************************/ -static GDelayedDisassembly *g_delayed_disassembly_new(const GOpenidaBinary *binary, GBinPart **parts, size_t count, GCodeBuffer *buffer) +static GDelayedDisassembly *g_delayed_disassembly_new(const GLoadedBinary *binary, GBinPart **parts, size_t count, GCodeBuffer *buffer) { GDelayedDisassembly *result; /* Tâche à retourner */ result = g_object_new(G_TYPE_DELAYED_DISASSEMBLY, NULL); result->binary = binary; - result->format = g_openida_binary_get_format(binary); + result->format = g_loaded_binary_get_format(binary); result->parts = parts; result->count = count; @@ -381,7 +381,7 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con * * ******************************************************************************/ -void disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t parts_count, GArchInstruction **instrs, GCodeBuffer **buffer) +void disassemble_binary(GLoadedBinary *binary, GBinPart **parts, size_t parts_count, GArchInstruction **instrs, GCodeBuffer **buffer) { const uint8_t *data; /* Données binaires brutes */ off_t length; /* Quantité de ces données */ @@ -395,8 +395,8 @@ void disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t parts_c *buffer = g_code_buffer_new(); - data = g_openida_binary_get_data(binary, &length); - build_disass_prologue(*buffer, g_openida_binary_get_filename(binary), data, length); + data = g_loaded_binary_get_data(binary, &length); + build_disass_prologue(*buffer, g_loaded_binary_get_filename(binary, true), data, length); disass = g_delayed_disassembly_new(binary, parts, parts_count, *buffer); diff --git a/src/analysis/disass/disassembler.h b/src/analysis/disass/disassembler.h index 2c5adef..8cca194 100644 --- a/src/analysis/disass/disassembler.h +++ b/src/analysis/disass/disassembler.h @@ -31,7 +31,7 @@ /* Procède à la décompilation des routines d'un fichier donné. */ -void disassemble_binary(GOpenidaBinary *, GBinPart **parts, size_t parts_count, GArchInstruction **, GCodeBuffer **); +void disassemble_binary(GLoadedBinary *, GBinPart **parts, size_t parts_count, GArchInstruction **, GCodeBuffer **); diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c index 6bd9795..a1df5e3 100644 --- a/src/analysis/disass/fetch.c +++ b/src/analysis/disass/fetch.c @@ -45,7 +45,7 @@ * * ******************************************************************************/ -GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPart **parts, size_t count, GtkExtStatusBar *statusbar, guint id) +GArchInstruction *disassemble_binary_parts(const GLoadedBinary *binary, GBinPart **parts, size_t count, GtkExtStatusBar *statusbar, guint id) { GArchInstruction *result; /* Liste d'instr. à renvoyer */ GBinFormat *format; /* Format du fichier binaire */ @@ -69,9 +69,9 @@ GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPar result = NULL; - format = G_BIN_FORMAT(g_openida_binary_get_format(binary)); + format = G_BIN_FORMAT(g_loaded_binary_get_format(binary)); proc = get_arch_processor_from_format(G_EXE_FORMAT(format)); - bin_data = g_openida_binary_get_data(binary, &bin_length); + bin_data = g_loaded_binary_get_data(binary, &bin_length); /* Préparation du suivi de la progression */ diff --git a/src/analysis/disass/fetch.h b/src/analysis/disass/fetch.h index 09bb584..89c3226 100644 --- a/src/analysis/disass/fetch.h +++ b/src/analysis/disass/fetch.h @@ -31,7 +31,7 @@ /* Procède au désassemblage basique d'un contenu binaire. */ -GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *, GBinPart **, size_t, GtkExtStatusBar *, guint); +GArchInstruction *disassemble_binary_parts(const GLoadedBinary *, GBinPart **, size_t, GtkExtStatusBar *, guint); |