summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/post.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-01-25 01:12:54 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-01-25 01:12:54 (GMT)
commit0993276d6450919c6d178182c5fd26497b62d5fc (patch)
tree5b069eb20ce7360ef6c8d4d55b8a0ab000eb70c2 /src/arch/arm/v7/post.c
parent141d2f0fbb2ce3b4ddf85383c55b891fd59dc598 (diff)
Added a fixed address for the start of the '.plt' section and improved the disassembly process.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@460 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/arm/v7/post.c')
-rw-r--r--src/arch/arm/v7/post.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/arch/arm/v7/post.c b/src/arch/arm/v7/post.c
index 8895740..084fc84 100644
--- a/src/arch/arm/v7/post.c
+++ b/src/arch/arm/v7/post.c
@@ -24,6 +24,9 @@
#include "post.h"
+#include <assert.h>
+
+
#include "../../target.h"
@@ -245,17 +248,26 @@ void post_process_ldr_instructions(GArchInstruction *instr, GProcContext *contex
op = g_arch_instruction_get_operand(instr, 1);
+
+ if (!G_IS_IMM_OPERAND(op)) return;
+
+
if (g_imm_operand_get_value(G_IMM_OPERAND(op), MDS_32_BITS_UNSIGNED, &addr))
{
new = g_target_operand_new(MDS_32_BITS_UNSIGNED, addr);
if (!g_target_operand_resolve(G_TARGET_OPERAND(new), format))
{
+ addr &= ~0x1;
+
+
+ printf("RESOLVING FOR 0x%08x\n", (unsigned int)addr);
+
init_vmpa(&target, VMPA_NO_PHYSICAL, addr);
init_mrange(&trange, &target, 0);
vmpa2_virt_to_string(&target, MDS_32_BITS, loc, NULL);
- snprintf(name, sizeof(name), "loc_%s", loc + 2);
+ snprintf(name, sizeof(name), "loccc_%s", loc + 2);
routine = g_binary_routine_new();
g_binary_routine_set_name(routine, strdup(name));
@@ -272,9 +284,11 @@ void post_process_ldr_instructions(GArchInstruction *instr, GProcContext *contex
g_target_operand_resolve(G_TARGET_OPERAND(new), format);
}
+ else printf("RESOLVED FOR 0x%08x\n", (unsigned int)addr);
g_arch_instruction_replace_operand(instr, new, op);
}
+ else assert(0);
}