| 544 | |
| 545 | |
| 546 | void 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 | |
| 581 | void Demangle::DemangleChar(char& ch) |