Skip to content

Instantly share code, notes, and snippets.

@extremecoders-re
Created February 7, 2016 06:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save extremecoders-re/31fc3dd702ae41096f0c to your computer and use it in GitHub Desktop.
Save extremecoders-re/31fc3dd702ae41096f0c to your computer and use it in GitHub Desktop.
Build your own Pin tool from scratch with Visual Studio 2010

###Build your own Pin tool from scratch with Visual Studio 2010 Intel PIN is a Dynamic Binary Instrumentation framework.

Building a pin tool from scratch is quite an intensive process and is not documented elsewhere. The official pin docs advises to use the sample project as a starting template.

Here I am depicting the steps to build a pin tool from a blank visual studio project. This is tested with Visual Studio 2010 and should also work with other versions.

Directory where pin is extracted: C:\pin

Project type : dll

####Project Options

C\C++

Additional include directories: 
C:\pin\source\include\pin;
C:\pin\source\include\pin\gen;
C:\pin\extras\components\include;
C:\pin\extras\xed2-ia32\include;

Preprocessor definitions:
TARGET_IA32
HOST_IA32
TARGET_WINDOWS
WIN32

Runtime library:
Multi-threaded DLL (/MD)


Additional options:
/D_SECURE_SCL=0 

Linker

Additional library directories:
C:\pin\ia32\lib
C:\pin\ia32\lib-ext
C:\pin\extras\xed2-ia32\lib

Additional dependencies:
pin.lib
libxed.lib
libcpmt.lib
libcmt.lib
pinvm.lib
kernel32.lib
ntdll-32.lib

Ignore all default libraries:
Yes (/NODEFAULTLIB)

Subsystem:
Not Set

EntryPoint:
Ptrace_DllMainCRTStartup%4012

Additional options:
/export:main 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment