summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-07-26 18:52:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-07-26 18:52:15 (GMT)
commita6c46fc296db67321db3d4bb586346998de90422 (patch)
tree042cd0fd89fd1f1c8943b3aefd2b50585f461f58 /src/analysis
parent19516ffcca14abb082c5109125b7249bdc7fc199 (diff)
Reduced the quantity of arguments used to deal with lines.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/block.c3
-rw-r--r--src/analysis/disass/disassembler.c12
2 files changed, 13 insertions, 2 deletions
diff --git a/src/analysis/disass/block.c b/src/analysis/disass/block.c
index d314b5a..74aaf66 100644
--- a/src/analysis/disass/block.c
+++ b/src/analysis/disass/block.c
@@ -36,6 +36,7 @@
#include "../../common/extstr.h"
#include "../../core/params.h"
#include "../../glibext/gbinarycursor.h"
+#include "../../gtkext/gtkblockdisplay.h"
@@ -572,7 +573,7 @@ static char *g_basic_block_build_tooltip(const GBasicBlock *block)
if (label != NULL)
{
- cache = g_buffer_cache_new(NULL);
+ cache = g_buffer_cache_new(NULL, DLC_COUNT);
g_buffer_cache_append(cache, G_LINE_GENERATOR(symbol), BLF_NONE);
line = g_buffer_cache_find_line_by_index(cache, 0);
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index af67fdf..9e4cd3e 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -39,8 +39,10 @@
#include "../human/asm/lang.h"
#include "../../arch/storage.h"
#include "../../core/global.h"
+#include "../../core/params.h"
#include "../../core/nproc.h"
#include "../../glibext/generators/prologue.h"
+#include "../../gtkext/gtkblockdisplay.h"
#include "../../plugins/pglist.h"
@@ -388,6 +390,8 @@ void output_disassembly(GLoadedBinary *binary, GProcContext *context, GtkStatusS
GBinFormat *format; /* Format associé au binaire */
GBinContent *content; /* Contenu bianire manipulé */
GCodingLanguage *lang; /* Langage de sortie préféré */
+ int offset; /* Décalage des étiquettes */
+ GWidthTracker *tracker; /* Gestionnaire de largeurs */
char **text; /* Contenu brute à imprimer */
char *desc; /* Désignation du binaire */
const gchar *checksum; /* Identifiant de binaire */
@@ -401,7 +405,13 @@ void output_disassembly(GLoadedBinary *binary, GProcContext *context, GtkStatusS
content = g_known_format_get_content(G_KNOWN_FORMAT(format));
lang = g_asm_language_new();
- *cache = g_buffer_cache_new(content);
+ *cache = g_buffer_cache_new(content, DLC_COUNT);
+
+ g_generic_config_get_value(get_main_configuration(), MPK_LABEL_OFFSET, &offset);
+
+ tracker = g_buffer_cache_get_width_tracker(*cache);
+ g_width_tracker_set_column_min_width(tracker, DLC_ASSEMBLY_LABEL, offset);
+ g_object_unref(G_OBJECT(tracker));
/**
* Impression du prologue.