bool operator==(const ExportDirectoryEntryRef &Other) const;
error_code getNext(ExportDirectoryEntryRef &Result) const;
+
+ error_code getDllName(StringRef &Result) const;
error_code getOrdinal(uint32_t &Result) const;
error_code getExportRVA(uint32_t &Result) const;
- error_code getName(StringRef &Result) const;
+ error_code getSymbolName(StringRef &Result) const;
private:
const export_directory_table_entry *ExportTable;
return object_error::success;
}
+// Returns the name of the current export symbol. If the symbol is exported only
+// by ordinal, the empty string is set as a result.
+error_code ExportDirectoryEntryRef::getDllName(StringRef &Result) const {
+ uintptr_t IntPtr = 0;
+ if (error_code EC = OwningObject->getRvaPtr(ExportTable->NameRVA, IntPtr))
+ return EC;
+ Result = StringRef(reinterpret_cast<const char *>(IntPtr));
+ return object_error::success;
+}
+
// Returns the export ordinal of the current export symbol.
error_code ExportDirectoryEntryRef::getOrdinal(uint32_t &Result) const {
Result = ExportTable->OrdinalBase + Index;
// Returns the name of the current export symbol. If the symbol is exported only
// by ordinal, the empty string is set as a result.
-error_code ExportDirectoryEntryRef::getName(StringRef &Result) const {
+error_code ExportDirectoryEntryRef::getSymbolName(StringRef &Result) const {
uintptr_t IntPtr = 0;
if (error_code EC = OwningObject->getRvaPtr(
ExportTable->OrdinalTableRVA, IntPtr))
export_directory_iterator E = Obj->export_directory_end();
if (I == E)
return;
+ StringRef DllName;
+ if (I->getDllName(DllName))
+ return;
+ outs() << " DLL name: " << DllName << "\n";
outs() << " Ordinal RVA Name\n";
error_code EC;
for (; I != E; I = I.increment(EC)) {
outs() << format(" % 4d %# 8x", Ordinal, RVA);
StringRef Name;
- if (I->getName(Name))
+ if (I->getSymbolName(Name))
continue;
if (!Name.empty())
outs() << " " << Name;