本文整理汇总了C++中PIN_AddFiniFunction函数的典型用法代码示例。如果您正苦于以下问题:C++ PIN_AddFiniFunction函数的具体用法?C++ PIN_AddFiniFunction怎么用?C++ PIN_AddFiniFunction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PIN_AddFiniFunction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
PIN_Init(argc, argv);
PIN_AddThreadStartFunction(ThreadStart, 0);
INS_AddInstrumentFunction(Instruction, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例2: main
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
out = new ofstream("nops.out");
INS_AddInstrumentFunction(Instruction, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例3: main
int main(INT32 argc, CHAR **argv)
{
PIN_InitSymbols();
PIN_Init(argc, argv);
RTN_AddInstrumentFunction(Rtn, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例4: STool_Run
// -------------------------------------------------------------
// Tool startup function
// -------------------------------------------------------------
void STool_Run(STool_TSetup* s) {
// make setup configuration globally available
gSetup = *s;
// extract application (path)name and full application command line
for (int i=0; i<gSetup.argc-1;)
if (!strcmp("--", gSetup.argv[i++])) {
int len = 0, j;
for (j=i; j<gSetup.argc; ++j) len += strlen(gSetup.argv[j])+1;
gAppName = gSetup.argv[i];
gCommandLine = (char*)calloc(len, 1);
if (gCommandLine == NULL) exit((printf("Can't allocate command line string\n"),1));
strcat(gCommandLine, gSetup.argv[i]);
for (j=i+1; j<gSetup.argc; ++j) {
strcat(gCommandLine, " ");
strcat(gCommandLine, gSetup.argv[j]);
}
}
// initialize symbol table code, needed for rtn instrumentation
PIN_InitSymbols();
// initialize pin
if (PIN_Init(gSetup.argc, gSetup.argv)) {
Usage();
return;
}
// obtain a key for TLS storage.
gTlsKey = PIN_CreateThreadDataKey(0);
// if using memory operations buffering, define a BUF_SIZE-pages trace buffer
// and register BufferOverflow to be called when the buffer fills up
if (gSetup.memBuf) buf_id = PIN_DefineTraceBuffer(sizeof(STool_TMemRec), BUF_SIZE, BufferOverflow, 0);
// register ThreadStart to be called when a thread starts
PIN_AddThreadStartFunction(ThreadStart, 0);
// register ThreadEnd to be called when a thread ends
PIN_AddThreadFiniFunction(ThreadEnd, 0);
// register I_Trace to be called to instrument traces
TRACE_AddInstrumentFunction(I_Trace, 0);
// register Fini to be called when application exits
if (gSetup.appEnd) PIN_AddFiniFunction(Fini, 0);
// start the program, never returns
PIN_StartProgram();
}
示例5: main
int main( int argc, char **argv )
{
PIN_InitSymbols();
if ( PIN_Init(argc, argv) )
return Usage();
LogFile = fopen( KnobOutputFile.Value().c_str(), "wb" );
IMG_AddInstrumentFunction( ImageLoad, NULL );
PIN_AddFiniFunction( Finish, NULL );
PIN_StartProgram();
return 0;
}
示例6: main
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) return Usage();
trace = fopen("pinatrace.out", "w");
INS_AddInstrumentFunction(Instruction, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例7: main
int main(int argc, char * argv[])
{
PIN_InitSymbols();
PIN_Init(argc, argv);
INS_AddInstrumentFunction(Instruction, 0);
IMG_AddInstrumentFunction(ImageLoad, 0);
// Register Fini to be called when the application exits
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例8: main
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
PIN_InitSymbols();
InitLock(&Lock);
IMG_AddInstrumentFunction(OnImage, 0);
RTN_AddInstrumentFunction(InstrumentRtn, 0);
PIN_InterceptDebuggingEvent(DEBUGGING_EVENT_BREAKPOINT, Intercept, 0);
PIN_InterceptDebuggingEvent(DEBUGGING_EVENT_ASYNC_BREAK, Intercept, 0);
PIN_AddFiniFunction(OnExit, 0);
PIN_StartProgram();
return 0;
}
示例9: main
int main(int argc, char * argv[])
{
PIN_InitSymbols();
PIN_Init(argc, argv);
RTN_AddInstrumentFunction(Rtn, 0);
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例10: main
int main(int argc, char *argv[])
{
// Initialize PIN library. Print help message if -h(elp) is specified
// in the command line or the command line is invalid
if(PIN_Init(argc,argv))
return Usage();
/// Instrumentations
// Register function to be called to instrument traces
TRACE_AddInstrumentFunction(trace_instrumentation, 0);
// Register function to be called when the application exits
PIN_AddFiniFunction(this_is_the_end, 0);
// Register function to be called when a module is loaded
IMG_AddInstrumentFunction(image_instrumentation, 0);
/// Other stuffs
// This routine will be called if the sleeping_thread calls PIN_Detach() (when the time is out)
PIN_AddDetachFunction(pin_is_detached, 0);
// Run a thread that will wait for the time out
PIN_SpawnInternalThread(
sleeping_thread,
0,
0,
NULL
);
// If we are in a wow64 process we must blacklist manually the JMP FAR: stub
// from being instrumented (each time a syscall is called, it will be instrumented for *nothing*)
// Its address is in FS:[0xC0] on Windows 7
ADDRINT wow64stub = __readfsdword(0xC0);
modules_blacklisted.insert(
std::make_pair(
std::string("wow64stub"),
std::make_pair(
wow64stub,
wow64stub
)
)
);
/// FIRE IN THE HOLE
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例11: main
int main(int argc, char * argv[]){
//If we want to debug the program manually setup the proper options in order to attach an external debugger
if(Config::ATTACH_DEBUGGER){
initDebug();
}
MYINFO("->Configuring Pintool<-\n");
//get the start time of the execution (benchmark)
tStart = clock();
// Initialize pin
PIN_InitSymbols();
if (PIN_Init(argc, argv)) return Usage();
//Register PIN Callbacks
INS_AddInstrumentFunction(Instruction,0);
//TRACE_AddInstrumentFunction(Trace,0);
PIN_AddThreadStartFunction(OnThreadStart, 0);
IMG_AddInstrumentFunction(imageLoadCallback, 0);
PIN_AddFiniFunction(Fini, 0);
PIN_AddInternalExceptionHandler(ExceptionHandler,NULL);
//get theknob args
ConfigureTool();
if(Config::getInstance()->POLYMORPHIC_CODE_PATCH){
TRACE_AddInstrumentFunction(Trace,0);
}
proc_info->addProcAddresses();
//init the hooking system
HookSyscalls::enumSyscalls();
HookSyscalls::initHooks();
// Start the program, never returns
MYINFO("->Starting instrumented program<-\n");
PIN_StartProgram();
return 0;
}
示例12: main
int main(int argc, char **argv)
{
if (PIN_Init(argc,argv)) usage();
file = fopen(KnobOutputFile.Value().c_str(),"w");
INS_AddInstrumentFunction(record_calls,0);
PIN_AddFiniFunction(finish,0);
PIN_StartProgram();
return 0;
}
示例13: main
int main(int argc, char * argv[])
{
PIN_InitSymbols();
PIN_Init(argc, argv);
outfile.open(KnobOutputFile.Value().c_str());
IMG_AddInstrumentFunction(ImageLoad, 0);
IMG_AddUnloadFunction(ImageUnload, 0);
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例14: main
int main(int argc, char *argv[])
{
if( PIN_Init(argc,argv) )
{
return Usage();
}
IMG_AddInstrumentFunction(Image, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例15: main
int main (int argc, char *argv[])
{
PIN_InitSymbols();
PIN_Init(argc, argv);
IMG_AddInstrumentFunction (ImageLoad, 0);
// INS_AddInstrumentFunction(Ins, 0);
// PIN_AddSyscallEntryFunction(SyscallEntry, 0);
// PIN_AddSyscallExitFunction(SyscallExit, 0);
PIN_AddFiniFunction (Fini, 0);
PIN_StartProgram();
return 0;
}