Skip to content

getting RTN function from address #1

@P0lako

Description

@P0lako

Hi,

I didn't use the code, but I'm working in something similar (probably I'will use parts of your code), for this reason, I was reading the code project, and I've identified that you are detecting the allocation function getting the RTN using the function name, but sometimes, is useful set the function using the address of the allocation function.

The following code is to Create the RTN from an addr.

RTN CreateRTNFromAddress(ADDRINT addr){
unsigned int i;
RTN func_rtn;
ADDRINT resolved_address;
func_rtn = RTN_FindByAddress(addr);
resolved_address = RTN_Address(func_rtn);
if (func_rtn == RTN_Invalid() || resolved_address != addr){

    for (i=0; i<2; i++){
        func_rtn = RTN_CreateAt((ADDRINT)addr+i, "A");

        if (func_rtn != RTN_Invalid())
            break;

    }

}

return func_rtn;

}

This code is useful if you using (for instance) membrush (ww.syssec-project.eu/m/page-media/3/membrush_wcre13.pdf) to identify the allocation functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions