MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / DemangleSubstitution

Method DemangleSubstitution

demangler/gnu3/demangle_gnu3.cpp:636–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634
635
636TypeBuilder DemangleGNU3::DemangleSubstitution()
637{
638 static const QualifiedName stdAllocatorName(vector<string>{"std", "allocator"});
639 static const QualifiedName stdBasicStringName(vector<string>{"std", "basic_string"});
640 static const QualifiedName stdIostreamName(vector<string>{"std", "iostream"});
641 static const QualifiedName stdIstreamName(vector<string>{"std", "istream"});
642 static const QualifiedName stdOstreamName(vector<string>{"std", "ostream"});
643 static const QualifiedName stdStringName(vector<string>{"std", "string"});
644 static const QualifiedName stdName(vector<string>{"std"});
645
646 indent()
647 MyLogDebug("%s: '%s'\n", __FUNCTION__, m_reader.GetRaw().c_str());
648 char elm;
649 elm = m_reader.Read();
650 QualifiedName name;
651 size_t number = 0;
652 switch (elm)
653 {
654 case 'a': name = stdAllocatorName; break;
655 case 'b': name = stdBasicStringName; break;
656 case 'd': name = stdIostreamName; break;
657 case 'i': name = stdIstreamName; break;
658 case 'o': name = stdOstreamName; break;
659 case 's': name = stdStringName; break;
660 case 't': name = stdName; break;
661 default:
662 if (elm == '_')
663 {
664 m_reader.UnRead(1);
665 number = 0;
666 }
667 else if (isdigit(elm))
668 {
669 number = elm - '0' + 1;
670 }
671 else if (isupper(elm))
672 {
673 number = elm - 'A' + 11;
674 }
675 else
676 {
677 // PrintTables();
678 throw DemangleException();
679 }
680
681 if (m_reader.Read() != '_')
682 {
683 throw DemangleException();
684 }
685
686 dedent();
687 return GetType(number);
688 }
689 m_lastName = name.back();
690 dedent();
691 return CreateUnknownType(name);
692}
693

Callers

nothing calls this directly

Calls 8

MyLogDebugFunction · 0.85
GetTypeFunction · 0.85
CreateUnknownTypeFunction · 0.85
c_strMethod · 0.80
UnReadMethod · 0.80
DemangleExceptionClass · 0.70
GetRawMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected