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

Method format

lowlevelilinstruction.cpp:3738–3776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3736
3737
3738fmt::format_context::iterator fmt::formatter<LowLevelILInstruction>::format(const LowLevelILInstruction& obj, format_context& ctx) const
3739{
3740 if (!obj.function)
3741 return fmt::format_to(ctx.out(), "<uninit>");
3742
3743 vector<InstructionTextToken> tokens;
3744#ifdef BINARYNINJACORE_LIBRARY
3745 bool success = obj.function->GetExprText(obj.function->GetFunction(), obj.function->GetArchitecture(), obj, tokens);
3746#else
3747 bool success = obj.function->GetExprText(obj.function->GetArchitecture(), obj.exprIndex, tokens);
3748#endif
3749 if (success)
3750 {
3751 string text;
3752 if (presentation == '?')
3753 {
3754 fmt::format_to(ctx.out(), "{} ", obj.operation);
3755 fmt::format_to(ctx.out(), "@ {:#x} ", obj.address);
3756 if (obj.exprIndex != BN_INVALID_EXPR && (obj.exprIndex & 0xffff000000000000) == 0)
3757 {
3758 fmt::format_to(ctx.out(), "[expr {}] ", obj.exprIndex);
3759 }
3760 if (obj.instructionIndex != BN_INVALID_EXPR && (obj.instructionIndex & 0xffff000000000000) == 0)
3761 {
3762 fmt::format_to(ctx.out(), "[instr {}] ", obj.instructionIndex);
3763 }
3764 }
3765
3766 for (auto& token: tokens)
3767 {
3768 fmt::format_to(ctx.out(), token.text);
3769 }
3770 }
3771 else
3772 {
3773 fmt::format_to(ctx.out(), "???");
3774 }
3775 return ctx.out();
3776}

Callers

nothing calls this directly

Calls 3

GetExprTextMethod · 0.45
GetFunctionMethod · 0.45
GetArchitectureMethod · 0.45

Tested by

no test coverage detected