0

I am testing PIN support for symbols. I have the following code:

VOID getSymbolAddressByName () {

for (IMG img = APP_ImgHead(); IMG_Valid(img); img = IMG_Next(img)){
    for( SYM sym = IMG_RegsymHead(img); SYM_Valid(sym); sym = SYM_Next(sym) ) {
            MYINFO("\n IMG NAME %s   \n SYM NAME %s  SYM ADDRESS %d   SYM VALUE %d \n", IMG_Name(img), PIN_UndecorateSymbolName(SYM_Name(sym), UNDECORATION_COMPLETE), SYM_Address(sym), SYM_Value(sym)); 
    }
}

}

Basically, I am parsing all the loaded images of my executable and for each of them all the symbols. For each symbol, I print the name of the image, the address, the name and the value.
My aim is to use later part of the code here to retrieve the address of a symbol starting from its name.
However, the program does not correctly print the information: the name of the symbol is (null) and the value and the address are set to 0. The name of the image is correctly diplayed. What am I doing wrong?

0 Answers0