#Getting Pin
- Download Pin from here
#Using MemGuard
- extract the Pin tarball you downloaded from here
$ tar -xvzf pin-2.13-62141-gcc.4.4.7-linux.tar.gz
- rename it to pin
$ mv pin-2.13-62141-gcc.4.4.7-linux pin
- move it to the root of the MemGuard folder
$ mv pin memguard/pin
- cd into src/
$ cd memguard/src/
- Make and test the tool.
$ ./make.sh
- The results will be in the obj-intel64 folder.
Or run it manually
- make
$ make PIN_ROOT=../pin
- Now run the MemGuard tool on a sample binary from the src directory
$ ../pin/pin.sh -t obj-intel64/memguard.so -- ./control
- clean
$ make PIN_ROOT=../pin clean
or
$ ./make.sh clean
An error may occur when you run pin:
Killed
paul@paul-UX32VD:~/Git/cse409/pin/MyPinTool$ ./pin/pin -t obj-intel64/mallocmem.so -- test
Killed
E:Attach to pid 7725 failed.
E: The Operating System configuration prevents Pin from using the default (parent) injection mode.
E: To resolve this, either execute the following (as root):
E: $ echo 0 > /proc/sys/kernel/yama/ptrace_scope
E: Or use the "-injection child" option.
E: For more information, regarding child injection, see Injection section in the Pin User Manual.
E:
If this happens do:
- sudo su
- echo 0 > /proc/sys/kernel/yama/ptrace_scope
- exit
Run the command again
#Building Pin Tools
- Navagate to cd source/tools/ManualExamples and make all
$ cd pin/source/tools/ManualExamples
$ make all
- or make just one tool
$ make malloctrace.test
#Using Pin
$ ./pin -t source/tools/ManualExamples/obj-intel64/<pin-tool>.so -- <prgm-to-test>
example
$ ./pin -t source/tools/ManualExamples/obj-intel64/malloctrace.so -- ~/Desktop/test