summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-11-10 01:28:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-11-10 01:28:23 (GMT)
commit12b4201890b4b2eefffaa6615b4b3076253dff6f (patch)
tree3756393810dc392658de2e05fc2589cbd119b2a8 /src/format
parent7c7109c1a8aaedea40af4b96d4b81d6ba4496226 (diff)
Shown/hidden virtual addresses / binary code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@41 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format')
-rw-r--r--src/format/elf/symbol.c2
-rw-r--r--src/format/exe_format.c29
-rw-r--r--src/format/exe_format.h2
3 files changed, 32 insertions, 1 deletions
diff --git a/src/format/elf/symbol.c b/src/format/elf/symbol.c
index 4b7740d..c8a0dac 100644
--- a/src/format/elf/symbol.c
+++ b/src/format/elf/symbol.c
@@ -513,7 +513,7 @@ asm_instr **decode_elf_relocations(elf_format *format, size_t *count)
{
offset = rel_vaddress + pos;
- instr = decode_instruction(proc, &EXE_FORMAT(format)->content[rel_start], &pos, rel_size, offset);
+ instr = decode_instruction(proc, &EXE_FORMAT(format)->content[rel_start], &pos, rel_size, 0/* FIXME*/, offset);
result = (asm_instr **)realloc(result, ++(*count) * sizeof(asm_instr *));
result[*count - 1] = instr;
diff --git a/src/format/exe_format.c b/src/format/exe_format.c
index 30976f1..7fcbcfb 100644
--- a/src/format/exe_format.c
+++ b/src/format/exe_format.c
@@ -166,6 +166,35 @@ void delete_bin_part(bin_part *part)
/* ---------------------------------------------------------------------------------- */
+
+
+
+
+/******************************************************************************
+* *
+* Paramètres : format = description de l'exécutable à consulter. *
+* target = nom de la section recherchée. *
+* length = taille du contenu à fournir. [OUT] *
+* *
+* Description : Fournit une référence vers le contenu binaire analysé. *
+* *
+* Retour : Adresse du tampon contenant le contenu du binaire. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+const uint8_t *get_exe_content(const exe_format *format, off_t *length)
+{
+ if (length != NULL) *length = format->length;
+
+ return format->content;
+
+}
+
+
+
+
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à consulter. *
diff --git a/src/format/exe_format.h b/src/format/exe_format.h
index 9be91fb..8e4932f 100644
--- a/src/format/exe_format.h
+++ b/src/format/exe_format.h
@@ -78,6 +78,8 @@ typedef enum _ResolvedType
} ResolvedType;
+/* Fournit une référence vers le contenu binaire analysé. */
+const uint8_t *get_exe_content(const exe_format *, off_t *);
/* Recherche une section donnée au sein de binaire. */
bool find_exe_section(const exe_format *, const char *, off_t *, off_t *, uint64_t *);