본문 바로가기

pintool30

Instruction Address Trace(Instruction Instrumentation) #include #include #include "pin.H" FILE * trace; // This function is called before every instruction is executed //and prints the IP; VOID printip(VOID * ip) { fprintf(trace, "%p\n", ip); } // Pin calls this function every time a new instruction is encountered VOID Instruction(INS ins, VOID *v) { // Insert a call to printip before every instruction, and pass it the IP INS_InsertCall(ins, IPOINT_.. 2018. 9. 11.
Simple Instruction Count(Instruction Instrument) Simple Instruction Count The example below instruments a program to count the total number of instructions executed. It inserts a call to docount before every instruction. When the program exits, it saves the count in the file inscount.out MAIN 함수 PIN_Init(argc, argv) : Initialize pin OutFile.open(KnobOutputFile.Value().c_str()) : output 파일을 오픈한다. INS_AddInstrumentFunction(Instruction, 0) : Regi.. 2018. 9. 11.
핀툴 기초1 Instrumentation-> A technique that inserts extra code into a program to collect runtime information Intsrumentation tool->Pintools INS_ : 명령어추적모든 명령어 실행시 호출할 함수들명령어 관련된 함수들은 여기에 있다. RTN_ : 루틴추적함수 관련 함수들은 여기에 있다. IMG_ : 이미지 로딩, 언로딩 등등 여기서 이미지란, dll 파일같은 공용 라이브러리 TRACE_ : 기록 단계에서 호출되며 추적 가능 KNOB은 Pin에서 만든 명령어 줄에 대한 파싱을 도와주는 역할을 한다. 옵션의 형태를 간략하게 지정해주고 그 옵션에 대한 설명을 써주면 툴 옵션으로서 출력을 해준다. 참고자료http://go.. 2018. 9. 11.