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

Method GetLinesForDataCallback

datarenderer.cpp:66–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65
66BNDisassemblyTextLine* DataRenderer::GetLinesForDataCallback(void* ctxt, BNBinaryView* view, uint64_t addr,
67 BNType* type, const BNInstructionTextToken* prefix, size_t prefixCount, size_t width, size_t* count,
68 BNTypeContext* typeCtx, size_t ctxCount, const char* language)
69{
70 CallbackRef<DataRenderer> renderer(ctxt);
71 Ref<BinaryView> viewObj = new BinaryView(BNNewViewReference(view));
72 Ref<Type> typeObj = new Type(BNNewTypeReference(type));
73 vector<InstructionTextToken> prefixes = InstructionTextToken::ConvertInstructionTextTokenList(prefix, prefixCount);
74
75 vector<pair<Type*, size_t>> context;
76 context.reserve(ctxCount);
77 for (size_t i = 0; i < ctxCount; i++)
78 {
79 // To keep API compatibility we have to manually do the refcounting here
80 Type* contextType = new Type(BNNewTypeReference(typeCtx[i].type));
81 contextType->AddRef();
82 context.push_back({contextType, typeCtx[i].offset});
83 }
84 auto lines = renderer->GetLinesForData(viewObj, addr, typeObj, prefixes, width, context,
85 language ? language : string());
86 BNDisassemblyTextLine* result = AllocAPIObjectList(lines, count);
87 for (size_t i = 0; i < ctxCount; i++)
88 context[i].first->Release();
89 return result;
90}
91
92
93void DataRenderer::FreeCallback(void* ctxt)

Callers

nothing calls this directly

Calls 5

AllocAPIObjectListFunction · 0.85
push_backMethod · 0.80
GetLinesForDataMethod · 0.80
AddRefMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected