|
@@ -254,7 +254,8 @@ public:
|
|
|
*/
|
|
*/
|
|
|
if (pSymbolTable->N.Name.Short != 0) {
|
|
if (pSymbolTable->N.Name.Short != 0) {
|
|
|
symbol.clear();
|
|
symbol.clear();
|
|
|
- symbol.insert(0, (char const*)pSymbolTable->N.ShortName, 8);
|
|
|
|
|
|
|
+ symbol.insert(0, (char const*)pSymbolTable->N.ShortName,
|
|
|
|
|
+ strnlen((char const*)pSymbolTable->N.ShortName, 8));
|
|
|
} else {
|
|
} else {
|
|
|
symbol = stringTable + pSymbolTable->N.Name.Long;
|
|
symbol = stringTable + pSymbolTable->N.Name.Long;
|
|
|
}
|
|
}
|
|
@@ -289,9 +290,11 @@ public:
|
|
|
symbol.compare(0, 4, vectorPrefix)) {
|
|
symbol.compare(0, 4, vectorPrefix)) {
|
|
|
SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
|
|
SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
|
|
|
.Characteristics;
|
|
.Characteristics;
|
|
|
- // skip symbols containing a dot or are from managed code
|
|
|
|
|
|
|
+ // Skip symbols containing a dot, are from managed code,
|
|
|
|
|
+ // or are C++ operators incorrectly declared extern "C".
|
|
|
if (symbol.find('.') == std::string::npos &&
|
|
if (symbol.find('.') == std::string::npos &&
|
|
|
- !SymbolIsFromManagedCode(symbol)) {
|
|
|
|
|
|
|
+ !SymbolIsFromManagedCode(symbol) &&
|
|
|
|
|
+ !SymbolIsOperatorExternC(symbol)) {
|
|
|
// skip arm64ec thunk symbols
|
|
// skip arm64ec thunk symbols
|
|
|
if (this->SymbolArch != Arch::ARM64EC ||
|
|
if (this->SymbolArch != Arch::ARM64EC ||
|
|
|
(symbol.find("$ientry_thunk") == std::string::npos &&
|
|
(symbol.find("$ientry_thunk") == std::string::npos &&
|
|
@@ -336,6 +339,12 @@ private:
|
|
|
symbol.find("$$J") != std::string::npos;
|
|
symbol.find("$$J") != std::string::npos;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ bool SymbolIsOperatorExternC(std::string const& symbol)
|
|
|
|
|
+ {
|
|
|
|
|
+ return symbol.find_first_not_of("=<>+-*/%,?|~!^&[]()") ==
|
|
|
|
|
+ std::string::npos;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
std::set<std::string>& Symbols;
|
|
std::set<std::string>& Symbols;
|
|
|
std::set<std::string>& DataSymbols;
|
|
std::set<std::string>& DataSymbols;
|
|
|
DWORD_PTR SymbolCount;
|
|
DWORD_PTR SymbolCount;
|