summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r--src/analysis/binary.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 9351c48..38d3d19 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -41,6 +41,7 @@
#include "line_prologue.h"
#include "prototype.h"
#include "../common/extstr.h"
+#include "../format/format.h"
#include "../panel/log.h"
#include "../plugins/pglist.h"
@@ -67,7 +68,7 @@ struct _GOpenidaBinary
off_t bin_length; /* Taille des données brutes */
bin_t *bin_data; /* Données binaires brutes */
- exe_format *format; /* Format du binaire */
+ GExeFormat *format; /* Format du binaire */
GArchProcessor *proc; /* Architecture du binaire */
GRenderingLine *lines; /* Lignes de rendu en place */
@@ -174,10 +175,10 @@ GOpenidaBinary *g_openida_binary_new_from_file(const char *filename)
result->bin_data = map_binary_file(filename, &result->bin_length);
if (result->bin_data == NULL) goto lbf_error;
- result->format = load_new_exe_format(result->bin_data, result->bin_length);
+ result->format = G_EXE_FORMAT(load_new_format(FMT_EXEC, result->bin_data, result->bin_length));
if (result->format == NULL) goto lbf_error;
- switch (get_exe_target_machine(result->format))
+ switch (g_exe_format_get_target_machine(result->format))
{
case FTM_JVM:
log_simple_message(LMT_INFO, _("Detected architecture: Java Virtual Machine"));
@@ -312,14 +313,13 @@ bool g_openida_binary_save(const GOpenidaBinary *binary, xmlDocPtr xdoc, xmlXPat
void g_openida_binary_analyse(GOpenidaBinary *binary)
{
GDelayedManager *manager; /* Gestionnaire de différés */
- bin_part **parts; /* Parties d'élément binaire */
+ GBinPart **parts; /* Parties d'élément binaire */
size_t parts_count; /* Nombre de ces parties */
manager = get_delayed_manager();
- parts = /* !!! */get_elf_default_code_parts(binary->format, &parts_count);
- qsort(parts, parts_count, sizeof(bin_part *), compare_bin_parts);
-
+ parts = g_exe_format_get_parts(binary->format, &parts_count);
+ qsort(parts, parts_count, sizeof(GBinPart *), g_binary_part_compare);
g_signal_connect(manager, "disassembly-completed",
@@ -407,7 +407,7 @@ bin_t *g_openida_binary_get_data(const GOpenidaBinary *binary, off_t *length)
* *
******************************************************************************/
-exe_format *g_openida_binary_get_format(const GOpenidaBinary *binary)
+GExeFormat *g_openida_binary_get_format(const GOpenidaBinary *binary)
{
return binary->format;
@@ -623,7 +623,8 @@ void ack_completed_disassembly(GDelayedManager *manager, GOpenidaBinary *binary,
- line = g_rendering_line_find_by_address(lines, NULL, get_exe_entry_point(binary->format));
+ line = g_rendering_line_find_by_address(lines, NULL,
+ g_exe_format_get_entry_point(binary->format));
if (line != NULL) g_rendering_line_add_flag(line, RLF_ENTRY_POINT);
/* Action post-désassemblage */