| 1776 | |
| 1777 | |
| 1778 | char* LowLevelILInstructionBase::Dump() const |
| 1779 | { |
| 1780 | vector<InstructionTextToken> tokens; |
| 1781 | #ifdef BINARYNINJACORE_LIBRARY |
| 1782 | bool success = function->GetExprText(function->GetFunction(), function->GetArchitecture(), *this, tokens); |
| 1783 | #else |
| 1784 | bool success = function->GetExprText(function->GetArchitecture(), exprIndex, tokens); |
| 1785 | #endif |
| 1786 | if (success) |
| 1787 | { |
| 1788 | string text; |
| 1789 | if (exprIndex != BN_INVALID_EXPR && (exprIndex & 0xffff000000000000) == 0) |
| 1790 | { |
| 1791 | text += "[expr " + to_string(exprIndex) + "] "; |
| 1792 | } |
| 1793 | if (instructionIndex != BN_INVALID_EXPR && (instructionIndex & 0xffff000000000000) == 0) |
| 1794 | { |
| 1795 | text += "[instr " + to_string(instructionIndex) + "] "; |
| 1796 | } |
| 1797 | for (auto& token: tokens) |
| 1798 | { |
| 1799 | text += token.text; |
| 1800 | } |
| 1801 | return strdup(text.c_str()); |
| 1802 | } |
| 1803 | else |
| 1804 | { |
| 1805 | return strdup("???"); |
| 1806 | } |
| 1807 | } |
| 1808 | |
| 1809 | |
| 1810 | void LowLevelILInstructionBase::Replace(ExprId expr) |
nothing calls this directly
no test coverage detected