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

Method DemangleName

demangler/gnu3/demangle_gnu3.cpp:1873–1952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1871
1872
1873TypeBuilder DemangleGNU3::DemangleName()
1874{
1875 indent();
1876 MyLogDebug("%s '%s'\n", __FUNCTION__, m_reader.GetRaw().c_str());
1877 /*
1878 <name> ::= <nested-name>
1879 ::= <unscoped-name>
1880 ::= <unscoped-template-name> <template-args>
1881 ::= <local-name> # See Scope Encoding below
1882
1883 <unscoped-name> ::= <unqualified-name>
1884 ::= St <unqualified-name> # ::std::
1885
1886 <unscoped-template-name> ::= <unscoped-name>
1887 ::= <substitution>
1888 */
1889 TypeBuilder type;
1890 bool substitute = false;
1891 switch (m_reader.Read())
1892 {
1893 case 'S':
1894 if (m_reader.Peek() == 't')
1895 {
1896 m_reader.Consume(1);
1897 type = DemangleUnqualifiedName();
1898 QualifiedName qn = type.GetTypeName();
1899 qn.insert(qn.begin(), "std");
1900 type.SetTypeName(qn);
1901 substitute = true;
1902 }
1903 else
1904 {
1905 type = DemangleSubstitution();
1906 }
1907
1908 if (m_reader.Peek() == 'I')
1909 {
1910 m_reader.Consume();
1911 if (substitute)
1912 PushType(type);
1913 vector<FunctionParameter> args;
1914 DemangleTemplateArgs(args);
1915 ExtendTypeName(type, GetTemplateString(args));
1916 type.SetHasTemplateArguments(true);
1917 }
1918 break;
1919 case 'N': //<nested-name>
1920 type = DemangleNestedName();
1921 break;
1922 case 'Z': //<local-name>
1923 type = DemangleLocalName();
1924 break;
1925 default: //<unscoped-name> | <substitution>
1926 /*
1927 <unscoped-name> ::= <unqualified-name>
1928 ::= St <unqualified-name> # ::std::
1929 <unscoped-template-name> ::= <unscoped-name>
1930 ::= <substitution>

Callers

nothing calls this directly

Calls 12

MyLogDebugFunction · 0.85
ExtendTypeNameFunction · 0.85
GetTemplateStringFunction · 0.85
c_strMethod · 0.80
UnReadMethod · 0.80
GetRawMethod · 0.45
ReadMethod · 0.45
PeekMethod · 0.45
ConsumeMethod · 0.45
GetTypeNameMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected