summaryrefslogtreecommitdiff
path: root/src/analysis/db/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db/items')
-rw-r--r--src/analysis/db/items/bookmark.c40
-rw-r--r--src/analysis/db/items/comment.c13
-rw-r--r--src/analysis/db/items/switcher.c22
3 files changed, 53 insertions, 22 deletions
diff --git a/src/analysis/db/items/bookmark.c b/src/analysis/db/items/bookmark.c
index 8512406..ba64491 100644
--- a/src/analysis/db/items/bookmark.c
+++ b/src/analysis/db/items/bookmark.c
@@ -28,6 +28,9 @@
#include <sys/socket.h>
+#include <i18n.h>
+
+
#include "../collection-int.h"
#include "../item-int.h"
@@ -69,7 +72,7 @@ static void g_db_bookmark_dispose(GDbBookmark *);
static void g_db_bookmark_finalize(GDbBookmark *);
/* Effectue la comparaison entre deux signets de collection. */
-static gint g_db_bookmark_cmp(GDbBookmark *, GDbBookmark *);
+static gint g_db_bookmark_cmp(GDbBookmark *, GDbBookmark *, bool);
/* Importe la définition d'un signet dans un flux réseau. */
static bool g_db_bookmark_recv_from_fd(GDbBookmark *, int, int);
@@ -80,6 +83,9 @@ static bool g_db_bookmark_send_to_fd(const GDbBookmark *, int, int);
/* Exécute un signet sur un tampon de binaire chargé. */
static bool g_db_bookmark_run(GDbBookmark *, GLoadedBinary *, bool *, bool);
+/* Construit la description humaine d'un signet sur un tampon. */
+static void g_db_bookmark_build_label(GDbBookmark *);
+
/* Applique un signet sur un tampon de binaire chargé. */
static bool g_db_bookmark_apply(GDbBookmark *, GLoadedBinary *);
@@ -168,10 +174,12 @@ static void g_db_bookmark_class_init(GDbBookmarkClass *klass)
item = G_DB_ITEM_CLASS(klass);
- item->cmp = (GCompareFunc)g_db_bookmark_cmp;
+ item->cmp = (cmp_db_item_fc)g_db_bookmark_cmp;
item->recv = (recv_db_item_fc)g_db_bookmark_recv_from_fd;
item->send = (send_db_item_fc)g_db_bookmark_send_to_fd;
+
+ item->build_label = (build_item_label_fc)g_db_bookmark_build_label;
item->apply = (run_item_fc)g_db_bookmark_apply;
item->cancel = (run_item_fc)g_db_bookmark_cancel;
@@ -269,8 +277,9 @@ GDbBookmark *g_db_bookmark_new(const vmpa2t *addr, const char *comment)
/******************************************************************************
* *
-* Paramètres : a = premier élément à analyser. *
-* b = second élément à analyser. *
+* Paramètres : a = premier élément à analyser. *
+* b = second élément à analyser. *
+* with = précise les horodatages à prendre en compte. *
* *
* Description : Effectue la comparaison entre deux signets de collection. *
* *
@@ -280,7 +289,7 @@ GDbBookmark *g_db_bookmark_new(const vmpa2t *addr, const char *comment)
* *
******************************************************************************/
-static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b)
+static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b, bool with)
{
gint result; /* Bilan de la comparaison */
@@ -290,7 +299,7 @@ static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b)
result = cmp_rle_string(&a->comment, &b->comment);
if (result == 0)
- result = G_DB_ITEM_CLASS(g_db_bookmark_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b));
+ result = G_DB_ITEM_CLASS(g_db_bookmark_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b), with);
return result;
@@ -413,6 +422,25 @@ static bool g_db_bookmark_run(GDbBookmark *bookmark, GLoadedBinary *binary, bool
/******************************************************************************
* *
* Paramètres : bookmark = signet à manipuler. *
+* *
+* Description : Construit la description humaine d'un signet sur un tampon. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_db_bookmark_build_label(GDbBookmark *bookmark)
+{
+ asprintf(&G_DB_ITEM(bookmark)->label, _("Bookmark \"%s\""), get_rle_string(&bookmark->comment));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : bookmark = signet à manipuler. *
* binary = binaire chargé en mémoire à modifier. *
* *
* Description : Applique un signet sur un tampon de binaire chargé. *
diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c
index 1bed0ab..249620b 100644
--- a/src/analysis/db/items/comment.c
+++ b/src/analysis/db/items/comment.c
@@ -67,7 +67,7 @@ static void g_db_comment_dispose(GDbComment *);
static void g_db_comment_finalize(GDbComment *);
/* Effectue la comparaison entre deux commentaires enregistrés. */
-static gint g_db_comment_cmp(GDbComment *, GDbComment *);
+static gint g_db_comment_cmp(GDbComment *, GDbComment *, bool);
/* Importe la définition d'un commentaire dans un flux réseau. */
static bool g_db_comment_recv_from_fd(GDbComment *, int, int);
@@ -157,7 +157,7 @@ static void g_db_comment_class_init(GDbCommentClass *klass)
item = G_DB_ITEM_CLASS(klass);
- item->cmp = (GCompareFunc)g_db_comment_cmp;
+ item->cmp = (cmp_db_item_fc)g_db_comment_cmp;
item->recv = (recv_db_item_fc)g_db_comment_recv_from_fd;
item->send = (send_db_item_fc)g_db_comment_send_to_fd;
@@ -259,8 +259,9 @@ GDbComment *g_db_comment_new(const vmpa2t *addr, const char *text, bool is_volat
/******************************************************************************
* *
-* Paramètres : a = premier élément à analyser. *
-* b = second élément à analyser. *
+* Paramètres : a = premier élément à analyser. *
+* b = second élément à analyser. *
+* with = précise les horodatages à prendre en compte. *
* *
* Description : Effectue la comparaison entre deux commentaires enregistrés. *
* *
@@ -270,7 +271,7 @@ GDbComment *g_db_comment_new(const vmpa2t *addr, const char *text, bool is_volat
* *
******************************************************************************/
-static gint g_db_comment_cmp(GDbComment *a, GDbComment *b)
+static gint g_db_comment_cmp(GDbComment *a, GDbComment *b, bool with)
{
gint result; /* Bilan de la comparaison */
@@ -280,7 +281,7 @@ static gint g_db_comment_cmp(GDbComment *a, GDbComment *b)
result = cmp_rle_string(&a->text, &b->text);
if (result == 0)
- result = G_DB_ITEM_CLASS(g_db_comment_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b));
+ result = G_DB_ITEM_CLASS(g_db_comment_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b), with);
return 0;
diff --git a/src/analysis/db/items/switcher.c b/src/analysis/db/items/switcher.c
index 2168e6b..67187aa 100644
--- a/src/analysis/db/items/switcher.c
+++ b/src/analysis/db/items/switcher.c
@@ -75,7 +75,7 @@ static void g_db_switcher_dispose(GDbSwitcher *);
static void g_db_switcher_finalize(GDbSwitcher *);
/* Effectue la comparaison entre deux signets de collection. */
-static gint g_db_switcher_cmp(GDbSwitcher *, GDbSwitcher *);
+static gint g_db_switcher_cmp(GDbSwitcher *, GDbSwitcher *, bool);
/* Importe la définition d'un signet dans un flux réseau. */
static bool g_db_switcher_recv_from_fd(GDbSwitcher *, int, int);
@@ -175,10 +175,11 @@ static void g_db_switcher_class_init(GDbSwitcherClass *klass)
item = G_DB_ITEM_CLASS(klass);
- item->cmp = (GCompareFunc)g_db_switcher_cmp;
+ item->cmp = (cmp_db_item_fc)g_db_switcher_cmp;
item->recv = (recv_db_item_fc)g_db_switcher_recv_from_fd;
item->send = (send_db_item_fc)g_db_switcher_send_to_fd;
+
item->apply = (run_item_fc)g_db_switcher_apply;
item->cancel = (run_item_fc)g_db_switcher_cancel;
@@ -190,7 +191,7 @@ static void g_db_switcher_class_init(GDbSwitcherClass *klass)
/******************************************************************************
* *
-* Paramètres : switcher = instance à initialiser. *
+* Paramètres : switcher = instance à initialiser. *
* *
* Description : Initialise une bascule d'affichage pour opérande numérique. *
* *
@@ -208,7 +209,7 @@ static void g_db_switcher_init(GDbSwitcher *switcher)
/******************************************************************************
* *
-* Paramètres : switcher = instance d'objet GLib à traiter. *
+* Paramètres : switcher = instance d'objet GLib à traiter. *
* *
* Description : Supprime toutes les références externes. *
* *
@@ -227,7 +228,7 @@ static void g_db_switcher_dispose(GDbSwitcher *switcher)
/******************************************************************************
* *
-* Paramètres : switcher = instance d'objet GLib à traiter. *
+* Paramètres : switcher = instance d'objet GLib à traiter. *
* *
* Description : Procède à la libération totale de la mémoire. *
* *
@@ -259,7 +260,7 @@ static void g_db_switcher_finalize(GDbSwitcher *switcher)
GDbSwitcher *g_db_switcher_new(const GArchInstruction *instr, const GImmOperand *imm, ImmOperandDisplay display)
{
- GDbSwitcher *result; /* Instance à retourner */
+ GDbSwitcher *result; /* Instance à retourner */
size_t count; /* Nombre d'opérandes à visiter*/
size_t i; /* Boucle de parcours */
const mrange_t *range; /* Localisation de l'instruct° */
@@ -299,8 +300,9 @@ GDbSwitcher *g_db_switcher_new(const GArchInstruction *instr, const GImmOperand
/******************************************************************************
* *
-* Paramètres : a = premier élément à analyser. *
-* b = second élément à analyser. *
+* Paramètres : a = premier élément à analyser. *
+* b = second élément à analyser. *
+* with = précise les horodatages à prendre en compte. *
* *
* Description : Effectue la comparaison entre deux signets de collection. *
* *
@@ -310,7 +312,7 @@ GDbSwitcher *g_db_switcher_new(const GArchInstruction *instr, const GImmOperand
* *
******************************************************************************/
-static gint g_db_switcher_cmp(GDbSwitcher *a, GDbSwitcher *b)
+static gint g_db_switcher_cmp(GDbSwitcher *a, GDbSwitcher *b, bool with)
{
gint result; /* Bilan de la comparaison */
@@ -337,7 +339,7 @@ static gint g_db_switcher_cmp(GDbSwitcher *a, GDbSwitcher *b)
}
if (result == 0)
- result = G_DB_ITEM_CLASS(g_db_switcher_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b));
+ result = G_DB_ITEM_CLASS(g_db_switcher_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b), with);
return result;