2

I need to find the correct .dll/.exe from where the function enumerated. For this I am using get_libraryName which to me should return file Name(.dll/.exe) in which the function was originally defined.

But It returns every time NULL(BadPtr=0x00000).. Is there any way out to retrieve the exact file Name from where the function was being defined and used ?

Regards Hassan

Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
Hassan
  • 171
  • 2
  • 6
  • Well, what other information does DIA give you about the functions for which this occurs? To start with, what are the names of these functions? – SamB Nov 27 '10 at 20:18

1 Answers1

2
IDiaSession mSession;
DiaSourceClass mSourceClass;
IDiaSymbol mGlobalScope;
string pdbFileName = @"c:\test.pdb";

mSourceClass = new DiaSourceClass();
mSourceClass.loadDataFromPdb(pdbFileName);
mSourceClass.openSession(out mSession);
mSession.loadAddress = loadAddress; 
mGlobalScope = mSession.globalScope;

IDiaEnumSymbols methodSymbols;
mGlobalScope.findChildren(SymTagEnum.SymTagFunction, null, 0, out methodSymbols);
foreach (IDiaSymbol methodSymbol in methodSymbols)
{
     string projectName = functionSymbol.lexicalParent.name;
}

Hope this helps !