VOID Restart(ADDRINT insAddress, CONTEXT * ctxt, ADDRINT traceAddress) { // This instruction requires swizzling SwizzleRefs.insert(insAddress); //fprintf(stderr,"Remove trace at address %p\n",(void*)traceAddress); CODECACHE_InvalidateTraceAtProgramAddress(traceAddress); //fprintf(stderr,"Restart %p\n",(void*)insAddress); PIN_ExecuteAt(ctxt); }
// This function is called before every trace is executed VOID DoSmcCheck(VOID * traceAddr, VOID * traceCopyAddr, USIZE traceSize, CONTEXT * ctxP) { if (memcmp(traceAddr, traceCopyAddr, traceSize) != 0) { smcCount++; free(traceCopyAddr); CODECACHE_InvalidateTraceAtProgramAddress((ADDRINT)traceAddr); PIN_ExecuteAt(ctxP); } }