summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-08-16 11:30:35 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-08-16 11:30:35 (GMT)
commit161c0f8ab227af5033b1b6456607b9b9c3bc60df (patch)
treecadf14ab1bfe857ac9a7904fe9ea98de554751d8 /src/analysis
parent56ee4d3ecddeee05f11083fcc1595e3756b91790 (diff)
Improved the code for handling vmpa_t definitions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@388 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/fetch.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c
index 4686fe2..1f93465 100644
--- a/src/analysis/disass/fetch.c
+++ b/src/analysis/disass/fetch.c
@@ -56,8 +56,8 @@ GArchInstruction *load_raw_binary(const GLoadedBinary *binary, const vmpa2t *bas
GArchProcessor *proc; /* Architecture du binaire */
off_t bin_length; /* Taille des données à lire */
bin_t *bin_data; /* Données binaires à lire */
- vmpa2t *pos; /* Boucle de parcours */
- vmpa2t *prev; /* Boucle de parcours */
+ vmpa2t pos; /* Boucle de parcours */
+ vmpa2t prev; /* Boucle de parcours */
off_t old_phy; /* Ancienne position physique */
GArchInstruction *instr; /* Instruction décodée */
off_t new_phy; /* Nouvelle position physique */
@@ -70,23 +70,23 @@ GArchInstruction *load_raw_binary(const GLoadedBinary *binary, const vmpa2t *bas
end = bin_length;
- pos = local_dup_vmpa(base);
- prev = local_dup_vmpa(base);
+ copy_vmpa(&pos, base);
+ copy_vmpa(&prev, base);
- old_phy = get_phy_addr(prev);
+ old_phy = get_phy_addr(&prev);
while (old_phy < end)
{
- instr = g_db_instruction_new_from_data(bin_data, pos, end, proc);
+ instr = g_db_instruction_new_from_data(bin_data, &pos, end, proc);
if (instr == NULL) break;
- new_phy = get_phy_addr(pos);
+ new_phy = get_phy_addr(&pos);
- g_arch_instruction_set_location(instr, prev, new_phy - old_phy);
+ g_arch_instruction_set_location(instr, &prev, new_phy - old_phy);
g_arch_instruction_add_to_list(&result, instr);
- copy_vmpa(prev, pos);
- old_phy = get_phy_addr(prev);
+ copy_vmpa(&prev, &pos);
+ old_phy = get_phy_addr(&prev);
//done += (new_phy - old_phy);
//gtk_extended_status_bar_update_activity(statusbar, id, done * 1.0 / sum);