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

Method Dump

highlevelilinstruction.cpp:925–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923
924
925char* HighLevelILInstructionBase::Dump() const
926{
927 if (!function)
928 return strdup("<uninit>");
929
930 vector<InstructionTextToken> tokens;
931 vector<DisassemblyTextLine> lines = function->GetExprText(*this, new DisassemblySettings());
932 if (!lines.empty())
933 {
934 string text;
935 if (exprIndex != BN_INVALID_EXPR && (exprIndex & 0xffff000000000000) == 0)
936 {
937 text += "[expr " + to_string(exprIndex) + "] ";
938 }
939 if (instructionIndex != BN_INVALID_EXPR && (instructionIndex & 0xffff000000000000) == 0)
940 {
941 text += "[instr " + to_string(instructionIndex) + "] ";
942 }
943 Ref<Type> type = GetType();
944 if (type)
945 {
946 text += "[type: " + type->GetString() + "] ";
947 }
948
949 for (auto& line: lines)
950 {
951 for (auto& token: line.tokens)
952 {
953 text += token.text;
954 }
955 text += " ; ";
956 }
957 return strdup(text.c_str());
958 }
959 else
960 {
961 return strdup("???");
962 }
963}
964
965
966void HighLevelILInstructionBase::Replace(ExprId expr)

Callers

nothing calls this directly

Calls 5

GetTypeFunction · 0.85
c_strMethod · 0.80
GetExprTextMethod · 0.45
emptyMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected