summaryrefslogtreecommitdiff
path: root/src/project.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/project.c')
-rw-r--r--src/project.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/project.c b/src/project.c
index 91fe36c..c3c1844 100644
--- a/src/project.c
+++ b/src/project.c
@@ -31,6 +31,7 @@
#include "params.h"
#include "common/xml.h"
+#include "analysis/binaries/file.h"
#include "gtkext/easygtk.h"
#include "gtkext/gtkblockview.h"
#include "gtkext/gtkdockpanel.h"
@@ -46,7 +47,7 @@
/* Conservation d'un binaire chargé */
typedef struct _loaded_binary
{
- GOpenidaBinary *binary; /* Binaire en question */
+ GLoadedBinary *binary; /* Binaire en question */
GtkViewPanel *views[BVW_COUNT]; /* Composants pour l'affichage */
GtkWidget *scrollwindows[BVW_COUNT]; /* Supports pour l'affichage */
@@ -179,7 +180,7 @@ GStudyProject *g_study_project_open(const char *filename)
unsigned int i; /* Boucle de parcours */
size_t access_len; /* Taille d'un chemin interne */
char *access; /* Chemin pour une sous-config.*/
- GOpenidaBinary *binary; /* Représentation à intégrer */
+ GLoadedBinary *binary; /* Représentation à intégrer */
if (!open_xml_file(filename, &xdoc, &context)) return NULL;
@@ -199,7 +200,7 @@ GStudyProject *g_study_project_open(const char *filename)
access = calloc(access_len, sizeof(char));
snprintf(access, access_len, "/OpenIDAProject/Binaries/Binary[position()=%u]", i + 1);
- binary = g_openida_binary_new_from_xml(context, access);
+ binary = g_file_binary_new_from_xml(context, access);
free(access);
@@ -207,7 +208,7 @@ GStudyProject *g_study_project_open(const char *filename)
{
g_signal_connect(binary, "disassembly-done",
G_CALLBACK(g_study_project_add_loaded_binary), result);
- g_openida_binary_analyse(binary);
+ g_loaded_binary_analyse(binary);
}
}
@@ -260,7 +261,7 @@ bool g_study_project_save(GStudyProject *project, const char *filename)
access = calloc(access_len, sizeof(char));
snprintf(access, access_len, "/OpenIDAProject/Binaries/Binary[position()=%zu]", i + 1);
- result = g_openida_binary_save(project->binaries[i]->binary, xdoc, context, access);
+ result = g_loaded_binary_save(project->binaries[i]->binary, xdoc, context, access);
free(access);
@@ -316,7 +317,7 @@ const char *g_study_project_get_filename(const GStudyProject *project)
* *
******************************************************************************/
-void g_study_project_add_loaded_binary(GOpenidaBinary *binary, GStudyProject *project)
+void g_study_project_add_loaded_binary(GLoadedBinary *binary, GStudyProject *project)
{
size_t index; /* Indice du nouveau binaire */
@@ -343,7 +344,7 @@ void g_study_project_add_loaded_binary(GOpenidaBinary *binary, GStudyProject *pr
* *
******************************************************************************/
-size_t g_study_project_attach_binary(GStudyProject *project, GOpenidaBinary *binary)
+size_t g_study_project_attach_binary(GStudyProject *project, GLoadedBinary *binary)
{
size_t result; /* Indice à retourner */
loaded_binary *loaded; /* Structure à renvoyer */
@@ -385,8 +386,8 @@ size_t g_study_project_attach_binary(GStudyProject *project, GOpenidaBinary *bin
loaded->views[i] = GTK_VIEW_PANEL(view);
gtk_view_panel_attach_binary(loaded->views[i], binary,
- g_openida_binary_display_addresses_in_text(binary),
- g_openida_binary_display_code_in_text(binary));
+ g_loaded_binary_display_addresses_in_text(binary),
+ g_loaded_binary_display_code_in_text(binary));
/* Intégration finale dans un support défilant */
@@ -402,9 +403,9 @@ size_t g_study_project_attach_binary(GStudyProject *project, GOpenidaBinary *bin
/* Support graphique final */
scroll = loaded->scrollwindows[BVW_BLOCK];
- title = g_openida_binary_to_string(binary);
+ title = g_loaded_binary_get_filename(binary, false);
- loaded->item = g_panel_item_new(strrchr(title, G_DIR_SEPARATOR) + 1, title, scroll, "M");
+ loaded->item = g_panel_item_new(title, title, scroll, "M");
/* Enregistrement dans le projet */
@@ -439,7 +440,7 @@ size_t g_study_project_attach_binary(GStudyProject *project, GOpenidaBinary *bin
* *
******************************************************************************/
-void g_study_project_detach_binary(GStudyProject *project, GOpenidaBinary *binary)
+void g_study_project_detach_binary(GStudyProject *project, GLoadedBinary *binary)
{
//GtkDockPanel *dpanel; /* Support de panneaux */
//GDockItem *ditem; /* Support d'affichage utilisé */
@@ -479,7 +480,7 @@ void g_study_project_detach_binary(GStudyProject *project, GOpenidaBinary *binar
* *
******************************************************************************/
-GtkWidget *g_study_project_get_view_for_binary(const GStudyProject *project, const GOpenidaBinary *binary, BinaryView kind, GtkViewPanel **view)
+GtkWidget *g_study_project_get_view_for_binary(const GStudyProject *project, const GLoadedBinary *binary, BinaryView kind, GtkViewPanel **view)
{
GtkWidget *result; /* Composant GTK à retourner */
size_t i; /* Boucle de parcours */
@@ -557,13 +558,13 @@ static void g_study_project_hide(const GStudyProject *project)
* *
******************************************************************************/
-GOpenidaBinary **g_study_project_get_binaries(const GStudyProject *project, size_t *count)
+GLoadedBinary **g_study_project_get_binaries(const GStudyProject *project, size_t *count)
{
- GOpenidaBinary **result; /* Tableau à retourner */
+ GLoadedBinary **result; /* Tableau à retourner */
size_t i; /* Boucle de parcours */
*count = project->binaries_count;
- result = (GOpenidaBinary **)calloc(*count, sizeof(GOpenidaBinary *));
+ result = (GLoadedBinary **)calloc(*count, sizeof(GLoadedBinary *));
for (i = 0; i < *count; i++)
{