Help on disassembler/decompilers
Hank Dietz
hankd at dynamo.ecn.purdue.edu
Mon Sep 10 08:38:57 AEST 1990
In article <HOW.90Sep5173755 at sundrops.ucdavis.edu> you write:
> I am looking for any information related to disassembling
>object code into assembly langauge or even higher-level language such
>as C. Would someone please give me pointers to program sources,
>documentation or papers related to this?
Basic disassembly is trivial, particularly if you have an object
module with a name list. The interesting problems are:
[1] Determining which portions of a raw memory image are
code and which are data. Typically, this is done by
providing a set of code entry points and having the
disassembler trace program flow marking each word with
type information as each flow path is followed.
[2] Dealing with self-modifying code. At least the
technique of [1] can detect when this might happen....
I don't know of any reasonable way to deal with it.
Notice that indirect jump tables are particularly difficult to flow
trace (see [1]), as are techniques which use a Call instruction but
follow the instruction with the argument values (raw data) and tweak
the return address appropriately (as in some threaded interpreters).
Notice that knowing that the code image came from a particular
compiler can make these problems much easier to deal with, since you
can simply recognize the compiler's code generation idiom.
-hankd at ecn.purdue.edu
PS: Back around 1981-2 I did a flow analyzing disassembler for several
then-popular microprocessors (e.g., 8080). I still have it, but
it really isn't very impressive... especially when it hits some of
those problem cases noted above (e.g., PCHL).
--
Send compilers articles to compilers at esegue.segue.boston.ma.us
{ima | spdcc | world}!esegue. Meta-mail to compilers-request at esegue.
More information about the Comp.unix.wizards
mailing list