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

Method DemangleNumber

demangler/msvc/demangle_msvc.cpp:546–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544
545
546void Demangle::DemangleNumber(int64_t& num)
547{
548 m_logger->LogDebug("%s: '%s'\n", __FUNCTION__, reader.GetRaw());
549 num = 0;
550 int mult = 1;
551 if (reader.Peek() == '?')
552 {
553 mult = -1;
554 reader.Consume();
555 }
556
557 //The number is decimal 1-10
558 if (reader.Peek() >= '0' && reader.Peek() <= '9')
559 {
560 num = mult * (reader.Read() + 1 - '0');
561 return;
562 }
563 else
564 {
565 //The number is hexidecimal
566 string strnum = reader.ReadUntil('@');
567 for (auto a : strnum)
568 {
569 num *= 16;
570 if (a >= 'A' && a <= 'P')
571 num += a - 'A';
572 else
573 throw DemangleException();
574 }
575 num *= mult;
576 return;
577 }
578}
579
580
581void Demangle::DemangleChar(char& ch)

Callers

nothing calls this directly

Calls 7

LogDebugMethod · 0.80
DemangleExceptionClass · 0.70
GetRawMethod · 0.45
PeekMethod · 0.45
ConsumeMethod · 0.45
ReadMethod · 0.45
ReadUntilMethod · 0.45

Tested by

no test coverage detected