Great! I will check this out. Cheers Buddhika
On Wed, Jan 23, 2019 at 10:01 PM Xiaozhu Meng <xm...@cs.wisc.edu> wrote: > Hi, > > If I am going to do it, I will try Symtab::getDependencies(), which should > return a vector of paths of the dependencies: > > https://github.com/dyninst/dyninst/blob/master/symtabAPI/h/Symtab.h#L366 > > Then, you can iterate over the vector to parse each of them. > > Thanks, > > --Xiaozhu > > On Wed, Jan 23, 2019 at 10:20 AM Buddhika Chamith Kahawitage Don < > budka...@iu.edu> wrote: > >> Hi All, >> >> I need to enumerate and parse linked shared libraries of a binary using >> Symtab API and Parse API. How can I do that? I am currently using below >> code sequence to parse the binary. >> >> Dyninst::SymtabAPI::Symtab* symtab; >> bool isParsable = Dyninst::SymtabAPI::Symtab::openFile(symtab, binary); >> if (isParsable == false) { >> const char* error = "error: file can not be parsed"; >> std::cout << error; >> return; >> } >> >> // Create a new binary code object from the filename argument >> Dyninst::ParseAPI::SymtabCodeSource* sts = >> new Dyninst::ParseAPI::SymtabCodeSource(binary.c_str()); >> Dyninst::ParseAPI::CodeObject* co = new >> Dyninst::ParseAPI::CodeObject(sts); >> co->parse(); >> >> auto fit = co->funcs().begin(); >> for (; fit != co->funcs().end(); ++fit) { >> Dyninst::ParseAPI::Function* f = *fit; >> .... >> } >> >> Regards >> Buddhika >> _______________________________________________ >> Dyninst-api mailing list >> Dyninst-api@cs.wisc.edu >> https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api > >
_______________________________________________ Dyninst-api mailing list Dyninst-api@cs.wisc.edu https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api