본문 바로가기
pintool

Instrumenting Child Processes

by sonysame 2018. 10. 2.
#include "pin.H"
#include <iostream>
#include <stdio.h>
#include <unistd.h>

/* ===================================================================== */
/* Command line Switches */
/* ===================================================================== */


BOOL FollowChild(CHILD_PROCESS childProcess, VOID * userData)
{
    fprintf(stdout, "before child:%u\n", getpid());
    return TRUE;
}        

/* ===================================================================== */

int main(INT32 argc, CHAR **argv)
{
    PIN_Init(argc, argv);

    PIN_AddFollowChildProcessFunction(FollowChild, 0);

    PIN_StartProgram();

    return 0;
}


PIN_AddFollowChildProcessFunction()은 child process 를 instrument하는 예시이다. 

'pintool' 카테고리의 다른 글

Managed platforms support1  (0) 2018.10.02
Instrumenting Before and After Forks  (0) 2018.10.02
Replacing a Routine in Probe Mode  (0) 2018.10.02
Detaching Pin from the Application  (0) 2018.10.02
Finding the Static Properties of an Image  (0) 2018.10.02