Keywords: pev, pe, malware, analysis, threat, manual

From the sources
Prev | Chapter 2. Download and installation | Next

## From the sources

Go to http://pev.sourceforge.net, and download the tarball named pev-x.xx.tar.gz, where x.xx is the version number you want.

You can have the most up to date source code from the pev repository on GitHub (recommended). If you have git installed, run the following:

`$` git clone --recursive git://github.com/merces/pev.git

Even without git installed, you can download a ZIP or tarball file from project web page on GitHub.

### Compiling on GNU/Linux

Make sure you have the following dependencies installed and working properly:

libpe (included if you've used the --recursive option of git command)
libssl (used by pehash and pesec)
gcc
make

If you have downloaded the tarball, uncompress it with tar command:

    $ tar xf pev-x.xx.tar.gz
    $ cd pev-x.xx

If you've cloned the git repository, it's time to compile pev and its libraries:

    $ make
    # make install (root privileges needed)

The commands above will compile libpe and all pev binaries. You can set DEST and PREFIX variables if you need. For compiling libpe only, enter in its directory and issue make command, as this:

    $ cd lib/libpe
    $ make

To compile individual pev binaries, use:

    $ cd src/
    $ make program

### Note

In order to use any pev binary you should compile and install libpe first.

### Compiling in Windows (via Cygwin)

The first step is to download and install Cygwin. During the installation process, you must select at minimum the following packages:

gcc-core
binutils
make
zip
openssl-devel
git (just to clone de repository and make things easier)

You should follow the same compilation steps for GNU/Linux, replacing "make install" by "make zip" at the end:

    $ make zip

A file pev-x.xx.zip will be created and can be extracted in any directory you choose. All pev toolks can be called directly from Windows Command Prompt (cmd.exe). You can add the pev's directory in %PATH% environment variable in order to call pev tools from anywhere.

### Warning

You can't call "make install" under Cygwin.

### Compiling in OS X

We recommend you use one of the following package managers to install dependencies first when compiling in OS X:

Homebrew - http://brew.sh/
MacPorts - http://www.macports.org

For Homebrew, use:

    $ brew install <pkgname>
    $ make CFLAGS="-I/opt/local/include"

For MacPorts, use:

    $ sudo port install <pkgname>
    $ make CFLAGS="-I/opt/local/include"

The directories above may change depending on your package manager installation settings.

### Compiling in other platforms

As pev is written in standard C language, we encourage you to compile it in different platforms and let us know about that. We believe pev can be compiled in many different platforms with just a few or no patches, but you may face some dependencies challenges. Anyway, we encourage you to get in touch to discuss.

Previous versions were compiled for Android, Solaris and other systems. If you want to give it a try, go ahead! ;)

### Output retro-compatibility

As of version 0.70 the output format of pev programs changed. If you have some scripts calling pev and parsing the old 0.60 output format, you can define a macro called LIBPE_ENABLE_OUTPUT_COMPAT_WITH_V06 before compilation, just like this:

    $ DFLAGS+=-DLIBPE_ENABLE_OUTPUT_COMPAT_WITH_V06 make readpe

This retrocompatibility will be removed in the next release, so please consider updating your scripts as soon as possible.

Prev | Up | Next
Chapter 2. Download and installation | Home | Chapter 3. Configuration