Table of Contents for
The IDA Pro Book, 2nd Edition

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition The IDA Pro Book, 2nd Edition by Chris Eagle Published by No Starch Press, 2011
  1. Cover
  2. The IDA Pro Book
  3. PRAISE FOR THE FIRST EDITION OF THE IDA PRO BOOK
  4. Acknowledgments
  5. Introduction
  6. I. Introduction to IDA
  7. 1. Introduction to Disassembly
  8. The What of Disassembly
  9. The Why of Disassembly
  10. The How of Disassembly
  11. Summary
  12. 2. Reversing and Disassembly Tools
  13. Summary Tools
  14. Deep Inspection Tools
  15. Summary
  16. 3. IDA Pro Background
  17. Obtaining IDA Pro
  18. IDA Support Resources
  19. Your IDA Installation
  20. Thoughts on IDA’s User Interface
  21. Summary
  22. II. Basic IDA Usage
  23. 4. Getting Started with IDA
  24. IDA Database Files
  25. Introduction to the IDA Desktop
  26. Desktop Behavior During Initial Analysis
  27. IDA Desktop Tips and Tricks
  28. Reporting Bugs
  29. Summary
  30. 5. IDA Data Displays
  31. Secondary IDA Displays
  32. Tertiary IDA Displays
  33. Summary
  34. 6. Disassembly Navigation
  35. Stack Frames
  36. Searching the Database
  37. Summary
  38. 7. Disassembly Manipulation
  39. Commenting in IDA
  40. Basic Code Transformations
  41. Basic Data Transformations
  42. Summary
  43. 8. Datatypes and Data Structures
  44. Creating IDA Structures
  45. Using Structure Templates
  46. Importing New Structures
  47. Using Standard Structures
  48. IDA TIL Files
  49. C++ Reversing Primer
  50. Summary
  51. 9. Cross-References and Graphing
  52. IDA Graphing
  53. Summary
  54. 10. The Many Faces of IDA
  55. Using IDA’s Batch Mode
  56. Summary
  57. III. Advanced IDA Usage
  58. 11. Customizing IDA
  59. Additional IDA Configuration Options
  60. Summary
  61. 12. Library Recognition Using FLIRT Signatures
  62. Applying FLIRT Signatures
  63. Creating FLIRT Signature Files
  64. Summary
  65. 13. Extending IDA’s Knowledge
  66. Augmenting Predefined Comments with loadint
  67. Summary
  68. 14. Patching Binaries and Other IDA Limitations
  69. IDA Output Files and Patch Generation
  70. Summary
  71. IV. Extending IDA’s Capabilities
  72. 15. IDA Scripting
  73. The IDC Language
  74. Associating IDC Scripts with Hotkeys
  75. Useful IDC Functions
  76. IDC Scripting Examples
  77. IDAPython
  78. IDAPython Scripting Examples
  79. Summary
  80. 16. The IDA Software Development Kit
  81. The IDA Application Programming Interface
  82. Summary
  83. 17. The IDA Plug-in Architecture
  84. Building Your Plug-ins
  85. Installing Plug-ins
  86. Configuring Plug-ins
  87. Extending IDC
  88. Plug-in User Interface Options
  89. Scripted Plug-ins
  90. Summary
  91. 18. Binary Files and IDA Loader Modules
  92. Manually Loading a Windows PE File
  93. IDA Loader Modules
  94. Writing an IDA Loader Using the SDK
  95. Alternative Loader Strategies
  96. Writing a Scripted Loader
  97. Summary
  98. 19. IDA Processor Modules
  99. The Python Interpreter
  100. Writing a Processor Module Using the SDK
  101. Building Processor Modules
  102. Customizing Existing Processors
  103. Processor Module Architecture
  104. Scripting a Processor Module
  105. Summary
  106. V. Real-World Applications
  107. 20. Compiler Personalities
  108. RTTI Implementations
  109. Locating main
  110. Debug vs. Release Binaries
  111. Alternative Calling Conventions
  112. Summary
  113. 21. Obfuscated Code Analysis
  114. Anti–Dynamic Analysis Techniques
  115. Static De-obfuscation of Binaries Using IDA
  116. Virtual Machine-Based Obfuscation
  117. Summary
  118. 22. Vulnerability Analysis
  119. After-the-Fact Vulnerability Discovery with IDA
  120. IDA and the Exploit-Development Process
  121. Analyzing Shellcode
  122. Summary
  123. 23. Real-World IDA Plug-ins
  124. IDAPython
  125. collabREate
  126. ida-x86emu
  127. Class Informer
  128. MyNav
  129. IdaPdf
  130. Summary
  131. VI. The IDA Debugger
  132. 24. The IDA Debugger
  133. Basic Debugger Displays
  134. Process Control
  135. Automating Debugger Tasks
  136. Summary
  137. 25. Disassembler/Debugger Integration
  138. IDA Databases and the IDA Debugger
  139. Debugging Obfuscated Code
  140. IdaStealth
  141. Dealing with Exceptions
  142. Summary
  143. 26. Additional Debugger Features
  144. Debugging with Bochs
  145. Appcall
  146. Summary
  147. A. Using IDA Freeware 5.0
  148. Using IDA Freeware
  149. B. IDC/SDK Cross-Reference
  150. Index
  151. About the Author

Your IDA Installation

Once you calm down from the initial excitement of receiving your shiny, new IDA CD and get down to the task of installing IDA, you will see that your CD contains directories named utilities and sdk containing various add-on utilities and the IDA software development kit, respectively. These will be discussed in detail later in the book. In the root directory of the CD you will find an installation binary. For Windows users, this binary is a traditional Windows installer executable. For Linux and OS X users, the installation binary is a gzipped .tar file.

Windows Installation

Installing IDA on Windows is very straightforward. IDA’s Windows installer requires a password that is supplied with your CD or via email if you have downloaded your copy of IDA. Launching the Windows installer walks you through several informational dialogs, only one of which requires any thought. As shown in Figure 3-1, you will be offered the opportunity to specify an installation location or to accept the default suggested by the installer. Regardless of whether you choose the default or specify an alternate location, for the remainder of this book we will refer to your chosen install location as <IDADIR>. In your IDA directory, you will find your key file, ida.key, along with the following IDA executables:

  • idag.exe is the Windows native GUI version of IDA. Beginning with version 6.2, this file will cease to be shipped with IDA.

  • idaq.exe is the Windows Qt GUI version of IDA (versions 6.0 and later).

  • idaw.exe is the Windows text-mode version of IDA.

Choosing your installation location

Figure 3-1. Choosing your installation location

With the move to the Qt cross-platform GUI library in IDA version 6.0, the native Windows version of IDA (idag.exe) has been deprecated and will cease to ship with IDA beginning with version 6.2.

OS X and Linux Installation

For installation on either OS X or Linux, gunzip and untar the appropriate archive to a location of your choosing. On a Linux system, it might look like this:

# tar -xvzf ida61l.tgz

On an OS X system, it will look like this:

# tar -xvzf ida61m.tgz

In either case, you will have a top-level directory named ida that contains all required files.

For both OS X and Linux, the name of the GUI version is idaq and the name of the console version is idal. The appearance of the console version is very similar to the Windows console version of IDA, which is shown in Figure 3-2. Linux users may need to verify (using ldd) that all shared libraries required by IDA are available on their systems. One plug-in in particular, IDAPython, expects to find Python version 2.6 installed. You may need to upgrade your Python installation or create symbolic links as necessary to satisfy IDA requirements.

The console version of IDA Pro

Figure 3-2. The console version of IDA Pro

IDA and SELinux

If you are a Linux user that has SELinux enabled, you may find that IDA complains it “cannot enable executable stack as shared object” when attempting to load your desired processor module. The execstack command may be used to fix this problem on a per module basis as shown here:

execstack -c <IDADIR>/procs/pc.ilx

32-bit vs. 64-bit IDA

Users of the advanced version of IDA will notice that they have two versions of each IDA executable, such as idag.exe and idag64.exe or idaq and idaq64. The distinction between the versions is that idax64 is capable of disassembling 64-bit code; however, all of the IDA executables themselves are 32-bit code. As a result, users running IDA on 64-bit platforms need to ensure that any supporting software required by IDA is available in a 32-bit version. For example, 64-bit Linux users must ensure that a 32-bit version of Python is installed if they wish to use IDAPython for scripting. Consult the documentation for your operating system for details on mixing 32- and 64-bit software.

The IDA Directory Layout

Instant familiarity with the contents of your IDA installation is by no means a requirement before you start using IDA. However, since our attention is turned to your new IDA install for the moment, let’s take an initial look at the basic layout. An understanding of the IDA directory structure will become more important as you progress to using the more advanced features of IDA covered later in the book. A brief description of each of the subdirectories within the IDA installation follows (for Windows and Linux users, these are found under <IDADIR>; for OS X users, these will be found under <IDA-DIR>/idaq.app/Contents/MacOS):

cfg

The cfg directory contains various configuration files, including the basic IDA configuration file ida.cfg, the GUI configuration file idagui.cfg, and the text-mode user interface configuration file idatui.cfg. Some of the more useful configuration capabilities of IDA will be covered in Chapter 11.

idc

The idc directory contains the core files required by IDA’s built-in scripting language, IDC. Scripting with IDC will be covered in more detail in Chapter 15.

ids

The ids directory contains symbol files (IDS files in IDA parlance) that describe the content of shared libraries that may be referenced by binaries loaded into IDA. These IDS files contain summary information that lists all entries that are exported from a given library. These entries describe the type and number of parameters that a function requires, the return type (if any) of a function, and the calling convention utilized by the function.

loaders

The loaders directory contains IDA extensions that are used during the file-loading process to recognize and parse known file formats such as PE or ELF files. IDA loaders will be discussed in more detail in Chapter 18.

plugins

The plugins directory contains IDA modules designed to provide additional, and in most cases user-defined, behavior for IDA. IDA plug-ins will be discussed in greater detail in Chapter 17.

procs

The procs directory contains the processor modules supported by the installed version of IDA. Processor modules provide the machine-language-to-assembly-language translation capability within IDA and are responsible for generating the assembly language displayed in the IDA user interface. IDA processor modules will be discussed in more detail in Chapter 19.

sig

The sig directory contains signatures for existing code that IDA utilizes for various pattern-matching operations. It is through such pattern matching that IDA can identify sequences of code as known library code, potentially saving you significant amounts of time in the analysis process. The signatures are generated using IDA’s Fast Library Identification and Recognition Technology (FLIRT), which will be covered in more detail in Chapter 12.

til

The til directory contains type library information that IDA uses to record the layout of data structures specific to various compiler libraries. Customizing IDA type libraries will be discussed further in Chapter 13.