Questions tagged [intel-pin]

Pin is a dynamic binary instrumentation framework for the IA-32 and x86-64 instruction-set architectures that enables the creation of dynamic program analysis tools.

"Pin is a dynamic binary instrumentation framework for the IA-32 and x86-64 instruction-set architectures that enables the creation of dynamic program analysis tools."

Pin resources:

237 questions
3
votes
0 answers

Intel Pin multithreading instrumentation: How to only instrument the shared variable accesses between the threads?

I'm using Intel Pin to dynamically instrument the multi-threaded programs to do some data race detection. I instrument memory read/write instructions to collect memory traces at runtime and then analyze the log. The trace collection is simple, which…
3
votes
1 answer

How do I get the value that is written by a store instruction in Pin?

I am currently using Pin and I want to get the value that a store instruction is writing. The problem that I am facing is that even though I can insert a callback before the write instruction (using IPOINT_BEFORE) and get a value from the memory…
vic
  • 359
  • 4
  • 18
3
votes
1 answer

Pin Tool Segmentation Fault for Ubuntu 17.04

I have successfully run the pin with one of its own example tool inscount for ubuntu 12.04. But I face a different situation for ubuntu 17.04 version. Here what it showed: A: Source/pin/injector_nonmac/auxvector.cpp: CopyAux: 291: unexpected AUX VEC…
3
votes
1 answer

Intel Pin 3.0 does not recognize MPX instructions?

I have the latest version of Intel Pin 3.0 version 76887. I have an MPX-enabled toy example: #include int g[10]; int main(int argc, char **argv) { int x = g[11]; printf("%d\n", x); return 0; } When compiled with gcc + MPX, I see MPX…
3
votes
2 answers

How can i pass instruction to a call back in intel-pintool?

I'm new in pintool, i know how to pass instruction address to call back, by using: INS_InsertPredicatedCall( ins, IPOINT_BEFORE, (AFUNPTR)MyFunction, IARG_ADDRINT, INS_Address(ins), IARG_END);…
Mos Moh
  • 317
  • 3
  • 15
3
votes
2 answers

Number of CALL and RET instructions tracking mismatch while using Intel Pin

I am trying to use Intel Pintool to monitor CALL and RET instructions on an x86-64 machine (Mac Pro). I'm passing IARG_INST_PTR (mentioned below) to the docount function and using the instruction-pointer I deduce the instruction by checking the…
kaushik
  • 31
  • 3
3
votes
1 answer

Using IARG_MEMORYREAD_EA with PIN_SafeCopy

Type of IARG_MEMORYREAD_EA is defined as ADDRINT in PIN. I need to fetch a piece of data stored in IARG_MEMORYREAD_EA location of memory. As far as I understand the most proper way to fetch data from a specific address location is using PIN_SafeCopy…
3
votes
1 answer

Extracting a copy of operands using Intel-pin

I am a newbie to intel-pin,I am trying to do a bit width analysis on binaries. I try to analyze the exact number of bits used for operands in each assembly instruction. For example if an unsigned integer 15 has been stored then 4 bits enough. To do…
Krish
  • 189
  • 2
  • 3
  • 9
2
votes
0 answers

In the below mentioned code I want the output to be in the decreasing order of the calls

In the code I"m trying to get the output in the decreasing order of calls. Can someone please help? #include #include #include #include #include "pin.H" using std::ofstream; using std::string; using…
Robert
  • 21
  • 2
2
votes
0 answers

Windows pintool mismatch between call/ret instructions

So i've been trying to write a pintool that monitors call/ret instructions but i've noticed that threre was a significant inconsistency between the two. For example ret instructions without previous call. I've run the tool in a console application…
tturbox
  • 21
  • 3
2
votes
1 answer

instruction point value of dynamic linking and static linking

By using Intel's pin, I printed out the instruction pointer (ip) values for a program with dynamic linking and static linking. And I've found that their ip values are quite different, even though they are the same program. A program with static…
2
votes
0 answers

Capture All Heap Allocations

I want to find all accesses to heap memory in an application. I need to store each allocation and, consequently, can not only check for addresses in the [heap] range (which also does not include heap memory areas allocated by mmap()). Therefore, I…
TheAhmad
  • 810
  • 1
  • 9
  • 21
2
votes
1 answer

How to find main function with pintool

I'm new to writing pintool programs. I want to find the main function of target program with PIN. But I always got just an UnNamedImageEntryPoint with SYM_Name() and RTN_Name. I guess the lack of symbols caused this. So is there any solution for me…
shijy
  • 21
  • 3
2
votes
1 answer

What IARG_EXPLICIT_MEMORY_EA should be used for?

I am willing to instrument lea instructions, followed by a call to PIN_SafeCopy() to capture the content of the memory. I tried with IARG_MEMORY_READ_EA but it did not work. So I move to IARG_EXPLICIT_MEMORY_EA as it is written in the fine manual…
Heyji
  • 1,113
  • 8
  • 26
2
votes
1 answer

Stack allocation size using intel pin tool

I have following c code: #include int foo() { int a = 4; int *p = &a; printf("%i\n", *p); int b[10]; b[1] = 3; } int main(void) { int a[10], b[20]; a[2] = 7; b[7] = 9; foo(); return 0; } I created following PIN…
R4444
  • 2,016
  • 2
  • 19
  • 30
1
2
3
15 16