Monday, December 22, 2014

Working with Visual Studio 2012 & pintools

Hello there fellow pinheads, this post is going to be short but I think it will be useful for generations to come of pinheads. 

I've been working with PIN for quite a long time now and I've reached the conclusion that having to edit the example Visual Studio solution is too annoying. This also is a problem with newcomers as editing the sample solution may lead to difficult to debug problems. 

It is for that reason that I've delved into VS2012's dungeons and came up with a template that generates the skeleton of a pintool and all the compiling targets that make sense on Windows. That is, 64 and 32 bit targets.

Installation is quite easy, you just need to download the template zip file from the link below and copy it to the following directory:
C:\Users\agustin\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C++ Project
You also need to add to your environment the variable PIN_ROOT pointing to the installation directory of pin. Make sure to give the absolute path without spaces. This allows us to create our pintools outside pin's tools directory.

The template is can be downloaded here. It is important to know that pin is quite version change averse, so make sure you have at least pin Version 2.13 Revision 65163. 

Let me know what you think. Cheers.

No comments: