summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-19 12:43:27 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-19 12:43:27 (GMT)
commit046283038b3e3c8439d71914373b7ac12ee24144 (patch)
treeb3b2fa4918f5ea03351b9b195aa1f5cdb2214758
parentde209a01e646d6d240d3d98ac1f1b0e100939a12 (diff)
Selected the right symbol location for the symbols panel.
-rw-r--r--src/gui/panels/symbols.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index a4ee454..385bfad 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -770,7 +770,7 @@ static void reload_symbols_for_new_list_view(const GSymbolsPanel *panel, GtkStat
GtkTreeStore *store; /* Modèle de gestion */
GExeFormat *format; /* Format associé au binaire */
GArchProcessor *proc; /* Architecture utilisée */
- MemoryDataSize size; /* Taille des localisations */
+ bool has_virt; /* Concept de virtuel présent ?*/
sym_iter_t *siter; /* Parcours des symboles */
GBinSymbol *symbol; /* Symbole manipulé */
cairo_surface_t *icon; /* Image associée au symbole */
@@ -789,7 +789,7 @@ static void reload_symbols_for_new_list_view(const GSymbolsPanel *panel, GtkStat
format = g_loaded_binary_get_format(panel->binary);
proc = g_loaded_binary_get_processor(panel->binary);
- size = g_arch_processor_get_memory_size(proc);
+ has_virt = g_arch_processor_has_virtual_space(proc);
g_object_unref(G_OBJECT(proc));
siter = create_symbol_iterator(G_BIN_FORMAT(format), 0);
@@ -827,7 +827,11 @@ static void reload_symbols_for_new_list_view(const GSymbolsPanel *panel, GtkStat
free(original);
addr = get_mrange_addr(g_binary_symbol_get_range(symbol));
- vmpa2_virt_to_string(addr, size, virt, NULL);
+
+ if (has_virt)
+ vmpa2_virt_to_string(addr, MDS_UNDEFINED, virt, NULL);
+ else
+ vmpa2_phys_to_string(addr, MDS_UNDEFINED, virt, NULL);
gtk_tree_store_append(store, &iter, NULL);
gtk_tree_store_set(store, &iter,
@@ -1045,7 +1049,7 @@ static void reload_symbols_for_new_tree_view(const GSymbolsPanel *panel, GtkStat
GtkTreeStore *store; /* Modèle de gestion */
GExeFormat *format; /* Format associé au binaire */
GArchProcessor *proc; /* Architecture utilisée */
- MemoryDataSize size; /* Taille des localisations */
+ bool has_virt; /* Concept de virtuel présent ?*/
sym_iter_t *siter; /* Parcours des symboles */
GBinSymbol *symbol; /* Symbole manipulé */
cairo_surface_t *icon; /* Image associée au symbole */
@@ -1066,7 +1070,7 @@ static void reload_symbols_for_new_tree_view(const GSymbolsPanel *panel, GtkStat
format = g_loaded_binary_get_format(panel->binary);
proc = g_loaded_binary_get_processor(panel->binary);
- size = g_arch_processor_get_memory_size(proc);
+ has_virt = g_arch_processor_has_virtual_space(proc);
g_object_unref(G_OBJECT(proc));
siter = create_symbol_iterator(G_BIN_FORMAT(format), 0);
@@ -1115,7 +1119,11 @@ static void reload_symbols_for_new_tree_view(const GSymbolsPanel *panel, GtkStat
name = NULL;
addr = get_mrange_addr(g_binary_symbol_get_range(symbol));
- vmpa2_virt_to_string(addr, size, virt, NULL);
+
+ if (has_virt)
+ vmpa2_virt_to_string(addr, MDS_UNDEFINED, virt, NULL);
+ else
+ vmpa2_phys_to_string(addr, MDS_UNDEFINED, virt, NULL);
gtk_tree_store_set(store, &iter,
SBC_SYMBOL, symbol,