diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-16 00:17:48 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-16 00:17:48 (GMT) |
commit | a61f089babe336b012da31a494b0f7470b6e1a9a (patch) | |
tree | 0dccd2fe50375e84de49b1119a3feec68b6bd23d /src/arch | |
parent | 46c8fd10ec5bff1ee1146a0b6a7aa7eb9f47a2da (diff) |
Used the binary contents a little bit more.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@551 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/processor.c | 18 | ||||
-rw-r--r-- | src/arch/processor.h | 12 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/arch/processor.c b/src/arch/processor.c index 2c86ffe..86e7845 100644 --- a/src/arch/processor.c +++ b/src/arch/processor.c @@ -269,11 +269,10 @@ GArchInstruction *g_arch_processor_decode_instruction(const GArchProcessor *proc /****************************************************************************** * * -* Paramètres : proc = architecture visée par la procédure. * -* ctx = contexte lié à l'exécution du processeur. * -* data = flux de données à analyser. * -* pos = position courante dans ce flux. [OUT] * -* end = limite des données à analyser. * +* Paramètres : proc = architecture visée par la procédure. * +* ctx = contexte lié à l'exécution du processeur. * +* content = flux de données à analyser. * +* pos = position courante dans ce flux. [OUT] * * * * Description : Désassemble une instruction dans un flux de données. * * * @@ -283,14 +282,19 @@ GArchInstruction *g_arch_processor_decode_instruction(const GArchProcessor *proc * * ******************************************************************************/ -GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *proc, GProcContext *ctx, const bin_t *data, vmpa2t *pos, phys_t end) +GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *proc, GProcContext *ctx, const GBinContent *content, vmpa2t *pos) { GArchInstruction *result; /* Instruction à renvoyer */ vmpa2t back; /* Position sauvegardée */ + /* FIXME */ + const bin_t *_bin_data; + off_t _bin_length; copy_vmpa(&back, pos); - result = G_ARCH_PROCESSOR_GET_CLASS(proc)->disassemble(proc, ctx, data, pos, end); + _bin_data = g_binary_content_get(content, &_bin_length); + + result = G_ARCH_PROCESSOR_GET_CLASS(proc)->disassemble(proc, ctx, _bin_data, pos, _bin_length); if (result == NULL) copy_vmpa(pos, &back); diff --git a/src/arch/processor.h b/src/arch/processor.h index a856942..f7d474a 100644 --- a/src/arch/processor.h +++ b/src/arch/processor.h @@ -74,17 +74,7 @@ MemoryDataSize g_arch_processor_get_instruction_size(const GArchProcessor *); GArchInstruction *g_arch_processor_decode_instruction(const GArchProcessor *, GProcContext *, const bin_t *, off_t *, off_t, vmpa_t, GBinFormat *) __attribute__ ((deprecated)); /* Désassemble une instruction dans un flux de données. */ -GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *, GProcContext *, const bin_t *, vmpa2t *, phys_t) __attribute__ ((deprecated)); - - - -#define g_arch_processor_disassemble_nextgen(_proc, _ctx, _cnt, _pos) \ - ({ \ - const bin_t *_bin_data; \ - off_t _bin_length; \ - _bin_data = g_binary_content_get(_cnt, &_bin_length); \ - g_arch_processor_disassemble(_proc, _ctx, _bin_data, _pos, _bin_length); \ - }) +GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *, GProcContext *, const GBinContent *, vmpa2t *); |