summaryrefslogtreecommitdiff
path: root/plugins/arm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-11-27 23:17:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-11-27 23:17:16 (GMT)
commit88f6bc3f7fa37612c2346699f7f3ed0e86660e39 (patch)
tree6e30254fe189faae74e7271dd08b88fc392f01a8 /plugins/arm
parentc81d2f989a14ed083bd99eff91791eca29bf3799 (diff)
Used the format endianness when fetching ARM ldr values.
Diffstat (limited to 'plugins/arm')
-rw-r--r--plugins/arm/v7/fetch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/arm/v7/fetch.c b/plugins/arm/v7/fetch.c
index 0c15dcd..0aa0c6c 100644
--- a/plugins/arm/v7/fetch.c
+++ b/plugins/arm/v7/fetch.c
@@ -377,7 +377,9 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
off_t val_offset; /* Position de valeur à lire */
vmpa2t loaded_addr; /* Adresse de valeur chargée */
mrange_t loaded_range; /* Espace de chargement */
+ GBinFormat *base; /* version parente du format */
GBinContent *content; /* Contenu binaire à relire */
+ SourceEndian endian; /* Boutisme du format parent */
uint32_t target; /* Adresse virtuelle visée */
vmpa2t pos; /* Tête de lecture de valeur */
VMPA_BUFFER(loc); /* Adresse au format texte */
@@ -452,11 +454,16 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
/* Lecture de la valeur vers laquelle renvoyer */
- content = g_binary_format_get_content(G_BIN_FORMAT(format));
+ base = G_BIN_FORMAT(format);
+
+ content = g_binary_format_get_content(base);
+
+ endian = g_binary_format_get_endianness(base);
copy_vmpa(&pos, &loaded_addr);
- ret = g_binary_content_read_u32(content, &pos, SRE_LITTLE /* FIXME */, &target);
+ ret = g_binary_content_read_u32(content, &pos, endian, &target);
+
g_object_unref(G_OBJECT(content));
if (!ret)