From 88f6bc3f7fa37612c2346699f7f3ed0e86660e39 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Wed, 28 Nov 2018 00:17:16 +0100 Subject: Used the format endianness when fetching ARM ldr values. --- plugins/arm/v7/fetch.c | 11 +++++++++-- 1 file 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) -- cgit v0.11.2-87-g4458