summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
commit156d2e2f6beda2302552ac79678494d914fda05b (patch)
tree021825960b7ac3315a336fc085a4f1d07c05df39 /src/analysis/disass
parent21537636cd8318cf5a720211619ad3c3023b52e9 (diff)
Replaced all remaining raw accesses to binary contents with the GBinContent wrapper in binary formats.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@555 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/area.c8
-rw-r--r--src/analysis/disass/disassembler.c4
-rw-r--r--src/analysis/disass/fetch.c4
-rw-r--r--src/analysis/disass/output.c5
4 files changed, 15 insertions, 6 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index dd35eaa..3338b03 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -509,7 +509,7 @@ bool load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
proc = g_loaded_binary_get_processor(binary);
- content = g_binary_format_get_conten_(format);
+ content = g_binary_format_get_content(format);
/* TODO : unref */
area = (*list) + *index;
@@ -632,6 +632,8 @@ bool load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons
printf("\n");
+ g_object_unref(G_OBJECT(content));
+
g_object_unref(G_OBJECT(proc));
return result;
@@ -680,7 +682,7 @@ static void load_data_from_mem_area(mem_area *area, mem_area *list, size_t count
/* Récupération des informations de base */
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
- content = g_binary_format_get_conten_(format);
+ content = g_binary_format_get_content(format);
/* TODO g_object_unref(G_OBJECT(format)); */
proc = g_loaded_binary_get_processor(binary);
@@ -793,6 +795,8 @@ static void load_data_from_mem_area(mem_area *area, mem_area *list, size_t count
}
+ g_object_unref(G_OBJECT(content));
+
}
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 2b518f9..cd16429 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -700,8 +700,10 @@ void disassemble_binary(GLoadedBinary *binary, GArchInstruction **instrs, GCodeB
*buffer = g_code_buffer_new(BLC_ASSEMBLY);
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
- content = g_binary_format_get_conten_(format);
+
+ content = g_binary_format_get_content(format);
checksum = g_binary_content_get_cheksum(content);
+ g_object_unref(G_OBJECT(content));
build_disass_prologue(*buffer, g_loaded_binary_get_name(binary, true), checksum);
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c
index d7de724..9ebe231 100644
--- a/src/analysis/disass/fetch.c
+++ b/src/analysis/disass/fetch.c
@@ -169,7 +169,7 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, GtkExt
/* Définition à la découpe des parties à traiter */
- content = g_binary_format_get_conten_(format);
+ content = g_binary_format_get_content(format);
length = g_binary_content_compute_size(content);
areas = compute_memory_areas(G_EXE_FORMAT(format), length, &count);
@@ -235,6 +235,8 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, GtkExt
/* free */
+ g_object_unref(G_OBJECT(content));
+
g_object_unref(G_OBJECT(proc));
return result;
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index 91c865a..d698c71 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -58,7 +58,7 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
GLangOutput *output; /* Modèle de sortie adéquat */
//GArchProcessor *proc; /* Architecture du binaire */
MemoryDataSize msize; /* Taille du bus d'adresses */
- const bin_t *content; /* Contenu binaire global */
+ const GBinContent *content; /* Contenu binaire global */
#if 0
const mrange_t *range; /* Cou
@@ -130,7 +130,7 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
//proc = get_arch_processor_from_format(format);
msize = g_arch_processor_get_memory_size(proc);
- content = g_binary_format_get_content(G_BIN_FORMAT(format), NULL);
+ content = g_binary_format_get_content(G_BIN_FORMAT(format));
#if 0
g_arch_instruction_get_location(instrs, NULL, NULL, &start);
@@ -276,6 +276,7 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
}
+ g_object_unref(G_OBJECT(content));
/* free portions... */