ex
#include "pin.H"#include namespace WINDOWS{#include } FILE * trace;int start = 0;VOID print_argument(ADDRINT insAddr, CONTEXT *ctx, /*ADDRINT * arg0, ADDRINT * arg1, ADDRINT * arg2, ADDRINT * arg3, ADDRINT * arg4*/ADDRINT *pEAX){/*if (start) {fprintf(trace, "0x%x ", *arg0);fprintf(trace, "%d ", *arg1);fprintf(trace, "0x%x ", *arg2);fprintf(trace, "%s ", *arg3);fprintf(trace, "%d\n", *arg4);*arg1..
2018. 10. 17.
내장함수의 리턴값 바꾸기
#include "pin.H" #include VOID change_eax(ADDRINT insAddr, CONTEXT *ctx, ADDRINT * pEAX) { *pEAX = 20; } VOID ImageLoad(IMG img, VOID *v) { RTN print_rtn = RTN_FindByName(img, "strlen"); if (RTN_Valid(print_rtn)) { RTN_Open(print_rtn); RTN_InsertCall(print_rtn, IPOINT_AFTER, (AFUNPTR)change_eax, IARG_ADDRINT, "change_eax", IARG_CONTEXT, IARG_REG_REFERENCE, REG_EAX, IARG_END); RTN_Close(print_rtn..
2018. 10. 17.