[DynInst_API:] InstructionAPI segfault on archive files


Date: Sun, 05 Jul 2015 22:22:19 +0300
From: Alin MÃndroc <mindroc.alin@xxxxxxxxx>
Subject: [DynInst_API:] InstructionAPI segfault on archive files
Hi everyone,

I am using DyninstAPI for a project involving disassembling files, and it worked perfectly until I had to use it on archive files (static libraries .a).

When I try to get the assembly code for librt.a, a segfault is raised inside the "ia32_decode_prefixes" method. The strange thing is that it fails for a "call" instruction (hex code e8 00 00 00 00), which was already parsed successfully before in another function.

Currently, my way of getting assembly code for a function is to instantiate a decoder:
decoder(currentFunction->isrc()->getPtrToInstruction(crtaddr), InstructionDecoder::maxInstructionLength, currentFunction->isrc()->getArch());
Where crtaddr is (last instruction address) + (last instruction size)
Then, the segfault is thrown for the "call" instruction when I call the decode() method on this InstructionDecoder instance.

Any hints on this? Is there any other way of getting assembly code for an archive file?Â

Thanks,
Alin
[← Prev in Thread] Current Thread [Next in Thread→]