How to use the pin.RTN_InsertCall function in pin

To help you get started, we’ve selected a few pin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blankwall / Python_Pin / examples / heap_check_uaf.py View on Github external
def image_load(img):
    rtn = pin.RTN_FindByName(img, "realloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "realloc", rtn, 3, realloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "realloc", rtn, 3, realloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "malloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "malloc", rtn, 1, malloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "malloc", rtn, 1, malloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "free")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "free", rtn, 1, free)
        pin.RTN_Close(rtn)
github blankwall / Python_Pin / examples / heap_check_uaf.py View on Github external
pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "realloc", rtn, 3, realloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "realloc", rtn, 3, realloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "malloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "malloc", rtn, 1, malloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "malloc", rtn, 1, malloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "free")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "free", rtn, 1, free)
        pin.RTN_Close(rtn)
github blankwall / Python_Pin / examples / heap_check_uaf.py View on Github external
def image_load(img):
    rtn = pin.RTN_FindByName(img, "realloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "realloc", rtn, 3, realloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "realloc", rtn, 3, realloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "malloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "malloc", rtn, 1, malloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "malloc", rtn, 1, malloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "free")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "free", rtn, 1, free)
        pin.RTN_Close(rtn)
github blankwall / Python_Pin / examples / heap_check_uaf.py View on Github external
def image_load(img):
    rtn = pin.RTN_FindByName(img, "realloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "realloc", rtn, 3, realloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "realloc", rtn, 3, realloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "malloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "malloc", rtn, 1, malloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "malloc", rtn, 1, malloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "free")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "free", rtn, 1, free)
        pin.RTN_Close(rtn)
github blankwall / Python_Pin / examples / heap_check_uaf.py View on Github external
def image_load(img):
    rtn = pin.RTN_FindByName(img, "realloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "realloc", rtn, 3, realloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "realloc", rtn, 3, realloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "malloc")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "malloc", rtn, 1, malloc_before)
        pin.RTN_InsertCall(pin.IPOINT_AFTER, "malloc", rtn, 1, malloc_after)
        pin.RTN_Close(rtn)

    rtn = pin.RTN_FindByName(img, "free")
    if pin.RTN_Valid(rtn):
        pin.RTN_Open(rtn)
        pin.RTN_InsertCall(pin.IPOINT_BEFORE, "free", rtn, 1, free)
        pin.RTN_Close(rtn)