summaryrefslogtreecommitdiff
path: root/src/format/format.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-10-13 23:30:30 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-10-13 23:30:30 (GMT)
commit18beadb4192144b00c06769645befb17ae1ce98e (patch)
tree9d29be95f3343bf8126ca99c42907242ceb57714 /src/format/format.c
parent7800159c1dd6538f0ee9d026cf3f121a488dd647 (diff)
Kept all information about real addresses for routine symbols (ARM vs Thumb).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@593 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/format.c')
-rw-r--r--src/format/format.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/format/format.c b/src/format/format.c
index 6128c9a..9f03924 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -147,6 +147,48 @@ GBinContent *g_binary_format_get_content(const GBinFormat *format)
/******************************************************************************
* *
+* Paramètres : format = description de l'exécutable à compléter. *
+* pt = point de l'espace mémoire à considérer. *
+* entry = nature du point fourni. *
+* *
+* Description : Enregistre une adresse comme début d'une zone de code. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_binary_format_register_code_point(GBinFormat *format, virt_t pt, bool entry)
+{
+ if (entry)
+ {
+ format->entry_points = (virt_t *)realloc(format->entry_points,
+ ++format->ep_count * sizeof(virt_t));
+
+ format->entry_points[format->ep_count - 1] = pt;
+
+ }
+ else
+ {
+ if (format->xp_count == format->xp_allocated)
+ {
+ format->xp_allocated += EXTRA_POINT_BLOCK;
+
+ format->extra_points = (virt_t *)realloc(format->extra_points,
+ format->xp_allocated * sizeof(virt_t));
+
+ }
+
+ format->extra_points[format->xp_count++] = pt;
+
+ }
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : format = description de l'exécutable à consulter. *
* ctx = contexte de désassemblage à préparer. *
* *
@@ -165,6 +207,9 @@ void g_binary_format_setup_disassembling_context(const GBinFormat *format, GProc
for (i = 0; i < format->ep_count; i++)
g_proc_context_push_drop_point(ctx, format->entry_points[i]);
+ for (i = 0; i < format->xp_count; i++)
+ g_proc_context_push_drop_point(ctx, format->extra_points[i]);
+
}