Reversing : The Hacker's Guide to Reverse Engineering

(ff) #1

Most compilers support the generation of listing files during the compila-
tion process. For some compilers, such as GCC, this is a standard part of the
compilation process because the compiler doesn’t directly generate an object
file, but instead generates an assembly language file which is then processed
by an assembler. In such compilers, requesting a listing file simply means that
the compiler must not delete it after the assembler is done with it. In other
compilers (such as the Microsoft or Intel compilers), a listing file is an optional
feature that must be enabled through the command line.


Specific Compilers


Any compiled code sample discussed in this book has been generated with
one of three compilers (this does not include third-party code reversed in the
book):


■■ GCC and G++ version 3.3.1: The GNU C Compiler (GCC) and GNU
C++ Compiler (G++) are popular open-source compilers that generate
code for a large number of different processors, including IA-32. The
GNU compilers (also available for other high-level languages) are com-
monly used by developers working on Unix-based platforms such as
Linux, and most Unix platforms are actually built using them. Note that
it is also possible to write code for Microsoft Windows using the GNU
compilers. The GNU compilers have a powerful optimization engine
that usually produces results similar to those of the other two compilers
in this list. However, the GNU compilers don’t seem to have a particu-
larly aggressive IA-32 code generator, probably because of their ability
to generate code for so many different processors. On one hand, this
frequently makes the IA-32 code generated by them slightly less effi-
cient compared to some of the other popular IA-32 compilers. On the
other hand, from a reversing standpoint this is actually an advantage
because the code they produce is often slightly more readable, at least
compared to code produced by the other compilers discussed here.
■■ Microsoft C/C++ Optimizing Compiler version 13.10.3077: The
Microsoft Optimizing Compiler is one of the most common compilers for
the Windows platform. This compiler is shipped with the various ver-
sions of Microsoft Visual Studio, and the specific version used through-
out this book is the one shipped with Microsoft Visual C++ .NET 2003.
■■ Intel C++ Compiler version 8.0: The Intel C/C++ compiler was devel-
oped primarily for those that need to squeeze the absolute maximum
performance possible from Intel’s IA-32 processors. The Intel compiler
has a good optimization stage that appears to be on par with the other
two compilers on this list, but its back end is where the Intel compiler

Low-Level Software 59
Free download pdf