# Installation

## Table of Contents

1. Overview
2. Installation

- Quick Start
- Detailed Installation Guide

3. Scripts and Tools
4. Console (GUI) and Modules
5. Developer Docs

## Quick Start

The quickest way to get up and running with an almost full installation of the framework is as follows:

1. Install Python 2.4, Windows Python-2.4.3.msi
2. Launch __install_requirements.py and follow the interactive prompts to download / install requirements.
3. Launch __setup_mysql.py (requires command line arguments) to setup the MySQL database for pstalker.
4. Launch console\PAIMEIconsole.pyw to pull up the GUI.
5. Install IDA Python.
6. Launch IDA, load a target executable and run the pida_dump.py IDA Python script to generate a PIDA file.
7. Load the PIDA file in the GUI and you're up and running.

## Detailed Installation Guide

I won't lie to you, there are a number of pre-requisites for a complete install of the PaiMei framework. Luckily, none of them are difficult to install and many of them you probably already have. Not every portion of the framework relies on all of the pre-reqs. The following table should help you get started on deciding what you will need:

Requirement | Available From | PyDbg | PIDA | GUI | Needed For
Python 2.4 | http://www.python.org | Y | Y | Y | Everything ;-) You definetely need to have this.
IDA Pro | http://www.datarescue.com/idabase/ |  | Y |  | Static analysis such as for PIDA generation. You probably already have this.
IDA Python | http://www.d-dome.net/idapython |  | Y |  | PIDA generation, process stalking. You should install this if you haven't already.
WxPython | http://www.wxpython.org |  |  | Y | Wx is required for PAIMEIconsole, the GUI component. If you don't plan on using the GUI, don't worry about this.
MySQL / MySQLdb | http://www.mysql.org http://sourceforge.net/projects/mysql-python |  |  | Y | The PAIMEIpstalker code coverage tool requires a MySQL database and the Python bindings. The code coverage utility can also store/load from disk, so you only need this module if you plan on using the GUI.
Python ctypes | http://starship.python.net/crew/theller/ctypes/ | Y |  | Y | Required for PyDbg and portions of the console, such as the code coverage tool.
uDraw(Graph) | http://www.informatik.uni-bremen.de/uDrawGraph/en/home.html |  |  |  | Required only if you wish to generate static / interactive graphs with uDraw. I recommend you install this.
GraphViz / PyDot | http://www.graphviz.org http://dkbza.org/pydot.html |  |  |  | Required only if you wish to generate static graphs in Dot. You probably don't need this module.
Oreas GDE | http://www.oreas.com/gde_en.php |  |  |  | Required for GML rendering. Of the 3 currently supported graph rendering routines, this is the prettiest.

You can run the __install_requirements.py Python script to help determine which of the above components you already have installed and to automatically download and install missing components. Once you have all the pre-requisites up and running, to install the PyDbg, pGRAPH, PIDA and utility libraries to your system wide Python directory, simply run the included Microsoft Windows installer. You can then individually launch the console or various scripts from any path on the system. Alternatively, you can keep the entire package: console, scripts, libraries and all together. For a full installation, the final step is to setup the paimei MySQL database. The database name is not optional. You can either manually setup the database yourself using the schema described in "docs\SQL Structure.txt". Alternatively, you can use the __setup_mysql.py helper script to do the work for you.
With everything installed and operational you can launch the GUI console through console\PAIMEIconsole.pyw or start tinkering with the various included scripts such as debuggee_procedure_call.py. For a quick example of an advanced creation on top of the PaiMei framework see the PAIMEIpstalker Flash demo.